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

deps: bump @npmcli/run-script from 7.0.4 to 8.0.0 #352

Merged
merged 2 commits into from
Apr 15, 2024
Merged
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
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ resolved, and other properties, as they are determined.
calls. This allows you to easily avoid hitting the registry multiple
times (even just to validate the cache) for a given packument, since it
is unlikely to change in the span of a single command.
* `silent` A boolean that determines whether the banner is displayed
when calling `@npmcli/run-script`.
* `verifySignatures` A boolean that will make pacote verify the
integrity signature of a manifest, if present. There must be a
configured `_keys` entry in the config that is scoped to the
Expand Down
5 changes: 0 additions & 5 deletions lib/dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,11 @@ class DirFetcher extends Fetcher {
// but this function is *also* run when installing git deps
const stdio = this.opts.foregroundScripts ? 'inherit' : 'pipe'

// hide the banner if silent opt is passed in, or if prepare running
// in the background.
const banner = this.opts.silent ? false : stdio === 'inherit'

return runScript({
pkg: mani,
event: 'prepare',
path: this.resolved,
stdio,
banner,
env: {
npm_package_resolved: this.resolved,
npm_package_integrity: this.integrity,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@npmcli/git": "^5.0.0",
"@npmcli/installed-package-contents": "^2.0.1",
"@npmcli/promise-spawn": "^7.0.0",
"@npmcli/run-script": "^7.0.0",
"@npmcli/run-script": "^8.0.0",
"cacache": "^18.0.0",
"fs-minipass": "^3.0.0",
"minipass": "^7.0.2",
Expand Down
66 changes: 0 additions & 66 deletions tap-snapshots/test/dir.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -247,72 +247,6 @@ Object {
}
`

exports[`test/dir.js TAP responds to foregroundScripts: true and silent: true > extract 1`] = `
Object {
"from": "file:test/fixtures/prepare-script",
"integrity": "{integrity}",
"resolved": "\${CWD}/test/fixtures/prepare-script",
}
`

exports[`test/dir.js TAP responds to foregroundScripts: true and silent: true > file list 1`] = `
Array [
"index.js",
"package.json",
"prepare.js",
]
`

exports[`test/dir.js TAP responds to foregroundScripts: true and silent: true > manifest 1`] = `
Object {
"_from": "file:test/fixtures/prepare-script",
"_id": "git-prepare-script@1.0.0",
"_integrity": null,
"_resolved": "\${CWD}/test/fixtures/prepare-script",
"devDependencies": Object {
"abbrev": "^1.1.1",
},
"license": "ISC",
"main": "index.js",
"name": "git-prepare-script",
"scripts": Object {
"prepare": "node prepare.js",
},
"version": "1.0.0",
}
`

exports[`test/dir.js TAP responds to foregroundScripts: true and silent: true > packument 1`] = `
Object {
"dist-tags": Object {
"latest": "1.0.0",
},
"name": "git-prepare-script",
"versions": Object {
"1.0.0": Object {
"_from": "file:test/fixtures/prepare-script",
"_id": "git-prepare-script@1.0.0",
"_integrity": null,
"_resolved": "\${CWD}/test/fixtures/prepare-script",
"devDependencies": Object {
"abbrev": "^1.1.1",
},
"dist": Object {
"integrity": null,
"tarball": "file:\${CWD}/test/fixtures/prepare-script",
},
"license": "ISC",
"main": "index.js",
"name": "git-prepare-script",
"scripts": Object {
"prepare": "node prepare.js",
},
"version": "1.0.0",
},
},
}
`

exports[`test/dir.js TAP with prepare script > extract 1`] = `
Object {
"from": "file:test/fixtures/prepare-script",
Expand Down
18 changes: 0 additions & 18 deletions test/dir.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ t.test('with prepare script', async t => {
.then(() => t.matchSnapshot(fs.readdirSync(me + '/prepare').sort(), 'file list'))
.then(() => t.match(RUNS[0], {
stdio: 'pipe',
banner: false,
}, 'should run in background'))
})

Expand All @@ -80,26 +79,9 @@ t.test('responds to foregroundScripts: true', async t => {
.then(() => t.matchSnapshot(fs.readdirSync(me + '/prepare').sort(), 'file list'))
.then(() => t.match(RUNS[0], {
stdio: 'inherit',
banner: true,
}, 'should run in foreground'))
})

t.test('responds to foregroundScripts: true and silent: true', async t => {
RUNS.length = 0
const opt = { foregroundScripts: true, silent: true, tree: await loadActual(prepare) }
const f = new DirFetcher(preparespec, opt)
t.resolveMatchSnapshot(f.packument(), 'packument')
t.resolveMatchSnapshot(f.manifest(), 'manifest')
const index = me + '/prepare/index.js'
return t.resolveMatchSnapshot(f.extract(me + '/prepare'), 'extract')
.then(() => t.spawn(process.execPath, [index], 'test prepared result'))
.then(() => t.matchSnapshot(fs.readdirSync(me + '/prepare').sort(), 'file list'))
.then(() => t.match(RUNS[0], {
stdio: 'inherit',
banner: false,
}, 'should run in foreground, but without banner'))
})

t.test('missing dir cannot be packed', async t => {
const f = new DirFetcher('file:/this/dir/doesnt/exist', { tree: await loadActual() })
return t.rejects(f.extract(me + '/nope'), {
Expand Down
Loading