Skip to content

Commit 4a2e481

Browse files
committed
feat!: adds --ignore-scripts flag to pack
BREAKING CHANGE: `--ignore-scripts` now applies to all lifecycle scripts, include `prepare`
2 parents f7f3087 + f143eed commit 4a2e481

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

lib/commands/pack.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class Pack extends BaseCommand {
1515
'workspace',
1616
'workspaces',
1717
'include-workspace-root',
18+
'ignore-scripts',
1819
]
1920

2021
static usage = ['<package-spec>']

package-lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16885,7 +16885,7 @@
1688516885
"@npmcli/fs": "^4.0.0",
1688616886
"@npmcli/installed-package-contents": "^3.0.0",
1688716887
"@npmcli/map-workspaces": "^4.0.1",
16888-
"@npmcli/metavuln-calculator": "^8.0.0",
16888+
"@npmcli/metavuln-calculator": "^8.0.1",
1688916889
"@npmcli/name-from-folder": "^3.0.0",
1689016890
"@npmcli/node-gyp": "^4.0.0",
1689116891
"@npmcli/package-json": "^6.0.1",

tap-snapshots/test/lib/docs.js.test.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3680,7 +3680,7 @@ npm pack <package-spec>
36803680
Options:
36813681
[--dry-run] [--json] [--pack-destination <pack-destination>]
36823682
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
3683-
[-ws|--workspaces] [--include-workspace-root]
3683+
[-ws|--workspaces] [--include-workspace-root] [--ignore-scripts]
36843684
36853685
Run "npm help pack" for more info
36863686
@@ -3694,6 +3694,7 @@ npm pack <package-spec>
36943694
#### \`workspace\`
36953695
#### \`workspaces\`
36963696
#### \`include-workspace-root\`
3697+
#### \`ignore-scripts\`
36973698
`
36983699

36993700
exports[`test/lib/docs.js TAP usage ping > must match snapshot 1`] = `

workspaces/arborist/lib/arborist/rebuild.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ module.exports = cls => class Builder extends cls {
154154

155155
// links should run prepare scripts and only link bins after that
156156
if (type === 'links') {
157-
await this.#runScripts('prepare')
157+
if (!this.options.ignoreScripts) {
158+
await this.#runScripts('prepare')
159+
}
158160
}
159161
if (this.options.binLinks) {
160162
await this.#linkAllBins()

workspaces/arborist/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"@npmcli/fs": "^4.0.0",
88
"@npmcli/installed-package-contents": "^3.0.0",
99
"@npmcli/map-workspaces": "^4.0.1",
10-
"@npmcli/metavuln-calculator": "^8.0.0",
10+
"@npmcli/metavuln-calculator": "^8.0.1",
1111
"@npmcli/name-from-folder": "^3.0.0",
1212
"@npmcli/node-gyp": "^4.0.0",
1313
"@npmcli/package-json": "^6.0.1",

0 commit comments

Comments
 (0)