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

clean-publish

Package Overview
Dependencies
Maintainers
2
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 4.2.0 to 4.3.0

16

clean-publish.js
#!/usr/bin/env node
import { parseListArg } from './utils.js'
import {
cleanComments,
cleanDocs,
clearPackageJSON,
copyFiles,
createFilesFilter,
createTempDirectory,
createFilesFilter,
copyFiles,
publish,
readPackageJSON,
clearPackageJSON,
writePackageJSON,
publish,
cleanComments,
removeTempDirectory,
runScript,
cleanDocs
writePackageJSON
} from './core.js'
import { getConfig } from './get-config.js'
import { parseListArg } from './utils.js'

@@ -19,0 +19,0 @@ const HELP =

#!/usr/bin/env node
import { clearPackageJSON } from './core.js'
import { getConfig } from './get-config.js'
import {
parseListArg,
readJSON,
readJSONFromStdin,
writeJSON,
parseListArg
writeJSON
} from './utils.js'
import { clearPackageJSON } from './core.js'
import { getConfig } from './get-config.js'

@@ -12,0 +12,0 @@ const HELP =

@@ -1,18 +0,18 @@

import { promises as fs } from 'fs'
import { join, basename } from 'path'
import spawn from 'cross-spawn'
import glob from 'fast-glob'
import micromatch from 'micromatch'
import { promises as fs } from 'node:fs'
import { basename, join } from 'node:path'
import IGNORE_FIELDS from './exception/ignore-fields.js'
import IGNORE_FILES from './exception/ignore-files.js'
import NPM_SCRIPTS from './exception/npm-scripts.js'
import {
writeJSON,
copy,
filterObjectByKey,
isObject,
readJSON,
copy,
remove,
isObject,
filterObjectByKey
writeJSON
} from './utils.js'
import IGNORE_FILES from './exception/ignore-files.js'
import IGNORE_FIELDS from './exception/ignore-fields.js'
import NPM_SCRIPTS from './exception/npm-scripts.js'

@@ -153,3 +153,3 @@ const PUBLISH_CONFIG_FIELDS = [

cwd,
{ packageManager, packageManagerOptions = [], access, tag, dryRun }
{ access, dryRun, packageManager, packageManagerOptions = [], tag }
) {

@@ -162,4 +162,4 @@ return new Promise((resolve, reject) => {

spawn(packageManager, args, {
stdio: 'inherit',
cwd
cwd,
stdio: 'inherit'
})

@@ -166,0 +166,0 @@ .on('close', (code, signal) => {

@@ -11,2 +11,3 @@ export default [

'lint-staged',
'nano-staged',
'pre-commit',

@@ -13,0 +14,0 @@ 'husky',

@@ -8,2 +8,3 @@ export default [

/^\.eslintrc/,
/eslint.config.(c|m)?js/,
/^\.babelrc/,

@@ -14,2 +15,3 @@ /^\.yaspellerrc/,

/^\.lintstagedrc/,
/^\.nanostagedrc/,
/^\.jsconfig/,

@@ -35,2 +37,3 @@ /^\.size-limit/,

/^changelog/i,
/^\.?nano-staged\.(c|m)?js(on)?$/,
/^\.?simple-pre-commit.js(on)?$/,

@@ -37,0 +40,0 @@ /^\.?simple-git-hooks.js(on)?$/,

@@ -7,3 +7,3 @@ /**

import { lilconfig } from 'lilconfig'
import { relative } from 'path'
import { relative } from 'node:path'

@@ -13,5 +13,6 @@ import { isObject } from './utils.js'

const PACKAGE_ERRORS = {
notObject:
'The `"clean-publish"` section of package.json ' + 'must be `an object`',
empty: 'The `"clean-publish"` section of package.json must `not be empty`',
fieldsNotStrings:
'The `fields` in the `"clean-publish"` section ' +
'of package.json must be `an array of strings`',
filesNotStringsOrRegExps:

@@ -21,8 +22,4 @@ 'The `files` in the `"clean-publish"` section ' +

'`an array of strings or RegExps`',
fieldsNotStrings:
'The `fields` in the `"clean-publish"` section ' +
'of package.json must be `an array of strings`',
tempDirNotString:
'The `tempDir` in the `"clean-publish"` section ' +
'of package.json must be `an string`',
notObject:
'The `"clean-publish"` section of package.json ' + 'must be `an object`',
packageManagerNotString:

@@ -33,14 +30,15 @@ 'The `packageManager` in the `"clean-publish"` section ' +

'The `packageManagerOptions` in the `"clean-publish"` section ' +
'of package.json must be `an array of strings`'
'of package.json must be `an array of strings`',
tempDirNotString:
'The `tempDir` in the `"clean-publish"` section ' +
'of package.json must be `an string`'
}
const FILE_ERRORS = {
notObject: 'Clean Publish config must contain `an object`',
empty: 'Clean Publish config must `not be empty`',
fieldsNotStrings:
'The `fields` in Clean Publish config ' + 'must be `an array of strings`',
filesNotStringsOrRegExps:
'The `files` in the Clean Publish config ' +
'must be `an array of strings or RegExps`',
fieldsNotStrings:
'The `fields` in Clean Publish config ' + 'must be `an array of strings`',
tempDirNotString:
'The `tempDir` in Clean Publish config ' + 'must be `an string`',
notObject: 'Clean Publish config must contain `an object`',
packageManagerNotString:

@@ -51,3 +49,5 @@ 'The `packageManager` in Clean Publish config ' +

'The `packageManagerOptions` in Clean Publish config ' +
'must be `an array of strings`'
'must be `an array of strings`',
tempDirNotString:
'The `tempDir` in Clean Publish config ' + 'must be `an string`'
}

@@ -54,0 +54,0 @@

{
"name": "clean-publish",
"version": "4.2.0",
"version": "4.3.0",
"description": "Clean your package before publish",

@@ -25,6 +25,6 @@ "keywords": [

"cross-spawn": "^7.0.3",
"fast-glob": "^3.2.12",
"lilconfig": "^2.1.0",
"fast-glob": "^3.3.2",
"lilconfig": "^3.1.1",
"micromatch": "^4.0.5"
}
}

@@ -79,2 +79,2 @@ {

}
}
}

@@ -1,2 +0,2 @@

import { promises as fs } from 'fs'
import { promises as fs } from 'node:fs'

@@ -8,3 +8,3 @@ if (!fs.cp) {

export async function remove(dir) {
await fs.rm(dir, { recursive: true, force: true })
await fs.rm(dir, { force: true, recursive: true })
}

@@ -11,0 +11,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