This repository has been archived by the owner on Mar 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release 6.0.0
- Loading branch information
Showing
18 changed files
with
215 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,5 @@ node_modules/ | |
/tests/**/*.js | ||
*.map | ||
*.css | ||
/.cache-loader | ||
package-lock.json |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/** | ||
* Created by sam on 13.11.2016. | ||
*/ | ||
|
||
const spawnSync = require('child_process').spawnSync; | ||
const fs = require('fs'); | ||
|
||
function gitHead(cwd) { | ||
const r = spawnSync('git', ['rev-parse', '--verify', 'HEAD'], { | ||
cwd: cwd | ||
}); | ||
if (!r.stdout) { | ||
console.error(cwd, r.error); | ||
return 'error'; | ||
} | ||
return r.stdout.toString().trim(); | ||
} | ||
|
||
function resolvePlugin(repo, version) { | ||
if (fs.lstatSync('.git').isDirectory() && repo) { | ||
if (repo.endsWith('.git')) { | ||
repo = repo.slice(0, repo.length - 4); | ||
return repo + '/commit/' + gitHead('.'); | ||
} | ||
} | ||
// not a git repo | ||
return version; | ||
} | ||
|
||
function toVersion(v) { | ||
const now = new Date().toISOString(); | ||
// %Y%m%d-%H%M%S | ||
const fmt = now | ||
.replace(/T/, ' ') | ||
.replace(/\..+/, '') | ||
.replace(/[-:]/, '') | ||
.replace(' ', '-'); | ||
return v.replace('SNAPSHOT', fmt); | ||
} | ||
|
||
function _main() { | ||
const pkg = require('./package.json'); | ||
const name = pkg.name; | ||
const version = toVersion(pkg.version); | ||
const resolved = resolvePlugin((pkg.repository || {}).url, version); | ||
|
||
const buildInfo = { | ||
name, | ||
version, | ||
resolved, | ||
description: pkg.description, | ||
homepage: pkg.homepage, | ||
repository: (pkg.repository || {}).url | ||
}; | ||
|
||
const l = ('build/source/' + name.toLowerCase()).split('/'); | ||
l.forEach((_, i) => { | ||
const path = l.slice(0, i + 1).join('/'); | ||
if (!fs.existsSync(path)) { | ||
fs.mkdirSync(path); | ||
} | ||
}); | ||
|
||
fs.writeFileSync('build/source/' + name.toLowerCase() + '/buildInfo.json', JSON.stringify(buildInfo, null, ' ')); | ||
} | ||
|
||
if (require.main === module) { | ||
_main(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version: '2.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.