clean-publish
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -11,2 +11,13 @@ # Change Log | ||
* Add linting | ||
* Remove package.json unused scripts | ||
* Remove package.json unused scripts | ||
## 1.0.4 | ||
* Test release | ||
## 1.0.5 | ||
* Fix publish | ||
## 1.0.6 | ||
* Fix regexp indexOf func | ||
* Write test | ||
* Add without-publish arguments |
@@ -25,2 +25,6 @@ #!/usr/bin/env node | ||
desc: 'One or more exclude package.json fields' | ||
}) | ||
.option('without-publish', { | ||
type: 'boolean', | ||
desc: 'Clean package without npm publish' | ||
}); | ||
@@ -45,3 +49,3 @@ | ||
const filteredFiles = files.filter(file => ( | ||
file !== tmpDir && regExpIndexOf(ignoreFiles, file) === -1 | ||
file !== tmpDir && regExpIndexOf(ignoreFiles, file) === false | ||
)) | ||
@@ -76,13 +80,15 @@ multiCp(filteredFiles.map(file => ({ | ||
} | ||
spawn('npm', ['publish'], { | ||
stdio: 'inherit', | ||
cwd: tmpDir | ||
}).on('close', () => { | ||
fse.remove(tmpDir, removeTmpDirErr => { | ||
if (removeTmpDirErr) { | ||
console.error(chalk.red(removeTmpDirErr)) | ||
process.exit() | ||
} | ||
if (!argv['without-publish']) { | ||
spawn('npm', ['publish'], { | ||
stdio: 'inherit', | ||
cwd: tmpDir | ||
}).on('close', () => { | ||
fse.remove(tmpDir, removeTmpDirErr => { | ||
if (removeTmpDirErr) { | ||
console.error(chalk.red(removeTmpDirErr)) | ||
process.exit() | ||
} | ||
}) | ||
}) | ||
}) | ||
} | ||
} | ||
@@ -89,0 +95,0 @@ ) |
module.exports = [ | ||
'.eslintrc', | ||
'.circleci', | ||
'.github', | ||
'.vscode', | ||
'node_modules', | ||
'test', | ||
/^\.eslintrc/, | ||
/^\.babelrc/, | ||
/^\.yaspellerrc/, | ||
/^\.prettierrc/, | ||
/^\.jsdocrc/, | ||
/^\.lintstagedrc/, | ||
/^\.jsconfig/, | ||
'.git', | ||
'.DS_Store', | ||
'.eslintignore', | ||
'.babelrc', | ||
'.editorconfig', | ||
'.jsdocrc', | ||
'.lintstagedrc', | ||
'.size-limit', | ||
'.yaspellerrc', | ||
'jest.config.js', | ||
@@ -19,7 +28,3 @@ '.travis.yml', | ||
'karma.conf.js', | ||
'.flowconfig', | ||
'.circleci', | ||
'.github', | ||
'.vscode', | ||
'.jsconfig' | ||
'.flowconfig' | ||
] |
module.exports = [ | ||
'version', | ||
'postversion', | ||
'postpack', | ||
'prepublish', | ||
'prepare', | ||
'prepublishOnly', | ||
'prepack', | ||
'postpack', | ||
'publish', | ||
'postpublish', | ||
'preinstall', | ||
'install', | ||
'postinstall', | ||
'preuninstall', | ||
'uninstall', | ||
'postuninstall', | ||
'preversion', | ||
'version', | ||
'postversion', | ||
'pretest', | ||
'test', | ||
'posttest', | ||
'prestop', | ||
'stop', | ||
'poststop', | ||
'prestart', | ||
'start', | ||
'poststart', | ||
'prerestart', | ||
'restart', | ||
'postrestart', | ||
'preshrinkwrap', | ||
'shrinkwrap', | ||
'postshrinkwrap' | ||
'postinstall' | ||
] |
{ | ||
"name": "clean-publish", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Clean your package before publish", | ||
@@ -24,8 +24,5 @@ "keywords": [ | ||
"lodash.pick": "^4.4.0", | ||
"rimraf": "^2.6.2", | ||
"yargs": "^12.0.1" | ||
}, | ||
"scripts": { | ||
"test": "jest && yarn run lint" | ||
} | ||
"scripts": {} | ||
} |
@@ -5,3 +5,3 @@ # Clean Publish | ||
<img src="./img/logo.svg" title="Clean Publish logo by Anton Panachev <pana4eow@yandex.ru>" width="180" height="180"> | ||
<img src="./img/logo.svg" title="Clean Publish logo by Anton Panachev <pana4eow@yandex.ru>" width="180" height="180" align="right"> | ||
@@ -89,2 +89,3 @@ [cult-img]: http://cultofmartians.com/assets/badges/badge.svg | ||
- `fields` - list of fields in the `package.json` file that you want to delete before publishing | ||
- `without-publish` - clean project without `npm publish` (tmp directory will not be deleted automatically) | ||
@@ -91,0 +92,0 @@ ```sh |
@@ -5,7 +5,10 @@ const fse = require('fs-extra') | ||
for (const i in array) { | ||
if (array[i].toString().match(item)) { | ||
return i | ||
if (typeof array[i] === 'string' && item === array[i]) { | ||
return true | ||
} | ||
if (array[i] instanceof RegExp && array[i].test(item)) { | ||
return true | ||
} | ||
} | ||
return -1 | ||
return false | ||
} | ||
@@ -12,0 +15,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15876
6
324
170
- Removedrimraf@^2.6.2
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedrimraf@2.7.1(transitive)