+38
-484
lines changedFilter options
+38
-484
lines changed Original file line number Diff line number Diff line change
@@ -228,6 +228,7 @@ graph LR;
228
228
npmcli-run-script-->npmcli-node-gyp["@npmcli/node-gyp"];
229
229
npmcli-run-script-->npmcli-package-json["@npmcli/package-json"];
230
230
npmcli-run-script-->npmcli-promise-spawn["@npmcli/promise-spawn"];
231
+
npmcli-run-script-->proc-log;
231
232
npmcli-smoke-tests-->npmcli-eslint-config["@npmcli/eslint-config"];
232
233
npmcli-smoke-tests-->npmcli-mock-registry["@npmcli/mock-registry"];
233
234
npmcli-smoke-tests-->npmcli-promise-spawn["@npmcli/promise-spawn"];
@@ -700,6 +701,7 @@ graph LR;
700
701
npmcli-run-script-->npmcli-node-gyp["@npmcli/node-gyp"];
701
702
npmcli-run-script-->npmcli-package-json["@npmcli/package-json"];
702
703
npmcli-run-script-->npmcli-promise-spawn["@npmcli/promise-spawn"];
704
+
npmcli-run-script-->proc-log;
703
705
npmcli-run-script-->which;
704
706
npmcli-smoke-tests-->npmcli-eslint-config["@npmcli/eslint-config"];
705
707
npmcli-smoke-tests-->npmcli-mock-registry["@npmcli/mock-registry"];
Original file line number Diff line number Diff line change
@@ -109,7 +109,6 @@ class CI extends ArboristWorkspaceCmd {
109
109
args: [],
110
110
scriptShell,
111
111
stdio: 'inherit',
112
-
banner: !this.npm.silent,
113
112
event,
114
113
})
115
114
}
Original file line number Diff line number Diff line change
@@ -56,7 +56,6 @@ class Explore extends BaseCommand {
56
56
return runScript({
57
57
...this.npm.flatOptions,
58
58
pkg,
59
-
banner: false,
60
59
path,
61
60
event: '_explore',
62
61
stdio: 'inherit',
Original file line number Diff line number Diff line change
@@ -168,7 +168,6 @@ class Install extends ArboristWorkspaceCmd {
168
168
args: [],
169
169
scriptShell,
170
170
stdio: 'inherit',
171
-
banner: !this.npm.silent,
172
171
event,
173
172
})
174
173
}
Original file line number Diff line number Diff line change
@@ -72,7 +72,6 @@ class Publish extends BaseCommand {
72
72
path: spec.fetchSpec,
73
73
stdio: 'inherit',
74
74
pkg: manifest,
75
-
banner: !silent,
76
75
})
77
76
}
78
77
@@ -131,15 +130,13 @@ class Publish extends BaseCommand {
131
130
path: spec.fetchSpec,
132
131
stdio: 'inherit',
133
132
pkg: manifest,
134
-
banner: !silent,
135
133
})
136
134
137
135
await runScript({
138
136
event: 'postpublish',
139
137
path: spec.fetchSpec,
140
138
stdio: 'inherit',
141
139
pkg: manifest,
142
-
banner: !silent,
143
140
})
144
141
}
145
142
Original file line number Diff line number Diff line change
@@ -114,7 +114,6 @@ class RunScript extends BaseCommand {
114
114
scriptShell,
115
115
stdio: 'inherit',
116
116
pkg,
117
-
banner: !this.npm.silent,
118
117
event: ev,
119
118
args: evArgs,
120
119
})
Original file line number Diff line number Diff line change
@@ -181,11 +181,6 @@
181
181
!/npm-user-validate
182
182
!/p-map
183
183
!/pacote
184
-
!/pacote/node_modules/
185
-
/pacote/node_modules/*
186
-
!/pacote/node_modules/@npmcli/
187
-
/pacote/node_modules/@npmcli/*
188
-
!/pacote/node_modules/@npmcli/run-script
189
184
!/parse-conflict-json
190
185
!/path-key
191
186
!/path-scurry
Original file line number Diff line number Diff line change
@@ -5,19 +5,6 @@ const { isNodeGypPackage, defaultGypInstallScript } = require('@npmcli/node-gyp'
5
5
const signalManager = require('./signal-manager.js')
6
6
const isServerPackage = require('./is-server-package.js')
7
7
8
-
// you wouldn't like me when I'm angry...
9
-
const bruce = (id, event, cmd, args) => {
10
-
let banner = id
11
-
? `\n> ${id} ${event}\n`
12
-
: `\n> ${event}\n`
13
-
banner += `> ${cmd.trim().replace(/\n/g, '\n> ')}`
14
-
if (args.length) {
15
-
banner += ` ${args.join(' ')}`
16
-
}
17
-
banner += '\n'
18
-
return banner
19
-
}
20
-
21
8
const runScriptPkg = async options => {
22
9
const {
23
10
event,
@@ -29,8 +16,6 @@ const runScriptPkg = async options => {
29
16
pkg,
30
17
args = [],
31
18
stdioString,
32
-
// note: only used when stdio:inherit
33
-
banner = true,
34
19
// how long to wait for a process.kill signal
35
20
// only exposed here so that we can make the test go a bit faster.
36
21
signalTimeout = 500,
@@ -59,9 +44,20 @@ const runScriptPkg = async options => {
59
44
return { code: 0, signal: null }
60
45
}
61
46
62
-
if (stdio === 'inherit' && banner !== false) {
63
-
// we're dumping to the parent's stdout, so print the banner
64
-
console.log(bruce(pkg._id, event, cmd, args))
47
+
if (stdio === 'inherit') {
48
+
let banner
49
+
if (pkg._id) {
50
+
banner = `\n> ${pkg._id} ${event}\n`
51
+
} else {
52
+
banner = `\n> ${event}\n`
53
+
}
54
+
banner += `> ${cmd.trim().replace(/\n/g, '\n> ')}`
55
+
if (args.length) {
56
+
banner += ` ${args.join(' ')}`
57
+
}
58
+
banner += '\n'
59
+
const { output } = require('proc-log')
60
+
output.standard(banner)
65
61
}
66
62
67
63
const [spawnShell, spawnArgs, spawnOpts] = makeSpawnArgs({
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@npmcli/run-script",
3
-
"version": "7.0.4",
3
+
"version": "8.0.0",
4
4
"description": "Run a lifecycle script for a package (descendant of npm-lifecycle)",
5
5
"author": "GitHub Inc.",
6
6
"license": "ISC",
@@ -25,6 +25,7 @@
25
25
"@npmcli/package-json": "^5.0.0",
26
26
"@npmcli/promise-spawn": "^7.0.0",
27
27
"node-gyp": "^10.0.0",
28
+
"proc-log": "^4.0.0",
28
29
"which": "^4.0.0"
29
30
},
30
31
"files": [
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4