Skip to content

Commit 205e2fd

Browse files
lukekarryswraithgar
authored andcommitted
deps: pacote@15.0.6
1 parent 8fd614a commit 205e2fd

File tree

19 files changed

+434
-10
lines changed

19 files changed

+434
-10
lines changed

node_modules/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@
192192
!/once
193193
!/p-map
194194
!/pacote
195+
!/pacote/node_modules/
196+
/pacote/node_modules/*
197+
!/pacote/node_modules/@npmcli/
198+
/pacote/node_modules/@npmcli/*
199+
!/pacote/node_modules/@npmcli/run-script
195200
!/parse-conflict-json
196201
!/path-is-absolute
197202
!/postcss-selector-parser

node_modules/pacote/lib/dir.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class DirFetcher extends Fetcher {
4949
pkg: mani,
5050
event: 'prepare',
5151
path: this.resolved,
52-
stdioString: true,
5352
stdio,
5453
banner,
5554
env: {

node_modules/pacote/lib/util/npm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ module.exports = (npmBin, npmCommand, cwd, env, extra) => {
1010
// in temp directories. this lets us link previously-seen repos that
1111
// are also being prepared.
1212

13-
return spawn(cmd, args, { cwd, stdioString: true, env }, extra)
13+
return spawn(cmd, args, { cwd, env }, extra)
1414
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
The ISC License
2+
3+
Copyright (c) npm, Inc.
4+
5+
Permission to use, copy, modify, and/or distribute this software for any
6+
purpose with or without fee is hereby granted, provided that the above
7+
copyright notice and this permission notice appear in all copies.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
15+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const util = require('util')
2+
const fs = require('fs')
3+
const { stat } = fs.promises || { stat: util.promisify(fs.stat) }
4+
const { resolve } = require('path')
5+
module.exports = async path => {
6+
try {
7+
const st = await stat(resolve(path, 'server.js'))
8+
return st.isFile()
9+
} catch (er) {
10+
return false
11+
}
12+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const platform = process.env.__FAKE_TESTING_PLATFORM__ || process.platform
2+
module.exports = platform === 'win32'
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* eslint camelcase: "off" */
2+
const setPATH = require('./set-path.js')
3+
const { resolve } = require('path')
4+
const npm_config_node_gyp = require.resolve('node-gyp/bin/node-gyp.js')
5+
6+
const makeSpawnArgs = options => {
7+
const {
8+
event,
9+
path,
10+
scriptShell = true,
11+
binPaths,
12+
env = {},
13+
stdio,
14+
cmd,
15+
args = [],
16+
stdioString,
17+
} = options
18+
19+
const spawnEnv = setPATH(path, binPaths, {
20+
// we need to at least save the PATH environment var
21+
...process.env,
22+
...env,
23+
npm_package_json: resolve(path, 'package.json'),
24+
npm_lifecycle_event: event,
25+
npm_lifecycle_script: cmd,
26+
npm_config_node_gyp,
27+
})
28+
29+
const spawnOpts = {
30+
env: spawnEnv,
31+
stdioString,
32+
stdio,
33+
cwd: path,
34+
shell: scriptShell,
35+
}
36+
37+
return [cmd, args, spawnOpts]
38+
}
39+
40+
module.exports = makeSpawnArgs
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env sh
2+
node "$npm_config_node_gyp" "$@"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@node "%npm_config_node_gyp%" %*
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// https://github.com/npm/rfcs/pull/183
2+
3+
const envVal = val => Array.isArray(val) ? val.map(v => envVal(v)).join('\n\n')
4+
: val === null || val === false ? ''
5+
: String(val)
6+
7+
const packageEnvs = (env, vals, prefix) => {
8+
for (const [key, val] of Object.entries(vals)) {
9+
if (val === undefined) {
10+
continue
11+
} else if (val && !Array.isArray(val) && typeof val === 'object') {
12+
packageEnvs(env, val, `${prefix}${key}_`)
13+
} else {
14+
env[`${prefix}${key}`] = envVal(val)
15+
}
16+
}
17+
return env
18+
}
19+
20+
module.exports = (env, pkg) => packageEnvs({ ...env }, {
21+
name: pkg.name,
22+
version: pkg.version,
23+
config: pkg.config,
24+
engines: pkg.engines,
25+
bin: pkg.bin,
26+
}, 'npm_package_')

0 commit comments

Comments
 (0)