@teambit/dependency-resolver 1.0.912 → 1.0.913
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/dependency-installer.d.ts +5 -2
- package/dist/dependency-installer.js +10 -3
- package/dist/dependency-installer.js.map +1 -1
- package/dist/dependency-resolver-workspace-config.d.ts +17 -0
- package/dist/dependency-resolver-workspace-config.js.map +1 -1
- package/dist/dependency-resolver.main.runtime.js +9 -4
- package/dist/dependency-resolver.main.runtime.js.map +1 -1
- package/dist/manifest/workspace-manifest-factory.d.ts +20 -1
- package/dist/manifest/workspace-manifest-factory.js +223 -30
- package/dist/manifest/workspace-manifest-factory.js.map +1 -1
- package/dist/manifest/workspace-manifest.d.ts +3 -1
- package/dist/manifest/workspace-manifest.js +10 -3
- package/dist/manifest/workspace-manifest.js.map +1 -1
- package/dist/package-manager.d.ts +1 -0
- package/dist/package-manager.js.map +1 -1
- package/dist/policy/env-policy/env-policy.d.ts +16 -2
- package/dist/policy/env-policy/env-policy.js +12 -4
- package/dist/policy/env-policy/env-policy.js.map +1 -1
- package/dist/policy/variant-policy/variant-policy.d.ts +2 -0
- package/dist/policy/variant-policy/variant-policy.js +5 -1
- package/dist/policy/variant-policy/variant-policy.js.map +1 -1
- package/dist/{preview-1773927560597.js → preview-1773942498396.js} +2 -2
- package/manifest/workspace-manifest-factory.ts +277 -34
- package/manifest/workspace-manifest.ts +14 -3
- package/package.json +8 -8
- package/policy/env-policy/env-policy.ts +24 -4
- package/policy/variant-policy/variant-policy.ts +6 -0
|
@@ -36,7 +36,7 @@ export type GetComponentManifestsOptions = {
|
|
|
36
36
|
includeAllEnvPeers?: boolean;
|
|
37
37
|
hasRootComponents?: boolean;
|
|
38
38
|
excludeExtensionsDependencies?: boolean;
|
|
39
|
-
} & Pick<PackageManagerInstallOptions, 'dedupe' | 'dependencyFilterFn' | 'copyPeerToRuntimeOnComponents' | 'copyPeerToRuntimeOnRoot' | 'installPeersFromEnvs'>;
|
|
39
|
+
} & Pick<PackageManagerInstallOptions, 'dedupe' | 'dependencyFilterFn' | 'copyPeerToRuntimeOnComponents' | 'copyPeerToRuntimeOnRoot' | 'installPeersFromEnvs' | 'resolveEnvPeersFromRoot'>;
|
|
40
40
|
export type PreInstallSubscriber = (installer: DependencyInstaller, installArgs: InstallArgs) => Promise<void>;
|
|
41
41
|
export type PreInstallSubscriberList = Array<PreInstallSubscriber>;
|
|
42
42
|
export type PostInstallSubscriber = (installer: DependencyInstaller, installArgs: InstallArgs) => Promise<void>;
|
|
@@ -82,7 +82,10 @@ export declare class DependencyInstaller {
|
|
|
82
82
|
* Compute all the component manifests (a.k.a. package.json files) that should be passed to the package manager
|
|
83
83
|
* in order to install the dependencies.
|
|
84
84
|
*/
|
|
85
|
-
getComponentManifests({ componentDirectoryMap, rootPolicy, rootDir, dedupe, dependencyFilterFn, copyPeerToRuntimeOnComponents, copyPeerToRuntimeOnRoot, installPeersFromEnvs, resolveVersionsFromDependenciesOnly, referenceLocalPackages, includeAllEnvPeers, hasRootComponents, excludeExtensionsDependencies, }: GetComponentManifestsOptions): Promise<
|
|
85
|
+
getComponentManifests({ componentDirectoryMap, rootPolicy, rootDir, dedupe, dependencyFilterFn, copyPeerToRuntimeOnComponents, copyPeerToRuntimeOnRoot, installPeersFromEnvs, resolveEnvPeersFromRoot, resolveVersionsFromDependenciesOnly, referenceLocalPackages, includeAllEnvPeers, hasRootComponents, excludeExtensionsDependencies, }: GetComponentManifestsOptions): Promise<{
|
|
86
|
+
manifests: Record<string, ProjectManifest>;
|
|
87
|
+
peerOverrides: Record<string, string>;
|
|
88
|
+
}>;
|
|
86
89
|
private cleanCompsNodeModules;
|
|
87
90
|
private runPrePostSubscribers;
|
|
88
91
|
}
|
|
@@ -81,7 +81,9 @@ class DependencyInstaller {
|
|
|
81
81
|
if (!finalRootDir) {
|
|
82
82
|
throw new (_exceptions().RootDirNotDefined)();
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const {
|
|
85
|
+
manifests
|
|
86
|
+
} = await this.getComponentManifests(_objectSpread(_objectSpread({}, packageManagerOptions), {}, {
|
|
85
87
|
componentDirectoryMap,
|
|
86
88
|
rootPolicy,
|
|
87
89
|
rootDir: finalRootDir,
|
|
@@ -223,6 +225,7 @@ class DependencyInstaller {
|
|
|
223
225
|
copyPeerToRuntimeOnComponents,
|
|
224
226
|
copyPeerToRuntimeOnRoot,
|
|
225
227
|
installPeersFromEnvs,
|
|
228
|
+
resolveEnvPeersFromRoot,
|
|
226
229
|
resolveVersionsFromDependenciesOnly,
|
|
227
230
|
referenceLocalPackages,
|
|
228
231
|
includeAllEnvPeers,
|
|
@@ -254,10 +257,14 @@ class DependencyInstaller {
|
|
|
254
257
|
if (!manifests[rootDir]) {
|
|
255
258
|
manifests[rootDir] = workspaceManifest.toJson({
|
|
256
259
|
copyPeerToRuntime: copyPeerToRuntimeOnRoot,
|
|
257
|
-
installPeersFromEnvs
|
|
260
|
+
installPeersFromEnvs,
|
|
261
|
+
resolveEnvPeersFromRoot
|
|
258
262
|
});
|
|
259
263
|
}
|
|
260
|
-
return
|
|
264
|
+
return {
|
|
265
|
+
manifests,
|
|
266
|
+
peerOverrides: workspaceManifest.peerOverrides
|
|
267
|
+
};
|
|
261
268
|
}
|
|
262
269
|
async cleanCompsNodeModules(componentDirectoryMap) {
|
|
263
270
|
const promises = componentDirectoryMap.toArray().map(([, dir]) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_path","_fsExtra","_exceptions","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DEFAULT_PM_INSTALL_OPTIONS","dedupe","copyPeerToRuntimeOnRoot","copyPeerToRuntimeOnComponents","installPeersFromEnvs","DEFAULT_INSTALL_OPTIONS","installTeambitBit","excludeExtensionsDependencies","DependencyInstaller","constructor","packageManager","aspectLoader","logger","dependencyResolver","rootDir","cacheRootDir","preInstallSubscriberList","postInstallSubscriberList","nodeLinker","packageImportMethod","sideEffectsCache","nodeVersion","engineStrict","peerDependencyRules","neverBuiltDependencies","allowScripts","dangerouslyAllowAllScripts","preferOffline","minimumReleaseAge","minimumReleaseAgeExclude","installingContext","install","rootPolicy","componentDirectoryMap","options","packageManagerOptions","finalRootDir","RootDirNotDefined","manifests","getComponentManifests","resolveVersionsFromDependenciesOnly","referenceLocalPackages","rootComponentsForCapsules","includeAllEnvPeers","installComponents","args","runPrePostSubscribers","mainAspect","linkedDependencies","JSON","parse","stringify","forcedHarmonyVersion","dependencies","directDeps","Set","values","manifest","depName","devDependencies","add","name","has","entries","dir","linkedDeps","isJsonCmd","process","argv","includes","hidePackageManagerOutput","Boolean","inCapsule","env","VERBOSE_PM_OUTPUT","calculatedPmOpts","packageManagerConfigRootDir","dedupeInjectedDeps","dependenciesGraph","version","packageName","MainAspectNotInstallable","dependencyId","lifecycleType","rootComponents","keepExistingModulesDir","cleanCompsNodeModules","err","debug","messagePrefix","messageSuffix","message","setStatusLine","startTime","hrtime","installResult","consoleSuccess","pruneModules","dependencyFilterFn","hasRootComponents","filterComponentsFromManifests","createManifestForComponentsWithoutDependencies","workspaceManifest","getWorkspaceManifest","undefined","components","toArray","reduce","acc","component","getPackageName","componentsManifestsMap","get","toJson","copyPeerToRuntime","promises","map","nmDir","path","join","fs","remove","Promise","all","subscribers","type","mapSeries","subscriber","exports"],"sources":["dependency-installer.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport path from 'path';\nimport fs from 'fs-extra';\nimport type { MainAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport type { ComponentMap } from '@teambit/component';\nimport { type DependenciesGraph } from '@teambit/objects';\nimport type { Logger } from '@teambit/logger';\nimport type { PathAbsolute } from '@teambit/toolbox.path.path';\nimport type { PeerDependencyRules, ProjectManifest } from '@pnpm/types';\nimport { MainAspectNotInstallable, RootDirNotDefined } from './exceptions';\nimport type { PackageManager, PackageManagerInstallOptions, PackageImportMethod } from './package-manager';\nimport type { WorkspacePolicy } from './policy';\nimport type { CreateFromComponentsOptions } from './manifest';\nimport type { DependencyResolverMain } from './dependency-resolver.main.runtime';\n\nconst DEFAULT_PM_INSTALL_OPTIONS: PackageManagerInstallOptions = {\n dedupe: true,\n copyPeerToRuntimeOnRoot: true,\n copyPeerToRuntimeOnComponents: false,\n installPeersFromEnvs: false,\n};\n\nconst DEFAULT_INSTALL_OPTIONS: InstallOptions = {\n installTeambitBit: false,\n excludeExtensionsDependencies: false,\n};\n\nexport type DepInstallerContext = {\n inCapsule?: boolean;\n};\n\nexport type InstallArgs = {\n rootDir: string | undefined;\n rootPolicy: WorkspacePolicy;\n componentDirectoryMap: ComponentMap<string>;\n options: InstallOptions;\n packageManagerOptions: PackageManagerInstallOptions;\n};\n\nexport type InstallOptions = {\n installTeambitBit: boolean;\n packageManagerConfigRootDir?: string;\n resolveVersionsFromDependenciesOnly?: boolean;\n linkedDependencies?: Record<string, Record<string, string>>;\n forcedHarmonyVersion?: string;\n excludeExtensionsDependencies?: boolean;\n dedupeInjectedDeps?: boolean;\n dependenciesGraph?: DependenciesGraph;\n};\n\nexport type GetComponentManifestsOptions = {\n componentDirectoryMap: ComponentMap<string>;\n rootPolicy: WorkspacePolicy;\n rootDir: string;\n resolveVersionsFromDependenciesOnly?: boolean;\n referenceLocalPackages?: boolean;\n includeAllEnvPeers?: boolean;\n hasRootComponents?: boolean;\n excludeExtensionsDependencies?: boolean;\n} & Pick<\n PackageManagerInstallOptions,\n 'dedupe' | 'dependencyFilterFn' | 'copyPeerToRuntimeOnComponents' | 'copyPeerToRuntimeOnRoot' | 'installPeersFromEnvs'\n>;\n\nexport type PreInstallSubscriber = (installer: DependencyInstaller, installArgs: InstallArgs) => Promise<void>;\nexport type PreInstallSubscriberList = Array<PreInstallSubscriber>;\n\nexport type PostInstallSubscriber = (installer: DependencyInstaller, installArgs: InstallArgs) => Promise<void>;\nexport type PostInstallSubscriberList = Array<PostInstallSubscriber>;\n\nexport class DependencyInstaller {\n constructor(\n /**\n * package manager instance.\n */\n private packageManager: PackageManager,\n\n private aspectLoader: AspectLoaderMain,\n\n private logger: Logger,\n\n private dependencyResolver: DependencyResolverMain,\n\n private rootDir?: string | PathAbsolute,\n\n private cacheRootDir?: string | PathAbsolute,\n\n private preInstallSubscriberList?: PreInstallSubscriberList,\n\n private postInstallSubscriberList?: PostInstallSubscriberList,\n\n private nodeLinker?: 'hoisted' | 'isolated',\n\n private packageImportMethod?: PackageImportMethod,\n\n private sideEffectsCache?: boolean,\n\n private nodeVersion?: string,\n\n private engineStrict?: boolean,\n\n private peerDependencyRules?: PeerDependencyRules,\n\n private neverBuiltDependencies?: string[],\n\n private allowScripts?: Record<string, boolean | 'warn'>,\n\n private dangerouslyAllowAllScripts?: boolean,\n\n private preferOffline?: boolean,\n\n private minimumReleaseAge?: number,\n\n private minimumReleaseAgeExclude?: string[],\n\n private installingContext: DepInstallerContext = {}\n ) {}\n\n async install(\n rootDir: string | undefined,\n rootPolicy: WorkspacePolicy,\n componentDirectoryMap: ComponentMap<string>,\n options: InstallOptions = DEFAULT_INSTALL_OPTIONS,\n packageManagerOptions: PackageManagerInstallOptions = DEFAULT_PM_INSTALL_OPTIONS\n ) {\n const finalRootDir = rootDir ?? this.rootDir;\n if (!finalRootDir) {\n throw new RootDirNotDefined();\n }\n const manifests = await this.getComponentManifests({\n ...packageManagerOptions,\n componentDirectoryMap,\n rootPolicy,\n rootDir: finalRootDir,\n resolveVersionsFromDependenciesOnly: options.resolveVersionsFromDependenciesOnly,\n referenceLocalPackages: packageManagerOptions.rootComponentsForCapsules,\n includeAllEnvPeers: packageManagerOptions.rootComponentsForCapsules,\n excludeExtensionsDependencies: options.excludeExtensionsDependencies,\n });\n return this.installComponents(\n finalRootDir,\n manifests,\n rootPolicy,\n componentDirectoryMap,\n options,\n packageManagerOptions\n );\n }\n\n async installComponents(\n rootDir: string | undefined,\n manifests: Record<string, ProjectManifest>,\n rootPolicy: WorkspacePolicy,\n componentDirectoryMap: ComponentMap<string>,\n options: InstallOptions = DEFAULT_INSTALL_OPTIONS,\n packageManagerOptions: PackageManagerInstallOptions = DEFAULT_PM_INSTALL_OPTIONS\n ): Promise<{ dependenciesChanged: boolean }> {\n const args = {\n componentDirectoryMap,\n options,\n packageManagerOptions,\n rootDir,\n rootPolicy,\n };\n await this.runPrePostSubscribers(this.preInstallSubscriberList, 'pre', args);\n const mainAspect: MainAspect = this.aspectLoader.mainAspect;\n const finalRootDir = rootDir || this.rootDir;\n if (!finalRootDir) {\n throw new RootDirNotDefined();\n }\n if (options.linkedDependencies) {\n manifests = JSON.parse(JSON.stringify(manifests));\n const linkedDependencies = JSON.parse(\n JSON.stringify(options.linkedDependencies)\n ) as typeof options.linkedDependencies;\n if (linkedDependencies[finalRootDir]) {\n if (options.forcedHarmonyVersion == null && manifests[finalRootDir].dependencies?.['@teambit/harmony']) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n delete manifests[finalRootDir].dependencies!['@teambit/harmony'];\n }\n const directDeps = new Set<string>();\n Object.values(manifests).forEach((manifest) => {\n for (const depName of Object.keys({ ...manifest.dependencies, ...manifest.devDependencies })) {\n directDeps.add(depName);\n }\n });\n for (const manifest of Object.values(manifests)) {\n if (manifest.name && directDeps.has(manifest.name)) {\n delete linkedDependencies[finalRootDir][manifest.name];\n }\n }\n }\n Object.entries(linkedDependencies).forEach(([dir, linkedDeps]) => {\n if (!manifests[dir]) {\n manifests[dir] = {};\n }\n manifests[dir].dependencies = {\n ...linkedDeps,\n ...manifests[dir].dependencies,\n };\n });\n }\n const isJsonCmd = process.argv.includes('--json') || process.argv.includes('-j');\n const hidePackageManagerOutput =\n Boolean(this.installingContext.inCapsule && process.env.VERBOSE_PM_OUTPUT !== 'true') || isJsonCmd;\n\n // Make sure to take other default if passed options with only one option\n const calculatedPmOpts = {\n ...DEFAULT_PM_INSTALL_OPTIONS,\n cacheRootDir: this.cacheRootDir,\n nodeLinker: this.nodeLinker,\n packageImportMethod: this.packageImportMethod,\n minimumReleaseAge: this.minimumReleaseAge,\n minimumReleaseAgeExclude: this.minimumReleaseAgeExclude,\n sideEffectsCache: this.sideEffectsCache,\n nodeVersion: this.nodeVersion,\n engineStrict: this.engineStrict,\n packageManagerConfigRootDir: options.packageManagerConfigRootDir,\n peerDependencyRules: this.peerDependencyRules,\n hidePackageManagerOutput,\n neverBuiltDependencies: this.neverBuiltDependencies,\n allowScripts: this.allowScripts,\n dangerouslyAllowAllScripts: this.dangerouslyAllowAllScripts,\n preferOffline: this.preferOffline,\n dedupeInjectedDeps: options.dedupeInjectedDeps,\n dependenciesGraph: options.dependenciesGraph,\n forcedHarmonyVersion: options.forcedHarmonyVersion,\n ...packageManagerOptions,\n };\n if (options.installTeambitBit) {\n if (!mainAspect.version || !mainAspect.packageName) {\n throw new MainAspectNotInstallable();\n }\n const version = mainAspect.version;\n rootPolicy.add({\n dependencyId: mainAspect.packageName,\n lifecycleType: 'runtime',\n value: {\n version,\n },\n });\n }\n\n if (!packageManagerOptions.rootComponents && !packageManagerOptions.keepExistingModulesDir) {\n try {\n // Remove node modules dir for all components dirs, since it might contain left overs from previous install.\n //\n // This is not needed when \"rootComponents\" are used, as in that case the package manager handles the node_modules\n // and it never leaves node_modules in a broken state.\n // Removing node_modules in that case would delete useful state information that is used by Yarn or pnpm.\n await this.cleanCompsNodeModules(componentDirectoryMap);\n } catch (err) {\n this.logger.debug('failed to remove node_modules directories from components', err);\n // A failure to remove the node_modules directory should not cause the process to fail\n }\n }\n\n const messagePrefix = 'running package installation';\n const messageSuffix = `using ${this.packageManager.name}`;\n const message = this.installingContext?.inCapsule\n ? `(capsule) ${messagePrefix} in root dir ${this.rootDir} ${messageSuffix}`\n : `${messagePrefix} ${messageSuffix}`;\n if (!hidePackageManagerOutput) {\n this.logger.setStatusLine(message);\n }\n const startTime = process.hrtime();\n\n // TODO: the cache should be probably passed to the package manager constructor not to the install function\n const installResult = await this.packageManager.install(\n {\n rootDir: finalRootDir,\n manifests,\n componentDirectoryMap,\n },\n calculatedPmOpts\n );\n if (!hidePackageManagerOutput) {\n this.logger.consoleSuccess(`done ${message}`, startTime);\n }\n await this.runPrePostSubscribers(this.postInstallSubscriberList, 'post', args);\n return installResult;\n }\n\n public async pruneModules(rootDir: string): Promise<void> {\n if (!this.packageManager.pruneModules) {\n return;\n }\n await this.packageManager.pruneModules(rootDir);\n }\n\n /**\n * Compute all the component manifests (a.k.a. package.json files) that should be passed to the package manager\n * in order to install the dependencies.\n */\n public async getComponentManifests({\n componentDirectoryMap,\n rootPolicy,\n rootDir,\n dedupe,\n dependencyFilterFn,\n copyPeerToRuntimeOnComponents,\n copyPeerToRuntimeOnRoot,\n installPeersFromEnvs,\n resolveVersionsFromDependenciesOnly,\n referenceLocalPackages,\n includeAllEnvPeers,\n hasRootComponents,\n excludeExtensionsDependencies,\n }: GetComponentManifestsOptions) {\n const options: CreateFromComponentsOptions = {\n filterComponentsFromManifests: true,\n createManifestForComponentsWithoutDependencies: true,\n dedupe,\n dependencyFilterFn,\n resolveVersionsFromDependenciesOnly,\n referenceLocalPackages,\n includeAllEnvPeers,\n hasRootComponents,\n excludeExtensionsDependencies,\n };\n const workspaceManifest = await this.dependencyResolver.getWorkspaceManifest(\n undefined,\n undefined,\n rootPolicy,\n rootDir,\n componentDirectoryMap.components,\n options,\n this.installingContext\n );\n const manifests: Record<string, ProjectManifest> = componentDirectoryMap\n .toArray()\n .reduce((acc, [component, dir]) => {\n const packageName = this.dependencyResolver.getPackageName(component);\n const manifest = workspaceManifest.componentsManifestsMap.get(packageName);\n if (manifest) {\n acc[dir] = manifest.toJson({ copyPeerToRuntime: copyPeerToRuntimeOnComponents });\n }\n return acc;\n }, {});\n if (!manifests[rootDir]) {\n manifests[rootDir] = workspaceManifest.toJson({\n copyPeerToRuntime: copyPeerToRuntimeOnRoot,\n installPeersFromEnvs,\n });\n }\n return manifests;\n }\n\n private async cleanCompsNodeModules(componentDirectoryMap: ComponentMap<string>) {\n const promises = componentDirectoryMap.toArray().map(([, dir]) => {\n const nmDir = path.join(dir, 'node_modules');\n return fs.remove(nmDir);\n });\n return Promise.all(promises);\n }\n\n private async runPrePostSubscribers(\n subscribers: PreInstallSubscriberList | PostInstallSubscriberList = [],\n type: 'pre' | 'post',\n args: InstallArgs\n ): Promise<void> {\n const message = this.installingContext?.inCapsule\n ? `(capsule) running ${type} install subscribers in root dir ${this.rootDir}`\n : `running ${type} install subscribers`;\n if (!this.installingContext?.inCapsule) {\n this.logger.setStatusLine(message);\n }\n await mapSeries(subscribers, async (subscriber) => {\n return subscriber(this, args);\n });\n if (!this.installingContext?.inCapsule) {\n this.logger.consoleSuccess(message);\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAK,YAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2E,SAAAC,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAA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D,MAAM,CAACoF,cAAc,CAACL,OAAO,CAAC;IACrC;EACF;AACF;AAACqC,OAAA,CAAAxH,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_path","_fsExtra","_exceptions","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DEFAULT_PM_INSTALL_OPTIONS","dedupe","copyPeerToRuntimeOnRoot","copyPeerToRuntimeOnComponents","installPeersFromEnvs","DEFAULT_INSTALL_OPTIONS","installTeambitBit","excludeExtensionsDependencies","DependencyInstaller","constructor","packageManager","aspectLoader","logger","dependencyResolver","rootDir","cacheRootDir","preInstallSubscriberList","postInstallSubscriberList","nodeLinker","packageImportMethod","sideEffectsCache","nodeVersion","engineStrict","peerDependencyRules","neverBuiltDependencies","allowScripts","dangerouslyAllowAllScripts","preferOffline","minimumReleaseAge","minimumReleaseAgeExclude","installingContext","install","rootPolicy","componentDirectoryMap","options","packageManagerOptions","finalRootDir","RootDirNotDefined","manifests","getComponentManifests","resolveVersionsFromDependenciesOnly","referenceLocalPackages","rootComponentsForCapsules","includeAllEnvPeers","installComponents","args","runPrePostSubscribers","mainAspect","linkedDependencies","JSON","parse","stringify","forcedHarmonyVersion","dependencies","directDeps","Set","values","manifest","depName","devDependencies","add","name","has","entries","dir","linkedDeps","isJsonCmd","process","argv","includes","hidePackageManagerOutput","Boolean","inCapsule","env","VERBOSE_PM_OUTPUT","calculatedPmOpts","packageManagerConfigRootDir","dedupeInjectedDeps","dependenciesGraph","version","packageName","MainAspectNotInstallable","dependencyId","lifecycleType","rootComponents","keepExistingModulesDir","cleanCompsNodeModules","err","debug","messagePrefix","messageSuffix","message","setStatusLine","startTime","hrtime","installResult","consoleSuccess","pruneModules","dependencyFilterFn","resolveEnvPeersFromRoot","hasRootComponents","filterComponentsFromManifests","createManifestForComponentsWithoutDependencies","workspaceManifest","getWorkspaceManifest","undefined","components","toArray","reduce","acc","component","getPackageName","componentsManifestsMap","get","toJson","copyPeerToRuntime","peerOverrides","promises","map","nmDir","path","join","fs","remove","Promise","all","subscribers","type","mapSeries","subscriber","exports"],"sources":["dependency-installer.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport path from 'path';\nimport fs from 'fs-extra';\nimport type { MainAspect, AspectLoaderMain } from '@teambit/aspect-loader';\nimport type { ComponentMap } from '@teambit/component';\nimport { type DependenciesGraph } from '@teambit/objects';\nimport type { Logger } from '@teambit/logger';\nimport type { PathAbsolute } from '@teambit/toolbox.path.path';\nimport type { PeerDependencyRules, ProjectManifest } from '@pnpm/types';\nimport { MainAspectNotInstallable, RootDirNotDefined } from './exceptions';\nimport type { PackageManager, PackageManagerInstallOptions, PackageImportMethod } from './package-manager';\nimport type { WorkspacePolicy } from './policy';\nimport type { CreateFromComponentsOptions } from './manifest';\nimport type { DependencyResolverMain } from './dependency-resolver.main.runtime';\n\nconst DEFAULT_PM_INSTALL_OPTIONS: PackageManagerInstallOptions = {\n dedupe: true,\n copyPeerToRuntimeOnRoot: true,\n copyPeerToRuntimeOnComponents: false,\n installPeersFromEnvs: false,\n};\n\nconst DEFAULT_INSTALL_OPTIONS: InstallOptions = {\n installTeambitBit: false,\n excludeExtensionsDependencies: false,\n};\n\nexport type DepInstallerContext = {\n inCapsule?: boolean;\n};\n\nexport type InstallArgs = {\n rootDir: string | undefined;\n rootPolicy: WorkspacePolicy;\n componentDirectoryMap: ComponentMap<string>;\n options: InstallOptions;\n packageManagerOptions: PackageManagerInstallOptions;\n};\n\nexport type InstallOptions = {\n installTeambitBit: boolean;\n packageManagerConfigRootDir?: string;\n resolveVersionsFromDependenciesOnly?: boolean;\n linkedDependencies?: Record<string, Record<string, string>>;\n forcedHarmonyVersion?: string;\n excludeExtensionsDependencies?: boolean;\n dedupeInjectedDeps?: boolean;\n dependenciesGraph?: DependenciesGraph;\n};\n\nexport type GetComponentManifestsOptions = {\n componentDirectoryMap: ComponentMap<string>;\n rootPolicy: WorkspacePolicy;\n rootDir: string;\n resolveVersionsFromDependenciesOnly?: boolean;\n referenceLocalPackages?: boolean;\n includeAllEnvPeers?: boolean;\n hasRootComponents?: boolean;\n excludeExtensionsDependencies?: boolean;\n} & Pick<\n PackageManagerInstallOptions,\n | 'dedupe'\n | 'dependencyFilterFn'\n | 'copyPeerToRuntimeOnComponents'\n | 'copyPeerToRuntimeOnRoot'\n | 'installPeersFromEnvs'\n | 'resolveEnvPeersFromRoot'\n>;\n\nexport type PreInstallSubscriber = (installer: DependencyInstaller, installArgs: InstallArgs) => Promise<void>;\nexport type PreInstallSubscriberList = Array<PreInstallSubscriber>;\n\nexport type PostInstallSubscriber = (installer: DependencyInstaller, installArgs: InstallArgs) => Promise<void>;\nexport type PostInstallSubscriberList = Array<PostInstallSubscriber>;\n\nexport class DependencyInstaller {\n constructor(\n /**\n * package manager instance.\n */\n private packageManager: PackageManager,\n\n private aspectLoader: AspectLoaderMain,\n\n private logger: Logger,\n\n private dependencyResolver: DependencyResolverMain,\n\n private rootDir?: string | PathAbsolute,\n\n private cacheRootDir?: string | PathAbsolute,\n\n private preInstallSubscriberList?: PreInstallSubscriberList,\n\n private postInstallSubscriberList?: PostInstallSubscriberList,\n\n private nodeLinker?: 'hoisted' | 'isolated',\n\n private packageImportMethod?: PackageImportMethod,\n\n private sideEffectsCache?: boolean,\n\n private nodeVersion?: string,\n\n private engineStrict?: boolean,\n\n private peerDependencyRules?: PeerDependencyRules,\n\n private neverBuiltDependencies?: string[],\n\n private allowScripts?: Record<string, boolean | 'warn'>,\n\n private dangerouslyAllowAllScripts?: boolean,\n\n private preferOffline?: boolean,\n\n private minimumReleaseAge?: number,\n\n private minimumReleaseAgeExclude?: string[],\n\n private installingContext: DepInstallerContext = {}\n ) {}\n\n async install(\n rootDir: string | undefined,\n rootPolicy: WorkspacePolicy,\n componentDirectoryMap: ComponentMap<string>,\n options: InstallOptions = DEFAULT_INSTALL_OPTIONS,\n packageManagerOptions: PackageManagerInstallOptions = DEFAULT_PM_INSTALL_OPTIONS\n ) {\n const finalRootDir = rootDir ?? this.rootDir;\n if (!finalRootDir) {\n throw new RootDirNotDefined();\n }\n const { manifests } = await this.getComponentManifests({\n ...packageManagerOptions,\n componentDirectoryMap,\n rootPolicy,\n rootDir: finalRootDir,\n resolveVersionsFromDependenciesOnly: options.resolveVersionsFromDependenciesOnly,\n referenceLocalPackages: packageManagerOptions.rootComponentsForCapsules,\n includeAllEnvPeers: packageManagerOptions.rootComponentsForCapsules,\n excludeExtensionsDependencies: options.excludeExtensionsDependencies,\n });\n return this.installComponents(\n finalRootDir,\n manifests,\n rootPolicy,\n componentDirectoryMap,\n options,\n packageManagerOptions\n );\n }\n\n async installComponents(\n rootDir: string | undefined,\n manifests: Record<string, ProjectManifest>,\n rootPolicy: WorkspacePolicy,\n componentDirectoryMap: ComponentMap<string>,\n options: InstallOptions = DEFAULT_INSTALL_OPTIONS,\n packageManagerOptions: PackageManagerInstallOptions = DEFAULT_PM_INSTALL_OPTIONS\n ): Promise<{ dependenciesChanged: boolean }> {\n const args = {\n componentDirectoryMap,\n options,\n packageManagerOptions,\n rootDir,\n rootPolicy,\n };\n await this.runPrePostSubscribers(this.preInstallSubscriberList, 'pre', args);\n const mainAspect: MainAspect = this.aspectLoader.mainAspect;\n const finalRootDir = rootDir || this.rootDir;\n if (!finalRootDir) {\n throw new RootDirNotDefined();\n }\n if (options.linkedDependencies) {\n manifests = JSON.parse(JSON.stringify(manifests));\n const linkedDependencies = JSON.parse(\n JSON.stringify(options.linkedDependencies)\n ) as typeof options.linkedDependencies;\n if (linkedDependencies[finalRootDir]) {\n if (options.forcedHarmonyVersion == null && manifests[finalRootDir].dependencies?.['@teambit/harmony']) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n delete manifests[finalRootDir].dependencies!['@teambit/harmony'];\n }\n const directDeps = new Set<string>();\n Object.values(manifests).forEach((manifest) => {\n for (const depName of Object.keys({ ...manifest.dependencies, ...manifest.devDependencies })) {\n directDeps.add(depName);\n }\n });\n for (const manifest of Object.values(manifests)) {\n if (manifest.name && directDeps.has(manifest.name)) {\n delete linkedDependencies[finalRootDir][manifest.name];\n }\n }\n }\n Object.entries(linkedDependencies).forEach(([dir, linkedDeps]) => {\n if (!manifests[dir]) {\n manifests[dir] = {};\n }\n manifests[dir].dependencies = {\n ...linkedDeps,\n ...manifests[dir].dependencies,\n };\n });\n }\n const isJsonCmd = process.argv.includes('--json') || process.argv.includes('-j');\n const hidePackageManagerOutput =\n Boolean(this.installingContext.inCapsule && process.env.VERBOSE_PM_OUTPUT !== 'true') || isJsonCmd;\n\n // Make sure to take other default if passed options with only one option\n const calculatedPmOpts = {\n ...DEFAULT_PM_INSTALL_OPTIONS,\n cacheRootDir: this.cacheRootDir,\n nodeLinker: this.nodeLinker,\n packageImportMethod: this.packageImportMethod,\n minimumReleaseAge: this.minimumReleaseAge,\n minimumReleaseAgeExclude: this.minimumReleaseAgeExclude,\n sideEffectsCache: this.sideEffectsCache,\n nodeVersion: this.nodeVersion,\n engineStrict: this.engineStrict,\n packageManagerConfigRootDir: options.packageManagerConfigRootDir,\n peerDependencyRules: this.peerDependencyRules,\n hidePackageManagerOutput,\n neverBuiltDependencies: this.neverBuiltDependencies,\n allowScripts: this.allowScripts,\n dangerouslyAllowAllScripts: this.dangerouslyAllowAllScripts,\n preferOffline: this.preferOffline,\n dedupeInjectedDeps: options.dedupeInjectedDeps,\n dependenciesGraph: options.dependenciesGraph,\n forcedHarmonyVersion: options.forcedHarmonyVersion,\n ...packageManagerOptions,\n };\n if (options.installTeambitBit) {\n if (!mainAspect.version || !mainAspect.packageName) {\n throw new MainAspectNotInstallable();\n }\n const version = mainAspect.version;\n rootPolicy.add({\n dependencyId: mainAspect.packageName,\n lifecycleType: 'runtime',\n value: {\n version,\n },\n });\n }\n\n if (!packageManagerOptions.rootComponents && !packageManagerOptions.keepExistingModulesDir) {\n try {\n // Remove node modules dir for all components dirs, since it might contain left overs from previous install.\n //\n // This is not needed when \"rootComponents\" are used, as in that case the package manager handles the node_modules\n // and it never leaves node_modules in a broken state.\n // Removing node_modules in that case would delete useful state information that is used by Yarn or pnpm.\n await this.cleanCompsNodeModules(componentDirectoryMap);\n } catch (err) {\n this.logger.debug('failed to remove node_modules directories from components', err);\n // A failure to remove the node_modules directory should not cause the process to fail\n }\n }\n\n const messagePrefix = 'running package installation';\n const messageSuffix = `using ${this.packageManager.name}`;\n const message = this.installingContext?.inCapsule\n ? `(capsule) ${messagePrefix} in root dir ${this.rootDir} ${messageSuffix}`\n : `${messagePrefix} ${messageSuffix}`;\n if (!hidePackageManagerOutput) {\n this.logger.setStatusLine(message);\n }\n const startTime = process.hrtime();\n\n // TODO: the cache should be probably passed to the package manager constructor not to the install function\n const installResult = await this.packageManager.install(\n {\n rootDir: finalRootDir,\n manifests,\n componentDirectoryMap,\n },\n calculatedPmOpts\n );\n if (!hidePackageManagerOutput) {\n this.logger.consoleSuccess(`done ${message}`, startTime);\n }\n await this.runPrePostSubscribers(this.postInstallSubscriberList, 'post', args);\n return installResult;\n }\n\n public async pruneModules(rootDir: string): Promise<void> {\n if (!this.packageManager.pruneModules) {\n return;\n }\n await this.packageManager.pruneModules(rootDir);\n }\n\n /**\n * Compute all the component manifests (a.k.a. package.json files) that should be passed to the package manager\n * in order to install the dependencies.\n */\n public async getComponentManifests({\n componentDirectoryMap,\n rootPolicy,\n rootDir,\n dedupe,\n dependencyFilterFn,\n copyPeerToRuntimeOnComponents,\n copyPeerToRuntimeOnRoot,\n installPeersFromEnvs,\n resolveEnvPeersFromRoot,\n resolveVersionsFromDependenciesOnly,\n referenceLocalPackages,\n includeAllEnvPeers,\n hasRootComponents,\n excludeExtensionsDependencies,\n }: GetComponentManifestsOptions): Promise<{\n manifests: Record<string, ProjectManifest>;\n peerOverrides: Record<string, string>;\n }> {\n const options: CreateFromComponentsOptions = {\n filterComponentsFromManifests: true,\n createManifestForComponentsWithoutDependencies: true,\n dedupe,\n dependencyFilterFn,\n resolveVersionsFromDependenciesOnly,\n referenceLocalPackages,\n includeAllEnvPeers,\n hasRootComponents,\n excludeExtensionsDependencies,\n };\n const workspaceManifest = await this.dependencyResolver.getWorkspaceManifest(\n undefined,\n undefined,\n rootPolicy,\n rootDir,\n componentDirectoryMap.components,\n options,\n this.installingContext\n );\n const manifests: Record<string, ProjectManifest> = componentDirectoryMap\n .toArray()\n .reduce((acc, [component, dir]) => {\n const packageName = this.dependencyResolver.getPackageName(component);\n const manifest = workspaceManifest.componentsManifestsMap.get(packageName);\n if (manifest) {\n acc[dir] = manifest.toJson({ copyPeerToRuntime: copyPeerToRuntimeOnComponents });\n }\n return acc;\n }, {});\n if (!manifests[rootDir]) {\n manifests[rootDir] = workspaceManifest.toJson({\n copyPeerToRuntime: copyPeerToRuntimeOnRoot,\n installPeersFromEnvs,\n resolveEnvPeersFromRoot,\n });\n }\n return { manifests, peerOverrides: workspaceManifest.peerOverrides };\n }\n\n private async cleanCompsNodeModules(componentDirectoryMap: ComponentMap<string>) {\n const promises = componentDirectoryMap.toArray().map(([, dir]) => {\n const nmDir = path.join(dir, 'node_modules');\n return fs.remove(nmDir);\n });\n return Promise.all(promises);\n }\n\n private async runPrePostSubscribers(\n subscribers: PreInstallSubscriberList | PostInstallSubscriberList = [],\n type: 'pre' | 'post',\n args: InstallArgs\n ): Promise<void> {\n const message = this.installingContext?.inCapsule\n ? `(capsule) running ${type} install subscribers in root dir ${this.rootDir}`\n : `running ${type} install subscribers`;\n if (!this.installingContext?.inCapsule) {\n this.logger.setStatusLine(message);\n }\n await mapSeries(subscribers, async (subscriber) => {\n return subscriber(this, args);\n });\n if (!this.installingContext?.inCapsule) {\n this.logger.consoleSuccess(message);\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAA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,GAAG,EAAE,cAAc,CAAC;MAC5C,OAAO0D,kBAAE,CAACC,MAAM,CAACJ,KAAK,CAAC;IACzB,CAAC,CAAC;IACF,OAAOK,OAAO,CAACC,GAAG,CAACR,QAAQ,CAAC;EAC9B;EAEA,MAAcvE,qBAAqBA,CACjCgF,WAAiE,GAAG,EAAE,EACtEC,IAAoB,EACpBlF,IAAiB,EACF;IACf,MAAM8C,OAAO,GAAG,IAAI,CAAC7D,iBAAiB,EAAE0C,SAAS,GAC7C,qBAAqBuD,IAAI,oCAAoC,IAAI,CAACjH,OAAO,EAAE,GAC3E,WAAWiH,IAAI,sBAAsB;IACzC,IAAI,CAAC,IAAI,CAACjG,iBAAiB,EAAE0C,SAAS,EAAE;MACtC,IAAI,CAAC5D,MAAM,CAACgF,aAAa,CAACD,OAAO,CAAC;IACpC;IACA,MAAM,IAAAqC,qBAAS,EAACF,WAAW,EAAE,MAAOG,UAAU,IAAK;MACjD,OAAOA,UAAU,CAAC,IAAI,EAAEpF,IAAI,CAAC;IAC/B,CAAC,CAAC;IACF,IAAI,CAAC,IAAI,CAACf,iBAAiB,EAAE0C,SAAS,EAAE;MACtC,IAAI,CAAC5D,MAAM,CAACoF,cAAc,CAACL,OAAO,CAAC;IACrC;EACF;AACF;AAACuC,OAAA,CAAA1H,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -119,6 +119,23 @@ export interface DependencyResolverWorkspaceConfig {
|
|
|
119
119
|
* Tells pnpm to automatically install peer dependencies. It is true by default.
|
|
120
120
|
*/
|
|
121
121
|
autoInstallPeers?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* When true (default), env peer dependencies defined in env.jsonc are resolved once and merged
|
|
124
|
+
* into the workspace root manifest as regular dependencies, instead of being injected into each
|
|
125
|
+
* component's manifest individually. Conflicts between envs are resolved by picking the version
|
|
126
|
+
* that satisfies the most envs, with a warning logged for any conflicts.
|
|
127
|
+
* Set to false to revert to the legacy per-component env peer injection behavior.
|
|
128
|
+
*/
|
|
129
|
+
resolveEnvPeersFromRoot?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* When true, ALL env peer dependencies are forced to the workspace root manifest,
|
|
132
|
+
* even when different envs specify conflicting versions. The best version is chosen
|
|
133
|
+
* (satisfying the most envs) and a warning is logged for unsatisfied envs.
|
|
134
|
+
* When false (default), conflicting peers without `workspaceSingleton` are injected
|
|
135
|
+
* per-component, allowing different envs to use different versions.
|
|
136
|
+
* Only applies when resolveEnvPeersFromRoot is true.
|
|
137
|
+
*/
|
|
138
|
+
forceEnvPeersToRoot?: boolean;
|
|
122
139
|
/**
|
|
123
140
|
* By default, Bit saves component dependencies with exact versions (pinned) in the package.json,
|
|
124
141
|
* even if the dependency-resolver policy specifies a version range.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["dependency-resolver-workspace-config.ts"],"sourcesContent":["import type { PeerDependencyRules } from '@pnpm/types';\nimport type { WorkspacePolicyConfigObject } from './policy';\nimport type { PackageImportMethod } from './package-manager';\n\nexport type NodeLinker = 'hoisted' | 'isolated';\n\nexport type ComponentRangePrefix = '~' | '^' | '+' | '-';\n\nexport interface DependencyResolverWorkspaceConfig {\n policy: WorkspacePolicyConfigObject;\n /**\n * choose the package manager for Bit to use. you can choose between 'npm', 'yarn', 'pnpm'\n * and 'librarian'. our recommendation is use 'librarian' which reduces package duplicates\n * and totally removes the need of a 'node_modules' directory in your project.\n */\n packageManager?: string;\n\n /**\n * A proxy server for out going network requests by the package manager\n * Used for both http and https requests (unless the httpsProxy is defined)\n */\n proxy?: string;\n\n /**\n * A proxy server for outgoing https requests by the package manager (fallback to proxy server if not defined)\n * Use this in case you want different proxy for http and https requests.\n */\n httpsProxy?: string;\n\n /**\n * A path to a file containing one or multiple Certificate Authority signing certificates.\n * allows for multiple CA's, as well as for the CA information to be stored in a file on disk.\n */\n ca?: string;\n\n /**\n * Whether or not to do SSL key validation when making requests to the registry via https\n */\n strictSsl?: string;\n\n /**\n * A client certificate to pass when accessing the registry. Values should be in PEM format (Windows calls it \"Base-64 encoded X.509 (.CER)\") with newlines replaced by the string \"\\n\". For example:\n * cert=\"----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE----\"\n * It is not the path to a certificate file (and there is no \"certfile\" option).\n */\n cert?: string;\n\n /**\n * A client key to pass when accessing the registry. Values should be in PEM format with newlines replaced by the string \"\\n\". For example:\n * key=\"----BEGIN PRIVATE KEY-----\\nXXXX\\nXXXX\\n-----END PRIVATE KEY----\"\n * It is not the path to a key file (and there is no \"keyfile\" option).\n */\n key?: string;\n\n /**\n * A comma-separated string of domain extensions that a proxy should not be used for.\n */\n noProxy?: string;\n\n /**\n * The IP address of the local interface to use when making connections to the npm registry.\n */\n localAddress?: string;\n\n /**\n * How many times to retry if Bit fails to fetch from the registry.\n */\n fetchRetries?: number;\n\n /*\n * The exponential factor for retry backoff.\n */\n fetchRetryFactor?: number;\n\n /*\n * The minimum (base) timeout for retrying requests.\n */\n fetchRetryMintimeout?: number;\n\n /*\n * The maximum fallback timeout to ensure the retry factor does not make requests too long.\n */\n fetchRetryMaxtimeout?: number;\n\n /*\n * The maximum amount of time (in milliseconds) to wait for HTTP requests to complete.\n */\n fetchTimeout?: number;\n\n /*\n * The maximum number of connections to use per origin (protocol/host/port combination).\n */\n maxSockets?: number;\n\n /*\n * Controls the maximum number of HTTP(S) requests to process simultaneously.\n */\n networkConcurrency?: number;\n\n /*\n * Set the prefix to use when adding dependency to workspace.jsonc via bit install\n * to lock version to exact version you can use empty string (default)\n */\n savePrefix?: string;\n\n /*\n * in case you want to disable this proxy set this config to false\n *\n */\n installFromBitDevRegistry?: boolean;\n\n /*\n * map of extra arguments to pass to the configured package manager upon the installation\n * of dependencies.\n */\n packageManagerArgs?: string[];\n\n /*\n * This field allows to instruct the package manager to override any dependency in the dependency graph.\n * This is useful to enforce all your packages to use a single version of a dependency, backport a fix,\n * or replace a dependency with a fork.\n */\n overrides?: Record<string, string>;\n\n /**\n * This is similar to overrides, but will only affect installation in capsules.\n * In case overrides is configured and this not, the regular overrides will affect capsules as well.\n * in case both configured, capsulesOverrides will be used for capsules, and overrides will affect the workspace.\n */\n capsulesOverrides?: Record<string, string>;\n\n /*\n * Defines what linker should be used for installing Node.js packages.\n * Supported values are hoisted and isolated.\n */\n nodeLinker?: NodeLinker;\n\n /*\n * Controls the way packages are imported from the store.\n */\n packageImportMethod?: PackageImportMethod;\n\n /*\n * Use and cache the results of (pre/post)install hooks.\n */\n sideEffectsCache?: boolean;\n\n /*\n * The list of components that should be installed in isolation from the workspace.\n * The component's package names should be used in this list, not their component IDs.\n */\n rootComponents?: boolean;\n\n /*\n * The node version to use when checking a package's engines setting.\n */\n nodeVersion?: string;\n\n /*\n * Refuse to install any package that claims to not be compatible with the current Node.js version.\n */\n engineStrict?: boolean;\n\n /*\n * Rules to mute specific peer dependeny warnings.\n */\n peerDependencyRules?: PeerDependencyRules;\n\n /*\n * This setting is \"true\" by default and tells bit to link core aspects to the node_modules of the workspace.\n * It only makes sense to set this to \"false\" in a workspace in which core aspects are actually developed.\n */\n linkCoreAspects?: boolean;\n\n /**\n * When false, Bit will create a shared node_modules directory for all components in a capsule.\n */\n isolatedCapsules?: boolean;\n\n /**\n * Ignore the builds of specific dependencies. The \"preinstall\", \"install\", and \"postinstall\" scripts\n * of the listed packages will not be executed during installation.\n */\n neverBuiltDependencies?: string[];\n\n /**\n * Fine-grained control over dependency lifecycle scripts. Allows explicitly permitting (true), blocking (false), or warning ('warn')\n * for specific dependencies' \"preinstall\", \"install\", and \"postinstall\" scripts during installation.\n */\n allowScripts?: Record<string, boolean | 'warn'>;\n\n /**\n * Set this to true in order to allow all dependencies to run install scripts.\n */\n dangerouslyAllowAllScripts?: boolean;\n\n /**\n * If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server.\n */\n preferOffline?: boolean;\n\n /**\n * When true, components in capsules are symlinked into their own node_modules.\n */\n capsuleSelfReference?: boolean;\n\n /**\n * Tells pnpm which packages should be hoisted to node_modules/.pnpm/node_modules.\n * By default, all packages are hoisted - however, if you know that only some flawed packages have phantom dependencies,\n * you can use this option to exclusively hoist the phantom dependencies (recommended).\n */\n hoistPatterns?: string[];\n\n /**\n * When true, dependencies from the workspace are hoisted to node_modules/.pnpm/node_modules\n * even if they are found in the root node_modules\n */\n hoistInjectedDependencies?: boolean;\n\n /**\n * Tells pnpm to automatically install peer dependencies. It is true by default.\n */\n autoInstallPeers?: boolean;\n\n /**\n * By default, Bit saves component dependencies with exact versions (pinned) in the package.json,\n * even if the dependency-resolver policy specifies a version range.\n *\n * To preserve the range defined in the policy, set this value to \"+\".\n * To apply a predefined range (\"~\" or \"^\") to other component dependencies not covered by the policy,\n * set this to the desired range symbol.\n */\n componentRangePrefix?: ComponentRangePrefix;\n\n externalPackageManager?: boolean;\n\n /**\n * Defines the minimum number of minutes that must pass after a version is published before pnpm will install it.\n * This applies to all dependencies, including transitive ones.\n */\n minimumReleaseAge?: number;\n\n /**\n * If you set minimumReleaseAge but need certain dependencies to always install the newest version immediately,\n * you can list them under minimumReleaseAgeExclude. The exclusion works by package name or package name pattern\n * and applies to all versions of that package.\n */\n minimumReleaseAgeExclude?: string[];\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["dependency-resolver-workspace-config.ts"],"sourcesContent":["import type { PeerDependencyRules } from '@pnpm/types';\nimport type { WorkspacePolicyConfigObject } from './policy';\nimport type { PackageImportMethod } from './package-manager';\n\nexport type NodeLinker = 'hoisted' | 'isolated';\n\nexport type ComponentRangePrefix = '~' | '^' | '+' | '-';\n\nexport interface DependencyResolverWorkspaceConfig {\n policy: WorkspacePolicyConfigObject;\n /**\n * choose the package manager for Bit to use. you can choose between 'npm', 'yarn', 'pnpm'\n * and 'librarian'. our recommendation is use 'librarian' which reduces package duplicates\n * and totally removes the need of a 'node_modules' directory in your project.\n */\n packageManager?: string;\n\n /**\n * A proxy server for out going network requests by the package manager\n * Used for both http and https requests (unless the httpsProxy is defined)\n */\n proxy?: string;\n\n /**\n * A proxy server for outgoing https requests by the package manager (fallback to proxy server if not defined)\n * Use this in case you want different proxy for http and https requests.\n */\n httpsProxy?: string;\n\n /**\n * A path to a file containing one or multiple Certificate Authority signing certificates.\n * allows for multiple CA's, as well as for the CA information to be stored in a file on disk.\n */\n ca?: string;\n\n /**\n * Whether or not to do SSL key validation when making requests to the registry via https\n */\n strictSsl?: string;\n\n /**\n * A client certificate to pass when accessing the registry. Values should be in PEM format (Windows calls it \"Base-64 encoded X.509 (.CER)\") with newlines replaced by the string \"\\n\". For example:\n * cert=\"----BEGIN CERTIFICATE-----\\nXXXX\\nXXXX\\n-----END CERTIFICATE----\"\n * It is not the path to a certificate file (and there is no \"certfile\" option).\n */\n cert?: string;\n\n /**\n * A client key to pass when accessing the registry. Values should be in PEM format with newlines replaced by the string \"\\n\". For example:\n * key=\"----BEGIN PRIVATE KEY-----\\nXXXX\\nXXXX\\n-----END PRIVATE KEY----\"\n * It is not the path to a key file (and there is no \"keyfile\" option).\n */\n key?: string;\n\n /**\n * A comma-separated string of domain extensions that a proxy should not be used for.\n */\n noProxy?: string;\n\n /**\n * The IP address of the local interface to use when making connections to the npm registry.\n */\n localAddress?: string;\n\n /**\n * How many times to retry if Bit fails to fetch from the registry.\n */\n fetchRetries?: number;\n\n /*\n * The exponential factor for retry backoff.\n */\n fetchRetryFactor?: number;\n\n /*\n * The minimum (base) timeout for retrying requests.\n */\n fetchRetryMintimeout?: number;\n\n /*\n * The maximum fallback timeout to ensure the retry factor does not make requests too long.\n */\n fetchRetryMaxtimeout?: number;\n\n /*\n * The maximum amount of time (in milliseconds) to wait for HTTP requests to complete.\n */\n fetchTimeout?: number;\n\n /*\n * The maximum number of connections to use per origin (protocol/host/port combination).\n */\n maxSockets?: number;\n\n /*\n * Controls the maximum number of HTTP(S) requests to process simultaneously.\n */\n networkConcurrency?: number;\n\n /*\n * Set the prefix to use when adding dependency to workspace.jsonc via bit install\n * to lock version to exact version you can use empty string (default)\n */\n savePrefix?: string;\n\n /*\n * in case you want to disable this proxy set this config to false\n *\n */\n installFromBitDevRegistry?: boolean;\n\n /*\n * map of extra arguments to pass to the configured package manager upon the installation\n * of dependencies.\n */\n packageManagerArgs?: string[];\n\n /*\n * This field allows to instruct the package manager to override any dependency in the dependency graph.\n * This is useful to enforce all your packages to use a single version of a dependency, backport a fix,\n * or replace a dependency with a fork.\n */\n overrides?: Record<string, string>;\n\n /**\n * This is similar to overrides, but will only affect installation in capsules.\n * In case overrides is configured and this not, the regular overrides will affect capsules as well.\n * in case both configured, capsulesOverrides will be used for capsules, and overrides will affect the workspace.\n */\n capsulesOverrides?: Record<string, string>;\n\n /*\n * Defines what linker should be used for installing Node.js packages.\n * Supported values are hoisted and isolated.\n */\n nodeLinker?: NodeLinker;\n\n /*\n * Controls the way packages are imported from the store.\n */\n packageImportMethod?: PackageImportMethod;\n\n /*\n * Use and cache the results of (pre/post)install hooks.\n */\n sideEffectsCache?: boolean;\n\n /*\n * The list of components that should be installed in isolation from the workspace.\n * The component's package names should be used in this list, not their component IDs.\n */\n rootComponents?: boolean;\n\n /*\n * The node version to use when checking a package's engines setting.\n */\n nodeVersion?: string;\n\n /*\n * Refuse to install any package that claims to not be compatible with the current Node.js version.\n */\n engineStrict?: boolean;\n\n /*\n * Rules to mute specific peer dependeny warnings.\n */\n peerDependencyRules?: PeerDependencyRules;\n\n /*\n * This setting is \"true\" by default and tells bit to link core aspects to the node_modules of the workspace.\n * It only makes sense to set this to \"false\" in a workspace in which core aspects are actually developed.\n */\n linkCoreAspects?: boolean;\n\n /**\n * When false, Bit will create a shared node_modules directory for all components in a capsule.\n */\n isolatedCapsules?: boolean;\n\n /**\n * Ignore the builds of specific dependencies. The \"preinstall\", \"install\", and \"postinstall\" scripts\n * of the listed packages will not be executed during installation.\n */\n neverBuiltDependencies?: string[];\n\n /**\n * Fine-grained control over dependency lifecycle scripts. Allows explicitly permitting (true), blocking (false), or warning ('warn')\n * for specific dependencies' \"preinstall\", \"install\", and \"postinstall\" scripts during installation.\n */\n allowScripts?: Record<string, boolean | 'warn'>;\n\n /**\n * Set this to true in order to allow all dependencies to run install scripts.\n */\n dangerouslyAllowAllScripts?: boolean;\n\n /**\n * If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server.\n */\n preferOffline?: boolean;\n\n /**\n * When true, components in capsules are symlinked into their own node_modules.\n */\n capsuleSelfReference?: boolean;\n\n /**\n * Tells pnpm which packages should be hoisted to node_modules/.pnpm/node_modules.\n * By default, all packages are hoisted - however, if you know that only some flawed packages have phantom dependencies,\n * you can use this option to exclusively hoist the phantom dependencies (recommended).\n */\n hoistPatterns?: string[];\n\n /**\n * When true, dependencies from the workspace are hoisted to node_modules/.pnpm/node_modules\n * even if they are found in the root node_modules\n */\n hoistInjectedDependencies?: boolean;\n\n /**\n * Tells pnpm to automatically install peer dependencies. It is true by default.\n */\n autoInstallPeers?: boolean;\n\n /**\n * When true (default), env peer dependencies defined in env.jsonc are resolved once and merged\n * into the workspace root manifest as regular dependencies, instead of being injected into each\n * component's manifest individually. Conflicts between envs are resolved by picking the version\n * that satisfies the most envs, with a warning logged for any conflicts.\n * Set to false to revert to the legacy per-component env peer injection behavior.\n */\n resolveEnvPeersFromRoot?: boolean;\n\n /**\n * When true, ALL env peer dependencies are forced to the workspace root manifest,\n * even when different envs specify conflicting versions. The best version is chosen\n * (satisfying the most envs) and a warning is logged for unsatisfied envs.\n * When false (default), conflicting peers without `workspaceSingleton` are injected\n * per-component, allowing different envs to use different versions.\n * Only applies when resolveEnvPeersFromRoot is true.\n */\n forceEnvPeersToRoot?: boolean;\n\n /**\n * By default, Bit saves component dependencies with exact versions (pinned) in the package.json,\n * even if the dependency-resolver policy specifies a version range.\n *\n * To preserve the range defined in the policy, set this value to \"+\".\n * To apply a predefined range (\"~\" or \"^\") to other component dependencies not covered by the policy,\n * set this to the desired range symbol.\n */\n componentRangePrefix?: ComponentRangePrefix;\n\n externalPackageManager?: boolean;\n\n /**\n * Defines the minimum number of minutes that must pass after a version is published before pnpm will install it.\n * This applies to all dependencies, including transitive ones.\n */\n minimumReleaseAge?: number;\n\n /**\n * If you set minimumReleaseAge but need certain dependencies to always install the newest version immediately,\n * you can list them under minimumReleaseAgeExclude. The exclusion works by package name or package name pattern\n * and applies to all versions of that package.\n */\n minimumReleaseAgeExclude?: string[];\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -657,7 +657,9 @@ class DependencyResolverMain {
|
|
|
657
657
|
this.logger.setStatusLine(statusMessage);
|
|
658
658
|
}
|
|
659
659
|
const concreteOpts = _objectSpread(_objectSpread({}, defaultCreateFromComponentsOptions), options);
|
|
660
|
-
const
|
|
660
|
+
const resolveEnvPeersFromRoot = context?.inCapsule ? false : this.config.resolveEnvPeersFromRoot ?? true;
|
|
661
|
+
const forceEnvPeersToRoot = this.config.forceEnvPeersToRoot ?? false;
|
|
662
|
+
const workspaceManifestFactory = new (_manifest().WorkspaceManifestFactory)(this, this.aspectLoader, this.logger, resolveEnvPeersFromRoot, forceEnvPeersToRoot);
|
|
661
663
|
const res = await workspaceManifestFactory.createFromComponents(name, version, rootPolicy, rootDir, components, concreteOpts);
|
|
662
664
|
if (!context?.inCapsule) {
|
|
663
665
|
this.logger.consoleSuccess();
|
|
@@ -939,7 +941,9 @@ class DependencyResolverMain {
|
|
|
939
941
|
const packageManager = this.getPackageManager();
|
|
940
942
|
let peerDependencyIssues;
|
|
941
943
|
const installer = this.getInstaller();
|
|
942
|
-
const
|
|
944
|
+
const {
|
|
945
|
+
manifests
|
|
946
|
+
} = await installer.getComponentManifests(_objectSpread(_objectSpread({}, options), {}, {
|
|
943
947
|
componentDirectoryMap,
|
|
944
948
|
rootPolicy,
|
|
945
949
|
rootDir
|
|
@@ -1163,9 +1167,10 @@ class DependencyResolverMain {
|
|
|
1163
1167
|
}
|
|
1164
1168
|
const policy = envManifest?.policy;
|
|
1165
1169
|
if (!policy) return undefined;
|
|
1170
|
+
const envId = envComponent?.id.toStringWithoutVersion();
|
|
1166
1171
|
const allPoliciesFromEnv = _envPolicy().EnvPolicy.fromConfigObject(policy, {
|
|
1167
1172
|
includeLegacyPeersInSelfPolicy: envComponent && this.envs.isCoreEnv(envComponent.id.toStringWithoutVersion())
|
|
1168
|
-
});
|
|
1173
|
+
}, envId);
|
|
1169
1174
|
return allPoliciesFromEnv;
|
|
1170
1175
|
}
|
|
1171
1176
|
|
|
@@ -1216,7 +1221,7 @@ class DependencyResolverMain {
|
|
|
1216
1221
|
const idWithoutVersion = options.envId.split('@')[0];
|
|
1217
1222
|
const allPoliciesFromEnv = _envPolicy().EnvPolicy.fromConfigObject(policiesFromEnvConfig, {
|
|
1218
1223
|
includeLegacyPeersInSelfPolicy: this.envs.isCoreEnv(idWithoutVersion)
|
|
1219
|
-
});
|
|
1224
|
+
}, idWithoutVersion);
|
|
1220
1225
|
return allPoliciesFromEnv;
|
|
1221
1226
|
}
|
|
1222
1227
|
}
|