-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates dependencies and switches to npm scripts
No more gulp! npm scripts forever! gulp lint has been replaced by npm run lint gulp release has been replaced by npm run release still need to remove npm test and pull it out.
- Loading branch information
1 parent
afd00e9
commit 3abc509
Showing
5 changed files
with
108 additions
and
74 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/env node | ||
'use strict'; | ||
|
||
const eslint = require('eslint') | ||
, CLIEngine = eslint.CLIEngine | ||
, linter = new CLIEngine({ | ||
useEslintrc: true, | ||
}) | ||
, report = linter.executeOnFiles([ | ||
'./utils/**/*.js' | ||
, '!./utils/**/*_test.js' | ||
, './routes/**/*.js' | ||
, '!./routes/**/*_test.js' | ||
, './security/**/*.js' | ||
, '!./security/**/*_test.js' | ||
, './web-sockets/**/*.js' | ||
, '!./web-sockets/**/*_test.js' | ||
, '*.js' | ||
, '!*_test.js' | ||
, '!gulpfile.js' ]) | ||
, formatter = linter.getFormatter() | ||
, errorCheck = (errorCount, file) => { | ||
return errorCount + file.errorCount; | ||
}; | ||
|
||
console.log(formatter(report.results)); | ||
|
||
if (report.results.reduce(errorCheck, 0) > 0) { | ||
process.exit(1); | ||
} |
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,72 @@ | ||
#!/bin/env node | ||
'use strict'; | ||
const minimist = require('minimist') | ||
, cp = require('child-process') | ||
, fs = require('fs') | ||
, chalk = require('chalk') | ||
, knownOptions = { | ||
string: 'type' | ||
, default: { type: 'patch' } | ||
} | ||
, options = minimist(process.argv.slice(2), knownOptions) | ||
, incrementVersion = (version, type) => { | ||
const versionArr = version.split('.'); | ||
|
||
if (type === 'major') { | ||
versionArr[0] = parseInt(versionArr[0], 10) + 1; | ||
versionArr[1] = 0; | ||
versionArr[2] = 0; | ||
} else if (type === 'minor') { | ||
versionArr[1] = parseInt(versionArr[1], 10) + 1; | ||
versionArr[2] = 0; | ||
} else { | ||
versionArr[2] = parseInt(versionArr[2], 10) + 1; | ||
} | ||
|
||
return versionArr.join('.'); | ||
} | ||
, pkg = require('../package.json') | ||
, newVersion = incrementVersion(pkg.version, options.type) | ||
, gitLogCommand = 'git log `git describe --tags --abbrev=0`..HEAD --pretty=format:" - %s"'; | ||
|
||
// this is the task to automat most of the release stuff... because it is lame and boring | ||
console.log(`\n\nPreparing for a ${chalk.bgGreen.bold(options.type)} release...\n\n`); | ||
|
||
|
||
cp.exec(gitLogCommand, (err, stdout) => { | ||
const history = fs.readFileSync('./history.md') | ||
, historyHeader = `### - ${newVersion} * ${new Date().toLocaleString()} *\n\n`; | ||
|
||
console.log('Updating the history.md file'); | ||
|
||
fs.writeFile('./history.md', `${historyHeader} ${stdout} \n\n\n ${history}`); | ||
|
||
cp.exec('git log --all --format="%aN <%aE>" | sort -u', (errLog, stdoutLog) => { | ||
// write out the Authors file with all contributors | ||
console.log('Updating the AUTHORS file'); | ||
|
||
fs.writeFileSync('./AUTHORS', stdoutLog); | ||
|
||
cp.exec('git add .', () => { | ||
cp.exec(`git commit -m "preparing for release of v${newVersion}"`, () => { | ||
console.log('commited the automated updates'); | ||
// run npm version | ||
cp.exec(`npm version ${options.type}`, () => { | ||
console.log('npm version to rev for release'); | ||
cp.exec('npm publish', () => { | ||
console.log('pushing to origin'); | ||
|
||
cp.exec('git push origin master', Function.prototype); | ||
cp.exec(`git push origin v${newVersion}`, (errPush) => { | ||
if (errPush) { | ||
console.log(errPush); | ||
} | ||
console.log(chalk.green('DONE! Congrats on the Release!')); | ||
}); | ||
}); | ||
}); | ||
|
||
}); | ||
}); | ||
}); | ||
}); |
Empty file.
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