@teambit/pnpm 1.0.1128 → 1.0.1129
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/lynx.js +12 -0
- package/dist/lynx.js.map +1 -1
- package/dist/node-gyp-bin.d.ts +18 -0
- package/dist/node-gyp-bin.js +123 -0
- package/dist/node-gyp-bin.js.map +1 -0
- package/dist/node-gyp-bin.spec.d.ts +1 -0
- package/dist/node-gyp-bin.spec.js +79 -0
- package/dist/node-gyp-bin.spec.js.map +1 -0
- package/dist/{preview-1785608153725.js → preview-1785671539411.js} +2 -2
- package/package.json +7 -6
package/dist/lynx.js
CHANGED
|
@@ -116,6 +116,13 @@ function _readConfig() {
|
|
|
116
116
|
};
|
|
117
117
|
return data;
|
|
118
118
|
}
|
|
119
|
+
function _nodeGypBin() {
|
|
120
|
+
const data = require("./node-gyp-bin");
|
|
121
|
+
_nodeGypBin = function () {
|
|
122
|
+
return data;
|
|
123
|
+
};
|
|
124
|
+
return data;
|
|
125
|
+
}
|
|
119
126
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
120
127
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
121
128
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -406,6 +413,9 @@ async function install(rootDir, manifestsByPaths, storeDir, cacheDir, registries
|
|
|
406
413
|
let depsRequiringBuild;
|
|
407
414
|
let resolvedStoreDir = storeDir;
|
|
408
415
|
if (!options.dryRun) {
|
|
416
|
+
// Dependency build scripts inherit this process's PATH. Set up inside the
|
|
417
|
+
// guard, so a dry run neither writes the wrapper nor touches the env.
|
|
418
|
+
(0, _nodeGypBin().addNodeGypToPath)(logger);
|
|
409
419
|
let stopReporting;
|
|
410
420
|
let installPromise;
|
|
411
421
|
let restoreWantedLockfile;
|
|
@@ -452,6 +462,8 @@ async function install(rootDir, manifestsByPaths, storeDir, cacheDir, registries
|
|
|
452
462
|
// The Rust engine's rebuild rebuilds every build-needing package and does not
|
|
453
463
|
// support the pending / skipIfHasSideEffectsCache selectors of the old engine.
|
|
454
464
|
rebuild: async () => {
|
|
465
|
+
// Reached without an install of its own after a dry run.
|
|
466
|
+
(0, _nodeGypBin().addNodeGypToPath)(logger);
|
|
455
467
|
let stopReporting;
|
|
456
468
|
if (!options.hidePackageManagerOutput) {
|
|
457
469
|
stopReporting = initReporter({
|
package/dist/lynx.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_path","data","require","_fs","_semver","_interopRequireDefault","_parsePackageName","_cli","_logger","_pluginTrustedDeps","nodeApi","_interopRequireWildcard","_nerfDart","_bitError","_legacy","_dependenciesPnpm","_lodash","_pnpmErrorToBitError","_readConfig","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","lockfileFsPromise","loadLockfileFs","loadEsm","lockfileFs","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","emitLogEvent","event","streamParser","emit","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","onLog","installOptions","nodeLinker","linkWorkspacePackages","publicHoistPattern","allowBuilds","dangerouslyAllowAllBuilds","autoInstallPeers","excludeLinksFromLockfile","lockfileOnly","packageImportMethod","preferOffline","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","dependenciesChanged","depsRequiringBuild","resolvedStoreDir","dryRun","stopReporting","installPromise","restoreWantedLockfile","hidePackageManagerOutput","initReporter","hideAddedPkgsProgress","preInstallBitAttrs","readBitLockfileAttrs","removeWantedLockfileForUpdate","installResult","sortedDepsRequiringBuild","sortDepsRequiringBuild","bitAttrs","mergeBitLockfileAttrs","addBitAttributesToLockfile","stats","added","removed","linkedToRoot","warn","rebuild","appendOnly","hideLifecycleOutput","lockfilePath","lockfileContent","fs","readFile","code","unlink","writeFile","pkg","packageDescriptor","allowedScript","trustedPkgName","TRUSTED_PACKAGE_NAMES","untrustedPkgName","scripts","includes","initDefaultReporter","context","argv","reportingOptions","throttleProgress","hideProgressPrefix","approveBuildsInstructionText","filterPkgsDiff","diff","startsWith","from","readPackage","readPackageHook","removeLegacyFromDeps","removeHarmonyFromDeps","readPackageHookForCapsules","dependencies","peerDependencies","BIT_ROOTS_DIR","readWorkspacePackageHook","newDeps","version","resolveRemoteVersion","packageName","preferredVersions","parsedPackage","parsePackageName","alias","bareSpecifier","val","BitError","wantedRange","semver","validRange","isSemver","resolvedVia","message","normalizedBareSpecifier","sort","preInstallAttrs","readWantedLockfile","lockfile","ignoreIncompatible","bit","attrs","writeWantedLockfile","merged","isEqual"],"sources":["lynx.ts"],"sourcesContent":["import { join } from 'path';\nimport { promises as fs } from 'fs';\nimport semver from 'semver';\nimport parsePackageName from 'parse-package-name';\nimport { initDefaultReporter } from '@pnpm/cli.default-reporter';\nimport { streamParser } from '@pnpm/logger';\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 { Registries } from '@teambit/pkg.entities.registry';\nimport toNerfDart from 'nerf-dart';\nimport type {\n ResolvedPackageVersion,\n PackageManagerProxyConfig,\n PackageManagerNetworkConfig,\n} from '@teambit/dependency-resolver';\nimport { BitError } from '@teambit/bit-error';\nimport { BIT_ROOTS_DIR } from '@teambit/legacy.constants';\nimport type * as LockfileFs from '@pnpm/lockfile.fs';\nimport { type LockfileFile, type LockfileObject } from '@pnpm/lockfile.types';\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';\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>> = {};\ntype LockfileFsModule = typeof LockfileFs;\nlet lockfileFsPromise: Promise<LockfileFsModule> | undefined;\n\nfunction loadLockfileFs(): Promise<LockfileFsModule> {\n lockfileFsPromise ??= (async () => {\n const { loadEsm } = require('./load-pnpm-esm.cjs') as {\n loadEsm: () => Promise<{ lockfileFs: LockfileFsModule }>;\n };\n const { lockfileFs } = await loadEsm();\n return lockfileFs;\n })();\n return lockfileFsPromise;\n}\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\n/**\n * Feed a wire-compatible pnpm log event into the default reporter. The engine\n * emits bunyan-shaped events; the reporter subscribes to `streamParser` via\n * `.on('data', ...)`, so emitting a `data` event on the underlying stream\n * delivers the event straight to the reporter.\n */\nfunction emitLogEvent(event: Record<string, unknown>): void {\n (streamParser as unknown as NodeJS.EventEmitter).emit('data', event);\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\nexport interface ReportOptions {\n appendOnly?: boolean;\n throttleProgress?: number;\n hideAddedPkgsProgress?: boolean;\n hideProgressPrefix?: boolean;\n hideLifecycleOutput?: boolean;\n peerDependencyRules?: PeerDependencyRules;\n process?: NodeJS.Process;\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 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 onLog: nodeApi.LogListener = (event) => {\n emitLogEvent(event);\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 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 };\n\n let dependenciesChanged = false;\n let depsRequiringBuild: DepPath[] | undefined;\n let resolvedStoreDir = storeDir;\n if (!options.dryRun) {\n let stopReporting: Function | undefined;\n let installPromise: Promise<nodeApi.InstallResult> | undefined;\n let restoreWantedLockfile: (() => Promise<void>) | undefined;\n if (!options.hidePackageManagerOutput) {\n stopReporting = initReporter({\n ...options.reportOptions,\n hideAddedPkgsProgress: options.lockfileOnly,\n });\n }\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, onLog, readPackageHookForDeps);\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 stopReporting?.();\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 let stopReporting: Function | undefined;\n if (!options.hidePackageManagerOutput) {\n stopReporting = initReporter({\n appendOnly: true,\n hideLifecycleOutput: true,\n });\n }\n try {\n await nodeApi.rebuild({ ...installOptions, storeDir: resolvedStoreDir }, onLog, undefined);\n } finally {\n stopReporting?.();\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\nfunction initReporter(opts?: ReportOptions) {\n return initDefaultReporter({\n context: {\n argv: [],\n process: opts?.process,\n },\n reportingOptions: {\n appendOnly: opts?.appendOnly ?? false,\n throttleProgress: opts?.throttleProgress ?? 200,\n hideAddedPkgsProgress: opts?.hideAddedPkgsProgress,\n hideProgressPrefix: opts?.hideProgressPrefix,\n hideLifecycleOutput: opts?.hideLifecycleOutput,\n approveBuildsInstructionText:\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 streamParser: streamParser as any, // eslint-disable-line\n // Linked in core aspects are excluded from the output to reduce noise.\n // Other @teambit/ dependencies will be shown.\n // Only those that are symlinked from outside the workspace will be hidden.\n filterPkgsDiff: (diff) => !diff.name.startsWith('@teambit/') || !diff.from,\n });\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 { readWantedLockfile } = await loadLockfileFs();\n const lockfile = (await readWantedLockfile(rootDir, { ignoreIncompatible: true })) as BitLockfile | null;\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 { readWantedLockfile, writeWantedLockfile } = await loadLockfileFs();\n const lockfile = (await readWantedLockfile(rootDir, { ignoreIncompatible: true })) as BitLockfile;\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 writeWantedLockfile(rootDir, lockfile);\n}\n\nexport interface BitLockfile extends LockfileObject {\n bit?: BitLockfileAttributes;\n}\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,QAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,kBAAA;EAAA,MAAAL,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAI,iBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAC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A,KAAQwP,QAAQ,CAACE,GAAG,GAAKC,KAAK,CAAE;EAC5C,IAAI,IAAAG,iBAAO,EAACN,QAAQ,CAACE,GAAG,EAAEG,MAAM,CAAC,EAAE;EACnCL,QAAQ,CAACE,GAAG,GAAGG,MAA+B;EAC9C,MAAMD,mBAAmB,CAAClK,OAAO,EAAE8J,QAAQ,CAAC;AAC9C","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_path","data","require","_fs","_semver","_interopRequireDefault","_parsePackageName","_cli","_logger","_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","lockfileFsPromise","loadLockfileFs","loadEsm","lockfileFs","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","emitLogEvent","event","streamParser","emit","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","onLog","installOptions","nodeLinker","linkWorkspacePackages","publicHoistPattern","allowBuilds","dangerouslyAllowAllBuilds","autoInstallPeers","excludeLinksFromLockfile","lockfileOnly","packageImportMethod","preferOffline","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","dependenciesChanged","depsRequiringBuild","resolvedStoreDir","dryRun","addNodeGypToPath","stopReporting","installPromise","restoreWantedLockfile","hidePackageManagerOutput","initReporter","hideAddedPkgsProgress","preInstallBitAttrs","readBitLockfileAttrs","removeWantedLockfileForUpdate","installResult","sortedDepsRequiringBuild","sortDepsRequiringBuild","bitAttrs","mergeBitLockfileAttrs","addBitAttributesToLockfile","stats","added","removed","linkedToRoot","warn","rebuild","appendOnly","hideLifecycleOutput","lockfilePath","lockfileContent","fs","readFile","code","unlink","writeFile","pkg","packageDescriptor","allowedScript","trustedPkgName","TRUSTED_PACKAGE_NAMES","untrustedPkgName","scripts","includes","initDefaultReporter","context","argv","reportingOptions","throttleProgress","hideProgressPrefix","approveBuildsInstructionText","filterPkgsDiff","diff","startsWith","from","readPackage","readPackageHook","removeLegacyFromDeps","removeHarmonyFromDeps","readPackageHookForCapsules","dependencies","peerDependencies","BIT_ROOTS_DIR","readWorkspacePackageHook","newDeps","version","resolveRemoteVersion","packageName","preferredVersions","parsedPackage","parsePackageName","alias","bareSpecifier","val","BitError","wantedRange","semver","validRange","isSemver","resolvedVia","message","normalizedBareSpecifier","sort","preInstallAttrs","readWantedLockfile","lockfile","ignoreIncompatible","bit","attrs","writeWantedLockfile","merged","isEqual"],"sources":["lynx.ts"],"sourcesContent":["import { join } from 'path';\nimport { promises as fs } from 'fs';\nimport semver from 'semver';\nimport parsePackageName from 'parse-package-name';\nimport { initDefaultReporter } from '@pnpm/cli.default-reporter';\nimport { streamParser } from '@pnpm/logger';\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 { Registries } from '@teambit/pkg.entities.registry';\nimport toNerfDart from 'nerf-dart';\nimport type {\n ResolvedPackageVersion,\n PackageManagerProxyConfig,\n PackageManagerNetworkConfig,\n} from '@teambit/dependency-resolver';\nimport { BitError } from '@teambit/bit-error';\nimport { BIT_ROOTS_DIR } from '@teambit/legacy.constants';\nimport type * as LockfileFs from '@pnpm/lockfile.fs';\nimport { type LockfileFile, type LockfileObject } from '@pnpm/lockfile.types';\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>> = {};\ntype LockfileFsModule = typeof LockfileFs;\nlet lockfileFsPromise: Promise<LockfileFsModule> | undefined;\n\nfunction loadLockfileFs(): Promise<LockfileFsModule> {\n lockfileFsPromise ??= (async () => {\n const { loadEsm } = require('./load-pnpm-esm.cjs') as {\n loadEsm: () => Promise<{ lockfileFs: LockfileFsModule }>;\n };\n const { lockfileFs } = await loadEsm();\n return lockfileFs;\n })();\n return lockfileFsPromise;\n}\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\n/**\n * Feed a wire-compatible pnpm log event into the default reporter. The engine\n * emits bunyan-shaped events; the reporter subscribes to `streamParser` via\n * `.on('data', ...)`, so emitting a `data` event on the underlying stream\n * delivers the event straight to the reporter.\n */\nfunction emitLogEvent(event: Record<string, unknown>): void {\n (streamParser as unknown as NodeJS.EventEmitter).emit('data', event);\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\nexport interface ReportOptions {\n appendOnly?: boolean;\n throttleProgress?: number;\n hideAddedPkgsProgress?: boolean;\n hideProgressPrefix?: boolean;\n hideLifecycleOutput?: boolean;\n peerDependencyRules?: PeerDependencyRules;\n process?: NodeJS.Process;\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 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 onLog: nodeApi.LogListener = (event) => {\n emitLogEvent(event);\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 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 };\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 stopReporting: Function | undefined;\n let installPromise: Promise<nodeApi.InstallResult> | undefined;\n let restoreWantedLockfile: (() => Promise<void>) | undefined;\n if (!options.hidePackageManagerOutput) {\n stopReporting = initReporter({\n ...options.reportOptions,\n hideAddedPkgsProgress: options.lockfileOnly,\n });\n }\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, onLog, readPackageHookForDeps);\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 stopReporting?.();\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 let stopReporting: Function | undefined;\n if (!options.hidePackageManagerOutput) {\n stopReporting = initReporter({\n appendOnly: true,\n hideLifecycleOutput: true,\n });\n }\n try {\n await nodeApi.rebuild({ ...installOptions, storeDir: resolvedStoreDir }, onLog, undefined);\n } finally {\n stopReporting?.();\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\nfunction initReporter(opts?: ReportOptions) {\n return initDefaultReporter({\n context: {\n argv: [],\n process: opts?.process,\n },\n reportingOptions: {\n appendOnly: opts?.appendOnly ?? false,\n throttleProgress: opts?.throttleProgress ?? 200,\n hideAddedPkgsProgress: opts?.hideAddedPkgsProgress,\n hideProgressPrefix: opts?.hideProgressPrefix,\n hideLifecycleOutput: opts?.hideLifecycleOutput,\n approveBuildsInstructionText:\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 streamParser: streamParser as any, // eslint-disable-line\n // Linked in core aspects are excluded from the output to reduce noise.\n // Other @teambit/ dependencies will be shown.\n // Only those that are symlinked from outside the workspace will be hidden.\n filterPkgsDiff: (diff) => !diff.name.startsWith('@teambit/') || !diff.from,\n });\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 { readWantedLockfile } = await loadLockfileFs();\n const lockfile = (await readWantedLockfile(rootDir, { ignoreIncompatible: true })) as BitLockfile | null;\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 { readWantedLockfile, writeWantedLockfile } = await loadLockfileFs();\n const lockfile = (await readWantedLockfile(rootDir, { ignoreIncompatible: true })) as BitLockfile;\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 writeWantedLockfile(rootDir, lockfile);\n}\n\nexport interface BitLockfile extends LockfileObject {\n bit?: BitLockfileAttributes;\n}\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,QAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,kBAAA;EAAA,MAAAL,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAI,iBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,KAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,IAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,mBAAA;EAAA,MAAAR,IAAA,GAAAC,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iBAAO,EAACN,QAAQ,CAACE,GAAG,EAAEG,MAAM,CAAC,EAAE;EACnCL,QAAQ,CAACE,GAAG,GAAGG,MAA+B;EAC9C,MAAMD,mBAAmB,CAACnK,OAAO,EAAE+J,QAAQ,CAAC;AAC9C","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
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;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.addNodeGypToPath = addNodeGypToPath;
|
|
7
|
+
function _crypto() {
|
|
8
|
+
const data = require("crypto");
|
|
9
|
+
_crypto = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _fs() {
|
|
15
|
+
const data = require("fs");
|
|
16
|
+
_fs = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _path() {
|
|
22
|
+
const data = require("path");
|
|
23
|
+
_path = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _legacy() {
|
|
29
|
+
const data = require("@teambit/legacy.constants");
|
|
30
|
+
_legacy = function () {
|
|
31
|
+
return data;
|
|
32
|
+
};
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* pnpm's engine spawns dependency lifecycle scripts with the PATH of this
|
|
37
|
+
* process, extended only with the relevant `node_modules/.bin` directories. It
|
|
38
|
+
* ships no `node-gyp` of its own, so a native package that shells out to
|
|
39
|
+
* `node-gyp rebuild` — `node-gyp-build`, `node-pre-gyp`, or a plain
|
|
40
|
+
* `"install": "node-gyp rebuild"` — fails with `spawn node-gyp ENOENT` unless
|
|
41
|
+
* something else put `node-gyp` on PATH.
|
|
42
|
+
*
|
|
43
|
+
* npm solves this with a wrapper script directory it prepends to PATH, and Bit
|
|
44
|
+
* used to inherit that wrapper from `@pnpm/npm-lifecycle`. Reproduce it here
|
|
45
|
+
* over the `node-gyp` that Bit depends on.
|
|
46
|
+
*
|
|
47
|
+
* The directory is *appended*, so a `node-gyp` the user installed themselves
|
|
48
|
+
* still takes precedence, and it goes on `process.env` because the N-API
|
|
49
|
+
* install binding accepts no `extraBinPaths`.
|
|
50
|
+
*/
|
|
51
|
+
function addNodeGypToPath(logger) {
|
|
52
|
+
let dir;
|
|
53
|
+
try {
|
|
54
|
+
dir = writeShims();
|
|
55
|
+
} catch (err) {
|
|
56
|
+
// Not fatal on its own: only a dependency that actually builds with
|
|
57
|
+
// node-gyp will fail, and it may well find one elsewhere on PATH. Warn
|
|
58
|
+
// rather than throw, but warn loudly enough to explain that failure.
|
|
59
|
+
logger?.consoleWarning(`failed to set up node-gyp, packages that build with it may fail to install: ${err}`);
|
|
60
|
+
logger?.warn('failed to set up the node-gyp wrapper', err);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const currentPath = process.env.PATH ?? '';
|
|
64
|
+
if (currentPath.split(_path().delimiter).includes(dir)) return;
|
|
65
|
+
process.env.PATH = currentPath === '' ? dir : `${currentPath}${_path().delimiter}${dir}`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Writes the wrappers if they are not already there, and returns their directory. */
|
|
69
|
+
function writeShims() {
|
|
70
|
+
const nodeGypJs = require.resolve('node-gyp/bin/node-gyp.js');
|
|
71
|
+
const node = process.execPath;
|
|
72
|
+
// The wrappers hardcode the two paths, so the directory is keyed by them:
|
|
73
|
+
// another Bit install, or the same one under a different Node, resolves to a
|
|
74
|
+
// directory of its own instead of overwriting this one — which would point
|
|
75
|
+
// concurrent installs at the wrong node-gyp, and would make two Bit versions
|
|
76
|
+
// used side by side rewrite the wrapper on every install. What accumulates is
|
|
77
|
+
// two ~100-byte files per distinct pair, so nothing needs pruning.
|
|
78
|
+
const key = (0, _crypto().createHash)('sha1').update(`${node}\n${nodeGypJs}`).digest('hex').slice(0, 12);
|
|
79
|
+
const dir = (0, _path().join)(_legacy().CACHE_ROOT, 'node-gyp-bin', key);
|
|
80
|
+
// Written on Windows too: the default shell there is cmd.exe, but a
|
|
81
|
+
// `scriptShell` pointing at bash needs the POSIX wrapper.
|
|
82
|
+
writeShim((0, _path().join)(dir, 'node-gyp'), `#!/bin/sh\nexec ${shQuote(node)} ${shQuote(nodeGypJs)} "$@"\n`);
|
|
83
|
+
if (process.platform === 'win32') {
|
|
84
|
+
writeShim((0, _path().join)(dir, 'node-gyp.cmd'), `@echo off\r\n"${node}" "${nodeGypJs}" %*\r\n`);
|
|
85
|
+
}
|
|
86
|
+
return dir;
|
|
87
|
+
}
|
|
88
|
+
function writeShim(target, content) {
|
|
89
|
+
if (readIfExists(target) === content) return;
|
|
90
|
+
(0, _fs().mkdirSync)((0, _path().dirname)(target), {
|
|
91
|
+
recursive: true
|
|
92
|
+
});
|
|
93
|
+
// Write and rename, so the wrapper only ever appears at its final path fully
|
|
94
|
+
// written and executable, whichever of several concurrent Bit processes wins.
|
|
95
|
+
const tmp = `${target}.${process.pid}.tmp`;
|
|
96
|
+
try {
|
|
97
|
+
(0, _fs().writeFileSync)(tmp, content);
|
|
98
|
+
(0, _fs().chmodSync)(tmp, 0o755); // not umask-masked, unlike writeFileSync's `mode`
|
|
99
|
+
(0, _fs().renameSync)(tmp, target);
|
|
100
|
+
} catch (err) {
|
|
101
|
+
(0, _fs().rmSync)(tmp, {
|
|
102
|
+
force: true
|
|
103
|
+
});
|
|
104
|
+
// Losing that race is a success, not a failure — on Windows the other
|
|
105
|
+
// process's rename would have thrown.
|
|
106
|
+
if (readIfExists(target) !== content) throw err;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function readIfExists(target) {
|
|
110
|
+
try {
|
|
111
|
+
return (0, _fs().readFileSync)(target, 'utf8');
|
|
112
|
+
} catch (err) {
|
|
113
|
+
// Read and handle the absence, rather than testing for it first: another
|
|
114
|
+
// Bit process replacing the wrapper could remove it between the two.
|
|
115
|
+
if (err.code === 'ENOENT') return undefined;
|
|
116
|
+
throw err;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function shQuote(value) {
|
|
120
|
+
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=node-gyp-bin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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;EA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c,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":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _chai() {
|
|
4
|
+
const data = require("chai");
|
|
5
|
+
_chai = function () {
|
|
6
|
+
return data;
|
|
7
|
+
};
|
|
8
|
+
return data;
|
|
9
|
+
}
|
|
10
|
+
function _child_process() {
|
|
11
|
+
const data = require("child_process");
|
|
12
|
+
_child_process = function () {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
function _fs() {
|
|
18
|
+
const data = require("fs");
|
|
19
|
+
_fs = function () {
|
|
20
|
+
return data;
|
|
21
|
+
};
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
function _path() {
|
|
25
|
+
const data = require("path");
|
|
26
|
+
_path = function () {
|
|
27
|
+
return data;
|
|
28
|
+
};
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
function _nodeGypBin() {
|
|
32
|
+
const data = require("./node-gyp-bin");
|
|
33
|
+
_nodeGypBin = function () {
|
|
34
|
+
return data;
|
|
35
|
+
};
|
|
36
|
+
return data;
|
|
37
|
+
}
|
|
38
|
+
describe('addNodeGypToPath()', () => {
|
|
39
|
+
let originalPath;
|
|
40
|
+
let addedDirs;
|
|
41
|
+
before(() => {
|
|
42
|
+
originalPath = process.env.PATH;
|
|
43
|
+
(0, _nodeGypBin().addNodeGypToPath)();
|
|
44
|
+
const before = (originalPath ?? '').split(_path().delimiter);
|
|
45
|
+
addedDirs = (process.env.PATH ?? '').split(_path().delimiter).filter(dir => !before.includes(dir));
|
|
46
|
+
});
|
|
47
|
+
after(() => {
|
|
48
|
+
// Assigning `undefined` would leave the literal string "undefined" for
|
|
49
|
+
// every spec that runs after this one in the same process.
|
|
50
|
+
if (originalPath === undefined) delete process.env.PATH;else process.env.PATH = originalPath;
|
|
51
|
+
// The wrapper lands in the real Bit cache — writing it there is the
|
|
52
|
+
// behavior under test, so it cannot be redirected without stubbing out the
|
|
53
|
+
// thing being asserted. Take it back out; an install that wants it writes
|
|
54
|
+
// it again, and a script already running one keeps the inode it opened.
|
|
55
|
+
addedDirs.forEach(dir => (0, _fs().rmSync)(dir, {
|
|
56
|
+
recursive: true,
|
|
57
|
+
force: true
|
|
58
|
+
}));
|
|
59
|
+
});
|
|
60
|
+
it('appends exactly one directory to PATH', () => {
|
|
61
|
+
(0, _chai().expect)(addedDirs).to.have.lengthOf(1);
|
|
62
|
+
(0, _chai().expect)(process.env.PATH?.startsWith(originalPath ?? '')).to.equal(true);
|
|
63
|
+
});
|
|
64
|
+
it('the appended directory holds a node-gyp that runs', function () {
|
|
65
|
+
if (process.platform === 'win32') this.skip();
|
|
66
|
+
const shim = (0, _path().join)(addedDirs[0], 'node-gyp');
|
|
67
|
+
(0, _chai().expect)((0, _fs().existsSync)(shim)).to.equal(true);
|
|
68
|
+
(0, _chai().expect)((0, _child_process().execFileSync)(shim, ['--version'], {
|
|
69
|
+
encoding: 'utf8'
|
|
70
|
+
}).trim()).to.match(/^v\d+\./);
|
|
71
|
+
});
|
|
72
|
+
it('is idempotent', () => {
|
|
73
|
+
const pathAfterFirstCall = process.env.PATH;
|
|
74
|
+
(0, _nodeGypBin().addNodeGypToPath)();
|
|
75
|
+
(0, _chai().expect)(process.env.PATH).to.equal(pathAfterFirstCall);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=node-gyp-bin.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 pathAfterFirstC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ACC,GAAG,CAACC,IAAI;IAC3C,IAAAC,8BAAgB,EAAC,CAAC;IAClB,IAAAa,cAAM,EAAChB,OAAO,CAACC,GAAG,CAACC,IAAI,CAAC,CAACe,EAAE,CAACI,KAAK,CAACU,kBAAkB,CAAC;EACvD,CAAC,CAAC;AACJ,CAAC,CAAC","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.1129/dist/pnpm.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.dependencies_pnpm@1.0.1129/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,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/pnpm",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1129",
|
|
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.1129"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@pnpm/napi": "12.0.0-beta.3",
|
|
@@ -23,25 +23,26 @@
|
|
|
23
23
|
"nerf-dart": "1.0.0",
|
|
24
24
|
"parse-package-name": "0.1.0",
|
|
25
25
|
"semver": "7.7.1",
|
|
26
|
+
"node-gyp": "11.5.0",
|
|
26
27
|
"fs-extra": "10.0.0",
|
|
27
28
|
"@pnpm/deps.inspection.list": "1100.0.20",
|
|
28
29
|
"@pnpm/deps.inspection.tree-builder": "1100.0.17",
|
|
29
30
|
"@pnpm/lockfile.filtering": "1100.1.8",
|
|
31
|
+
"@teambit/dependency-resolver": "1.0.1090",
|
|
30
32
|
"@teambit/bit-error": "0.0.404",
|
|
31
33
|
"@teambit/component-package-version": "0.0.459",
|
|
34
|
+
"@teambit/objects": "0.0.597",
|
|
32
35
|
"@teambit/logger": "0.0.1453",
|
|
33
36
|
"@teambit/dependencies.pnpm.dep-path": "1.0.1",
|
|
34
37
|
"@teambit/legacy.constants": "0.0.39",
|
|
35
38
|
"@teambit/pkg.entities.registry": "0.0.4",
|
|
36
39
|
"@teambit/harmony": "0.4.12",
|
|
37
40
|
"@teambit/cli": "0.0.1360",
|
|
41
|
+
"@teambit/cloud": "0.0.1389",
|
|
38
42
|
"@teambit/harmony.modules.feature-toggle": "0.0.51",
|
|
39
43
|
"@teambit/legacy.logger": "0.0.54",
|
|
40
|
-
"@teambit/ui-foundation.ui.use-box.menu": "1.0.16",
|
|
41
|
-
"@teambit/dependency-resolver": "1.0.1090",
|
|
42
|
-
"@teambit/objects": "0.0.597",
|
|
43
|
-
"@teambit/cloud": "0.0.1389",
|
|
44
44
|
"@teambit/component": "1.0.1090",
|
|
45
|
+
"@teambit/ui-foundation.ui.use-box.menu": "1.0.16",
|
|
45
46
|
"@teambit/ui": "1.0.1090"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|