Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pack prepare lifecycle script honors --ignore-scripts #7836

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/commands/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Pack extends BaseCommand {
'workspace',
'workspaces',
'include-workspace-root',
'ignore-scripts',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is substantive code change

]

static usage = ['<package-spec>']
Expand Down
3 changes: 3 additions & 0 deletions node_modules/pacote/lib/dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class DirFetcher extends Fetcher {
if (!mani.scripts || !mani.scripts.prepare) {
return
}
if (this.opts.ignoreScripts) {
return
}

// we *only* run prepare.
// pre/post-pack is run by the npm CLI for publish and pack,
Expand Down
5 changes: 2 additions & 3 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -11269,8 +11269,7 @@
},
"node_modules/pacote": {
"version": "19.0.1",
"resolved": "https://registry.npmjs.org/pacote/-/pacote-19.0.1.tgz",
"integrity": "sha512-zIpxWAsr/BvhrkSruspG8aqCQUUrWtpwx0GjiRZQhEM/pZXrigA32ElN3vTcCPUDOFmHr6SFxwYrvVUs5NTEUg==",
"resolved": "git+ssh://[email protected]/npm/pacote.git#d8254e94eacf14b7b4c3f99f70e1a0463d9adfeb",
"inBundle": true,
"license": "ISC",
"dependencies": {
Expand Down Expand Up @@ -17090,7 +17089,7 @@
"@npmcli/arborist": "^8.0.0",
"@npmcli/run-script": "^9.0.1",
"npm-package-arg": "^12.0.0",
"pacote": "^19.0.0"
"pacote": "github:npm/pacote#reggi/ignore-scripts"
},
"devDependencies": {
"@npmcli/eslint-config": "^5.0.1",
Expand Down
3 changes: 2 additions & 1 deletion tap-snapshots/test/lib/docs.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3708,7 +3708,7 @@ npm pack <package-spec>
Options:
[--dry-run] [--json] [--pack-destination <pack-destination>]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
[-ws|--workspaces] [--include-workspace-root]
[-ws|--workspaces] [--include-workspace-root] [--ignore-scripts]

Run "npm help pack" for more info

Expand All @@ -3722,6 +3722,7 @@ npm pack <package-spec>
#### \`workspace\`
#### \`workspaces\`
#### \`include-workspace-root\`
#### \`ignore-scripts\`
`

exports[`test/lib/docs.js TAP usage ping > must match snapshot 1`] = `
Expand Down
2 changes: 1 addition & 1 deletion workspaces/libnpmpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@npmcli/arborist": "^8.0.0",
"@npmcli/run-script": "^9.0.1",
"npm-package-arg": "^12.0.0",
"pacote": "^19.0.0"
"pacote": "github:npm/pacote#reggi/ignore-scripts"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be landed

},
"engines": {
"node": "^20.17.0 || >=22.9.0"
Expand Down
Loading