Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clean-publish

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clean-publish - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

13

CHANGELOG.md

@@ -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

28

clean-publish.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc