From fea1ba381afd9ff695ade023634a16024ffdc1d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Mar 2025 08:40:39 -0800 Subject: [PATCH 1/3] chore: bump @npmcli/template-oss from 4.23.4 to 4.23.5 (#229) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [@npmcli/template-oss](https://github.com/npm/template-oss) from 4.23.4 to 4.23.5.
Release notes

Sourced from @​npmcli/template-oss's releases.

v4.23.5

4.23.5 (2024-11-25)

Bug Fixes

Dependencies

Chores

Changelog

Sourced from @​npmcli/template-oss's changelog.

4.23.5 (2024-11-25)

Bug Fixes

Dependencies

Chores

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@npmcli/template-oss&package-manager=npm_and_yarn&previous-version=4.23.4&new-version=4.23.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: npm CLI robot --- package.json | 4 ++-- release-please-config.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 38a2ac9..51b78f1 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^5.0.0", - "@npmcli/template-oss": "4.23.4", + "@npmcli/template-oss": "4.24.1", "spawk": "^1.8.1", "tap": "^16.0.1" }, @@ -42,7 +42,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.23.4", + "version": "4.24.1", "publish": "true" }, "tap": { diff --git a/release-please-config.json b/release-please-config.json index a1676b9..c56fd1d 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -33,5 +33,5 @@ "package-name": "" } }, - "prerelease-type": "pre" + "prerelease-type": "pre.0" } From 21694f2098d27f3391a137a8885d20b34363faed Mon Sep 17 00:00:00 2001 From: Gar Date: Fri, 7 Mar 2025 08:42:00 -0800 Subject: [PATCH 2/3] feat: use nodeGyp option (#230) This allows for a `nodeGyp` option to be passed in to define where the node-gyp bin is to run. It also allows for the environment variable `npm_config_node_gyp` to already be set, and not override it if it is. This is an extension of #222 Closes: https://github.com/npm/cli/issues/2839 Co-author: @legobeat --------- Co-authored-by: legobt <6wbvkn0j@anonaddy.me> --- lib/make-spawn-args.js | 23 ++++++++++++++++++----- lib/run-script-pkg.js | 22 ++++++++++++---------- test/make-spawn-args.js | 21 ++++++++++++++++++++- 3 files changed, 50 insertions(+), 16 deletions(-) diff --git a/lib/make-spawn-args.js b/lib/make-spawn-args.js index 8a32d71..1c9f02c 100644 --- a/lib/make-spawn-args.js +++ b/lib/make-spawn-args.js @@ -1,21 +1,34 @@ /* eslint camelcase: "off" */ const setPATH = require('./set-path.js') const { resolve } = require('path') -const npm_config_node_gyp = require.resolve('node-gyp/bin/node-gyp.js') + +let npm_config_node_gyp const makeSpawnArgs = options => { const { + args, + binPaths, + cmd, + env, event, + nodeGyp, path, scriptShell = true, - binPaths, - env, stdio, - cmd, - args, stdioString, } = options + if (nodeGyp) { + // npm already pulled this from env and passes it in to options + npm_config_node_gyp = nodeGyp + } else if (env.npm_config_node_gyp) { + // legacy mode for standalone user + npm_config_node_gyp = env.npm_config_node_gyp + } else { + // default + npm_config_node_gyp = require.resolve('node-gyp/bin/node-gyp.js') + } + const spawnEnv = setPATH(path, binPaths, { // we need to at least save the PATH environment var ...process.env, diff --git a/lib/run-script-pkg.js b/lib/run-script-pkg.js index 9900c96..161caeb 100644 --- a/lib/run-script-pkg.js +++ b/lib/run-script-pkg.js @@ -7,18 +7,19 @@ const isServerPackage = require('./is-server-package.js') const runScriptPkg = async options => { const { - event, - path, - scriptShell, + args = [], binPaths = false, env = {}, - stdio = 'pipe', + event, + nodeGyp, + path, pkg, - args = [], - stdioString, + scriptShell, // how long to wait for a process.kill signal // only exposed here so that we can make the test go a bit faster. signalTimeout = 500, + stdio = 'pipe', + stdioString, } = options const { scripts = {}, gypfile } = pkg @@ -63,14 +64,15 @@ const runScriptPkg = async options => { } const [spawnShell, spawnArgs, spawnOpts] = makeSpawnArgs({ + args, + binPaths, + cmd, + env: { ...env, ...packageEnvs(pkg) }, event, + nodeGyp, path, scriptShell, - binPaths, - env: { ...env, ...packageEnvs(pkg) }, stdio, - cmd, - args, stdioString, }) diff --git a/test/make-spawn-args.js b/test/make-spawn-args.js index 83e90a0..110f28f 100644 --- a/test/make-spawn-args.js +++ b/test/make-spawn-args.js @@ -62,13 +62,15 @@ t.test('spawn args', async t => { /.*/, a => a.includes('echo test'), e => { - return e.env.test_fixture === 'a string' + return e.env.test_fixture === 'a string' && + e.env.npm_config_node_gyp === '/test/path.js' } ) await t.resolves(() => runScript({ pkg, path: testdir, env: { + npm_config_node_gyp: '/test/path.js', test_fixture: 'a string', }, event: 'test', @@ -76,6 +78,23 @@ t.test('spawn args', async t => { t.ok(spawk.done()) }) + await t.test('provided options.nodeGyp', async t => { + spawk.spawn( + /.*/, + a => a.includes('echo test'), + e => { + return e.env.npm_config_node_gyp === '/test/path.js' + } + ) + await t.resolves(() => runScript({ + pkg, + path: testdir, + nodeGyp: '/test/path.js', + event: 'test', + })) + t.ok(spawk.done()) + }) + await t.test('provided args', async t => { spawk.spawn( /.*/, From 1aad88a8b6968b135e2087e1ed0e83bfd676f823 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 08:51:38 -0800 Subject: [PATCH 3/3] chore: release 9.1.0 (#232) :robot: I have created a release *beep* *boop* --- ## [9.1.0](https://github.com/npm/run-script/compare/v9.0.2...v9.1.0) (2025-03-07) ### Features * [`21694f2`](https://github.com/npm/run-script/commit/21694f2098d27f3391a137a8885d20b34363faed) [#230](https://github.com/npm/run-script/pull/230) use nodeGyp option (#230) (@wraithgar, @legobeat) ### Chores * [`fea1ba3`](https://github.com/npm/run-script/commit/fea1ba381afd9ff695ade023634a16024ffdc1d9) [#229](https://github.com/npm/run-script/pull/229) bump @npmcli/template-oss from 4.23.4 to 4.23.5 (#229) (@dependabot[bot], @npm-cli-bot) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 6 ++++++ package.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c6101b7..9695e0e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "9.0.2" + ".": "9.1.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fcf8b2..32d92d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [9.1.0](https://github.com/npm/run-script/compare/v9.0.2...v9.1.0) (2025-03-07) +### Features +* [`21694f2`](https://github.com/npm/run-script/commit/21694f2098d27f3391a137a8885d20b34363faed) [#230](https://github.com/npm/run-script/pull/230) use nodeGyp option (#230) (@wraithgar, @legobeat) +### Chores +* [`fea1ba3`](https://github.com/npm/run-script/commit/fea1ba381afd9ff695ade023634a16024ffdc1d9) [#229](https://github.com/npm/run-script/pull/229) bump @npmcli/template-oss from 4.23.4 to 4.23.5 (#229) (@dependabot[bot], @npm-cli-bot) + ## [9.0.2](https://github.com/npm/run-script/compare/v9.0.1...v9.0.2) (2024-12-04) ### Dependencies * [`74f7e7a`](https://github.com/npm/run-script/commit/74f7e7a87252099fdcb5f516f846061cb9731139) [#227](https://github.com/npm/run-script/pull/227) `node-gyp@11.0.0` (#227) diff --git a/package.json b/package.json index 51b78f1..6003a73 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/run-script", - "version": "9.0.2", + "version": "9.1.0", "description": "Run a lifecycle script for a package (descendant of npm-lifecycle)", "author": "GitHub Inc.", "license": "ISC", pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy