@teambit/pnpm 1.0.1199 → 1.0.1200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-scripts-path.d.ts +29 -0
- package/dist/{node-gyp-bin.js → build-scripts-path.js} +36 -13
- package/dist/build-scripts-path.js.map +1 -0
- package/dist/{node-gyp-bin.spec.js → build-scripts-path.spec.js} +28 -15
- package/dist/build-scripts-path.spec.js.map +1 -0
- package/dist/lynx.js +5 -5
- package/dist/lynx.js.map +1 -1
- package/dist/{preview-1788966965383.js → preview-1789038252122.js} +2 -2
- package/package.json +9 -9
- package/dist/node-gyp-bin.d.ts +0 -18
- package/dist/node-gyp-bin.js.map +0 -1
- package/dist/node-gyp-bin.spec.js.map +0 -1
- /package/dist/{node-gyp-bin.spec.d.ts → build-scripts-path.spec.d.ts} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Logger } from '@teambit/logger';
|
|
2
|
+
/**
|
|
3
|
+
* pnpm's engine spawns dependency lifecycle scripts with the PATH of this
|
|
4
|
+
* process, extended only with the relevant `node_modules/.bin` directories, and
|
|
5
|
+
* its install binding takes no `extraBinPaths` or env overrides — so `process.env`
|
|
6
|
+
* is the one place to shape what those scripts find. Two things go there.
|
|
7
|
+
*
|
|
8
|
+
* The directory of the Node running Bit goes *first*. `node` in a build script
|
|
9
|
+
* — `"install": "node install.js"`, `node-gyp-build`, `prebuild-install` — is
|
|
10
|
+
* whatever PATH resolves, and a native addon built against that Node's headers
|
|
11
|
+
* (ssh2 passes `--target=${process.version}` to node-gyp explicitly) only loads
|
|
12
|
+
* into that Node. What loads the dependency afterwards is this process — `bit
|
|
13
|
+
* run`, envs, `bit build` all `require` it — so the addon has to match this
|
|
14
|
+
* process's Node, and a machine whose own `node` is older than Bit's otherwise
|
|
15
|
+
* segfaults there. The engine also identifies the host Node by `node --version`
|
|
16
|
+
* on PATH and keys the store's side-effects cache and the global virtual store
|
|
17
|
+
* by it, so this keeps those keys matching what Bit loads. npm always prepends
|
|
18
|
+
* `dirname(process.execPath)` for the same reason, and the `bit` wrapper bvm
|
|
19
|
+
* writes exports the same PATH for the whole process.
|
|
20
|
+
*
|
|
21
|
+
* A `node-gyp` wrapper goes *last*. The engine ships no `node-gyp` of its own,
|
|
22
|
+
* so a native package that shells out to `node-gyp rebuild` — `node-gyp-build`,
|
|
23
|
+
* `node-pre-gyp`, or a plain `"install": "node-gyp rebuild"` — fails with
|
|
24
|
+
* `spawn node-gyp ENOENT` unless something else put `node-gyp` on PATH. npm
|
|
25
|
+
* solves this with a wrapper script directory of its own; reproduce it here over
|
|
26
|
+
* the `node-gyp` that Bit depends on. Appended, so a `node-gyp` the user
|
|
27
|
+
* installed themselves still takes precedence.
|
|
28
|
+
*/
|
|
29
|
+
export declare function prepareBuildScriptsPath(logger?: Logger): void;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.prepareBuildScriptsPath = prepareBuildScriptsPath;
|
|
7
7
|
function _crypto() {
|
|
8
8
|
const data = require("crypto");
|
|
9
9
|
_crypto = function () {
|
|
@@ -34,20 +34,43 @@ function _legacy() {
|
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* pnpm's engine spawns dependency lifecycle scripts with the PATH of this
|
|
37
|
-
* process, extended only with the relevant `node_modules/.bin` directories
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* `"install": "node-gyp rebuild"` — fails with `spawn node-gyp ENOENT` unless
|
|
41
|
-
* something else put `node-gyp` on PATH.
|
|
37
|
+
* process, extended only with the relevant `node_modules/.bin` directories, and
|
|
38
|
+
* its install binding takes no `extraBinPaths` or env overrides — so `process.env`
|
|
39
|
+
* is the one place to shape what those scripts find. Two things go there.
|
|
42
40
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
41
|
+
* The directory of the Node running Bit goes *first*. `node` in a build script
|
|
42
|
+
* — `"install": "node install.js"`, `node-gyp-build`, `prebuild-install` — is
|
|
43
|
+
* whatever PATH resolves, and a native addon built against that Node's headers
|
|
44
|
+
* (ssh2 passes `--target=${process.version}` to node-gyp explicitly) only loads
|
|
45
|
+
* into that Node. What loads the dependency afterwards is this process — `bit
|
|
46
|
+
* run`, envs, `bit build` all `require` it — so the addon has to match this
|
|
47
|
+
* process's Node, and a machine whose own `node` is older than Bit's otherwise
|
|
48
|
+
* segfaults there. The engine also identifies the host Node by `node --version`
|
|
49
|
+
* on PATH and keys the store's side-effects cache and the global virtual store
|
|
50
|
+
* by it, so this keeps those keys matching what Bit loads. npm always prepends
|
|
51
|
+
* `dirname(process.execPath)` for the same reason, and the `bit` wrapper bvm
|
|
52
|
+
* writes exports the same PATH for the whole process.
|
|
46
53
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* install
|
|
54
|
+
* A `node-gyp` wrapper goes *last*. The engine ships no `node-gyp` of its own,
|
|
55
|
+
* so a native package that shells out to `node-gyp rebuild` — `node-gyp-build`,
|
|
56
|
+
* `node-pre-gyp`, or a plain `"install": "node-gyp rebuild"` — fails with
|
|
57
|
+
* `spawn node-gyp ENOENT` unless something else put `node-gyp` on PATH. npm
|
|
58
|
+
* solves this with a wrapper script directory of its own; reproduce it here over
|
|
59
|
+
* the `node-gyp` that Bit depends on. Appended, so a `node-gyp` the user
|
|
60
|
+
* installed themselves still takes precedence.
|
|
50
61
|
*/
|
|
62
|
+
function prepareBuildScriptsPath(logger) {
|
|
63
|
+
addNodeToPath();
|
|
64
|
+
addNodeGypToPath(logger);
|
|
65
|
+
}
|
|
66
|
+
function addNodeToPath() {
|
|
67
|
+
const nodeDir = (0, _path().dirname)(process.execPath);
|
|
68
|
+
const currentPath = process.env.PATH ?? '';
|
|
69
|
+
if (currentPath.split(_path().delimiter)[0] === nodeDir) return;
|
|
70
|
+
// The inherited value is kept as is after the prefix: an empty component in
|
|
71
|
+
// it means the working directory, so it must not be dropped as noise.
|
|
72
|
+
process.env.PATH = currentPath === '' ? nodeDir : `${nodeDir}${_path().delimiter}${currentPath}`;
|
|
73
|
+
}
|
|
51
74
|
function addNodeGypToPath(logger) {
|
|
52
75
|
let dir;
|
|
53
76
|
try {
|
|
@@ -120,4 +143,4 @@ function shQuote(value) {
|
|
|
120
143
|
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
121
144
|
}
|
|
122
145
|
|
|
123
|
-
//# sourceMappingURL=
|
|
146
|
+
//# sourceMappingURL=build-scripts-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_crypto","data","require","_fs","_path","_legacy","prepareBuildScriptsPath","logger","addNodeToPath","addNodeGypToPath","nodeDir","dirname","process","execPath","currentPath","env","PATH","split","delimiter","dir","writeShims","err","consoleWarning","warn","includes","nodeGypJs","resolve","node","key","createHash","update","digest","slice","join","CACHE_ROOT","writeShim","shQuote","platform","target","content","readIfExists","mkdirSync","recursive","tmp","pid","writeFileSync","chmodSync","renameSync","rmSync","force","readFileSync","code","undefined","value","replace"],"sources":["build-scripts-path.ts"],"sourcesContent":["import { createHash } from 'crypto';\nimport { chmodSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'fs';\nimport { delimiter, dirname, join } from 'path';\nimport { CACHE_ROOT } from '@teambit/legacy.constants';\nimport type { Logger } from '@teambit/logger';\n\n/**\n * pnpm's engine spawns dependency lifecycle scripts with the PATH of this\n * process, extended only with the relevant `node_modules/.bin` directories, and\n * its install binding takes no `extraBinPaths` or env overrides — so `process.env`\n * is the one place to shape what those scripts find. Two things go there.\n *\n * The directory of the Node running Bit goes *first*. `node` in a build script\n * — `\"install\": \"node install.js\"`, `node-gyp-build`, `prebuild-install` — is\n * whatever PATH resolves, and a native addon built against that Node's headers\n * (ssh2 passes `--target=${process.version}` to node-gyp explicitly) only loads\n * into that Node. What loads the dependency afterwards is this process — `bit\n * run`, envs, `bit build` all `require` it — so the addon has to match this\n * process's Node, and a machine whose own `node` is older than Bit's otherwise\n * segfaults there. The engine also identifies the host Node by `node --version`\n * on PATH and keys the store's side-effects cache and the global virtual store\n * by it, so this keeps those keys matching what Bit loads. npm always prepends\n * `dirname(process.execPath)` for the same reason, and the `bit` wrapper bvm\n * writes exports the same PATH for the whole process.\n *\n * A `node-gyp` wrapper goes *last*. The engine ships no `node-gyp` of its own,\n * so a native package that shells out to `node-gyp rebuild` — `node-gyp-build`,\n * `node-pre-gyp`, or a plain `\"install\": \"node-gyp rebuild\"` — fails with\n * `spawn node-gyp ENOENT` unless something else put `node-gyp` on PATH. npm\n * solves this with a wrapper script directory of its own; reproduce it here over\n * the `node-gyp` that Bit depends on. Appended, so a `node-gyp` the user\n * installed themselves still takes precedence.\n */\nexport function prepareBuildScriptsPath(logger?: Logger): void {\n addNodeToPath();\n addNodeGypToPath(logger);\n}\n\nfunction addNodeToPath(): void {\n const nodeDir = dirname(process.execPath);\n const currentPath = process.env.PATH ?? '';\n if (currentPath.split(delimiter)[0] === nodeDir) return;\n // The inherited value is kept as is after the prefix: an empty component in\n // it means the working directory, so it must not be dropped as noise.\n process.env.PATH = currentPath === '' ? nodeDir : `${nodeDir}${delimiter}${currentPath}`;\n}\n\nfunction addNodeGypToPath(logger?: Logger): void {\n let dir: string;\n try {\n dir = writeShims();\n } catch (err: any) {\n // Not fatal on its own: only a dependency that actually builds with\n // node-gyp will fail, and it may well find one elsewhere on PATH. Warn\n // rather than throw, but warn loudly enough to explain that failure.\n logger?.consoleWarning(`failed to set up node-gyp, packages that build with it may fail to install: ${err}`);\n logger?.warn('failed to set up the node-gyp wrapper', err);\n return;\n }\n const currentPath = process.env.PATH ?? '';\n if (currentPath.split(delimiter).includes(dir)) return;\n process.env.PATH = currentPath === '' ? dir : `${currentPath}${delimiter}${dir}`;\n}\n\n/** Writes the wrappers if they are not already there, and returns their directory. */\nfunction writeShims(): string {\n const nodeGypJs = require.resolve('node-gyp/bin/node-gyp.js');\n const node = process.execPath;\n // The wrappers hardcode the two paths, so the directory is keyed by them:\n // another Bit install, or the same one under a different Node, resolves to a\n // directory of its own instead of overwriting this one — which would point\n // concurrent installs at the wrong node-gyp, and would make two Bit versions\n // used side by side rewrite the wrapper on every install. What accumulates is\n // two ~100-byte files per distinct pair, so nothing needs pruning.\n const key = createHash('sha1').update(`${node}\\n${nodeGypJs}`).digest('hex').slice(0, 12);\n const dir = join(CACHE_ROOT, 'node-gyp-bin', key);\n // Written on Windows too: the default shell there is cmd.exe, but a\n // `scriptShell` pointing at bash needs the POSIX wrapper.\n writeShim(join(dir, 'node-gyp'), `#!/bin/sh\\nexec ${shQuote(node)} ${shQuote(nodeGypJs)} \"$@\"\\n`);\n if (process.platform === 'win32') {\n writeShim(join(dir, 'node-gyp.cmd'), `@echo off\\r\\n\"${node}\" \"${nodeGypJs}\" %*\\r\\n`);\n }\n return dir;\n}\n\nfunction writeShim(target: string, content: string): void {\n if (readIfExists(target) === content) return;\n mkdirSync(dirname(target), { recursive: true });\n // Write and rename, so the wrapper only ever appears at its final path fully\n // written and executable, whichever of several concurrent Bit processes wins.\n const tmp = `${target}.${process.pid}.tmp`;\n try {\n writeFileSync(tmp, content);\n chmodSync(tmp, 0o755); // not umask-masked, unlike writeFileSync's `mode`\n renameSync(tmp, target);\n } catch (err) {\n rmSync(tmp, { force: true });\n // Losing that race is a success, not a failure — on Windows the other\n // process's rename would have thrown.\n if (readIfExists(target) !== content) throw err;\n }\n}\n\nfunction readIfExists(target: string): string | undefined {\n try {\n return readFileSync(target, 'utf8');\n } catch (err: any) {\n // Read and handle the absence, rather than testing for it first: another\n // Bit process replacing the wrapper could remove it between the two.\n if (err.code === 'ENOENT') return undefined;\n throw err;\n }\n}\n\nfunction shQuote(value: string): string {\n return `'${value.replace(/'/g, `'\\\\''`)}'`;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;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AACZ;AAEA,SAASgB,SAASA,CAACG,MAAc,EAAEC,OAAe,EAAQ;EACxD,IAAIC,YAAY,CAACF,MAAM,CAAC,KAAKC,OAAO,EAAE;EACtC,IAAAE,eAAS,EAAC,IAAA9B,eAAO,EAAC2B,MAAM,CAAC,EAAE;IAAEI,SAAS,EAAE;EAAK,CAAC,CAAC;EAC/C;EACA;EACA,MAAMC,GAAG,GAAG,GAAGL,MAAM,IAAI1B,OAAO,CAACgC,GAAG,MAAM;EAC1C,IAAI;IACF,IAAAC,mBAAa,EAACF,GAAG,EAAEJ,OAAO,CAAC;IAC3B,IAAAO,eAAS,EAACH,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IACvB,IAAAI,gBAAU,EAACJ,GAAG,EAAEL,MAAM,CAAC;EACzB,CAAC,CAAC,OAAOjB,GAAG,EAAE;IACZ,IAAA2B,YAAM,EAACL,GAAG,EAAE;MAAEM,KAAK,EAAE;IAAK,CAAC,CAAC;IAC5B;IACA;IACA,IAAIT,YAAY,CAACF,MAAM,CAAC,KAAKC,OAAO,EAAE,MAAMlB,GAAG;EACjD;AACF;AAEA,SAASmB,YAAYA,CAACF,MAAc,EAAsB;EACxD,IAAI;IACF,OAAO,IAAAY,kBAAY,EAACZ,MAAM,EAAE,MAAM,CAAC;EACrC,CAAC,CAAC,OAAOjB,GAAQ,EAAE;IACjB;IACA;IACA,IAAIA,GAAG,CAAC8B,IAAI,KAAK,QAAQ,EAAE,OAAOC,SAAS;IAC3C,MAAM/B,GAAG;EACX;AACF;AAEA,SAASe,OAAOA,CAACiB,KAAa,EAAU;EACtC,OAAO,IAAIA,KAAK,CAACC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG;AAC5C","ignoreList":[]}
|
|
@@ -28,21 +28,29 @@ function _path() {
|
|
|
28
28
|
};
|
|
29
29
|
return data;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
const data = require("./
|
|
33
|
-
|
|
31
|
+
function _buildScriptsPath() {
|
|
32
|
+
const data = require("./build-scripts-path");
|
|
33
|
+
_buildScriptsPath = function () {
|
|
34
34
|
return data;
|
|
35
35
|
};
|
|
36
36
|
return data;
|
|
37
37
|
}
|
|
38
|
-
describe('
|
|
38
|
+
describe('prepareBuildScriptsPath()', () => {
|
|
39
|
+
const nodeDir = (0, _path().dirname)(process.execPath);
|
|
39
40
|
let originalPath;
|
|
41
|
+
let pathBefore;
|
|
42
|
+
let entries;
|
|
40
43
|
let addedDirs;
|
|
41
44
|
before(() => {
|
|
42
45
|
originalPath = process.env.PATH;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
// Whatever runs the specs may already have put this Node first. Push it
|
|
47
|
+
// back so the prepend is exercised, not skipped as already done. The empty
|
|
48
|
+
// component stands for the working directory and has to survive as is.
|
|
49
|
+
process.env.PATH = ['/nonexistent-first', '', ...(originalPath ?? '').split(_path().delimiter)].join(_path().delimiter);
|
|
50
|
+
pathBefore = process.env.PATH.split(_path().delimiter);
|
|
51
|
+
(0, _buildScriptsPath().prepareBuildScriptsPath)();
|
|
52
|
+
entries = (process.env.PATH ?? '').split(_path().delimiter);
|
|
53
|
+
addedDirs = entries.filter(dir => !pathBefore.includes(dir));
|
|
46
54
|
});
|
|
47
55
|
after(() => {
|
|
48
56
|
// Assigning `undefined` would leave the literal string "undefined" for
|
|
@@ -52,18 +60,23 @@ describe('addNodeGypToPath()', () => {
|
|
|
52
60
|
// behavior under test, so it cannot be redirected without stubbing out the
|
|
53
61
|
// thing being asserted. Take it back out; an install that wants it writes
|
|
54
62
|
// it again, and a script already running one keeps the inode it opened.
|
|
55
|
-
addedDirs.forEach(dir => (0, _fs().rmSync)(dir, {
|
|
63
|
+
addedDirs.filter(dir => dir !== nodeDir).forEach(dir => (0, _fs().rmSync)(dir, {
|
|
56
64
|
recursive: true,
|
|
57
65
|
force: true
|
|
58
66
|
}));
|
|
59
67
|
});
|
|
60
|
-
it(
|
|
61
|
-
(0, _chai().expect)(
|
|
62
|
-
(0, _chai().expect)(process.env.PATH?.startsWith(originalPath ?? '')).to.equal(true);
|
|
68
|
+
it("puts the running node's directory first", () => {
|
|
69
|
+
(0, _chai().expect)(entries[0]).to.equal(nodeDir);
|
|
63
70
|
});
|
|
64
|
-
it('the
|
|
71
|
+
it('keeps the rest of PATH as it was, between the node dir and the node-gyp wrapper', () => {
|
|
72
|
+
(0, _chai().expect)(entries.slice(1, -1)).to.deep.equal(pathBefore);
|
|
73
|
+
});
|
|
74
|
+
it('appends exactly one directory, holding a node-gyp that runs', function () {
|
|
75
|
+
const appended = addedDirs.filter(dir => dir !== nodeDir);
|
|
76
|
+
(0, _chai().expect)(appended).to.have.lengthOf(1);
|
|
77
|
+
(0, _chai().expect)(entries[entries.length - 1]).to.equal(appended[0]);
|
|
65
78
|
if (process.platform === 'win32') this.skip();
|
|
66
|
-
const shim = (0, _path().join)(
|
|
79
|
+
const shim = (0, _path().join)(appended[0], 'node-gyp');
|
|
67
80
|
(0, _chai().expect)((0, _fs().existsSync)(shim)).to.equal(true);
|
|
68
81
|
(0, _chai().expect)((0, _child_process().execFileSync)(shim, ['--version'], {
|
|
69
82
|
encoding: 'utf8'
|
|
@@ -71,9 +84,9 @@ describe('addNodeGypToPath()', () => {
|
|
|
71
84
|
});
|
|
72
85
|
it('is idempotent', () => {
|
|
73
86
|
const pathAfterFirstCall = process.env.PATH;
|
|
74
|
-
(0,
|
|
87
|
+
(0, _buildScriptsPath().prepareBuildScriptsPath)();
|
|
75
88
|
(0, _chai().expect)(process.env.PATH).to.equal(pathAfterFirstCall);
|
|
76
89
|
});
|
|
77
90
|
});
|
|
78
91
|
|
|
79
|
-
//# sourceMappingURL=
|
|
92
|
+
//# sourceMappingURL=build-scripts-path.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_chai","data","require","_child_process","_fs","_path","_buildScriptsPath","describe","nodeDir","dirname","process","execPath","originalPath","pathBefore","entries","addedDirs","before","env","PATH","split","delimiter","join","prepareBuildScriptsPath","filter","dir","includes","after","undefined","forEach","rmSync","recursive","force","it","expect","to","equal","slice","deep","appended","have","lengthOf","length","platform","skip","shim","existsSync","execFileSync","encoding","trim","match","pathAfterFirstCall"],"sources":["build-scripts-path.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport { execFileSync } from 'child_process';\nimport { existsSync, rmSync } from 'fs';\nimport { delimiter, dirname, join } from 'path';\nimport { prepareBuildScriptsPath } from './build-scripts-path';\n\ndescribe('prepareBuildScriptsPath()', () => {\n const nodeDir = dirname(process.execPath);\n let originalPath: string | undefined;\n let pathBefore: string[];\n let entries: string[];\n let addedDirs: string[];\n\n before(() => {\n originalPath = process.env.PATH;\n // Whatever runs the specs may already have put this Node first. Push it\n // back so the prepend is exercised, not skipped as already done. The empty\n // component stands for the working directory and has to survive as is.\n process.env.PATH = ['/nonexistent-first', '', ...(originalPath ?? '').split(delimiter)].join(delimiter);\n pathBefore = process.env.PATH.split(delimiter);\n prepareBuildScriptsPath();\n entries = (process.env.PATH ?? '').split(delimiter);\n addedDirs = entries.filter((dir) => !pathBefore.includes(dir));\n });\n\n after(() => {\n // Assigning `undefined` would leave the literal string \"undefined\" for\n // every spec that runs after this one in the same process.\n if (originalPath === undefined) delete process.env.PATH;\n else process.env.PATH = originalPath;\n // The wrapper lands in the real Bit cache — writing it there is the\n // behavior under test, so it cannot be redirected without stubbing out the\n // thing being asserted. Take it back out; an install that wants it writes\n // it again, and a script already running one keeps the inode it opened.\n addedDirs.filter((dir) => dir !== nodeDir).forEach((dir) => rmSync(dir, { recursive: true, force: true }));\n });\n\n it(\"puts the running node's directory first\", () => {\n expect(entries[0]).to.equal(nodeDir);\n });\n\n it('keeps the rest of PATH as it was, between the node dir and the node-gyp wrapper', () => {\n expect(entries.slice(1, -1)).to.deep.equal(pathBefore);\n });\n\n it('appends exactly one directory, holding a node-gyp that runs', function () {\n const appended = addedDirs.filter((dir) => dir !== nodeDir);\n expect(appended).to.have.lengthOf(1);\n expect(entries[entries.length - 1]).to.equal(appended[0]);\n if (process.platform === 'win32') this.skip();\n const shim = join(appended[0], 'node-gyp');\n expect(existsSync(shim)).to.equal(true);\n expect(execFileSync(shim, ['--version'], { encoding: 'utf8' }).trim()).to.match(/^v\\d+\\./);\n });\n\n it('is idempotent', () => {\n const pathAfterFirstCall = process.env.PATH;\n prepareBuildScriptsPath();\n expect(process.env.PATH).to.equal(pathAfterFirstCall);\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,eAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,cAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,IAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,GAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,kBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,iBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEAM,QAAQ,CAAC,2BAA2B,EAAE,MAAM;EAC1C,MAAMC,OAAO,GAAG,IAAAC,eAAO,EAACC,OAAO,CAACC,QAAQ,CAAC;EACzC,IAAIC,YAAgC;EACpC,IAAIC,UAAoB;EACxB,IAAIC,OAAiB;EACrB,IAAIC,SAAmB;EAEvBC,MAAM,CAAC,MAAM;IACXJ,YAAY,GAAGF,OAAO,CAACO,GAAG,CAACC,IAAI;IAC/B;IACA;IACA;IACAR,OAAO,CAACO,GAAG,C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 +109,9 @@ function _readConfig() {
|
|
|
109
109
|
};
|
|
110
110
|
return data;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
const data = require("./
|
|
114
|
-
|
|
112
|
+
function _buildScriptsPath() {
|
|
113
|
+
const data = require("./build-scripts-path");
|
|
114
|
+
_buildScriptsPath = function () {
|
|
115
115
|
return data;
|
|
116
116
|
};
|
|
117
117
|
return data;
|
|
@@ -398,7 +398,7 @@ async function install(rootDir, manifestsByPaths, storeDir, cacheDir, registries
|
|
|
398
398
|
if (!options.dryRun) {
|
|
399
399
|
// Dependency build scripts inherit this process's PATH. Set up inside the
|
|
400
400
|
// guard, so a dry run neither writes the wrapper nor touches the env.
|
|
401
|
-
(0,
|
|
401
|
+
(0, _buildScriptsPath().prepareBuildScriptsPath)(logger);
|
|
402
402
|
let installPromise;
|
|
403
403
|
let restoreWantedLockfile;
|
|
404
404
|
const onOutput = options.hidePackageManagerOutput ? undefined : reporterOutput(options.reportOptions);
|
|
@@ -440,7 +440,7 @@ async function install(rootDir, manifestsByPaths, storeDir, cacheDir, registries
|
|
|
440
440
|
// support the pending / skipIfHasSideEffectsCache selectors of the old engine.
|
|
441
441
|
rebuild: async () => {
|
|
442
442
|
// Reached without an install of its own after a dry run.
|
|
443
|
-
(0,
|
|
443
|
+
(0, _buildScriptsPath().prepareBuildScriptsPath)(logger);
|
|
444
444
|
// Same output routing as the install: the CLI server's stream has to
|
|
445
445
|
// carry the rebuild's output too, not just the install's.
|
|
446
446
|
const rebuildReportOptions = _objectSpread(_objectSpread({}, options.reportOptions), {}, {
|
package/dist/lynx.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_path","data","require","_fs","_chalk","_interopRequireDefault","_semver","_parsePackageName","_pluginTrustedDeps","nodeApi","_interopRequireWildcard","_nerfDart","_bitError","_legacy","_dependenciesPnpm","_lodash","_pnpmErrorToBitError","_readConfig","_nodeGypBin","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","UNTRUSTED_PACKAGE_NAMES","installsRunning","toNodeApiProxyConfig","proxyConfig","httpProxy","httpsProxy","noProxy","toNodeApiNetworkConfig","networkConfig","ca","cert","key","localAddress","strictSsl","strictSSL","maxSockets","networkConcurrency","fetchRetries","fetchRetryFactor","fetchRetryMintimeout","fetchRetryMaxtimeout","fetchTimeout","userAgent","buildAuthHeaderByUri","registries","result","registry","values","scopes","uri","authHeaderValue","toNerfDart","defaultRegistry","applyReadPackageHooks","hooks","manifest","workspaceDir","reduce","m","hook","generateResolverAndFetcher","cacheDir","fullMetadata","pnpmConfig","readConfig","authHeaderByUri","config","registriesMap","toMap","resolve","wantedDep","resolveOpts","resolveDependency","dir","projectDir","lockfileDir","process","cwd","undefined","getPeerDependencyIssues","manifestsByPaths","opts","projects","entries","map","rootDir","storeDir","overrides","peersSuffixMaxLength","virtualStoreDirMaxLength","VIRTUAL_STORE_DIR_MAX_LENGTH","err","pnpmErrorToBitError","install","options","logger","externalDependencies","Set","createReadPackageHooks","rootComponents","rootComponentsForCapsules","name","add","forcedHarmonyVersion","dependenciesMeta","hoistPattern","size","hoistInjectedDependencies","pkgName","scriptPolicies","resolveScriptPolicies","allowScripts","dangerouslyAllowAllScripts","neverBuiltDependencies","readPackageHookForDeps","resolvedDir","rawManifest","join","resolvedManifest","removeScriptsFromNeverBuiltPackages","neverBuildPackageNames","installOptions","nodeLinker","linkWorkspacePackages","publicHoistPattern","allowBuilds","dangerouslyAllowAllBuilds","autoInstallPeers","excludeLinksFromLockfile","lockfileOnly","packageImportMethod","preferOffline","enableGlobalVirtualStore","globalVirtualStoreDir","patchedDependencies","packageExtensions","dedupePeerDependents","dedupePeers","dedupeDirectDeps","dedupeInjectedDeps","injectWorkspacePackages","includeOptionalDeps","update","updateAll","depth","nodeVersion","engineStrict","minimumReleaseAge","minimumReleaseAgeExclude","trustLockfile","ignorePackageManifest","hoistWorkspacePackages","enableModulesDir","resolvePeersFromWorkspaceRoot","frozenLockfile","preferFrozenLockfile","peerDependencyRules","allowAny","ignoreMissing","reportOptions","strictDepBuilds","pnpmHomeDir","returnListOfDepsRequiringBuild","reporter","hidePackageManagerOutput","toReporterOptions","hideAddedPkgsProgress","dependenciesChanged","depsRequiringBuild","resolvedStoreDir","dryRun","addNodeGypToPath","installPromise","restoreWantedLockfile","onOutput","reporterOutput","preInstallBitAttrs","readBitLockfileAttrs","removeWantedLockfileForUpdate","installResult","sortedDepsRequiringBuild","sortDepsRequiringBuild","bitAttrs","mergeBitLockfileAttrs","addBitAttributesToLockfile","stats","added","removed","linkedToRoot","warn","rebuild","rebuildReportOptions","appendOnly","hideLifecycleOutput","lockfilePath","lockfileContent","fs","readFile","code","unlink","writeFile","pkg","packageDescriptor","allowedScript","trustedPkgName","TRUSTED_PACKAGE_NAMES","untrustedPkgName","scripts","includes","APPROVE_BUILDS_INSTRUCTION_TEXT","stream","reporterOutputStream","throttleProgress","hideProgressPrefix","ignoredBuildsInstructionText","hideLinkedPkgsDiff","width","columns","Math","max","color","chalk","level","chunk","write","outputStream","stdout","readPackage","readPackageHook","removeLegacyFromDeps","removeHarmonyFromDeps","readPackageHookForCapsules","dependencies","peerDependencies","startsWith","BIT_ROOTS_DIR","readWorkspacePackageHook","newDeps","version","resolveRemoteVersion","packageName","preferredVersions","parsedPackage","parsePackageName","alias","bareSpecifier","val","BitError","wantedRange","semver","validRange","isSemver","resolvedVia","message","normalizedBareSpecifier","sort","preInstallAttrs","lockfile","readLockfile","bit","attrs","merged","isEqual","writeLockfile"],"sources":["lynx.ts"],"sourcesContent":["import { join } from 'path';\nimport { promises as fs } from 'fs';\nimport chalk from 'chalk';\nimport semver from 'semver';\nimport parsePackageName from 'parse-package-name';\nimport { TRUSTED_PACKAGE_NAMES } from '@pnpm/plugin-trusted-deps';\nimport type {\n PackageManifest,\n ProjectManifest,\n ReadPackageHook,\n PeerDependencyRules,\n DependencyManifest,\n DepPath,\n} from '@pnpm/types';\nimport * as nodeApi from '@pnpm/napi';\nimport type { PeerDependencyIssuesByProjects } from '@pnpm/napi';\nimport { type LockfileFile } from '@pnpm/lockfile.types';\nimport type { Registries } from '@teambit/pkg.entities.registry';\nimport toNerfDart from 'nerf-dart';\nimport type {\n ResolvedPackageVersion,\n PackageManagerProxyConfig,\n PackageManagerNetworkConfig,\n PackageExtension,\n} from '@teambit/dependency-resolver';\nimport { BitError } from '@teambit/bit-error';\nimport { BIT_ROOTS_DIR } from '@teambit/legacy.constants';\nimport type { Logger } from '@teambit/logger';\nimport { VIRTUAL_STORE_DIR_MAX_LENGTH } from '@teambit/dependencies.pnpm.dep-path';\nimport { isEqual } from 'lodash';\nimport { pnpmErrorToBitError } from './pnpm-error-to-bit-error';\nimport { readConfig } from './read-config';\nimport { addNodeGypToPath } from './node-gyp-bin';\n\n/**\n * Packages that are known to have risky or unnecessary build scripts.\n * These packages will be disallowed from running scripts by default,\n * unless the user explicitly allows them in `allowScripts`.\n */\nconst UNTRUSTED_PACKAGE_NAMES = ['es5-ext', 'less', 'protobufjs', 'ssh', 'core-js-pure', 'core-js'];\n\nconst installsRunning: Record<string, Promise<any>> = {};\n\n/**\n * Minimal structural signature of the `resolve` function returned by\n * `generateResolverAndFetcher`. It mirrors what the old\n * `@pnpm/installing.client` `ResolveFunction` exposed, but is backed by\n * `@pnpm/napi`'s `resolveDependency`.\n */\ntype ResolveOpts = {\n lockfileDir?: string;\n projectDir?: string;\n preferredVersions?: Record<string, unknown>;\n registry?: string;\n};\ntype ResolveFunction = (\n wantedDependency: nodeApi.WantedDependency,\n opts: ResolveOpts\n) => Promise<nodeApi.ResolveResult>;\n\nfunction toNodeApiProxyConfig(proxyConfig: PackageManagerProxyConfig): nodeApi.ProxyConfig {\n return {\n httpProxy: proxyConfig.httpProxy,\n httpsProxy: proxyConfig.httpsProxy,\n noProxy: proxyConfig.noProxy,\n };\n}\n\nfunction toNodeApiNetworkConfig(networkConfig: PackageManagerNetworkConfig): nodeApi.NetworkConfig {\n return {\n ca: networkConfig.ca,\n cert: networkConfig.cert,\n key: networkConfig.key,\n localAddress: networkConfig.localAddress,\n strictSsl: networkConfig.strictSSL,\n maxSockets: networkConfig.maxSockets,\n networkConcurrency: networkConfig.networkConcurrency,\n fetchRetries: networkConfig.fetchRetries,\n fetchRetryFactor: networkConfig.fetchRetryFactor,\n fetchRetryMintimeout: networkConfig.fetchRetryMintimeout,\n fetchRetryMaxtimeout: networkConfig.fetchRetryMaxtimeout,\n fetchTimeout: networkConfig.fetchTimeout,\n userAgent: networkConfig.userAgent,\n };\n}\n\n/**\n * Pre-computed `Authorization` headers keyed by nerf-darted registry URI\n * (plus `''` for the default registry) — the shape `@pnpm/napi` applies\n * directly. Bit's registries model already carries ready-to-send header\n * values (from the engine's `readConfig` plus Bit's own cloud token), so no\n * npmrc-style credential round-trip is needed.\n */\nfunction buildAuthHeaderByUri(registries: Registries): Record<string, string> {\n const result: Record<string, string> = {};\n for (const registry of Object.values(registries.scopes)) {\n if (registry.uri && registry.authHeaderValue) {\n result[toNerfDart(registry.uri)] = registry.authHeaderValue;\n }\n }\n const { defaultRegistry } = registries;\n if (defaultRegistry?.authHeaderValue) {\n if (defaultRegistry.uri) {\n result[toNerfDart(defaultRegistry.uri)] = defaultRegistry.authHeaderValue;\n }\n result[''] = defaultRegistry.authHeaderValue;\n }\n return result;\n}\n\n/**\n * Compose the list of read-package hooks into a single synchronous transform.\n * The Bit hooks are all synchronous, so the accumulator stays synchronous even\n * though the pnpm `ReadPackageHook` type allows returning a promise.\n */\nfunction applyReadPackageHooks(\n hooks: ReadPackageHook[],\n manifest: PackageManifest,\n workspaceDir?: string\n): PackageManifest {\n return hooks.reduce<PackageManifest>((m, hook) => hook(m, workspaceDir) as PackageManifest, manifest);\n}\n\nexport async function generateResolverAndFetcher({\n cacheDir,\n registries,\n proxyConfig,\n networkConfig,\n fullMetadata,\n}: {\n cacheDir: string;\n registries: Registries;\n proxyConfig?: PackageManagerProxyConfig;\n networkConfig?: PackageManagerNetworkConfig;\n fullMetadata?: boolean;\n}): Promise<{ resolve: ResolveFunction }> {\n const pnpmConfig = await readConfig();\n // The engine-resolved `.npmrc` headers first; Bit's own registries model\n // (which carries the cloud token) wins on conflict.\n const authHeaderByUri = { ...pnpmConfig.config.authHeaderByUri, ...buildAuthHeaderByUri(registries) };\n const registriesMap = registries.toMap();\n const resolve: ResolveFunction = (wantedDep, resolveOpts) =>\n nodeApi.resolveDependency(wantedDep, {\n dir: resolveOpts.projectDir || resolveOpts.lockfileDir || process.cwd(),\n cacheDir,\n registries: registriesMap,\n authHeaderByUri,\n proxyConfig: proxyConfig ? toNodeApiProxyConfig(proxyConfig) : undefined,\n networkConfig: networkConfig ? toNodeApiNetworkConfig(networkConfig) : undefined,\n fullMetadata,\n });\n return { resolve };\n}\n\nexport async function getPeerDependencyIssues(\n manifestsByPaths: Record<string, any>,\n opts: {\n storeDir?: string;\n cacheDir: string;\n registries: Registries;\n rootDir: string;\n proxyConfig: PackageManagerProxyConfig;\n networkConfig: PackageManagerNetworkConfig;\n overrides?: Record<string, string>;\n packageImportMethod?: 'auto' | 'hardlink' | 'copy' | 'clone';\n pnpmHomeDir?: string;\n }\n): Promise<PeerDependencyIssuesByProjects> {\n const projects: nodeApi.NodeApiProject[] = Object.entries(manifestsByPaths).map(([rootDir, manifest]) => ({\n rootDir,\n manifest: manifest as nodeApi.PackageManifest,\n }));\n try {\n return await nodeApi.getPeerDependencyIssues({\n dir: opts.rootDir,\n projects,\n storeDir: opts.storeDir,\n cacheDir: opts.cacheDir,\n overrides: opts.overrides,\n peersSuffixMaxLength: 1000,\n registries: opts.registries.toMap(),\n authHeaderByUri: buildAuthHeaderByUri(opts.registries),\n proxyConfig: toNodeApiProxyConfig(opts.proxyConfig),\n networkConfig: toNodeApiNetworkConfig(opts.networkConfig),\n virtualStoreDirMaxLength: VIRTUAL_STORE_DIR_MAX_LENGTH,\n });\n } catch (err: any) {\n throw pnpmErrorToBitError(err);\n }\n}\n\nexport type RebuildFn = (opts: { pending?: boolean; skipIfHasSideEffectsCache?: boolean }) => Promise<void>;\n\n/**\n * A stream the engine's rendered output can be written to. `columns` is\n * how the frame is sized; a stream that is not a terminal has none, and\n * the reporter falls back to pnpm's 80-column default.\n */\nexport type OutputStream = NodeJS.WritableStream & { columns?: number };\n\nexport interface ReportOptions {\n appendOnly?: boolean;\n throttleProgress?: number;\n hideAddedPkgsProgress?: boolean;\n hideProgressPrefix?: boolean;\n hideLifecycleOutput?: boolean;\n peerDependencyRules?: PeerDependencyRules;\n /** Defaults to `process.stdout`. */\n outputStream?: OutputStream;\n}\n\nexport async function install(\n rootDir: string,\n manifestsByPaths: Record<string, ProjectManifest>,\n storeDir: string | undefined,\n cacheDir: string,\n registries: Registries,\n proxyConfig: PackageManagerProxyConfig = {},\n networkConfig: PackageManagerNetworkConfig = {},\n options: {\n updateAll?: boolean;\n nodeLinker?: 'hoisted' | 'isolated';\n overrides?: Record<string, string>;\n rootComponents?: boolean;\n rootComponentsForCapsules?: boolean;\n includeOptionalDeps?: boolean;\n reportOptions?: ReportOptions;\n hidePackageManagerOutput?: boolean;\n hoistInjectedDependencies?: boolean;\n dryRun?: boolean;\n dedupePeers?: boolean;\n dedupeInjectedDeps?: boolean;\n forcedHarmonyVersion?: string;\n allowScripts?: Record<string, boolean | 'warn'>;\n dangerouslyAllowAllScripts?: boolean;\n neverBuiltDependencies?: string[];\n autoInstallPeers?: boolean;\n publicHoistPattern?: string[];\n hoistPattern?: string[];\n lockfileOnly?: boolean;\n nodeVersion?: string;\n enableModulesDir?: boolean;\n engineStrict?: boolean;\n excludeLinksFromLockfile?: boolean;\n minimumReleaseAge?: number;\n minimumReleaseAgeExclude?: string[];\n ignorePackageManifest?: boolean;\n hoistWorkspacePackages?: boolean;\n returnListOfDepsRequiringBuild?: boolean;\n packageImportMethod?: 'auto' | 'hardlink' | 'copy' | 'clone';\n enableGlobalVirtualStore?: boolean;\n globalVirtualStoreDir?: string;\n patchedDependencies?: Record<string, string>;\n packageExtensions?: Record<string, PackageExtension>;\n pnpmHomeDir?: string;\n preferOffline?: boolean;\n // Accepted for backward-compatibility with the previous pnpm engine, but the\n // Rust engine manages the side-effects cache internally.\n sideEffectsCacheRead?: boolean;\n sideEffectsCacheWrite?: boolean;\n },\n logger?: Logger\n): Promise<{ dependenciesChanged: boolean; rebuild: RebuildFn; storeDir: string; depsRequiringBuild?: DepPath[] }> {\n const externalDependencies = new Set<string>();\n const hooks = createReadPackageHooks(options);\n if (options?.rootComponents && !options?.rootComponentsForCapsules) {\n for (const [dir, { name }] of Object.entries(manifestsByPaths)) {\n if (dir !== rootDir && name) {\n externalDependencies.add(name);\n }\n }\n }\n const overrides = {\n ...options.overrides,\n };\n if (options.forcedHarmonyVersion) {\n // Harmony needs to be a singleton, so if a specific version was requested for the workspace,\n // we force that version accross the whole dependency graph.\n overrides['@teambit/harmony'] = options.forcedHarmonyVersion;\n }\n if (!manifestsByPaths[rootDir].dependenciesMeta) {\n manifestsByPaths = {\n ...manifestsByPaths,\n [rootDir]: {\n ...manifestsByPaths[rootDir],\n dependenciesMeta: {},\n },\n };\n }\n const hoistPattern = options.hoistPattern ?? ['*'];\n if (hoistPattern.length > 0 && externalDependencies.size > 0 && !options.hoistInjectedDependencies) {\n for (const pkgName of externalDependencies) {\n hoistPattern.push(`!${pkgName}`);\n }\n }\n const scriptPolicies = resolveScriptPolicies({\n allowScripts: options.allowScripts,\n dangerouslyAllowAllScripts: options.dangerouslyAllowAllScripts,\n neverBuiltDependencies: options.neverBuiltDependencies,\n });\n\n // The in-memory importer manifests are transformed up front (with each\n // importer's own directory as workspaceDir). The dependency manifests are\n // transformed lazily by the engine through the readPackageHook (which has no\n // workspaceDir).\n const projects: nodeApi.NodeApiProject[] = Object.entries(manifestsByPaths).map(([dir, manifest]) => ({\n rootDir: dir,\n manifest: applyReadPackageHooks(\n hooks,\n manifest as unknown as PackageManifest,\n dir\n ) as unknown as nodeApi.PackageManifest,\n }));\n // When the engine resolves a workspace project as a dependency (an injected\n // \"file:\" instance), it hands the hook that project's importer manifest —\n // which the up-front transform above already stripped of workspace-sibling\n // deps. The instance must keep those deps (they become the component's graph\n // edges), so substitute the project's raw manifest, identified by the\n // lockfile-root-relative directory the engine passes for directory\n // resolutions. pnpm's TS engine reaches the same split by keeping raw\n // project manifests and applying the hook chain contextually.\n const readPackageHookForDeps = (manifest: nodeApi.PackageManifest, resolvedDir?: string): nodeApi.PackageManifest => {\n const rawManifest = resolvedDir ? manifestsByPaths[join(rootDir, resolvedDir)] : undefined;\n const resolvedManifest = applyReadPackageHooks(\n hooks,\n (rawManifest ?? manifest) as unknown as PackageManifest\n ) as unknown as nodeApi.PackageManifest;\n return removeScriptsFromNeverBuiltPackages(resolvedManifest, scriptPolicies.neverBuildPackageNames);\n };\n\n const installOptions: nodeApi.InstallOptions = {\n dir: rootDir,\n projects,\n storeDir,\n cacheDir,\n registries: registries.toMap(),\n authHeaderByUri: buildAuthHeaderByUri(registries),\n proxyConfig: toNodeApiProxyConfig(proxyConfig),\n networkConfig: toNodeApiNetworkConfig(networkConfig),\n overrides,\n nodeLinker: options.nodeLinker,\n // Resolve bare-semver deps on workspace components (incl. auto-installed\n // peers naming a sibling component) from the workspace instead of the\n // registry — otherwise an unpublished component peer 404s. `'deep'` so\n // transitive component deps link locally too.\n linkWorkspacePackages: 'deep',\n hoistPattern,\n publicHoistPattern: options.publicHoistPattern,\n externalDependencies: [...externalDependencies],\n allowBuilds: scriptPolicies.allowBuilds as Record<string, boolean>,\n dangerouslyAllowAllBuilds: scriptPolicies.dangerouslyAllowAllBuilds,\n // `neverBuiltDependencies` is already folded into `allowBuilds` above by\n // `resolveScriptPolicies`; the binding rejects a non-empty pass-through.\n autoInstallPeers: options.autoInstallPeers,\n excludeLinksFromLockfile: options.excludeLinksFromLockfile ?? true,\n lockfileOnly: options.lockfileOnly ?? false,\n packageImportMethod: options.packageImportMethod,\n preferOffline: options.preferOffline,\n virtualStoreDirMaxLength: VIRTUAL_STORE_DIR_MAX_LENGTH,\n // The hoisted linker copies packages straight into `node_modules` instead of symlinking them\n // out of a virtual store, so there is no virtual store for the global one to replace.\n enableGlobalVirtualStore: options.nodeLinker === 'hoisted' ? false : options.enableGlobalVirtualStore,\n globalVirtualStoreDir: options.globalVirtualStoreDir,\n patchedDependencies: options.patchedDependencies,\n packageExtensions: options.packageExtensions,\n peersSuffixMaxLength: 1000,\n dedupePeerDependents: true,\n dedupePeers: options.dedupePeers,\n dedupeDirectDeps: true,\n dedupeInjectedDeps: options.dedupeInjectedDeps,\n injectWorkspacePackages: true,\n includeOptionalDeps: options.includeOptionalDeps !== false,\n // `update` re-resolves the whole graph; the binding ignores `depth` (there\n // are no package selectors), but pass a finite full-depth value for parity\n // with the old engine's `depth: Infinity` update-all call.\n update: options.updateAll,\n depth: options.updateAll ? 1000 : undefined,\n nodeVersion: options.nodeVersion,\n engineStrict: options.engineStrict,\n // pnpm v12 defaults minimumReleaseAge to 1440 when the option is absent.\n // bit.cloud packuments are huge (a version per snap) and their abbreviated\n // form carries no `time` field, so the maturity cutoff forces a full-\n // packument upgrade fetch for every component on a cold resolve. Disable\n // the policy unless the workspace opts in.\n minimumReleaseAge: options.minimumReleaseAge ?? 0,\n minimumReleaseAgeExclude: options.minimumReleaseAgeExclude,\n // Bit lockfiles are trusted workspace input. Keep installs compatible with\n // lockfiles generated before pnpm v12 added registry resolution verification.\n trustLockfile: true,\n ignorePackageManifest: options.ignorePackageManifest,\n hoistWorkspacePackages: options.hoistWorkspacePackages,\n enableModulesDir: options.enableModulesDir,\n resolvePeersFromWorkspaceRoot: true,\n frozenLockfile: options.updateAll ? false : undefined,\n preferFrozenLockfile: !options.updateAll,\n // Suppress peer-dependency warnings by default (allow any version, ignore\n // missing), letting the workspace's own rules override.\n peerDependencyRules: {\n allowAny: ['*'],\n ignoreMissing: ['*'],\n ...options.reportOptions?.peerDependencyRules,\n } as nodeApi.PeerDependencyRules,\n // Bit reports the deps requiring a build in the lockfile instead of failing.\n strictDepBuilds: false,\n pnpmHomeDir: options.pnpmHomeDir,\n // Report every package with install scripts (not just blocked ones) in\n // `depsRequiringBuild`, so the `bit:` lockfile block lists them even\n // though Bit allows the builds to run.\n returnListOfDepsRequiringBuild: true,\n reporter: options.hidePackageManagerOutput\n ? undefined\n : toReporterOptions({ ...options.reportOptions, hideAddedPkgsProgress: options.lockfileOnly }),\n };\n\n let dependenciesChanged = false;\n let depsRequiringBuild: DepPath[] | undefined;\n let resolvedStoreDir = storeDir;\n if (!options.dryRun) {\n // Dependency build scripts inherit this process's PATH. Set up inside the\n // guard, so a dry run neither writes the wrapper nor touches the env.\n addNodeGypToPath(logger);\n let installPromise: Promise<nodeApi.InstallResult> | undefined;\n let restoreWantedLockfile: (() => Promise<void>) | undefined;\n const onOutput = options.hidePackageManagerOutput ? undefined : reporterOutput(options.reportOptions);\n try {\n await installsRunning[rootDir];\n // The engine rewrites pnpm-lock.yaml from its typed model, which\n // does not round-trip Bit's `bit:` extension block (the v11 TS\n // engine mutated the loaded object in place, so the block\n // survived). Capture it up front and re-assert it after the\n // install alongside `depsRequiringBuild`.\n const preInstallBitAttrs = await readBitLockfileAttrs(rootDir);\n restoreWantedLockfile = await removeWantedLockfileForUpdate(rootDir, options.updateAll);\n installPromise = nodeApi.install(installOptions, undefined, readPackageHookForDeps, onOutput);\n installsRunning[rootDir] = installPromise;\n const installResult: nodeApi.InstallResult = await installPromise;\n resolvedStoreDir = installResult.storeDir;\n const sortedDepsRequiringBuild = sortDepsRequiringBuild(installResult.depsRequiringBuild);\n const bitAttrs = mergeBitLockfileAttrs(preInstallBitAttrs, sortedDepsRequiringBuild);\n if (bitAttrs != null) {\n await addBitAttributesToLockfile(rootDir, bitAttrs);\n }\n depsRequiringBuild = sortedDepsRequiringBuild as unknown as DepPath[] | undefined;\n dependenciesChanged =\n installResult.stats.added + installResult.stats.removed + installResult.stats.linkedToRoot > 0;\n } catch (err: any) {\n await restoreWantedLockfile?.();\n if (logger) {\n logger.warn('got an error from the pnpm install function', err);\n }\n throw pnpmErrorToBitError(err);\n } finally {\n if (installPromise && installsRunning[rootDir] === installPromise) {\n delete installsRunning[rootDir];\n }\n }\n }\n return {\n dependenciesChanged,\n // The Rust engine's rebuild rebuilds every build-needing package and does not\n // support the pending / skipIfHasSideEffectsCache selectors of the old engine.\n rebuild: async () => {\n // Reached without an install of its own after a dry run.\n addNodeGypToPath(logger);\n // Same output routing as the install: the CLI server's stream has to\n // carry the rebuild's output too, not just the install's.\n const rebuildReportOptions: ReportOptions = {\n ...options.reportOptions,\n appendOnly: true,\n hideLifecycleOutput: true,\n };\n await nodeApi.rebuild(\n {\n ...installOptions,\n storeDir: resolvedStoreDir,\n reporter: options.hidePackageManagerOutput ? undefined : toReporterOptions(rebuildReportOptions),\n },\n undefined,\n undefined,\n options.hidePackageManagerOutput ? undefined : reporterOutput(rebuildReportOptions)\n );\n },\n storeDir: resolvedStoreDir ?? '',\n depsRequiringBuild,\n };\n}\n\nasync function removeWantedLockfileForUpdate(\n rootDir: string,\n updateAll?: boolean\n): Promise<(() => Promise<void>) | undefined> {\n if (!updateAll) return undefined;\n const lockfilePath = join(rootDir, 'pnpm-lock.yaml');\n let lockfileContent: Buffer;\n try {\n lockfileContent = await fs.readFile(lockfilePath);\n } catch (err: any) {\n if (err?.code === 'ENOENT') return undefined;\n throw err;\n }\n await fs.unlink(lockfilePath);\n return async () => {\n await fs.writeFile(lockfilePath, lockfileContent);\n };\n}\n\ntype ScriptPolicyConfig = {\n allowScripts?: Record<string, boolean | 'warn'>;\n dangerouslyAllowAllScripts?: boolean;\n neverBuiltDependencies?: string[];\n};\n\nexport function resolveScriptPolicies({\n allowScripts,\n dangerouslyAllowAllScripts,\n neverBuiltDependencies,\n}: ScriptPolicyConfig): {\n allowBuilds: Record<string, boolean | string>;\n dangerouslyAllowAllBuilds?: boolean;\n neverBuildPackageNames?: string[];\n} {\n const allowBuilds: Record<string, boolean | string> = {};\n if (dangerouslyAllowAllScripts) {\n if (!neverBuiltDependencies?.length) {\n return { allowBuilds, dangerouslyAllowAllBuilds: true };\n }\n for (const pkg of neverBuiltDependencies) {\n allowBuilds[pkg] = false;\n }\n return { allowBuilds, neverBuildPackageNames: neverBuiltDependencies };\n }\n for (const [packageDescriptor, allowedScript] of Object.entries(allowScripts ?? {})) {\n if (allowedScript === true || allowedScript === false) {\n allowBuilds[packageDescriptor] = allowedScript;\n }\n // String values (e.g. 'warn') are placeholders — ignore them; pnpm warns about these.\n }\n for (const trustedPkgName of TRUSTED_PACKAGE_NAMES) {\n if (allowScripts?.[trustedPkgName] == null) {\n allowBuilds[trustedPkgName] = true;\n }\n }\n for (const untrustedPkgName of UNTRUSTED_PACKAGE_NAMES) {\n if (allowScripts?.[untrustedPkgName] !== true) {\n allowBuilds[untrustedPkgName] = false;\n }\n }\n for (const pkg of neverBuiltDependencies ?? []) {\n allowBuilds[pkg] = false;\n }\n return { allowBuilds };\n}\n\nfunction removeScriptsFromNeverBuiltPackages(\n manifest: nodeApi.PackageManifest,\n neverBuildPackageNames?: string[]\n): nodeApi.PackageManifest {\n if (!manifest.name || !manifest.scripts || !neverBuildPackageNames?.includes(manifest.name)) return manifest;\n return {\n ...manifest,\n scripts: undefined,\n };\n}\n\nconst APPROVE_BUILDS_INSTRUCTION_TEXT =\n 'Update the \"allowScripts\" field under \"teambit.dependencies/dependency-resolver\" in workspace.jsonc. \\nSet to true to allow, false to explicitly disallow. \\nExample: allowScripts: { \"esbuild\": true, \"core-js\": false }. \\nThis is a security-sensitive setting: enabling scripts may allow arbitrary code execution during install.';\n\n/**\n * How the engine should render pnpm's output. Every field maps onto the\n * pnpm reporting option of the same name.\n */\nfunction toReporterOptions(opts?: ReportOptions): nodeApi.ReporterOptions {\n const stream = reporterOutputStream(opts);\n return {\n appendOnly: opts?.appendOnly ?? false,\n throttleProgress: opts?.throttleProgress ?? 200,\n hideAddedPkgsProgress: opts?.hideAddedPkgsProgress,\n hideProgressPrefix: opts?.hideProgressPrefix,\n hideLifecycleOutput: opts?.hideLifecycleOutput,\n ignoredBuildsInstructionText: APPROVE_BUILDS_INSTRUCTION_TEXT,\n // Core aspects Bit links in are excluded from the summary to reduce\n // noise. Other @teambit/ dependencies still show; only the ones\n // symlinked from outside the workspace are hidden.\n hideLinkedPkgsDiff: ['@teambit/*'],\n // pnpm's `outputMaxWidth`, floored: a terminal reporting one or two\n // columns would otherwise ask the engine to wrap at zero.\n width: stream.columns ? Math.max(stream.columns - 2, 1) : 80,\n // chalk is the switch Bit already flips for its own output (the CLI\n // server enables it per request and resets it afterwards), so the\n // engine follows it rather than probing the terminal itself.\n color: chalk.level > 0,\n };\n}\n\n/**\n * Where the engine's rendered output goes. It has to be written through\n * the JS stream rather than by the engine itself: Bit monkey-patches\n * `process.stdout.write` to mirror output to a tty, and the CLI server\n * swaps in a stream that forwards to connected editors — a write from Rust\n * would bypass both.\n */\nfunction reporterOutput(opts?: ReportOptions): (chunk: string) => void {\n const stream = reporterOutputStream(opts);\n return (chunk) => {\n stream.write(chunk);\n };\n}\n\nfunction reporterOutputStream(opts?: ReportOptions): OutputStream {\n return opts?.outputStream ?? process.stdout;\n}\n\n/**\n * This function returns the list of hooks that are passed to pnpm\n * for transforming the manifests of dependencies during installation.\n */\nexport function createReadPackageHooks(options: {\n rootComponents?: boolean;\n rootComponentsForCapsules?: boolean;\n forcedHarmonyVersion?: string;\n}): ReadPackageHook[] {\n const readPackage: ReadPackageHook[] = [];\n if (options?.rootComponents && !options?.rootComponentsForCapsules) {\n readPackage.push(readPackageHook as ReadPackageHook);\n }\n readPackage.push(removeLegacyFromDeps as ReadPackageHook);\n if (!options.forcedHarmonyVersion) {\n // If the workspace did not specify a harmony version in a root policy,\n // then we remove harmony from any dependencies, so that the one linked from bvm is used.\n readPackage.push(removeHarmonyFromDeps as ReadPackageHook);\n }\n if (options?.rootComponentsForCapsules) {\n readPackage.push(readPackageHookForCapsules as ReadPackageHook);\n }\n return readPackage;\n}\n\n/**\n * This hook is used when installation is executed inside a capsule.\n * The components in the capsules should get their peer dependencies installed,\n * so this hook converts any peer dependencies into runtime dependencies.\n */\nfunction readPackageHookForCapsules(pkg: PackageManifest, workspaceDir?: string): PackageManifest {\n // workspaceDir is set only for workspace packages\n if (workspaceDir) {\n return {\n ...pkg,\n dependencies: {\n ...pkg.peerDependencies,\n ...pkg.dependencies,\n },\n };\n }\n return pkg;\n}\n\n/**\n * @teambit/legacy should never be installed as a dependency.\n * It is linked from bvm.\n */\nfunction removeLegacyFromDeps(pkg: PackageManifest): PackageManifest {\n if (pkg.dependencies != null) {\n if (pkg.dependencies['@teambit/legacy'] && !pkg.dependencies['@teambit/legacy'].startsWith('link:')) {\n delete pkg.dependencies['@teambit/legacy'];\n }\n }\n if (pkg.peerDependencies != null) {\n if (pkg.peerDependencies['@teambit/legacy']) {\n delete pkg.peerDependencies['@teambit/legacy'];\n }\n }\n return pkg;\n}\n\nfunction removeHarmonyFromDeps(pkg: PackageManifest): PackageManifest {\n if (pkg.dependencies != null) {\n if (pkg.dependencies['@teambit/harmony'] && !pkg.dependencies['@teambit/harmony'].startsWith('link:')) {\n delete pkg.dependencies['@teambit/harmony'];\n }\n }\n if (pkg.peerDependencies != null) {\n if (pkg.peerDependencies['@teambit/harmony']) {\n delete pkg.peerDependencies['@teambit/harmony'];\n }\n }\n return pkg;\n}\n\n/**\n * This hook is used when installation happens in a Bit workspace.\n * We need a different hook for this case because unlike in a capsule, in a workspace,\n * the package manager only links workspace components to subdependencies.\n * For direct dependencies, Bit's linking is used.\n */\nfunction readPackageHook(pkg: PackageManifest, workspaceDir?: string): PackageManifest {\n // workspaceDir is set only for workspace packages\n if (workspaceDir && !workspaceDir.includes(BIT_ROOTS_DIR)) {\n return readWorkspacePackageHook(pkg);\n }\n return pkg;\n}\n\n/**\n * This hook is used when installation happens in a Bit workspace.\n * It is applied on workspace projects, and it removes any references to other workspace projects.\n * This is needed because Bit has its own linking for workspace projects.\n * pnpm should not override the links created by Bit.\n * Otherwise, the IDE would reference workspace projects from inside `node_modules/.pnpm`.\n */\nfunction readWorkspacePackageHook(pkg: PackageManifest): PackageManifest {\n const newDeps = {};\n for (const [name, version] of Object.entries(pkg.dependencies ?? {})) {\n if (!version.startsWith('workspace:')) {\n newDeps[name] = version;\n }\n }\n return {\n ...pkg,\n dependencies: {\n ...pkg.peerDependencies,\n ...newDeps,\n },\n };\n}\n\nexport async function resolveRemoteVersion(\n packageName: string,\n {\n rootDir,\n cacheDir,\n fullMetadata,\n registries,\n proxyConfig,\n networkConfig,\n }: {\n rootDir: string;\n cacheDir: string;\n fullMetadata?: boolean;\n registries: Registries;\n proxyConfig?: PackageManagerProxyConfig;\n networkConfig?: PackageManagerNetworkConfig;\n }\n): Promise<ResolvedPackageVersion> {\n const { resolve } = await generateResolverAndFetcher({\n cacheDir,\n fullMetadata,\n networkConfig,\n proxyConfig,\n registries,\n });\n const resolveOpts = {\n lockfileDir: rootDir,\n preferredVersions: {},\n projectDir: rootDir,\n registry: '',\n };\n try {\n const parsedPackage = parsePackageName(packageName);\n const wantedDep: nodeApi.WantedDependency = {\n alias: parsedPackage.name,\n // parse-package-name returns an empty string when no version is present,\n // but the engine resolves only undefined (or an explicit range) as \"latest\".\n bareSpecifier: parsedPackage.version || undefined,\n };\n const val = await resolve(wantedDep, resolveOpts);\n if (!val.manifest) {\n throw new BitError('The resolved package has no manifest');\n }\n const manifest = val.manifest as unknown as DependencyManifest;\n const wantedRange =\n parsedPackage.version && semver.validRange(parsedPackage.version) ? parsedPackage.version : undefined;\n\n return {\n packageName: manifest.name,\n version: manifest.version,\n wantedRange,\n isSemver: true,\n resolvedVia: val.resolvedVia,\n manifest,\n };\n } catch (e: any) {\n if (!e.message?.includes('is not a valid string')) {\n throw pnpmErrorToBitError(e);\n }\n // The provided package is probably a git url or path to a folder\n const wantedDep: nodeApi.WantedDependency = {\n alias: undefined,\n bareSpecifier: packageName,\n };\n const val = await resolve(wantedDep, resolveOpts);\n if (!val.manifest) {\n throw new BitError('The resolved package has no manifest');\n }\n if (!val.normalizedBareSpecifier) {\n throw new BitError('The resolved package has no version');\n }\n const manifest = val.manifest as unknown as DependencyManifest;\n return {\n packageName: manifest.name,\n version: val.normalizedBareSpecifier,\n isSemver: false,\n resolvedVia: val.resolvedVia,\n manifest,\n };\n }\n}\n\n/**\n * Sort the engine's `depsRequiringBuild` for a stable lockfile block, or\n * return undefined when the install did not compute the list at all —\n * it was served from the frozen-lockfile path, or the engine predates\n * `returnListOfDepsRequiringBuild`. Undefined is not an empty list: the\n * install has no answer, so the recorded one has to stand.\n */\nexport function sortDepsRequiringBuild(depsRequiringBuild: string[] | undefined): string[] | undefined {\n return depsRequiringBuild == null ? undefined : [...depsRequiringBuild].sort();\n}\n\n/**\n * The `bit:` attributes to re-assert after an install, or undefined when\n * there is nothing to write. See {@link sortDepsRequiringBuild} for why\n * an uncomputed list leaves the recorded one untouched.\n */\nexport function mergeBitLockfileAttrs(\n preInstallAttrs: Partial<BitLockfileAttributes> | undefined,\n sortedDepsRequiringBuild: string[] | undefined\n): Partial<BitLockfileAttributes> | undefined {\n if (sortedDepsRequiringBuild == null) return preInstallAttrs;\n return { ...preInstallAttrs, depsRequiringBuild: sortedDepsRequiringBuild };\n}\n\n/**\n * Read the `bit:` extension block of the workspace's wanted lockfile,\n * or undefined when there is no lockfile or no block.\n */\nasync function readBitLockfileAttrs(rootDir: string): Promise<Partial<BitLockfileAttributes> | undefined> {\n try {\n const lockfile = await nodeApi.readLockfile<BitLockfileFile>({ dir: rootDir });\n return lockfile?.bit;\n } catch {\n // A malformed lockfile fails the install itself later with a proper\n // error; there is nothing to preserve here.\n return undefined;\n }\n}\n\n/**\n * Re-assert Bit's `bit:` extension block on the wanted lockfile after\n * an engine install rewrote it. Merges over whatever the file has, so\n * an attribute captured before the install (e.g. `restoredFromModel`)\n * survives the rewrite.\n */\nasync function addBitAttributesToLockfile(rootDir: string, attrs: Partial<BitLockfileAttributes>) {\n const lockfile = await nodeApi.readLockfile<BitLockfileFile>({ dir: rootDir });\n if (lockfile == null) return;\n const merged = { ...lockfile.bit, ...attrs };\n if (isEqual(lockfile.bit, merged)) return;\n lockfile.bit = merged as BitLockfileAttributes;\n await nodeApi.writeLockfile({ dir: rootDir, lockfile });\n}\n\n/**\n * A `pnpm-lock.yaml` as the engine reads and writes it, plus the `bit:`\n * block Bit records beside pnpm's own keys. The engine preserves top-level\n * keys it does not define, so reading, editing that block, and writing the\n * file back leaves everything else untouched.\n */\nexport interface BitLockfileFile extends LockfileFile {\n bit?: BitLockfileAttributes;\n}\n\nexport interface BitLockfileAttributes {\n depsRequiringBuild: string[];\n restoredFromModel?: boolean;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,IAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,GAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,kBAAA;EAAA,MAAAN,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAK,iBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAA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AQ,GAAG,MAAMlS,OAAO,CAAD,CAAC,CAACmS,YAAY,CAAkB;IAAEzL,GAAG,EAAEY;EAAQ,CAAC,CAAC;EAC9E,IAAI4K,QAAQ,IAAI,IAAI,EAAE;EACtB,MAAMI,MAAM,GAAAlQ,aAAA,CAAAA,aAAA,KAAQ8P,QAAQ,CAACE,GAAG,GAAKC,KAAK,CAAE;EAC5C,IAAI,IAAAE,iBAAO,EAACL,QAAQ,CAACE,GAAG,EAAEE,MAAM,CAAC,EAAE;EACnCJ,QAAQ,CAACE,GAAG,GAAGE,MAA+B;EAC9C,MAAMtS,OAAO,CAAD,CAAC,CAACwS,aAAa,CAAC;IAAE9L,GAAG,EAAEY,OAAO;IAAE4K;EAAS,CAAC,CAAC;AACzD;;AAEA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_path","data","require","_fs","_chalk","_interopRequireDefault","_semver","_parsePackageName","_pluginTrustedDeps","nodeApi","_interopRequireWildcard","_nerfDart","_bitError","_legacy","_dependenciesPnpm","_lodash","_pnpmErrorToBitError","_readConfig","_buildScriptsPath","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","UNTRUSTED_PACKAGE_NAMES","installsRunning","toNodeApiProxyConfig","proxyConfig","httpProxy","httpsProxy","noProxy","toNodeApiNetworkConfig","networkConfig","ca","cert","key","localAddress","strictSsl","strictSSL","maxSockets","networkConcurrency","fetchRetries","fetchRetryFactor","fetchRetryMintimeout","fetchRetryMaxtimeout","fetchTimeout","userAgent","buildAuthHeaderByUri","registries","result","registry","values","scopes","uri","authHeaderValue","toNerfDart","defaultRegistry","applyReadPackageHooks","hooks","manifest","workspaceDir","reduce","m","hook","generateResolverAndFetcher","cacheDir","fullMetadata","pnpmConfig","readConfig","authHeaderByUri","config","registriesMap","toMap","resolve","wantedDep","resolveOpts","resolveDependency","dir","projectDir","lockfileDir","process","cwd","undefined","getPeerDependencyIssues","manifestsByPaths","opts","projects","entries","map","rootDir","storeDir","overrides","peersSuffixMaxLength","virtualStoreDirMaxLength","VIRTUAL_STORE_DIR_MAX_LENGTH","err","pnpmErrorToBitError","install","options","logger","externalDependencies","Set","createReadPackageHooks","rootComponents","rootComponentsForCapsules","name","add","forcedHarmonyVersion","dependenciesMeta","hoistPattern","size","hoistInjectedDependencies","pkgName","scriptPolicies","resolveScriptPolicies","allowScripts","dangerouslyAllowAllScripts","neverBuiltDependencies","readPackageHookForDeps","resolvedDir","rawManifest","join","resolvedManifest","removeScriptsFromNeverBuiltPackages","neverBuildPackageNames","installOptions","nodeLinker","linkWorkspacePackages","publicHoistPattern","allowBuilds","dangerouslyAllowAllBuilds","autoInstallPeers","excludeLinksFromLockfile","lockfileOnly","packageImportMethod","preferOffline","enableGlobalVirtualStore","globalVirtualStoreDir","patchedDependencies","packageExtensions","dedupePeerDependents","dedupePeers","dedupeDirectDeps","dedupeInjectedDeps","injectWorkspacePackages","includeOptionalDeps","update","updateAll","depth","nodeVersion","engineStrict","minimumReleaseAge","minimumReleaseAgeExclude","trustLockfile","ignorePackageManifest","hoistWorkspacePackages","enableModulesDir","resolvePeersFromWorkspaceRoot","frozenLockfile","preferFrozenLockfile","peerDependencyRules","allowAny","ignoreMissing","reportOptions","strictDepBuilds","pnpmHomeDir","returnListOfDepsRequiringBuild","reporter","hidePackageManagerOutput","toReporterOptions","hideAddedPkgsProgress","dependenciesChanged","depsRequiringBuild","resolvedStoreDir","dryRun","prepareBuildScriptsPath","installPromise","restoreWantedLockfile","onOutput","reporterOutput","preInstallBitAttrs","readBitLockfileAttrs","removeWantedLockfileForUpdate","installResult","sortedDepsRequiringBuild","sortDepsRequiringBuild","bitAttrs","mergeBitLockfileAttrs","addBitAttributesToLockfile","stats","added","removed","linkedToRoot","warn","rebuild","rebuildReportOptions","appendOnly","hideLifecycleOutput","lockfilePath","lockfileContent","fs","readFile","code","unlink","writeFile","pkg","packageDescriptor","allowedScript","trustedPkgName","TRUSTED_PACKAGE_NAMES","untrustedPkgName","scripts","includes","APPROVE_BUILDS_INSTRUCTION_TEXT","stream","reporterOutputStream","throttleProgress","hideProgressPrefix","ignoredBuildsInstructionText","hideLinkedPkgsDiff","width","columns","Math","max","color","chalk","level","chunk","write","outputStream","stdout","readPackage","readPackageHook","removeLegacyFromDeps","removeHarmonyFromDeps","readPackageHookForCapsules","dependencies","peerDependencies","startsWith","BIT_ROOTS_DIR","readWorkspacePackageHook","newDeps","version","resolveRemoteVersion","packageName","preferredVersions","parsedPackage","parsePackageName","alias","bareSpecifier","val","BitError","wantedRange","semver","validRange","isSemver","resolvedVia","message","normalizedBareSpecifier","sort","preInstallAttrs","lockfile","readLockfile","bit","attrs","merged","isEqual","writeLockfile"],"sources":["lynx.ts"],"sourcesContent":["import { join } from 'path';\nimport { promises as fs } from 'fs';\nimport chalk from 'chalk';\nimport semver from 'semver';\nimport parsePackageName from 'parse-package-name';\nimport { TRUSTED_PACKAGE_NAMES } from '@pnpm/plugin-trusted-deps';\nimport type {\n PackageManifest,\n ProjectManifest,\n ReadPackageHook,\n PeerDependencyRules,\n DependencyManifest,\n DepPath,\n} from '@pnpm/types';\nimport * as nodeApi from '@pnpm/napi';\nimport type { PeerDependencyIssuesByProjects } from '@pnpm/napi';\nimport { type LockfileFile } from '@pnpm/lockfile.types';\nimport type { Registries } from '@teambit/pkg.entities.registry';\nimport toNerfDart from 'nerf-dart';\nimport type {\n ResolvedPackageVersion,\n PackageManagerProxyConfig,\n PackageManagerNetworkConfig,\n PackageExtension,\n} from '@teambit/dependency-resolver';\nimport { BitError } from '@teambit/bit-error';\nimport { BIT_ROOTS_DIR } from '@teambit/legacy.constants';\nimport type { Logger } from '@teambit/logger';\nimport { VIRTUAL_STORE_DIR_MAX_LENGTH } from '@teambit/dependencies.pnpm.dep-path';\nimport { isEqual } from 'lodash';\nimport { pnpmErrorToBitError } from './pnpm-error-to-bit-error';\nimport { readConfig } from './read-config';\nimport { prepareBuildScriptsPath } from './build-scripts-path';\n\n/**\n * Packages that are known to have risky or unnecessary build scripts.\n * These packages will be disallowed from running scripts by default,\n * unless the user explicitly allows them in `allowScripts`.\n */\nconst UNTRUSTED_PACKAGE_NAMES = ['es5-ext', 'less', 'protobufjs', 'ssh', 'core-js-pure', 'core-js'];\n\nconst installsRunning: Record<string, Promise<any>> = {};\n\n/**\n * Minimal structural signature of the `resolve` function returned by\n * `generateResolverAndFetcher`. It mirrors what the old\n * `@pnpm/installing.client` `ResolveFunction` exposed, but is backed by\n * `@pnpm/napi`'s `resolveDependency`.\n */\ntype ResolveOpts = {\n lockfileDir?: string;\n projectDir?: string;\n preferredVersions?: Record<string, unknown>;\n registry?: string;\n};\ntype ResolveFunction = (\n wantedDependency: nodeApi.WantedDependency,\n opts: ResolveOpts\n) => Promise<nodeApi.ResolveResult>;\n\nfunction toNodeApiProxyConfig(proxyConfig: PackageManagerProxyConfig): nodeApi.ProxyConfig {\n return {\n httpProxy: proxyConfig.httpProxy,\n httpsProxy: proxyConfig.httpsProxy,\n noProxy: proxyConfig.noProxy,\n };\n}\n\nfunction toNodeApiNetworkConfig(networkConfig: PackageManagerNetworkConfig): nodeApi.NetworkConfig {\n return {\n ca: networkConfig.ca,\n cert: networkConfig.cert,\n key: networkConfig.key,\n localAddress: networkConfig.localAddress,\n strictSsl: networkConfig.strictSSL,\n maxSockets: networkConfig.maxSockets,\n networkConcurrency: networkConfig.networkConcurrency,\n fetchRetries: networkConfig.fetchRetries,\n fetchRetryFactor: networkConfig.fetchRetryFactor,\n fetchRetryMintimeout: networkConfig.fetchRetryMintimeout,\n fetchRetryMaxtimeout: networkConfig.fetchRetryMaxtimeout,\n fetchTimeout: networkConfig.fetchTimeout,\n userAgent: networkConfig.userAgent,\n };\n}\n\n/**\n * Pre-computed `Authorization` headers keyed by nerf-darted registry URI\n * (plus `''` for the default registry) — the shape `@pnpm/napi` applies\n * directly. Bit's registries model already carries ready-to-send header\n * values (from the engine's `readConfig` plus Bit's own cloud token), so no\n * npmrc-style credential round-trip is needed.\n */\nfunction buildAuthHeaderByUri(registries: Registries): Record<string, string> {\n const result: Record<string, string> = {};\n for (const registry of Object.values(registries.scopes)) {\n if (registry.uri && registry.authHeaderValue) {\n result[toNerfDart(registry.uri)] = registry.authHeaderValue;\n }\n }\n const { defaultRegistry } = registries;\n if (defaultRegistry?.authHeaderValue) {\n if (defaultRegistry.uri) {\n result[toNerfDart(defaultRegistry.uri)] = defaultRegistry.authHeaderValue;\n }\n result[''] = defaultRegistry.authHeaderValue;\n }\n return result;\n}\n\n/**\n * Compose the list of read-package hooks into a single synchronous transform.\n * The Bit hooks are all synchronous, so the accumulator stays synchronous even\n * though the pnpm `ReadPackageHook` type allows returning a promise.\n */\nfunction applyReadPackageHooks(\n hooks: ReadPackageHook[],\n manifest: PackageManifest,\n workspaceDir?: string\n): PackageManifest {\n return hooks.reduce<PackageManifest>((m, hook) => hook(m, workspaceDir) as PackageManifest, manifest);\n}\n\nexport async function generateResolverAndFetcher({\n cacheDir,\n registries,\n proxyConfig,\n networkConfig,\n fullMetadata,\n}: {\n cacheDir: string;\n registries: Registries;\n proxyConfig?: PackageManagerProxyConfig;\n networkConfig?: PackageManagerNetworkConfig;\n fullMetadata?: boolean;\n}): Promise<{ resolve: ResolveFunction }> {\n const pnpmConfig = await readConfig();\n // The engine-resolved `.npmrc` headers first; Bit's own registries model\n // (which carries the cloud token) wins on conflict.\n const authHeaderByUri = { ...pnpmConfig.config.authHeaderByUri, ...buildAuthHeaderByUri(registries) };\n const registriesMap = registries.toMap();\n const resolve: ResolveFunction = (wantedDep, resolveOpts) =>\n nodeApi.resolveDependency(wantedDep, {\n dir: resolveOpts.projectDir || resolveOpts.lockfileDir || process.cwd(),\n cacheDir,\n registries: registriesMap,\n authHeaderByUri,\n proxyConfig: proxyConfig ? toNodeApiProxyConfig(proxyConfig) : undefined,\n networkConfig: networkConfig ? toNodeApiNetworkConfig(networkConfig) : undefined,\n fullMetadata,\n });\n return { resolve };\n}\n\nexport async function getPeerDependencyIssues(\n manifestsByPaths: Record<string, any>,\n opts: {\n storeDir?: string;\n cacheDir: string;\n registries: Registries;\n rootDir: string;\n proxyConfig: PackageManagerProxyConfig;\n networkConfig: PackageManagerNetworkConfig;\n overrides?: Record<string, string>;\n packageImportMethod?: 'auto' | 'hardlink' | 'copy' | 'clone';\n pnpmHomeDir?: string;\n }\n): Promise<PeerDependencyIssuesByProjects> {\n const projects: nodeApi.NodeApiProject[] = Object.entries(manifestsByPaths).map(([rootDir, manifest]) => ({\n rootDir,\n manifest: manifest as nodeApi.PackageManifest,\n }));\n try {\n return await nodeApi.getPeerDependencyIssues({\n dir: opts.rootDir,\n projects,\n storeDir: opts.storeDir,\n cacheDir: opts.cacheDir,\n overrides: opts.overrides,\n peersSuffixMaxLength: 1000,\n registries: opts.registries.toMap(),\n authHeaderByUri: buildAuthHeaderByUri(opts.registries),\n proxyConfig: toNodeApiProxyConfig(opts.proxyConfig),\n networkConfig: toNodeApiNetworkConfig(opts.networkConfig),\n virtualStoreDirMaxLength: VIRTUAL_STORE_DIR_MAX_LENGTH,\n });\n } catch (err: any) {\n throw pnpmErrorToBitError(err);\n }\n}\n\nexport type RebuildFn = (opts: { pending?: boolean; skipIfHasSideEffectsCache?: boolean }) => Promise<void>;\n\n/**\n * A stream the engine's rendered output can be written to. `columns` is\n * how the frame is sized; a stream that is not a terminal has none, and\n * the reporter falls back to pnpm's 80-column default.\n */\nexport type OutputStream = NodeJS.WritableStream & { columns?: number };\n\nexport interface ReportOptions {\n appendOnly?: boolean;\n throttleProgress?: number;\n hideAddedPkgsProgress?: boolean;\n hideProgressPrefix?: boolean;\n hideLifecycleOutput?: boolean;\n peerDependencyRules?: PeerDependencyRules;\n /** Defaults to `process.stdout`. */\n outputStream?: OutputStream;\n}\n\nexport async function install(\n rootDir: string,\n manifestsByPaths: Record<string, ProjectManifest>,\n storeDir: string | undefined,\n cacheDir: string,\n registries: Registries,\n proxyConfig: PackageManagerProxyConfig = {},\n networkConfig: PackageManagerNetworkConfig = {},\n options: {\n updateAll?: boolean;\n nodeLinker?: 'hoisted' | 'isolated';\n overrides?: Record<string, string>;\n rootComponents?: boolean;\n rootComponentsForCapsules?: boolean;\n includeOptionalDeps?: boolean;\n reportOptions?: ReportOptions;\n hidePackageManagerOutput?: boolean;\n hoistInjectedDependencies?: boolean;\n dryRun?: boolean;\n dedupePeers?: boolean;\n dedupeInjectedDeps?: boolean;\n forcedHarmonyVersion?: string;\n allowScripts?: Record<string, boolean | 'warn'>;\n dangerouslyAllowAllScripts?: boolean;\n neverBuiltDependencies?: string[];\n autoInstallPeers?: boolean;\n publicHoistPattern?: string[];\n hoistPattern?: string[];\n lockfileOnly?: boolean;\n nodeVersion?: string;\n enableModulesDir?: boolean;\n engineStrict?: boolean;\n excludeLinksFromLockfile?: boolean;\n minimumReleaseAge?: number;\n minimumReleaseAgeExclude?: string[];\n ignorePackageManifest?: boolean;\n hoistWorkspacePackages?: boolean;\n returnListOfDepsRequiringBuild?: boolean;\n packageImportMethod?: 'auto' | 'hardlink' | 'copy' | 'clone';\n enableGlobalVirtualStore?: boolean;\n globalVirtualStoreDir?: string;\n patchedDependencies?: Record<string, string>;\n packageExtensions?: Record<string, PackageExtension>;\n pnpmHomeDir?: string;\n preferOffline?: boolean;\n // Accepted for backward-compatibility with the previous pnpm engine, but the\n // Rust engine manages the side-effects cache internally.\n sideEffectsCacheRead?: boolean;\n sideEffectsCacheWrite?: boolean;\n },\n logger?: Logger\n): Promise<{ dependenciesChanged: boolean; rebuild: RebuildFn; storeDir: string; depsRequiringBuild?: DepPath[] }> {\n const externalDependencies = new Set<string>();\n const hooks = createReadPackageHooks(options);\n if (options?.rootComponents && !options?.rootComponentsForCapsules) {\n for (const [dir, { name }] of Object.entries(manifestsByPaths)) {\n if (dir !== rootDir && name) {\n externalDependencies.add(name);\n }\n }\n }\n const overrides = {\n ...options.overrides,\n };\n if (options.forcedHarmonyVersion) {\n // Harmony needs to be a singleton, so if a specific version was requested for the workspace,\n // we force that version accross the whole dependency graph.\n overrides['@teambit/harmony'] = options.forcedHarmonyVersion;\n }\n if (!manifestsByPaths[rootDir].dependenciesMeta) {\n manifestsByPaths = {\n ...manifestsByPaths,\n [rootDir]: {\n ...manifestsByPaths[rootDir],\n dependenciesMeta: {},\n },\n };\n }\n const hoistPattern = options.hoistPattern ?? ['*'];\n if (hoistPattern.length > 0 && externalDependencies.size > 0 && !options.hoistInjectedDependencies) {\n for (const pkgName of externalDependencies) {\n hoistPattern.push(`!${pkgName}`);\n }\n }\n const scriptPolicies = resolveScriptPolicies({\n allowScripts: options.allowScripts,\n dangerouslyAllowAllScripts: options.dangerouslyAllowAllScripts,\n neverBuiltDependencies: options.neverBuiltDependencies,\n });\n\n // The in-memory importer manifests are transformed up front (with each\n // importer's own directory as workspaceDir). The dependency manifests are\n // transformed lazily by the engine through the readPackageHook (which has no\n // workspaceDir).\n const projects: nodeApi.NodeApiProject[] = Object.entries(manifestsByPaths).map(([dir, manifest]) => ({\n rootDir: dir,\n manifest: applyReadPackageHooks(\n hooks,\n manifest as unknown as PackageManifest,\n dir\n ) as unknown as nodeApi.PackageManifest,\n }));\n // When the engine resolves a workspace project as a dependency (an injected\n // \"file:\" instance), it hands the hook that project's importer manifest —\n // which the up-front transform above already stripped of workspace-sibling\n // deps. The instance must keep those deps (they become the component's graph\n // edges), so substitute the project's raw manifest, identified by the\n // lockfile-root-relative directory the engine passes for directory\n // resolutions. pnpm's TS engine reaches the same split by keeping raw\n // project manifests and applying the hook chain contextually.\n const readPackageHookForDeps = (manifest: nodeApi.PackageManifest, resolvedDir?: string): nodeApi.PackageManifest => {\n const rawManifest = resolvedDir ? manifestsByPaths[join(rootDir, resolvedDir)] : undefined;\n const resolvedManifest = applyReadPackageHooks(\n hooks,\n (rawManifest ?? manifest) as unknown as PackageManifest\n ) as unknown as nodeApi.PackageManifest;\n return removeScriptsFromNeverBuiltPackages(resolvedManifest, scriptPolicies.neverBuildPackageNames);\n };\n\n const installOptions: nodeApi.InstallOptions = {\n dir: rootDir,\n projects,\n storeDir,\n cacheDir,\n registries: registries.toMap(),\n authHeaderByUri: buildAuthHeaderByUri(registries),\n proxyConfig: toNodeApiProxyConfig(proxyConfig),\n networkConfig: toNodeApiNetworkConfig(networkConfig),\n overrides,\n nodeLinker: options.nodeLinker,\n // Resolve bare-semver deps on workspace components (incl. auto-installed\n // peers naming a sibling component) from the workspace instead of the\n // registry — otherwise an unpublished component peer 404s. `'deep'` so\n // transitive component deps link locally too.\n linkWorkspacePackages: 'deep',\n hoistPattern,\n publicHoistPattern: options.publicHoistPattern,\n externalDependencies: [...externalDependencies],\n allowBuilds: scriptPolicies.allowBuilds as Record<string, boolean>,\n dangerouslyAllowAllBuilds: scriptPolicies.dangerouslyAllowAllBuilds,\n // `neverBuiltDependencies` is already folded into `allowBuilds` above by\n // `resolveScriptPolicies`; the binding rejects a non-empty pass-through.\n autoInstallPeers: options.autoInstallPeers,\n excludeLinksFromLockfile: options.excludeLinksFromLockfile ?? true,\n lockfileOnly: options.lockfileOnly ?? false,\n packageImportMethod: options.packageImportMethod,\n preferOffline: options.preferOffline,\n virtualStoreDirMaxLength: VIRTUAL_STORE_DIR_MAX_LENGTH,\n // The hoisted linker copies packages straight into `node_modules` instead of symlinking them\n // out of a virtual store, so there is no virtual store for the global one to replace.\n enableGlobalVirtualStore: options.nodeLinker === 'hoisted' ? false : options.enableGlobalVirtualStore,\n globalVirtualStoreDir: options.globalVirtualStoreDir,\n patchedDependencies: options.patchedDependencies,\n packageExtensions: options.packageExtensions,\n peersSuffixMaxLength: 1000,\n dedupePeerDependents: true,\n dedupePeers: options.dedupePeers,\n dedupeDirectDeps: true,\n dedupeInjectedDeps: options.dedupeInjectedDeps,\n injectWorkspacePackages: true,\n includeOptionalDeps: options.includeOptionalDeps !== false,\n // `update` re-resolves the whole graph; the binding ignores `depth` (there\n // are no package selectors), but pass a finite full-depth value for parity\n // with the old engine's `depth: Infinity` update-all call.\n update: options.updateAll,\n depth: options.updateAll ? 1000 : undefined,\n nodeVersion: options.nodeVersion,\n engineStrict: options.engineStrict,\n // pnpm v12 defaults minimumReleaseAge to 1440 when the option is absent.\n // bit.cloud packuments are huge (a version per snap) and their abbreviated\n // form carries no `time` field, so the maturity cutoff forces a full-\n // packument upgrade fetch for every component on a cold resolve. Disable\n // the policy unless the workspace opts in.\n minimumReleaseAge: options.minimumReleaseAge ?? 0,\n minimumReleaseAgeExclude: options.minimumReleaseAgeExclude,\n // Bit lockfiles are trusted workspace input. Keep installs compatible with\n // lockfiles generated before pnpm v12 added registry resolution verification.\n trustLockfile: true,\n ignorePackageManifest: options.ignorePackageManifest,\n hoistWorkspacePackages: options.hoistWorkspacePackages,\n enableModulesDir: options.enableModulesDir,\n resolvePeersFromWorkspaceRoot: true,\n frozenLockfile: options.updateAll ? false : undefined,\n preferFrozenLockfile: !options.updateAll,\n // Suppress peer-dependency warnings by default (allow any version, ignore\n // missing), letting the workspace's own rules override.\n peerDependencyRules: {\n allowAny: ['*'],\n ignoreMissing: ['*'],\n ...options.reportOptions?.peerDependencyRules,\n } as nodeApi.PeerDependencyRules,\n // Bit reports the deps requiring a build in the lockfile instead of failing.\n strictDepBuilds: false,\n pnpmHomeDir: options.pnpmHomeDir,\n // Report every package with install scripts (not just blocked ones) in\n // `depsRequiringBuild`, so the `bit:` lockfile block lists them even\n // though Bit allows the builds to run.\n returnListOfDepsRequiringBuild: true,\n reporter: options.hidePackageManagerOutput\n ? undefined\n : toReporterOptions({ ...options.reportOptions, hideAddedPkgsProgress: options.lockfileOnly }),\n };\n\n let dependenciesChanged = false;\n let depsRequiringBuild: DepPath[] | undefined;\n let resolvedStoreDir = storeDir;\n if (!options.dryRun) {\n // Dependency build scripts inherit this process's PATH. Set up inside the\n // guard, so a dry run neither writes the wrapper nor touches the env.\n prepareBuildScriptsPath(logger);\n let installPromise: Promise<nodeApi.InstallResult> | undefined;\n let restoreWantedLockfile: (() => Promise<void>) | undefined;\n const onOutput = options.hidePackageManagerOutput ? undefined : reporterOutput(options.reportOptions);\n try {\n await installsRunning[rootDir];\n // The engine rewrites pnpm-lock.yaml from its typed model, which\n // does not round-trip Bit's `bit:` extension block (the v11 TS\n // engine mutated the loaded object in place, so the block\n // survived). Capture it up front and re-assert it after the\n // install alongside `depsRequiringBuild`.\n const preInstallBitAttrs = await readBitLockfileAttrs(rootDir);\n restoreWantedLockfile = await removeWantedLockfileForUpdate(rootDir, options.updateAll);\n installPromise = nodeApi.install(installOptions, undefined, readPackageHookForDeps, onOutput);\n installsRunning[rootDir] = installPromise;\n const installResult: nodeApi.InstallResult = await installPromise;\n resolvedStoreDir = installResult.storeDir;\n const sortedDepsRequiringBuild = sortDepsRequiringBuild(installResult.depsRequiringBuild);\n const bitAttrs = mergeBitLockfileAttrs(preInstallBitAttrs, sortedDepsRequiringBuild);\n if (bitAttrs != null) {\n await addBitAttributesToLockfile(rootDir, bitAttrs);\n }\n depsRequiringBuild = sortedDepsRequiringBuild as unknown as DepPath[] | undefined;\n dependenciesChanged =\n installResult.stats.added + installResult.stats.removed + installResult.stats.linkedToRoot > 0;\n } catch (err: any) {\n await restoreWantedLockfile?.();\n if (logger) {\n logger.warn('got an error from the pnpm install function', err);\n }\n throw pnpmErrorToBitError(err);\n } finally {\n if (installPromise && installsRunning[rootDir] === installPromise) {\n delete installsRunning[rootDir];\n }\n }\n }\n return {\n dependenciesChanged,\n // The Rust engine's rebuild rebuilds every build-needing package and does not\n // support the pending / skipIfHasSideEffectsCache selectors of the old engine.\n rebuild: async () => {\n // Reached without an install of its own after a dry run.\n prepareBuildScriptsPath(logger);\n // Same output routing as the install: the CLI server's stream has to\n // carry the rebuild's output too, not just the install's.\n const rebuildReportOptions: ReportOptions = {\n ...options.reportOptions,\n appendOnly: true,\n hideLifecycleOutput: true,\n };\n await nodeApi.rebuild(\n {\n ...installOptions,\n storeDir: resolvedStoreDir,\n reporter: options.hidePackageManagerOutput ? undefined : toReporterOptions(rebuildReportOptions),\n },\n undefined,\n undefined,\n options.hidePackageManagerOutput ? undefined : reporterOutput(rebuildReportOptions)\n );\n },\n storeDir: resolvedStoreDir ?? '',\n depsRequiringBuild,\n };\n}\n\nasync function removeWantedLockfileForUpdate(\n rootDir: string,\n updateAll?: boolean\n): Promise<(() => Promise<void>) | undefined> {\n if (!updateAll) return undefined;\n const lockfilePath = join(rootDir, 'pnpm-lock.yaml');\n let lockfileContent: Buffer;\n try {\n lockfileContent = await fs.readFile(lockfilePath);\n } catch (err: any) {\n if (err?.code === 'ENOENT') return undefined;\n throw err;\n }\n await fs.unlink(lockfilePath);\n return async () => {\n await fs.writeFile(lockfilePath, lockfileContent);\n };\n}\n\ntype ScriptPolicyConfig = {\n allowScripts?: Record<string, boolean | 'warn'>;\n dangerouslyAllowAllScripts?: boolean;\n neverBuiltDependencies?: string[];\n};\n\nexport function resolveScriptPolicies({\n allowScripts,\n dangerouslyAllowAllScripts,\n neverBuiltDependencies,\n}: ScriptPolicyConfig): {\n allowBuilds: Record<string, boolean | string>;\n dangerouslyAllowAllBuilds?: boolean;\n neverBuildPackageNames?: string[];\n} {\n const allowBuilds: Record<string, boolean | string> = {};\n if (dangerouslyAllowAllScripts) {\n if (!neverBuiltDependencies?.length) {\n return { allowBuilds, dangerouslyAllowAllBuilds: true };\n }\n for (const pkg of neverBuiltDependencies) {\n allowBuilds[pkg] = false;\n }\n return { allowBuilds, neverBuildPackageNames: neverBuiltDependencies };\n }\n for (const [packageDescriptor, allowedScript] of Object.entries(allowScripts ?? {})) {\n if (allowedScript === true || allowedScript === false) {\n allowBuilds[packageDescriptor] = allowedScript;\n }\n // String values (e.g. 'warn') are placeholders — ignore them; pnpm warns about these.\n }\n for (const trustedPkgName of TRUSTED_PACKAGE_NAMES) {\n if (allowScripts?.[trustedPkgName] == null) {\n allowBuilds[trustedPkgName] = true;\n }\n }\n for (const untrustedPkgName of UNTRUSTED_PACKAGE_NAMES) {\n if (allowScripts?.[untrustedPkgName] !== true) {\n allowBuilds[untrustedPkgName] = false;\n }\n }\n for (const pkg of neverBuiltDependencies ?? []) {\n allowBuilds[pkg] = false;\n }\n return { allowBuilds };\n}\n\nfunction removeScriptsFromNeverBuiltPackages(\n manifest: nodeApi.PackageManifest,\n neverBuildPackageNames?: string[]\n): nodeApi.PackageManifest {\n if (!manifest.name || !manifest.scripts || !neverBuildPackageNames?.includes(manifest.name)) return manifest;\n return {\n ...manifest,\n scripts: undefined,\n };\n}\n\nconst APPROVE_BUILDS_INSTRUCTION_TEXT =\n 'Update the \"allowScripts\" field under \"teambit.dependencies/dependency-resolver\" in workspace.jsonc. \\nSet to true to allow, false to explicitly disallow. \\nExample: allowScripts: { \"esbuild\": true, \"core-js\": false }. \\nThis is a security-sensitive setting: enabling scripts may allow arbitrary code execution during install.';\n\n/**\n * How the engine should render pnpm's output. Every field maps onto the\n * pnpm reporting option of the same name.\n */\nfunction toReporterOptions(opts?: ReportOptions): nodeApi.ReporterOptions {\n const stream = reporterOutputStream(opts);\n return {\n appendOnly: opts?.appendOnly ?? false,\n throttleProgress: opts?.throttleProgress ?? 200,\n hideAddedPkgsProgress: opts?.hideAddedPkgsProgress,\n hideProgressPrefix: opts?.hideProgressPrefix,\n hideLifecycleOutput: opts?.hideLifecycleOutput,\n ignoredBuildsInstructionText: APPROVE_BUILDS_INSTRUCTION_TEXT,\n // Core aspects Bit links in are excluded from the summary to reduce\n // noise. Other @teambit/ dependencies still show; only the ones\n // symlinked from outside the workspace are hidden.\n hideLinkedPkgsDiff: ['@teambit/*'],\n // pnpm's `outputMaxWidth`, floored: a terminal reporting one or two\n // columns would otherwise ask the engine to wrap at zero.\n width: stream.columns ? Math.max(stream.columns - 2, 1) : 80,\n // chalk is the switch Bit already flips for its own output (the CLI\n // server enables it per request and resets it afterwards), so the\n // engine follows it rather than probing the terminal itself.\n color: chalk.level > 0,\n };\n}\n\n/**\n * Where the engine's rendered output goes. It has to be written through\n * the JS stream rather than by the engine itself: Bit monkey-patches\n * `process.stdout.write` to mirror output to a tty, and the CLI server\n * swaps in a stream that forwards to connected editors — a write from Rust\n * would bypass both.\n */\nfunction reporterOutput(opts?: ReportOptions): (chunk: string) => void {\n const stream = reporterOutputStream(opts);\n return (chunk) => {\n stream.write(chunk);\n };\n}\n\nfunction reporterOutputStream(opts?: ReportOptions): OutputStream {\n return opts?.outputStream ?? process.stdout;\n}\n\n/**\n * This function returns the list of hooks that are passed to pnpm\n * for transforming the manifests of dependencies during installation.\n */\nexport function createReadPackageHooks(options: {\n rootComponents?: boolean;\n rootComponentsForCapsules?: boolean;\n forcedHarmonyVersion?: string;\n}): ReadPackageHook[] {\n const readPackage: ReadPackageHook[] = [];\n if (options?.rootComponents && !options?.rootComponentsForCapsules) {\n readPackage.push(readPackageHook as ReadPackageHook);\n }\n readPackage.push(removeLegacyFromDeps as ReadPackageHook);\n if (!options.forcedHarmonyVersion) {\n // If the workspace did not specify a harmony version in a root policy,\n // then we remove harmony from any dependencies, so that the one linked from bvm is used.\n readPackage.push(removeHarmonyFromDeps as ReadPackageHook);\n }\n if (options?.rootComponentsForCapsules) {\n readPackage.push(readPackageHookForCapsules as ReadPackageHook);\n }\n return readPackage;\n}\n\n/**\n * This hook is used when installation is executed inside a capsule.\n * The components in the capsules should get their peer dependencies installed,\n * so this hook converts any peer dependencies into runtime dependencies.\n */\nfunction readPackageHookForCapsules(pkg: PackageManifest, workspaceDir?: string): PackageManifest {\n // workspaceDir is set only for workspace packages\n if (workspaceDir) {\n return {\n ...pkg,\n dependencies: {\n ...pkg.peerDependencies,\n ...pkg.dependencies,\n },\n };\n }\n return pkg;\n}\n\n/**\n * @teambit/legacy should never be installed as a dependency.\n * It is linked from bvm.\n */\nfunction removeLegacyFromDeps(pkg: PackageManifest): PackageManifest {\n if (pkg.dependencies != null) {\n if (pkg.dependencies['@teambit/legacy'] && !pkg.dependencies['@teambit/legacy'].startsWith('link:')) {\n delete pkg.dependencies['@teambit/legacy'];\n }\n }\n if (pkg.peerDependencies != null) {\n if (pkg.peerDependencies['@teambit/legacy']) {\n delete pkg.peerDependencies['@teambit/legacy'];\n }\n }\n return pkg;\n}\n\nfunction removeHarmonyFromDeps(pkg: PackageManifest): PackageManifest {\n if (pkg.dependencies != null) {\n if (pkg.dependencies['@teambit/harmony'] && !pkg.dependencies['@teambit/harmony'].startsWith('link:')) {\n delete pkg.dependencies['@teambit/harmony'];\n }\n }\n if (pkg.peerDependencies != null) {\n if (pkg.peerDependencies['@teambit/harmony']) {\n delete pkg.peerDependencies['@teambit/harmony'];\n }\n }\n return pkg;\n}\n\n/**\n * This hook is used when installation happens in a Bit workspace.\n * We need a different hook for this case because unlike in a capsule, in a workspace,\n * the package manager only links workspace components to subdependencies.\n * For direct dependencies, Bit's linking is used.\n */\nfunction readPackageHook(pkg: PackageManifest, workspaceDir?: string): PackageManifest {\n // workspaceDir is set only for workspace packages\n if (workspaceDir && !workspaceDir.includes(BIT_ROOTS_DIR)) {\n return readWorkspacePackageHook(pkg);\n }\n return pkg;\n}\n\n/**\n * This hook is used when installation happens in a Bit workspace.\n * It is applied on workspace projects, and it removes any references to other workspace projects.\n * This is needed because Bit has its own linking for workspace projects.\n * pnpm should not override the links created by Bit.\n * Otherwise, the IDE would reference workspace projects from inside `node_modules/.pnpm`.\n */\nfunction readWorkspacePackageHook(pkg: PackageManifest): PackageManifest {\n const newDeps = {};\n for (const [name, version] of Object.entries(pkg.dependencies ?? {})) {\n if (!version.startsWith('workspace:')) {\n newDeps[name] = version;\n }\n }\n return {\n ...pkg,\n dependencies: {\n ...pkg.peerDependencies,\n ...newDeps,\n },\n };\n}\n\nexport async function resolveRemoteVersion(\n packageName: string,\n {\n rootDir,\n cacheDir,\n fullMetadata,\n registries,\n proxyConfig,\n networkConfig,\n }: {\n rootDir: string;\n cacheDir: string;\n fullMetadata?: boolean;\n registries: Registries;\n proxyConfig?: PackageManagerProxyConfig;\n networkConfig?: PackageManagerNetworkConfig;\n }\n): Promise<ResolvedPackageVersion> {\n const { resolve } = await generateResolverAndFetcher({\n cacheDir,\n fullMetadata,\n networkConfig,\n proxyConfig,\n registries,\n });\n const resolveOpts = {\n lockfileDir: rootDir,\n preferredVersions: {},\n projectDir: rootDir,\n registry: '',\n };\n try {\n const parsedPackage = parsePackageName(packageName);\n const wantedDep: nodeApi.WantedDependency = {\n alias: parsedPackage.name,\n // parse-package-name returns an empty string when no version is present,\n // but the engine resolves only undefined (or an explicit range) as \"latest\".\n bareSpecifier: parsedPackage.version || undefined,\n };\n const val = await resolve(wantedDep, resolveOpts);\n if (!val.manifest) {\n throw new BitError('The resolved package has no manifest');\n }\n const manifest = val.manifest as unknown as DependencyManifest;\n const wantedRange =\n parsedPackage.version && semver.validRange(parsedPackage.version) ? parsedPackage.version : undefined;\n\n return {\n packageName: manifest.name,\n version: manifest.version,\n wantedRange,\n isSemver: true,\n resolvedVia: val.resolvedVia,\n manifest,\n };\n } catch (e: any) {\n if (!e.message?.includes('is not a valid string')) {\n throw pnpmErrorToBitError(e);\n }\n // The provided package is probably a git url or path to a folder\n const wantedDep: nodeApi.WantedDependency = {\n alias: undefined,\n bareSpecifier: packageName,\n };\n const val = await resolve(wantedDep, resolveOpts);\n if (!val.manifest) {\n throw new BitError('The resolved package has no manifest');\n }\n if (!val.normalizedBareSpecifier) {\n throw new BitError('The resolved package has no version');\n }\n const manifest = val.manifest as unknown as DependencyManifest;\n return {\n packageName: manifest.name,\n version: val.normalizedBareSpecifier,\n isSemver: false,\n resolvedVia: val.resolvedVia,\n manifest,\n };\n }\n}\n\n/**\n * Sort the engine's `depsRequiringBuild` for a stable lockfile block, or\n * return undefined when the install did not compute the list at all —\n * it was served from the frozen-lockfile path, or the engine predates\n * `returnListOfDepsRequiringBuild`. Undefined is not an empty list: the\n * install has no answer, so the recorded one has to stand.\n */\nexport function sortDepsRequiringBuild(depsRequiringBuild: string[] | undefined): string[] | undefined {\n return depsRequiringBuild == null ? undefined : [...depsRequiringBuild].sort();\n}\n\n/**\n * The `bit:` attributes to re-assert after an install, or undefined when\n * there is nothing to write. See {@link sortDepsRequiringBuild} for why\n * an uncomputed list leaves the recorded one untouched.\n */\nexport function mergeBitLockfileAttrs(\n preInstallAttrs: Partial<BitLockfileAttributes> | undefined,\n sortedDepsRequiringBuild: string[] | undefined\n): Partial<BitLockfileAttributes> | undefined {\n if (sortedDepsRequiringBuild == null) return preInstallAttrs;\n return { ...preInstallAttrs, depsRequiringBuild: sortedDepsRequiringBuild };\n}\n\n/**\n * Read the `bit:` extension block of the workspace's wanted lockfile,\n * or undefined when there is no lockfile or no block.\n */\nasync function readBitLockfileAttrs(rootDir: string): Promise<Partial<BitLockfileAttributes> | undefined> {\n try {\n const lockfile = await nodeApi.readLockfile<BitLockfileFile>({ dir: rootDir });\n return lockfile?.bit;\n } catch {\n // A malformed lockfile fails the install itself later with a proper\n // error; there is nothing to preserve here.\n return undefined;\n }\n}\n\n/**\n * Re-assert Bit's `bit:` extension block on the wanted lockfile after\n * an engine install rewrote it. Merges over whatever the file has, so\n * an attribute captured before the install (e.g. `restoredFromModel`)\n * survives the rewrite.\n */\nasync function addBitAttributesToLockfile(rootDir: string, attrs: Partial<BitLockfileAttributes>) {\n const lockfile = await nodeApi.readLockfile<BitLockfileFile>({ dir: rootDir });\n if (lockfile == null) return;\n const merged = { ...lockfile.bit, ...attrs };\n if (isEqual(lockfile.bit, merged)) return;\n lockfile.bit = merged as BitLockfileAttributes;\n await nodeApi.writeLockfile({ dir: rootDir, lockfile });\n}\n\n/**\n * A `pnpm-lock.yaml` as the engine reads and writes it, plus the `bit:`\n * block Bit records beside pnpm's own keys. The engine preserves top-level\n * keys it does not define, so reading, editing that block, and writing the\n * file back leaves everything else untouched.\n */\nexport interface BitLockfileFile extends LockfileFile {\n bit?: BitLockfileAttributes;\n}\n\nexport interface BitLockfileAttributes {\n depsRequiringBuild: string[];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;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.dependencies_pnpm@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.dependencies_pnpm@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.dependencies_pnpm@1.0.1200/dist/pnpm.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.dependencies_pnpm@1.0.1200/dist/pnpm.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/pnpm",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1200",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/dependencies/pnpm",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.dependencies",
|
|
8
8
|
"name": "pnpm",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.1200"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
+
"node-gyp": "11.5.0",
|
|
12
13
|
"@pnpm/napi": "12.1.0",
|
|
13
14
|
"@pnpm/deps.path": "1100.1.0",
|
|
14
15
|
"@pnpm/lockfile.types": "1100.0.19",
|
|
@@ -20,22 +21,21 @@
|
|
|
20
21
|
"nerf-dart": "1.0.0",
|
|
21
22
|
"parse-package-name": "0.1.0",
|
|
22
23
|
"semver": "7.7.1",
|
|
23
|
-
"node-gyp": "11.5.0",
|
|
24
24
|
"fs-extra": "10.0.0",
|
|
25
|
+
"@teambit/legacy.constants": "0.0.43",
|
|
26
|
+
"@teambit/logger": "0.0.1482",
|
|
27
|
+
"@teambit/dependency-resolver": "1.0.1159",
|
|
25
28
|
"@teambit/bit-error": "0.0.404",
|
|
26
29
|
"@teambit/component-package-version": "0.0.463",
|
|
30
|
+
"@teambit/objects": "0.0.666",
|
|
27
31
|
"@teambit/dependencies.pnpm.dep-path": "1.0.1",
|
|
28
|
-
"@teambit/legacy.constants": "0.0.43",
|
|
29
|
-
"@teambit/logger": "0.0.1482",
|
|
30
32
|
"@teambit/pkg.entities.registry": "0.0.4",
|
|
31
33
|
"@teambit/harmony": "0.4.12",
|
|
32
34
|
"@teambit/cli": "0.0.1389",
|
|
33
|
-
"@teambit/legacy.logger": "0.0.60",
|
|
34
|
-
"@teambit/ui-foundation.ui.use-box.menu": "1.0.16",
|
|
35
|
-
"@teambit/dependency-resolver": "1.0.1159",
|
|
36
|
-
"@teambit/objects": "0.0.666",
|
|
37
35
|
"@teambit/cloud": "0.0.1459",
|
|
36
|
+
"@teambit/legacy.logger": "0.0.60",
|
|
38
37
|
"@teambit/component": "1.0.1159",
|
|
38
|
+
"@teambit/ui-foundation.ui.use-box.menu": "1.0.16",
|
|
39
39
|
"@teambit/ui": "1.0.1159"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
package/dist/node-gyp-bin.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '@teambit/logger';
|
|
2
|
-
/**
|
|
3
|
-
* pnpm's engine spawns dependency lifecycle scripts with the PATH of this
|
|
4
|
-
* process, extended only with the relevant `node_modules/.bin` directories. It
|
|
5
|
-
* ships no `node-gyp` of its own, so a native package that shells out to
|
|
6
|
-
* `node-gyp rebuild` — `node-gyp-build`, `node-pre-gyp`, or a plain
|
|
7
|
-
* `"install": "node-gyp rebuild"` — fails with `spawn node-gyp ENOENT` unless
|
|
8
|
-
* something else put `node-gyp` on PATH.
|
|
9
|
-
*
|
|
10
|
-
* npm solves this with a wrapper script directory it prepends to PATH, and Bit
|
|
11
|
-
* used to inherit that wrapper from `@pnpm/npm-lifecycle`. Reproduce it here
|
|
12
|
-
* over the `node-gyp` that Bit depends on.
|
|
13
|
-
*
|
|
14
|
-
* The directory is *appended*, so a `node-gyp` the user installed themselves
|
|
15
|
-
* still takes precedence, and it goes on `process.env` because the N-API
|
|
16
|
-
* install binding accepts no `extraBinPaths`.
|
|
17
|
-
*/
|
|
18
|
-
export declare function addNodeGypToPath(logger?: Logger): void;
|
package/dist/node-gyp-bin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_crypto","data","require","_fs","_path","_legacy","addNodeGypToPath","logger","dir","writeShims","err","consoleWarning","warn","currentPath","process","env","PATH","split","delimiter","includes","nodeGypJs","resolve","node","execPath","key","createHash","update","digest","slice","join","CACHE_ROOT","writeShim","shQuote","platform","target","content","readIfExists","mkdirSync","dirname","recursive","tmp","pid","writeFileSync","chmodSync","renameSync","rmSync","force","readFileSync","code","undefined","value","replace"],"sources":["node-gyp-bin.ts"],"sourcesContent":["import { createHash } from 'crypto';\nimport { chmodSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'fs';\nimport { delimiter, dirname, join } from 'path';\nimport { CACHE_ROOT } from '@teambit/legacy.constants';\nimport type { Logger } from '@teambit/logger';\n\n/**\n * pnpm's engine spawns dependency lifecycle scripts with the PATH of this\n * process, extended only with the relevant `node_modules/.bin` directories. It\n * ships no `node-gyp` of its own, so a native package that shells out to\n * `node-gyp rebuild` — `node-gyp-build`, `node-pre-gyp`, or a plain\n * `\"install\": \"node-gyp rebuild\"` — fails with `spawn node-gyp ENOENT` unless\n * something else put `node-gyp` on PATH.\n *\n * npm solves this with a wrapper script directory it prepends to PATH, and Bit\n * used to inherit that wrapper from `@pnpm/npm-lifecycle`. Reproduce it here\n * over the `node-gyp` that Bit depends on.\n *\n * The directory is *appended*, so a `node-gyp` the user installed themselves\n * still takes precedence, and it goes on `process.env` because the N-API\n * install binding accepts no `extraBinPaths`.\n */\nexport function addNodeGypToPath(logger?: Logger): void {\n let dir: string;\n try {\n dir = writeShims();\n } catch (err: any) {\n // Not fatal on its own: only a dependency that actually builds with\n // node-gyp will fail, and it may well find one elsewhere on PATH. Warn\n // rather than throw, but warn loudly enough to explain that failure.\n logger?.consoleWarning(`failed to set up node-gyp, packages that build with it may fail to install: ${err}`);\n logger?.warn('failed to set up the node-gyp wrapper', err);\n return;\n }\n const currentPath = process.env.PATH ?? '';\n if (currentPath.split(delimiter).includes(dir)) return;\n process.env.PATH = currentPath === '' ? dir : `${currentPath}${delimiter}${dir}`;\n}\n\n/** Writes the wrappers if they are not already there, and returns their directory. */\nfunction writeShims(): string {\n const nodeGypJs = require.resolve('node-gyp/bin/node-gyp.js');\n const node = process.execPath;\n // The wrappers hardcode the two paths, so the directory is keyed by them:\n // another Bit install, or the same one under a different Node, resolves to a\n // directory of its own instead of overwriting this one — which would point\n // concurrent installs at the wrong node-gyp, and would make two Bit versions\n // used side by side rewrite the wrapper on every install. What accumulates is\n // two ~100-byte files per distinct pair, so nothing needs pruning.\n const key = createHash('sha1').update(`${node}\\n${nodeGypJs}`).digest('hex').slice(0, 12);\n const dir = join(CACHE_ROOT, 'node-gyp-bin', key);\n // Written on Windows too: the default shell there is cmd.exe, but a\n // `scriptShell` pointing at bash needs the POSIX wrapper.\n writeShim(join(dir, 'node-gyp'), `#!/bin/sh\\nexec ${shQuote(node)} ${shQuote(nodeGypJs)} \"$@\"\\n`);\n if (process.platform === 'win32') {\n writeShim(join(dir, 'node-gyp.cmd'), `@echo off\\r\\n\"${node}\" \"${nodeGypJs}\" %*\\r\\n`);\n }\n return dir;\n}\n\nfunction writeShim(target: string, content: string): void {\n if (readIfExists(target) === content) return;\n mkdirSync(dirname(target), { recursive: true });\n // Write and rename, so the wrapper only ever appears at its final path fully\n // written and executable, whichever of several concurrent Bit processes wins.\n const tmp = `${target}.${process.pid}.tmp`;\n try {\n writeFileSync(tmp, content);\n chmodSync(tmp, 0o755); // not umask-masked, unlike writeFileSync's `mode`\n renameSync(tmp, target);\n } catch (err) {\n rmSync(tmp, { force: true });\n // Losing that race is a success, not a failure — on Windows the other\n // process's rename would have thrown.\n if (readIfExists(target) !== content) throw err;\n }\n}\n\nfunction readIfExists(target: string): string | undefined {\n try {\n return readFileSync(target, 'utf8');\n } catch (err: any) {\n // Read and handle the absence, rather than testing for it first: another\n // Bit process replacing the wrapper could remove it between the two.\n if (err.code === 'ENOENT') return undefined;\n throw err;\n }\n}\n\nfunction shQuote(value: string): string {\n return `'${value.replace(/'/g, `'\\\\''`)}'`;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,IAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,GAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,gBAAgBA,CAACC,MAAe,EAAQ;EACtD,IAAIC,GAAW;EACf,IAAI;IACFA,GAAG,GAAGC,UAAU,CAAC,CAAC;EACpB,CAAC,CAAC,OAAOC,GAAQ,EAAE;IACjB;IACA;IACA;IACAH,MAAM,EAAEI,cAAc,CAAC,+EAA+ED,GAAG,EAAE,CAAC;IAC5GH,MAAM,EAAEK,IAAI,CAAC,uCAAuC,EAAEF,GAAG,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IAAAE,eAAS,EAAC,IAAAC,eAAO,EAACJ,MAAM,CAAC,EAAE;IAAEK,SAAS,EAAE;EAAK,CAAC,CAAC;EAC/C;EACA;EACA,MAAMC,GAAG,GAAG,GAAGN,MAAM,IAAIpB,OAAO,CAAC2B,GAAG,MAAM;EAC1C,IAAI;IACF,IAAAC,mBAAa,EAACF,GAAG,EAAEL,OAAO,CAAC;IAC3B,IAAAQ,eAAS,EAACH,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IACvB,IAAAI,gBAAU,EAACJ,GAAG,EAAEN,MAAM,CAAC;EACzB,CAAC,CAAC,OAAOxB,GAAG,EAAE;IACZ,IAAAmC,YAAM,EAACL,GAAG,EAAE;MAAEM,KAAK,EAAE;IAAK,CAAC,CAAC;IAC5B;IACA;IACA,IAAIV,YAAY,CAACF,MAAM,CAAC,KAAKC,OAAO,EAAE,MAAMzB,GAAG;EACjD;AACF;AAEA,SAAS0B,YAAYA,CAACF,MAAc,EAAsB;EACxD,IAAI;IACF,OAAO,IAAAa,kBAAY,EAACb,MAAM,EAAE,MAAM,CAAC;EACrC,CAAC,CAAC,OAAOxB,GAAQ,EAAE;IACjB;IACA;IACA,IAAIA,GAAG,CAACsC,IAAI,KAAK,QAAQ,EAAE,OAAOC,SAAS;IAC3C,MAAMvC,GAAG;EACX;AACF;AAEA,SAASsB,OAAOA,CAACkB,KAAa,EAAU;EACtC,OAAO,IAAIA,KAAK,CAACC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG;AAC5C","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_chai","data","require","_child_process","_fs","_path","_nodeGypBin","describe","originalPath","addedDirs","before","process","env","PATH","addNodeGypToPath","split","delimiter","filter","dir","includes","after","undefined","forEach","rmSync","recursive","force","it","expect","to","have","lengthOf","startsWith","equal","platform","skip","shim","join","existsSync","execFileSync","encoding","trim","match","pathAfterFirstCall"],"sources":["node-gyp-bin.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport { execFileSync } from 'child_process';\nimport { existsSync, rmSync } from 'fs';\nimport { delimiter, join } from 'path';\nimport { addNodeGypToPath } from './node-gyp-bin';\n\ndescribe('addNodeGypToPath()', () => {\n let originalPath: string | undefined;\n let addedDirs: string[];\n\n before(() => {\n originalPath = process.env.PATH;\n addNodeGypToPath();\n const before = (originalPath ?? '').split(delimiter);\n addedDirs = (process.env.PATH ?? '').split(delimiter).filter((dir) => !before.includes(dir));\n });\n\n after(() => {\n // Assigning `undefined` would leave the literal string \"undefined\" for\n // every spec that runs after this one in the same process.\n if (originalPath === undefined) delete process.env.PATH;\n else process.env.PATH = originalPath;\n // The wrapper lands in the real Bit cache — writing it there is the\n // behavior under test, so it cannot be redirected without stubbing out the\n // thing being asserted. Take it back out; an install that wants it writes\n // it again, and a script already running one keeps the inode it opened.\n addedDirs.forEach((dir) => rmSync(dir, { recursive: true, force: true }));\n });\n\n it('appends exactly one directory to PATH', () => {\n expect(addedDirs).to.have.lengthOf(1);\n expect(process.env.PATH?.startsWith(originalPath ?? '')).to.equal(true);\n });\n\n it('the appended directory holds a node-gyp that runs', function () {\n if (process.platform === 'win32') this.skip();\n const shim = join(addedDirs[0], 'node-gyp');\n expect(existsSync(shim)).to.equal(true);\n expect(execFileSync(shim, ['--version'], { encoding: 'utf8' }).trim()).to.match(/^v\\d+\\./);\n });\n\n it('is idempotent', () => {\n const pathAfterFirstCall = process.env.PATH;\n addNodeGypToPath();\n expect(process.env.PATH).to.equal(pathAfterFirstCall);\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,eAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,cAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG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