@teambit/pnpm 0.0.988 → 0.0.990
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 +48 -44
- package/dist/lynx.js.map +1 -1
- package/dist/pnpm.package-manager.d.ts +1 -0
- package/dist/pnpm.package-manager.js +5 -0
- package/dist/pnpm.package-manager.js.map +1 -1
- package/dist/{preview-1676604673087.js → preview-1676811569495.js} +2 -2
- package/package-tar/teambit-pnpm-0.0.990.tgz +0 -0
- package/package.json +18 -16
- package/package-tar/teambit-pnpm-0.0.988.tgz +0 -0
package/dist/lynx.js
CHANGED
|
@@ -17,9 +17,9 @@ function _defineProperty2() {
|
|
|
17
17
|
};
|
|
18
18
|
return data;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const data = require("
|
|
22
|
-
|
|
20
|
+
function _fsExtra() {
|
|
21
|
+
const data = _interopRequireDefault(require("fs-extra"));
|
|
22
|
+
_fsExtra = function () {
|
|
23
23
|
return data;
|
|
24
24
|
};
|
|
25
25
|
return data;
|
|
@@ -59,6 +59,13 @@ function _logger() {
|
|
|
59
59
|
};
|
|
60
60
|
return data;
|
|
61
61
|
}
|
|
62
|
+
function _modulesYaml() {
|
|
63
|
+
const data = require("@pnpm/modules-yaml");
|
|
64
|
+
_modulesYaml = function () {
|
|
65
|
+
return data;
|
|
66
|
+
};
|
|
67
|
+
return data;
|
|
68
|
+
}
|
|
62
69
|
function _storeConnectionManager() {
|
|
63
70
|
const data = require("@pnpm/store-connection-manager");
|
|
64
71
|
_storeConnectionManager = function () {
|
|
@@ -233,10 +240,12 @@ async function install(rootDir, manifestsByPaths, storeDir, cacheDir, registries
|
|
|
233
240
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
234
241
|
logger) {
|
|
235
242
|
let externalDependencies;
|
|
236
|
-
|
|
243
|
+
const readPackage = [];
|
|
244
|
+
if (options !== null && options !== void 0 && options.rootComponents && !(options !== null && options !== void 0 && options.rootComponentsForCapsules)) {
|
|
237
245
|
externalDependencies = new Set(Object.values(manifestsByPaths).map(({
|
|
238
246
|
name
|
|
239
247
|
}) => name).filter(Boolean));
|
|
248
|
+
readPackage.push(readPackageHook);
|
|
240
249
|
}
|
|
241
250
|
if (!manifestsByPaths[rootDir].dependenciesMeta) {
|
|
242
251
|
manifestsByPaths = _objectSpread(_objectSpread({}, manifestsByPaths), {}, {
|
|
@@ -245,20 +254,7 @@ logger) {
|
|
|
245
254
|
})
|
|
246
255
|
});
|
|
247
256
|
}
|
|
248
|
-
|
|
249
|
-
if (options !== null && options !== void 0 && options.rootComponents) {
|
|
250
|
-
const rootComponentWrappers = createRootComponentWrapperManifests(rootDir, manifestsByPaths);
|
|
251
|
-
manifestsByPaths = _objectSpread(_objectSpread({}, rootComponentWrappers), (0, _lodash().mapValues)(manifestsByPaths, (manifest, dir) => {
|
|
252
|
-
if (!manifest.name || dir === rootDir) return manifest;
|
|
253
|
-
return _objectSpread(_objectSpread({}, manifest), {}, {
|
|
254
|
-
publishConfig: {
|
|
255
|
-
directory: _path().default.relative(dir, _path().default.join(rootDir, 'node_modules', manifest.name)),
|
|
256
|
-
linkDirectory: true
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
}));
|
|
260
|
-
readPackage.push(readPackageHook);
|
|
261
|
-
} else if (options !== null && options !== void 0 && options.rootComponentsForCapsules) {
|
|
257
|
+
if (options !== null && options !== void 0 && options.rootComponentsForCapsules) {
|
|
262
258
|
readPackage.push(readPackageHookForCapsules);
|
|
263
259
|
}
|
|
264
260
|
const {
|
|
@@ -329,33 +325,42 @@ logger) {
|
|
|
329
325
|
} finally {
|
|
330
326
|
stopReporting();
|
|
331
327
|
}
|
|
328
|
+
if (options.rootComponents) {
|
|
329
|
+
const modulesState = await (0, _modulesYaml().readModulesManifest)(_path().default.join(rootDir, 'node_modules'));
|
|
330
|
+
if (modulesState !== null && modulesState !== void 0 && modulesState.injectedDeps) {
|
|
331
|
+
await linkManifestsToInjectedDeps({
|
|
332
|
+
injectedDeps: modulesState.injectedDeps,
|
|
333
|
+
manifestsByPaths,
|
|
334
|
+
rootDir
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
}
|
|
332
338
|
}
|
|
333
339
|
|
|
334
|
-
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
* and peer dependencies.
|
|
338
|
-
* A root component wrapper has the wrapped component in the dependencies and any of its peer dependencies.
|
|
339
|
-
* This way pnpm will install the wrapped component in isolation from other components and their dependencies.
|
|
340
|
+
/*
|
|
341
|
+
* The package.json files of the components are generated into node_modules/<component pkg name>/package.json
|
|
342
|
+
* This function copies the generated package.json file into all the locations of the component.
|
|
340
343
|
*/
|
|
341
|
-
function
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
344
|
+
async function linkManifestsToInjectedDeps({
|
|
345
|
+
rootDir,
|
|
346
|
+
manifestsByPaths,
|
|
347
|
+
injectedDeps
|
|
348
|
+
}) {
|
|
349
|
+
await Promise.all(Object.entries(injectedDeps).map(async ([compDir, targetDirs]) => {
|
|
350
|
+
var _manifestsByPaths$pat;
|
|
351
|
+
const pkgName = (_manifestsByPaths$pat = manifestsByPaths[_path().default.join(rootDir, compDir)]) === null || _manifestsByPaths$pat === void 0 ? void 0 : _manifestsByPaths$pat.name;
|
|
352
|
+
if (!pkgName) return;
|
|
353
|
+
const pkgJsonPath = _path().default.join(rootDir, 'node_modules', pkgName, 'package.json');
|
|
354
|
+
if (_fsExtra().default.existsSync(pkgJsonPath)) {
|
|
355
|
+
await Promise.all(targetDirs.map(async targetDir => {
|
|
356
|
+
try {
|
|
357
|
+
await _fsExtra().default.link(pkgJsonPath, _path().default.join(targetDir, 'package.json'));
|
|
358
|
+
} catch (err) {
|
|
359
|
+
if (err.code !== 'EEXIST') throw err;
|
|
354
360
|
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
return rootComponentWrappers;
|
|
361
|
+
}));
|
|
362
|
+
}
|
|
363
|
+
}));
|
|
359
364
|
}
|
|
360
365
|
|
|
361
366
|
/**
|
|
@@ -382,12 +387,11 @@ function readPackageHookForCapsules(pkg, workspaceDir) {
|
|
|
382
387
|
* For direct dependencies, Bit's linking is used.
|
|
383
388
|
*/
|
|
384
389
|
function readPackageHook(pkg, workspaceDir) {
|
|
385
|
-
|
|
386
|
-
if (!pkg.dependencies || (_pkg$name = pkg.name) !== null && _pkg$name !== void 0 && _pkg$name.endsWith(`__root`)) {
|
|
390
|
+
if (!pkg.dependencies) {
|
|
387
391
|
return pkg;
|
|
388
392
|
}
|
|
389
393
|
// workspaceDir is set only for workspace packages
|
|
390
|
-
if (workspaceDir) {
|
|
394
|
+
if (workspaceDir && !workspaceDir.includes('.bit_roots')) {
|
|
391
395
|
return readWorkspacePackageHook(pkg);
|
|
392
396
|
}
|
|
393
397
|
return readDependencyPackageHook(pkg);
|
package/dist/lynx.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["installsRunning","STORE_CACHE","createStoreController","options","authConfig","getAuthConfig","registries","opts","dir","rootDir","cacheDir","storeDir","rawConfig","verifyStoreIntegrity","httpProxy","proxyConfig","httpsProxy","ca","networkConfig","cert","key","localAddress","noProxy","strictSsl","strictSSL","maxSockets","networkConcurrency","packageImportMethod","resolveSymlinksInInjectedDirs","pnpmHomeDir","cacheKey","JSON","stringify","createOrConnectStoreController","generateResolverAndFetcher","pnpmConfig","readConfig","Object","assign","config","timeout","fetchTimeout","retry","factor","fetchRetryFactor","maxTimeout","fetchRetryMaxtimeout","minTimeout","fetchRetryMintimeout","retries","fetchRetries","result","createClient","getPeerDependencyIssues","manifestsByPaths","projects","workspacePackages","manifest","entries","push","buildIndex","name","version","registriesMap","getRegistriesMap","storeController","pnpm","ctrl","overrides","install","logger","externalDependencies","rootComponents","Set","values","map","filter","Boolean","dependenciesMeta","readPackage","rootComponentWrappers","createRootComponentWrapperManifests","mapValues","publishConfig","directory","path","relative","join","linkDirectory","readPackageHook","rootComponentsForCapsules","readPackageHookForCapsules","allProjects","packagesToBuild","groupPkgs","preferFrozenLockfile","pruneLockfileImporters","modulesCacheMaxAge","neverBuiltDependencies","hooks","strictPeerDependencies","resolvePeersFromWorkspaceRoot","dedupeDirectDeps","include","dependencies","devDependencies","optionalDependencies","includeOptionalDeps","peerDependencyRules","allowAny","ignoreMissing","stopReporting","initDefaultReporter","context","argv","reportingOptions","appendOnly","throttleProgress","streamParser","mutateModules","err","pnpmErrorToBitError","toString","compDir","peerDependencies","injected","pkg","workspaceDir","readDependencyPackageHook","endsWith","readWorkspacePackageHook","startsWith","newDeps","pkgs","graph","createPkgGraph","chunks","sortPackages","forEach","dirs","mutation","resolveRemoteVersion","packageName","resolve","resolveOpts","lockfileDir","preferredVersions","projectDir","registry","parsedPackage","parsePackageName","pickRegistryForPackage","wantedDep","alias","pref","isValidRange","semver","validRange","val","BitError","isSemver","resolvedVia","e","message","includes","undefined","normalizedPref","default","defaultRegistry","uri","NPM_REGISTRY","scopes","registryName","res","alwaysAuth","defaultAuthTokens","getAuthTokenForRegistry","keyName","authTokens","nerfed","toNerfDart","alwaysAuthKeyName","isDefault","originalAuthType","originalAuthValue","split"],"sources":["lynx.ts"],"sourcesContent":["import { mapValues } from 'lodash';\nimport path from 'path';\nimport semver from 'semver';\nimport parsePackageName from 'parse-package-name';\nimport { initDefaultReporter } from '@pnpm/default-reporter';\nimport { streamParser } from '@pnpm/logger';\nimport { StoreController, WantedDependency } from '@pnpm/package-store';\nimport { createOrConnectStoreController, CreateStoreControllerOptions } from '@pnpm/store-connection-manager';\nimport { sortPackages } from '@pnpm/sort-packages';\nimport {\n ResolvedPackageVersion,\n Registries,\n NPM_REGISTRY,\n Registry,\n PackageManagerProxyConfig,\n PackageManagerNetworkConfig,\n} from '@teambit/dependency-resolver';\nimport { BitError } from '@teambit/bit-error';\nimport {\n MutatedProject,\n mutateModules,\n InstallOptions,\n PeerDependencyIssuesByProjects,\n ProjectOptions,\n} from '@pnpm/core';\nimport * as pnpm from '@pnpm/core';\nimport { createClient, ClientOptions } from '@pnpm/client';\nimport { pickRegistryForPackage } from '@pnpm/pick-registry-for-package';\nimport { createPkgGraph } from '@pnpm/workspace.pkgs-graph';\nimport { PackageManifest, ProjectManifest, ReadPackageHook } from '@pnpm/types';\nimport { Logger } from '@teambit/logger';\nimport toNerfDart from 'nerf-dart';\nimport { pnpmErrorToBitError } from './pnpm-error-to-bit-error';\nimport { readConfig } from './read-config';\n\nconst installsRunning: Record<string, Promise<any>> = {};\n\ntype RegistriesMap = {\n default: string;\n [registryName: string]: string;\n};\n\nconst STORE_CACHE: Record<string, { ctrl: StoreController; dir: string }> = {};\n\nasync function createStoreController(\n options: {\n rootDir: string;\n storeDir?: string;\n cacheDir: string;\n registries: Registries;\n proxyConfig: PackageManagerProxyConfig;\n networkConfig: PackageManagerNetworkConfig;\n } & Pick<CreateStoreControllerOptions, 'packageImportMethod' | 'pnpmHomeDir'>\n): Promise<{ ctrl: StoreController; dir: string }> {\n const authConfig = getAuthConfig(options.registries);\n const opts: CreateStoreControllerOptions = {\n dir: options.rootDir,\n cacheDir: options.cacheDir,\n storeDir: options.storeDir,\n rawConfig: authConfig,\n verifyStoreIntegrity: true,\n httpProxy: options.proxyConfig?.httpProxy,\n httpsProxy: options.proxyConfig?.httpsProxy,\n ca: options.networkConfig?.ca,\n cert: options.networkConfig?.cert,\n key: options.networkConfig?.key,\n localAddress: options.networkConfig?.localAddress,\n noProxy: options.proxyConfig?.noProxy,\n strictSsl: options.networkConfig.strictSSL,\n maxSockets: options.networkConfig.maxSockets,\n networkConcurrency: options.networkConfig.networkConcurrency,\n packageImportMethod: options.packageImportMethod,\n resolveSymlinksInInjectedDirs: true,\n pnpmHomeDir: options.pnpmHomeDir,\n };\n // We should avoid the recreation of store.\n // The store holds cache that makes subsequent resolutions faster.\n const cacheKey = JSON.stringify(opts);\n if (!STORE_CACHE[cacheKey]) {\n // Although it would be enough to call createNewStoreController(),\n // that doesn't resolve the store directory location.\n STORE_CACHE[cacheKey] = await createOrConnectStoreController(opts);\n }\n return STORE_CACHE[cacheKey];\n}\n\nasync function generateResolverAndFetcher(\n cacheDir: string,\n registries: Registries,\n proxyConfig: PackageManagerProxyConfig = {},\n networkConfig: PackageManagerNetworkConfig = {}\n) {\n const pnpmConfig = await readConfig();\n const authConfig = getAuthConfig(registries);\n const opts: ClientOptions = {\n authConfig: Object.assign({}, pnpmConfig.config.rawConfig, authConfig),\n cacheDir,\n httpProxy: proxyConfig?.httpProxy,\n httpsProxy: proxyConfig?.httpsProxy,\n ca: networkConfig?.ca,\n cert: networkConfig?.cert,\n key: networkConfig?.key,\n localAddress: networkConfig?.localAddress,\n noProxy: proxyConfig?.noProxy,\n strictSsl: networkConfig.strictSSL,\n timeout: networkConfig.fetchTimeout,\n rawConfig: pnpmConfig.config.rawConfig,\n retry: {\n factor: networkConfig.fetchRetryFactor,\n maxTimeout: networkConfig.fetchRetryMaxtimeout,\n minTimeout: networkConfig.fetchRetryMintimeout,\n retries: networkConfig.fetchRetries,\n },\n };\n const result = createClient(opts);\n return result;\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 } & Pick<CreateStoreControllerOptions, 'packageImportMethod' | 'pnpmHomeDir'>\n): Promise<PeerDependencyIssuesByProjects> {\n const projects: ProjectOptions[] = [];\n const workspacePackages = {};\n for (const [rootDir, manifest] of Object.entries(manifestsByPaths)) {\n projects.push({\n buildIndex: 0, // this is not used while searching for peer issues anyway\n manifest,\n rootDir,\n });\n workspacePackages[manifest.name] = workspacePackages[manifest.name] || {};\n workspacePackages[manifest.name][manifest.version] = { dir: rootDir, manifest };\n }\n const registriesMap = getRegistriesMap(opts.registries);\n const storeController = await createStoreController({\n ...opts,\n rootDir: opts.rootDir,\n });\n return pnpm.getPeerDependencyIssues(projects, {\n storeController: storeController.ctrl,\n storeDir: storeController.dir,\n overrides: opts.overrides,\n workspacePackages,\n registries: registriesMap,\n });\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 nodeLinker?: 'hoisted' | 'isolated';\n overrides?: Record<string, string>;\n rootComponents?: boolean;\n rootComponentsForCapsules?: boolean;\n includeOptionalDeps?: boolean;\n } & Pick<\n InstallOptions,\n 'publicHoistPattern' | 'hoistPattern' | 'nodeVersion' | 'engineStrict' | 'peerDependencyRules'\n > &\n Pick<CreateStoreControllerOptions, 'packageImportMethod' | 'pnpmHomeDir'>,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n logger?: Logger\n) {\n let externalDependencies: Set<string> | undefined;\n if (options?.rootComponents) {\n externalDependencies = new Set(\n Object.values(manifestsByPaths)\n .map(({ name }) => name)\n .filter(Boolean) as string[]\n );\n }\n if (!manifestsByPaths[rootDir].dependenciesMeta) {\n manifestsByPaths = {\n ...manifestsByPaths,\n [rootDir]: {\n ...manifestsByPaths[rootDir],\n dependenciesMeta: {},\n },\n };\n }\n const readPackage: ReadPackageHook[] = [];\n if (options?.rootComponents) {\n const rootComponentWrappers = createRootComponentWrapperManifests(rootDir, manifestsByPaths);\n manifestsByPaths = {\n ...rootComponentWrappers,\n ...mapValues(manifestsByPaths, (manifest, dir) => {\n if (!manifest.name || dir === rootDir) return manifest;\n return {\n ...manifest,\n publishConfig: {\n directory: path.relative(dir, path.join(rootDir, 'node_modules', manifest.name)),\n linkDirectory: true,\n },\n };\n }),\n };\n readPackage.push(readPackageHook as ReadPackageHook);\n } else if (options?.rootComponentsForCapsules) {\n readPackage.push(readPackageHookForCapsules as ReadPackageHook);\n }\n const { allProjects, packagesToBuild, workspacePackages } = groupPkgs(manifestsByPaths);\n const registriesMap = getRegistriesMap(registries);\n const authConfig = getAuthConfig(registries);\n const storeController = await createStoreController({\n rootDir,\n storeDir,\n cacheDir,\n registries,\n proxyConfig,\n networkConfig,\n packageImportMethod: options?.packageImportMethod,\n pnpmHomeDir: options?.pnpmHomeDir,\n });\n const opts: InstallOptions = {\n allProjects,\n storeDir: storeController.dir,\n dir: rootDir,\n storeController: storeController.ctrl,\n workspacePackages,\n preferFrozenLockfile: true,\n pruneLockfileImporters: true,\n modulesCacheMaxAge: 0,\n neverBuiltDependencies: ['core-js'],\n registries: registriesMap,\n rawConfig: authConfig,\n hooks: { readPackage },\n externalDependencies,\n strictPeerDependencies: false,\n resolveSymlinksInInjectedDirs: true,\n resolvePeersFromWorkspaceRoot: true,\n dedupeDirectDeps: true,\n include: {\n dependencies: true,\n devDependencies: true,\n optionalDependencies: options?.includeOptionalDeps !== false,\n },\n ...options,\n peerDependencyRules: {\n allowAny: ['*'],\n ignoreMissing: ['*'],\n ...options?.peerDependencyRules,\n },\n };\n\n const stopReporting = initDefaultReporter({\n context: {\n argv: [],\n },\n reportingOptions: {\n appendOnly: false,\n throttleProgress: 200,\n },\n streamParser,\n });\n try {\n await installsRunning[rootDir];\n installsRunning[rootDir] = mutateModules(packagesToBuild, opts);\n await installsRunning[rootDir];\n delete installsRunning[rootDir];\n } catch (err: any) {\n throw pnpmErrorToBitError(err);\n } finally {\n stopReporting();\n }\n}\n\n/**\n * This function creates manifests for root component wrappers.\n * Root component wrappers are used to isolated workspace components with their workspace dependencies\n * and peer dependencies.\n * A root component wrapper has the wrapped component in the dependencies and any of its peer dependencies.\n * This way pnpm will install the wrapped component in isolation from other components and their dependencies.\n */\nfunction createRootComponentWrapperManifests(rootDir: string, manifestsByPaths: Record<string, ProjectManifest>) {\n const rootComponentWrappers: Record<string, ProjectManifest> = {};\n for (const manifest of Object.values(manifestsByPaths)) {\n const name = manifest.name!.toString(); // eslint-disable-line\n const compDir = path.join(rootDir, 'node_modules', name);\n rootComponentWrappers[compDir] = {\n name: `${name}__root`,\n dependencies: {\n [name]: `workspace:*`,\n ...manifest.peerDependencies,\n ...manifest['defaultPeerDependencies'], // eslint-disable-line\n },\n dependenciesMeta: {\n [name]: { injected: true },\n },\n };\n }\n return rootComponentWrappers;\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 * Also, any local dependencies are extended with the \"injected\" option,\n * this tells pnpm to hard link the packages instead of symlinking them.\n */\nfunction readPackageHookForCapsules(pkg: PackageManifest, workspaceDir?: string): PackageManifest {\n // workspaceDir is set only for workspace packages\n if (workspaceDir) {\n return readDependencyPackageHook({\n ...pkg,\n dependencies: {\n ...pkg.dependencies,\n ...pkg.peerDependencies,\n ...pkg['defaultPeerDependencies'], // eslint-disable-line\n },\n });\n }\n return readDependencyPackageHook(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 if (!pkg.dependencies || pkg.name?.endsWith(`__root`)) {\n return pkg;\n }\n // workspaceDir is set only for workspace packages\n if (workspaceDir) {\n return readWorkspacePackageHook(pkg);\n }\n return readDependencyPackageHook(pkg);\n}\n\n/**\n * This hook adds the \"injected\" option to any workspace dependency.\n * The injected option tell pnpm to hard link the packages instead of symlinking them.\n */\nfunction readDependencyPackageHook(pkg: PackageManifest): PackageManifest {\n const dependenciesMeta = pkg.dependenciesMeta ?? {};\n for (const [name, version] of Object.entries(pkg.dependencies ?? {})) {\n if (version.startsWith('workspace:')) {\n // This instructs pnpm to hard link the component from the workspace, not symlink it.\n dependenciesMeta[name] = { injected: true };\n }\n }\n return {\n ...pkg,\n dependenciesMeta,\n };\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 ...pkg['defaultPeerDependencies'], // eslint-disable-line\n ...newDeps,\n },\n };\n}\n\nfunction groupPkgs(manifestsByPaths: Record<string, ProjectManifest>) {\n const pkgs = Object.entries(manifestsByPaths).map(([dir, manifest]) => ({ dir, manifest }));\n const { graph } = createPkgGraph(pkgs);\n const chunks = sortPackages(graph as any);\n\n // This will create local link by pnpm to a component exists in the ws.\n // it will later deleted by the link process\n // we keep it here to better support case like this:\n // compA@1.0.0 uses compB@1.0.0\n // I have compB@2.0.0 in my workspace\n // now I install compA@1.0.0\n // compA is hoisted to the root and install B@1.0.0 hoisted to the root as well\n // now we will make link to B@2.0.0 and A will break\n // with this we will have a link to the local B by pnpm so it will install B@1.0.0 inside A\n // then when overriding the link, A will still works\n // This is the rational behind not deleting this completely, but need further check that it really works\n const packagesToBuild: MutatedProject[] = []; // @pnpm/core will use this to install the packages\n const allProjects: ProjectOptions[] = [];\n const workspacePackages = {}; // @pnpm/core will use this to link packages to each other\n\n chunks.forEach((dirs, buildIndex) => {\n for (const rootDir of dirs) {\n const manifest = manifestsByPaths[rootDir];\n allProjects.push({\n buildIndex,\n manifest,\n rootDir,\n });\n packagesToBuild.push({\n rootDir,\n mutation: 'install',\n });\n if (manifest.name) {\n workspacePackages[manifest.name] = workspacePackages[manifest.name] || {};\n workspacePackages[manifest.name][manifest.version] = { dir: rootDir, manifest };\n }\n }\n });\n return { packagesToBuild, allProjects, workspacePackages };\n}\n\nexport async function resolveRemoteVersion(\n packageName: string,\n rootDir: string,\n cacheDir: string,\n registries: Registries,\n proxyConfig: PackageManagerProxyConfig = {},\n networkConfig: PackageManagerNetworkConfig = {}\n): Promise<ResolvedPackageVersion> {\n const { resolve } = await generateResolverAndFetcher(cacheDir, registries, proxyConfig, networkConfig);\n const resolveOpts = {\n lockfileDir: rootDir,\n preferredVersions: {},\n projectDir: rootDir,\n registry: '',\n };\n try {\n const parsedPackage = parsePackageName(packageName);\n const registriesMap = getRegistriesMap(registries);\n const registry = pickRegistryForPackage(registriesMap, parsedPackage.name);\n const wantedDep: WantedDependency = {\n alias: parsedPackage.name,\n pref: parsedPackage.version,\n };\n const isValidRange = parsedPackage.version ? !!semver.validRange(parsedPackage.version) : false;\n resolveOpts.registry = registry;\n const val = await resolve(wantedDep, resolveOpts);\n if (!val.manifest) {\n throw new BitError('The resolved package has no manifest');\n }\n const version = isValidRange ? parsedPackage.version : val.manifest.version;\n\n return {\n packageName: val.manifest.name,\n version,\n isSemver: true,\n resolvedVia: val.resolvedVia,\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: WantedDependency = {\n alias: undefined,\n pref: 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.normalizedPref) {\n throw new BitError('The resolved package has no version');\n }\n return {\n packageName: val.manifest.name,\n version: val.normalizedPref,\n isSemver: false,\n resolvedVia: val.resolvedVia,\n };\n }\n}\n\nfunction getRegistriesMap(registries: Registries): RegistriesMap {\n const registriesMap = {\n default: registries.defaultRegistry.uri || NPM_REGISTRY,\n };\n\n Object.entries(registries.scopes).forEach(([registryName, registry]) => {\n registriesMap[`@${registryName}`] = registry.uri;\n });\n return registriesMap;\n}\n\nfunction getAuthConfig(registries: Registries): Record<string, any> {\n const res: any = {};\n res.registry = registries.defaultRegistry.uri;\n if (registries.defaultRegistry.alwaysAuth) {\n res['always-auth'] = true;\n }\n const defaultAuthTokens = getAuthTokenForRegistry(registries.defaultRegistry, true);\n defaultAuthTokens.forEach(({ keyName, val }) => {\n res[keyName] = val;\n });\n\n Object.entries(registries.scopes).forEach(([, registry]) => {\n const authTokens = getAuthTokenForRegistry(registry);\n authTokens.forEach(({ keyName, val }) => {\n res[keyName] = val;\n });\n if (registry.alwaysAuth) {\n const nerfed = toNerfDart(registry.uri);\n const alwaysAuthKeyName = `${nerfed}:always-auth`;\n res[alwaysAuthKeyName] = true;\n }\n });\n return res;\n}\n\nfunction getAuthTokenForRegistry(registry: Registry, isDefault = false): { keyName: string; val: string }[] {\n const nerfed = toNerfDart(registry.uri);\n if (registry.originalAuthType === 'authToken') {\n return [\n {\n keyName: `${nerfed}:_authToken`,\n val: registry.originalAuthValue || '',\n },\n ];\n }\n if (registry.originalAuthType === 'auth') {\n return [\n {\n keyName: isDefault ? '_auth' : `${nerfed}:_auth`,\n val: registry.originalAuthValue || '',\n },\n ];\n }\n if (registry.originalAuthType === 'user-pass') {\n return [\n {\n keyName: `${nerfed}:username`,\n val: registry.originalAuthValue?.split(':')[0] || '',\n },\n {\n keyName: `${nerfed}:_password`,\n val: registry.originalAuthValue?.split(':')[1] || '',\n },\n ];\n }\n return [];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;E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AAK,WAAW,EAAE;IAC7C,OAAO,CACL;MACEN,OAAO,EAAG,GAAEE,MAAO,aAAY;MAC/BrB,GAAG,EAAEV,QAAQ,CAACoC,iBAAiB,IAAI;IACrC,CAAC,CACF;EACH;EACA,IAAIpC,QAAQ,CAACmC,gBAAgB,KAAK,MAAM,EAAE;IACxC,OAAO,CACL;MACEN,OAAO,EAAEK,SAAS,GAAG,OAAO,GAAI,GAAEH,MAAO,QAAO;MAChDrB,GAAG,EAAEV,QAAQ,CAACoC,iBAAiB,IAAI;IACrC,CAAC,CACF;EACH;EACA,IAAIpC,QAAQ,CAACmC,gBAAgB,KAAK,WAAW,EAAE;IAAA;IAC7C,OAAO,CACL;MACEN,OAAO,EAAG,GAAEE,MAAO,WAAU;MAC7BrB,GAAG,EAAE,0BAAAV,QAAQ,CAACoC,iBAAiB,0DAA1B,sBAA4BC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAI;IACpD,CAAC,EACD;MACER,OAAO,EAAG,GAAEE,MAAO,YAAW;MAC9BrB,GAAG,EAAE,2BAAAV,QAAQ,CAACoC,iBAAiB,2DAA1B,uBAA4BC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAI;IACpD,CAAC,CACF;EACH;EACA,OAAO,EAAE;AACX"}
|
|
1
|
+
{"version":3,"names":["installsRunning","STORE_CACHE","createStoreController","options","authConfig","getAuthConfig","registries","opts","dir","rootDir","cacheDir","storeDir","rawConfig","verifyStoreIntegrity","httpProxy","proxyConfig","httpsProxy","ca","networkConfig","cert","key","localAddress","noProxy","strictSsl","strictSSL","maxSockets","networkConcurrency","packageImportMethod","resolveSymlinksInInjectedDirs","pnpmHomeDir","cacheKey","JSON","stringify","createOrConnectStoreController","generateResolverAndFetcher","pnpmConfig","readConfig","Object","assign","config","timeout","fetchTimeout","retry","factor","fetchRetryFactor","maxTimeout","fetchRetryMaxtimeout","minTimeout","fetchRetryMintimeout","retries","fetchRetries","result","createClient","getPeerDependencyIssues","manifestsByPaths","projects","workspacePackages","manifest","entries","push","buildIndex","name","version","registriesMap","getRegistriesMap","storeController","pnpm","ctrl","overrides","install","logger","externalDependencies","readPackage","rootComponents","rootComponentsForCapsules","Set","values","map","filter","Boolean","readPackageHook","dependenciesMeta","readPackageHookForCapsules","allProjects","packagesToBuild","groupPkgs","preferFrozenLockfile","pruneLockfileImporters","modulesCacheMaxAge","neverBuiltDependencies","hooks","strictPeerDependencies","resolvePeersFromWorkspaceRoot","dedupeDirectDeps","include","dependencies","devDependencies","optionalDependencies","includeOptionalDeps","peerDependencyRules","allowAny","ignoreMissing","stopReporting","initDefaultReporter","context","argv","reportingOptions","appendOnly","throttleProgress","streamParser","mutateModules","err","pnpmErrorToBitError","modulesState","readModulesManifest","path","join","injectedDeps","linkManifestsToInjectedDeps","Promise","all","compDir","targetDirs","pkgName","pkgJsonPath","fs","existsSync","targetDir","link","code","pkg","workspaceDir","readDependencyPackageHook","peerDependencies","includes","readWorkspacePackageHook","startsWith","injected","newDeps","pkgs","graph","createPkgGraph","chunks","sortPackages","forEach","dirs","mutation","resolveRemoteVersion","packageName","resolve","resolveOpts","lockfileDir","preferredVersions","projectDir","registry","parsedPackage","parsePackageName","pickRegistryForPackage","wantedDep","alias","pref","isValidRange","semver","validRange","val","BitError","isSemver","resolvedVia","e","message","undefined","normalizedPref","default","defaultRegistry","uri","NPM_REGISTRY","scopes","registryName","res","alwaysAuth","defaultAuthTokens","getAuthTokenForRegistry","keyName","authTokens","nerfed","toNerfDart","alwaysAuthKeyName","isDefault","originalAuthType","originalAuthValue","split"],"sources":["lynx.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport path from 'path';\nimport semver from 'semver';\nimport parsePackageName from 'parse-package-name';\nimport { initDefaultReporter } from '@pnpm/default-reporter';\nimport { streamParser } from '@pnpm/logger';\nimport { StoreController, WantedDependency } from '@pnpm/package-store';\nimport { readModulesManifest } from '@pnpm/modules-yaml';\nimport { createOrConnectStoreController, CreateStoreControllerOptions } from '@pnpm/store-connection-manager';\nimport { sortPackages } from '@pnpm/sort-packages';\nimport {\n ResolvedPackageVersion,\n Registries,\n NPM_REGISTRY,\n Registry,\n PackageManagerProxyConfig,\n PackageManagerNetworkConfig,\n} from '@teambit/dependency-resolver';\nimport { BitError } from '@teambit/bit-error';\nimport {\n MutatedProject,\n mutateModules,\n InstallOptions,\n PeerDependencyIssuesByProjects,\n ProjectOptions,\n} from '@pnpm/core';\nimport * as pnpm from '@pnpm/core';\nimport { createClient, ClientOptions } from '@pnpm/client';\nimport { pickRegistryForPackage } from '@pnpm/pick-registry-for-package';\nimport { createPkgGraph } from '@pnpm/workspace.pkgs-graph';\nimport { PackageManifest, ProjectManifest, ReadPackageHook } from '@pnpm/types';\nimport { Logger } from '@teambit/logger';\nimport toNerfDart from 'nerf-dart';\nimport { pnpmErrorToBitError } from './pnpm-error-to-bit-error';\nimport { readConfig } from './read-config';\n\nconst installsRunning: Record<string, Promise<any>> = {};\n\ntype RegistriesMap = {\n default: string;\n [registryName: string]: string;\n};\n\nconst STORE_CACHE: Record<string, { ctrl: StoreController; dir: string }> = {};\n\nasync function createStoreController(\n options: {\n rootDir: string;\n storeDir?: string;\n cacheDir: string;\n registries: Registries;\n proxyConfig: PackageManagerProxyConfig;\n networkConfig: PackageManagerNetworkConfig;\n } & Pick<CreateStoreControllerOptions, 'packageImportMethod' | 'pnpmHomeDir'>\n): Promise<{ ctrl: StoreController; dir: string }> {\n const authConfig = getAuthConfig(options.registries);\n const opts: CreateStoreControllerOptions = {\n dir: options.rootDir,\n cacheDir: options.cacheDir,\n storeDir: options.storeDir,\n rawConfig: authConfig,\n verifyStoreIntegrity: true,\n httpProxy: options.proxyConfig?.httpProxy,\n httpsProxy: options.proxyConfig?.httpsProxy,\n ca: options.networkConfig?.ca,\n cert: options.networkConfig?.cert,\n key: options.networkConfig?.key,\n localAddress: options.networkConfig?.localAddress,\n noProxy: options.proxyConfig?.noProxy,\n strictSsl: options.networkConfig.strictSSL,\n maxSockets: options.networkConfig.maxSockets,\n networkConcurrency: options.networkConfig.networkConcurrency,\n packageImportMethod: options.packageImportMethod,\n resolveSymlinksInInjectedDirs: true,\n pnpmHomeDir: options.pnpmHomeDir,\n };\n // We should avoid the recreation of store.\n // The store holds cache that makes subsequent resolutions faster.\n const cacheKey = JSON.stringify(opts);\n if (!STORE_CACHE[cacheKey]) {\n // Although it would be enough to call createNewStoreController(),\n // that doesn't resolve the store directory location.\n STORE_CACHE[cacheKey] = await createOrConnectStoreController(opts);\n }\n return STORE_CACHE[cacheKey];\n}\n\nasync function generateResolverAndFetcher(\n cacheDir: string,\n registries: Registries,\n proxyConfig: PackageManagerProxyConfig = {},\n networkConfig: PackageManagerNetworkConfig = {}\n) {\n const pnpmConfig = await readConfig();\n const authConfig = getAuthConfig(registries);\n const opts: ClientOptions = {\n authConfig: Object.assign({}, pnpmConfig.config.rawConfig, authConfig),\n cacheDir,\n httpProxy: proxyConfig?.httpProxy,\n httpsProxy: proxyConfig?.httpsProxy,\n ca: networkConfig?.ca,\n cert: networkConfig?.cert,\n key: networkConfig?.key,\n localAddress: networkConfig?.localAddress,\n noProxy: proxyConfig?.noProxy,\n strictSsl: networkConfig.strictSSL,\n timeout: networkConfig.fetchTimeout,\n rawConfig: pnpmConfig.config.rawConfig,\n retry: {\n factor: networkConfig.fetchRetryFactor,\n maxTimeout: networkConfig.fetchRetryMaxtimeout,\n minTimeout: networkConfig.fetchRetryMintimeout,\n retries: networkConfig.fetchRetries,\n },\n };\n const result = createClient(opts);\n return result;\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 } & Pick<CreateStoreControllerOptions, 'packageImportMethod' | 'pnpmHomeDir'>\n): Promise<PeerDependencyIssuesByProjects> {\n const projects: ProjectOptions[] = [];\n const workspacePackages = {};\n for (const [rootDir, manifest] of Object.entries(manifestsByPaths)) {\n projects.push({\n buildIndex: 0, // this is not used while searching for peer issues anyway\n manifest,\n rootDir,\n });\n workspacePackages[manifest.name] = workspacePackages[manifest.name] || {};\n workspacePackages[manifest.name][manifest.version] = { dir: rootDir, manifest };\n }\n const registriesMap = getRegistriesMap(opts.registries);\n const storeController = await createStoreController({\n ...opts,\n rootDir: opts.rootDir,\n });\n return pnpm.getPeerDependencyIssues(projects, {\n storeController: storeController.ctrl,\n storeDir: storeController.dir,\n overrides: opts.overrides,\n workspacePackages,\n registries: registriesMap,\n });\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 nodeLinker?: 'hoisted' | 'isolated';\n overrides?: Record<string, string>;\n rootComponents?: boolean;\n rootComponentsForCapsules?: boolean;\n includeOptionalDeps?: boolean;\n } & Pick<\n InstallOptions,\n 'publicHoistPattern' | 'hoistPattern' | 'nodeVersion' | 'engineStrict' | 'peerDependencyRules'\n > &\n Pick<CreateStoreControllerOptions, 'packageImportMethod' | 'pnpmHomeDir'>,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n logger?: Logger\n) {\n let externalDependencies: Set<string> | undefined;\n const readPackage: ReadPackageHook[] = [];\n if (options?.rootComponents && !options?.rootComponentsForCapsules) {\n externalDependencies = new Set(\n Object.values(manifestsByPaths)\n .map(({ name }) => name)\n .filter(Boolean) as string[]\n );\n readPackage.push(readPackageHook as ReadPackageHook);\n }\n if (!manifestsByPaths[rootDir].dependenciesMeta) {\n manifestsByPaths = {\n ...manifestsByPaths,\n [rootDir]: {\n ...manifestsByPaths[rootDir],\n dependenciesMeta: {},\n },\n };\n }\n if (options?.rootComponentsForCapsules) {\n readPackage.push(readPackageHookForCapsules as ReadPackageHook);\n }\n const { allProjects, packagesToBuild, workspacePackages } = groupPkgs(manifestsByPaths);\n const registriesMap = getRegistriesMap(registries);\n const authConfig = getAuthConfig(registries);\n const storeController = await createStoreController({\n rootDir,\n storeDir,\n cacheDir,\n registries,\n proxyConfig,\n networkConfig,\n packageImportMethod: options?.packageImportMethod,\n pnpmHomeDir: options?.pnpmHomeDir,\n });\n const opts: InstallOptions = {\n allProjects,\n storeDir: storeController.dir,\n dir: rootDir,\n storeController: storeController.ctrl,\n workspacePackages,\n preferFrozenLockfile: true,\n pruneLockfileImporters: true,\n modulesCacheMaxAge: 0,\n neverBuiltDependencies: ['core-js'],\n registries: registriesMap,\n rawConfig: authConfig,\n hooks: { readPackage },\n externalDependencies,\n strictPeerDependencies: false,\n resolveSymlinksInInjectedDirs: true,\n resolvePeersFromWorkspaceRoot: true,\n dedupeDirectDeps: true,\n include: {\n dependencies: true,\n devDependencies: true,\n optionalDependencies: options?.includeOptionalDeps !== false,\n },\n ...options,\n peerDependencyRules: {\n allowAny: ['*'],\n ignoreMissing: ['*'],\n ...options?.peerDependencyRules,\n },\n };\n\n const stopReporting = initDefaultReporter({\n context: {\n argv: [],\n },\n reportingOptions: {\n appendOnly: false,\n throttleProgress: 200,\n },\n streamParser,\n });\n try {\n await installsRunning[rootDir];\n installsRunning[rootDir] = mutateModules(packagesToBuild, opts);\n await installsRunning[rootDir];\n delete installsRunning[rootDir];\n } catch (err: any) {\n throw pnpmErrorToBitError(err);\n } finally {\n stopReporting();\n }\n if (options.rootComponents) {\n const modulesState = await readModulesManifest(path.join(rootDir, 'node_modules'));\n if (modulesState?.injectedDeps) {\n await linkManifestsToInjectedDeps({\n injectedDeps: modulesState.injectedDeps,\n manifestsByPaths,\n rootDir,\n });\n }\n }\n}\n\n/*\n * The package.json files of the components are generated into node_modules/<component pkg name>/package.json\n * This function copies the generated package.json file into all the locations of the component.\n */\nasync function linkManifestsToInjectedDeps({\n rootDir,\n manifestsByPaths,\n injectedDeps,\n}: {\n rootDir: string;\n manifestsByPaths: Record<string, ProjectManifest>;\n injectedDeps: Record<string, string[]>;\n}) {\n await Promise.all(\n Object.entries(injectedDeps).map(async ([compDir, targetDirs]) => {\n const pkgName = manifestsByPaths[path.join(rootDir, compDir)]?.name;\n if (!pkgName) return;\n const pkgJsonPath = path.join(rootDir, 'node_modules', pkgName, 'package.json');\n if (fs.existsSync(pkgJsonPath)) {\n await Promise.all(\n targetDirs.map(async (targetDir) => {\n try {\n await fs.link(pkgJsonPath, path.join(targetDir, 'package.json'));\n } catch (err: any) {\n if (err.code !== 'EEXIST') throw err;\n }\n })\n );\n }\n })\n );\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 * Also, any local dependencies are extended with the \"injected\" option,\n * this tells pnpm to hard link the packages instead of symlinking them.\n */\nfunction readPackageHookForCapsules(pkg: PackageManifest, workspaceDir?: string): PackageManifest {\n // workspaceDir is set only for workspace packages\n if (workspaceDir) {\n return readDependencyPackageHook({\n ...pkg,\n dependencies: {\n ...pkg.dependencies,\n ...pkg.peerDependencies,\n ...pkg['defaultPeerDependencies'], // eslint-disable-line\n },\n });\n }\n return readDependencyPackageHook(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 if (!pkg.dependencies) {\n return pkg;\n }\n // workspaceDir is set only for workspace packages\n if (workspaceDir && !workspaceDir.includes('.bit_roots')) {\n return readWorkspacePackageHook(pkg);\n }\n return readDependencyPackageHook(pkg);\n}\n\n/**\n * This hook adds the \"injected\" option to any workspace dependency.\n * The injected option tell pnpm to hard link the packages instead of symlinking them.\n */\nfunction readDependencyPackageHook(pkg: PackageManifest): PackageManifest {\n const dependenciesMeta = pkg.dependenciesMeta ?? {};\n for (const [name, version] of Object.entries(pkg.dependencies ?? {})) {\n if (version.startsWith('workspace:')) {\n // This instructs pnpm to hard link the component from the workspace, not symlink it.\n dependenciesMeta[name] = { injected: true };\n }\n }\n return {\n ...pkg,\n dependenciesMeta,\n };\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 ...pkg['defaultPeerDependencies'], // eslint-disable-line\n ...newDeps,\n },\n };\n}\n\nfunction groupPkgs(manifestsByPaths: Record<string, ProjectManifest>) {\n const pkgs = Object.entries(manifestsByPaths).map(([dir, manifest]) => ({ dir, manifest }));\n const { graph } = createPkgGraph(pkgs);\n const chunks = sortPackages(graph as any);\n\n // This will create local link by pnpm to a component exists in the ws.\n // it will later deleted by the link process\n // we keep it here to better support case like this:\n // compA@1.0.0 uses compB@1.0.0\n // I have compB@2.0.0 in my workspace\n // now I install compA@1.0.0\n // compA is hoisted to the root and install B@1.0.0 hoisted to the root as well\n // now we will make link to B@2.0.0 and A will break\n // with this we will have a link to the local B by pnpm so it will install B@1.0.0 inside A\n // then when overriding the link, A will still works\n // This is the rational behind not deleting this completely, but need further check that it really works\n const packagesToBuild: MutatedProject[] = []; // @pnpm/core will use this to install the packages\n const allProjects: ProjectOptions[] = [];\n const workspacePackages = {}; // @pnpm/core will use this to link packages to each other\n\n chunks.forEach((dirs, buildIndex) => {\n for (const rootDir of dirs) {\n const manifest = manifestsByPaths[rootDir];\n allProjects.push({\n buildIndex,\n manifest,\n rootDir,\n });\n packagesToBuild.push({\n rootDir,\n mutation: 'install',\n });\n if (manifest.name) {\n workspacePackages[manifest.name] = workspacePackages[manifest.name] || {};\n workspacePackages[manifest.name][manifest.version] = { dir: rootDir, manifest };\n }\n }\n });\n return { packagesToBuild, allProjects, workspacePackages };\n}\n\nexport async function resolveRemoteVersion(\n packageName: string,\n rootDir: string,\n cacheDir: string,\n registries: Registries,\n proxyConfig: PackageManagerProxyConfig = {},\n networkConfig: PackageManagerNetworkConfig = {}\n): Promise<ResolvedPackageVersion> {\n const { resolve } = await generateResolverAndFetcher(cacheDir, registries, proxyConfig, networkConfig);\n const resolveOpts = {\n lockfileDir: rootDir,\n preferredVersions: {},\n projectDir: rootDir,\n registry: '',\n };\n try {\n const parsedPackage = parsePackageName(packageName);\n const registriesMap = getRegistriesMap(registries);\n const registry = pickRegistryForPackage(registriesMap, parsedPackage.name);\n const wantedDep: WantedDependency = {\n alias: parsedPackage.name,\n pref: parsedPackage.version,\n };\n const isValidRange = parsedPackage.version ? !!semver.validRange(parsedPackage.version) : false;\n resolveOpts.registry = registry;\n const val = await resolve(wantedDep, resolveOpts);\n if (!val.manifest) {\n throw new BitError('The resolved package has no manifest');\n }\n const version = isValidRange ? parsedPackage.version : val.manifest.version;\n\n return {\n packageName: val.manifest.name,\n version,\n isSemver: true,\n resolvedVia: val.resolvedVia,\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: WantedDependency = {\n alias: undefined,\n pref: 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.normalizedPref) {\n throw new BitError('The resolved package has no version');\n }\n return {\n packageName: val.manifest.name,\n version: val.normalizedPref,\n isSemver: false,\n resolvedVia: val.resolvedVia,\n };\n }\n}\n\nfunction getRegistriesMap(registries: Registries): RegistriesMap {\n const registriesMap = {\n default: registries.defaultRegistry.uri || NPM_REGISTRY,\n };\n\n Object.entries(registries.scopes).forEach(([registryName, registry]) => {\n registriesMap[`@${registryName}`] = registry.uri;\n });\n return registriesMap;\n}\n\nfunction getAuthConfig(registries: Registries): Record<string, any> {\n const res: any = {};\n res.registry = registries.defaultRegistry.uri;\n if (registries.defaultRegistry.alwaysAuth) {\n res['always-auth'] = true;\n }\n const defaultAuthTokens = getAuthTokenForRegistry(registries.defaultRegistry, true);\n defaultAuthTokens.forEach(({ keyName, val }) => {\n res[keyName] = val;\n });\n\n Object.entries(registries.scopes).forEach(([, registry]) => {\n const authTokens = getAuthTokenForRegistry(registry);\n authTokens.forEach(({ keyName, val }) => {\n res[keyName] = val;\n });\n if (registry.alwaysAuth) {\n const nerfed = toNerfDart(registry.uri);\n const alwaysAuthKeyName = `${nerfed}:always-auth`;\n res[alwaysAuthKeyName] = true;\n }\n });\n return res;\n}\n\nfunction getAuthTokenForRegistry(registry: Registry, isDefault = false): { keyName: string; val: string }[] {\n const nerfed = toNerfDart(registry.uri);\n if (registry.originalAuthType === 'authToken') {\n return [\n {\n keyName: `${nerfed}:_authToken`,\n val: registry.originalAuthValue || '',\n },\n ];\n }\n if (registry.originalAuthType === 'auth') {\n return [\n {\n keyName: isDefault ? '_auth' : `${nerfed}:_auth`,\n val: registry.originalAuthValue || '',\n },\n ];\n }\n if (registry.originalAuthType === 'user-pass') {\n return [\n {\n keyName: `${nerfed}:username`,\n val: registry.originalAuthValue?.split(':')[0] || '',\n },\n {\n keyName: `${nerfed}:_password`,\n val: registry.originalAuthValue?.split(':')[1] || '',\n },\n ];\n }\n return [];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAA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kB,EAAEiC,SAAS,GAAG,KAAK,EAAsC;EAC1G,MAAMH,MAAM,GAAG,IAAAC,mBAAU,EAAC/B,QAAQ,CAACoB,GAAG,CAAC;EACvC,IAAIpB,QAAQ,CAACkC,gBAAgB,KAAK,WAAW,EAAE;IAC7C,OAAO,CACL;MACEN,OAAO,EAAG,GAAEE,MAAO,aAAY;MAC/BpB,GAAG,EAAEV,QAAQ,CAACmC,iBAAiB,IAAI;IACrC,CAAC,CACF;EACH;EACA,IAAInC,QAAQ,CAACkC,gBAAgB,KAAK,MAAM,EAAE;IACxC,OAAO,CACL;MACEN,OAAO,EAAEK,SAAS,GAAG,OAAO,GAAI,GAAEH,MAAO,QAAO;MAChDpB,GAAG,EAAEV,QAAQ,CAACmC,iBAAiB,IAAI;IACrC,CAAC,CACF;EACH;EACA,IAAInC,QAAQ,CAACkC,gBAAgB,KAAK,WAAW,EAAE;IAAA;IAC7C,OAAO,CACL;MACEN,OAAO,EAAG,GAAEE,MAAO,WAAU;MAC7BpB,GAAG,EAAE,0BAAAV,QAAQ,CAACmC,iBAAiB,0DAA1B,sBAA4BC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAI;IACpD,CAAC,EACD;MACER,OAAO,EAAG,GAAEE,MAAO,YAAW;MAC9BpB,GAAG,EAAE,2BAAAV,QAAQ,CAACmC,iBAAiB,2DAA1B,uBAA4BC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAI;IACpD,CAAC,CACF;EACH;EACA,OAAO,EAAE;AACX"}
|
|
@@ -14,4 +14,5 @@ export declare class PnpmPackageManager implements PackageManager {
|
|
|
14
14
|
getNetworkConfig?(): Promise<PackageManagerNetworkConfig>;
|
|
15
15
|
getRegistries(): Promise<Registries>;
|
|
16
16
|
getInjectedDirs(rootDir: string, componentDir: string, packageName: string): Promise<string[]>;
|
|
17
|
+
getWorkspaceDepsOfBitRoots(manifests: ProjectManifest[]): Record<string, string>;
|
|
17
18
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
require("core-js/modules/es.array.iterator.js");
|
|
5
|
+
require("core-js/modules/es.object.from-entries.js");
|
|
4
6
|
require("core-js/modules/es.promise.js");
|
|
5
7
|
require("core-js/modules/es.regexp.exec.js");
|
|
6
8
|
require("core-js/modules/es.string.replace.js");
|
|
@@ -198,6 +200,9 @@ class PnpmPackageManager {
|
|
|
198
200
|
if ((modulesState === null || modulesState === void 0 ? void 0 : modulesState.injectedDeps) == null) return [];
|
|
199
201
|
return (_ref = (_modulesState$injecte = modulesState.injectedDeps[`node_modules/${packageName}`]) !== null && _modulesState$injecte !== void 0 ? _modulesState$injecte : modulesState.injectedDeps[componentDir]) !== null && _ref !== void 0 ? _ref : [];
|
|
200
202
|
}
|
|
203
|
+
getWorkspaceDepsOfBitRoots(manifests) {
|
|
204
|
+
return Object.fromEntries(manifests.map(manifest => [manifest.name, 'workspace:*']));
|
|
205
|
+
}
|
|
201
206
|
}
|
|
202
207
|
exports.PnpmPackageManager = PnpmPackageManager;
|
|
203
208
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PnpmPackageManager","constructor","depResolver","logger","memoize","readConfig","install","rootDir","manifests","installOptions","require","debug","setStatusLine","off","registries","getRegistries","proxyConfig","getProxyConfig","networkConfig","getNetworkConfig","config","packageManagerConfigRootDir","useNesting","extendWithComponentsFromDir","storeDir","cacheDir","engineStrict","nodeLinker","nodeVersion","includeOptionalDeps","overrides","hoistPattern","publicHoistPattern","packageImportMethod","rootComponents","rootComponentsForCapsules","peerDependencyRules","sideEffectsCacheRead","sideEffectsCache","sideEffectsCacheWrite","pnpmHomeDir","on","console","consoleSuccess","getPeerDependencyIssues","lynx","resolveRemoteVersion","packageName","options","maxSockets","rawConfig","networkConcurrency","fetchRetries","fetchTimeout","fetchRetryMaxtimeout","fetchRetryMintimeout","strictSSL","ca","cert","key","pnpmRegistry","defaultRegistry","Registry","default","uri","alwaysAuth","authHeaderValue","originalAuthType","originalAuthValue","pnpmScoped","omit","scopesRegistries","Object","keys","reduce","acc","scopedRegName","scopedReg","name","replace","bit","BIT_DEV_REGISTRY","Registries","getInjectedDirs","componentDir","modulesState","readModulesManifest","join","injectedDeps"],"sources":["pnpm.package-manager.ts"],"sourcesContent":["import {\n DependencyResolverMain,\n extendWithComponentsFromDir,\n InstallationContext,\n PackageManager,\n PackageManagerInstallOptions,\n PackageManagerResolveRemoteVersionOptions,\n ResolvedPackageVersion,\n Registries,\n Registry,\n BIT_DEV_REGISTRY,\n PackageManagerProxyConfig,\n PackageManagerNetworkConfig,\n} from '@teambit/dependency-resolver';\nimport { Logger } from '@teambit/logger';\nimport { memoize, omit } from 'lodash';\nimport { PeerDependencyIssuesByProjects } from '@pnpm/core';\nimport { readModulesManifest } from '@pnpm/modules-yaml';\nimport { ProjectManifest } from '@pnpm/types';\nimport { join } from 'path';\nimport { readConfig } from './read-config';\n\nexport class PnpmPackageManager implements PackageManager {\n private readConfig = memoize(readConfig);\n constructor(private depResolver: DependencyResolverMain, private logger: Logger) {}\n\n async install(\n { rootDir, manifests }: InstallationContext,\n installOptions: PackageManagerInstallOptions = {}\n ): Promise<void> {\n // require it dynamically for performance purpose. the pnpm package require many files - do not move to static import\n // eslint-disable-next-line global-require, import/no-dynamic-require\n const { install } = require('./lynx');\n\n this.logger.debug(`running installation in root dir ${rootDir}`);\n this.logger.debug('components manifests for installation', manifests);\n this.logger.setStatusLine('installing dependencies using pnpm');\n // turn off the logger because it interrupts the pnpm output\n this.logger.off();\n const registries = await this.depResolver.getRegistries();\n const proxyConfig = await this.depResolver.getProxyConfig();\n const networkConfig = await this.depResolver.getNetworkConfig();\n const { config } = await this.readConfig(installOptions.packageManagerConfigRootDir);\n if (!installOptions.useNesting) {\n manifests = await extendWithComponentsFromDir(rootDir, manifests);\n }\n await install(\n rootDir,\n manifests,\n config.storeDir,\n config.cacheDir,\n registries,\n proxyConfig,\n networkConfig,\n {\n engineStrict: installOptions.engineStrict ?? config.engineStrict,\n nodeLinker: installOptions.nodeLinker,\n nodeVersion: installOptions.nodeVersion ?? config.nodeVersion,\n includeOptionalDeps: installOptions.includeOptionalDeps,\n overrides: installOptions.overrides,\n hoistPattern: config.hoistPattern,\n publicHoistPattern: ['@eslint/plugin-*', '*eslint-plugin*', '@prettier/plugin-*', '*prettier-plugin-*'],\n packageImportMethod: installOptions.packageImportMethod ?? config.packageImportMethod,\n rootComponents: installOptions.rootComponents,\n rootComponentsForCapsules: installOptions.rootComponentsForCapsules,\n peerDependencyRules: installOptions.peerDependencyRules,\n sideEffectsCacheRead: installOptions.sideEffectsCache ?? true,\n sideEffectsCacheWrite: installOptions.sideEffectsCache ?? true,\n pnpmHomeDir: config.pnpmHomeDir,\n },\n this.logger\n );\n this.logger.on();\n // Make a divider row to improve output\n this.logger.console('-------------------------');\n this.logger.consoleSuccess('installing dependencies using pnpm');\n }\n\n async getPeerDependencyIssues(\n rootDir: string,\n manifests: Record<string, ProjectManifest>,\n installOptions: PackageManagerInstallOptions = {}\n ): Promise<PeerDependencyIssuesByProjects> {\n const proxyConfig = await this.depResolver.getProxyConfig();\n const networkConfig = await this.depResolver.getNetworkConfig();\n const registries = await this.depResolver.getRegistries();\n // require it dynamically for performance purpose. the pnpm package require many files - do not move to static import\n // eslint-disable-next-line global-require, import/no-dynamic-require\n const lynx = require('./lynx');\n const { config } = await this.readConfig(installOptions.packageManagerConfigRootDir);\n return lynx.getPeerDependencyIssues(manifests, {\n storeDir: config.storeDir,\n cacheDir: config.cacheDir,\n proxyConfig,\n registries,\n rootDir,\n networkConfig,\n overrides: installOptions.overrides,\n packageImportMethod: installOptions.packageImportMethod ?? config.packageImportMethod,\n });\n }\n\n async resolveRemoteVersion(\n packageName: string,\n options: PackageManagerResolveRemoteVersionOptions\n ): Promise<ResolvedPackageVersion> {\n // require it dynamically for performance purpose. the pnpm package require many files - do not move to static import\n // eslint-disable-next-line global-require, import/no-dynamic-require\n const { resolveRemoteVersion } = require('./lynx');\n const registries = await this.depResolver.getRegistries();\n const proxyConfig = await this.depResolver.getProxyConfig();\n const networkConfig = await this.depResolver.getNetworkConfig();\n const { config } = await this.readConfig(options.packageManagerConfigRootDir);\n return resolveRemoteVersion(packageName, options.rootDir, config.cacheDir, registries, proxyConfig, networkConfig);\n }\n\n async getProxyConfig?(): Promise<PackageManagerProxyConfig> {\n // eslint-disable-next-line global-require, import/no-dynamic-require\n const { getProxyConfig } = require('./get-proxy-config');\n const { config } = await this.readConfig();\n return getProxyConfig(config);\n }\n\n async getNetworkConfig?(): Promise<PackageManagerNetworkConfig> {\n const { config } = await this.readConfig();\n // We need to use config.rawConfig as it will only contain the settings defined by the user.\n // config contains default values of the settings when they are not defined by the user.\n return {\n maxSockets: config.rawConfig['max-sockets'],\n networkConcurrency: config.rawConfig['network-concurrency'],\n fetchRetries: config.rawConfig['fetch-retries'],\n fetchTimeout: config.rawConfig['fetch-timeout'],\n fetchRetryMaxtimeout: config.rawConfig['fetch-retry-maxtimeout'],\n fetchRetryMintimeout: config.rawConfig['fetch-retry-mintimeout'],\n strictSSL: config.rawConfig['strict-ssl'],\n // These settings don't have default value, so it is safe to read them from config\n // ca is automatically populated from the content of the file specified by cafile.\n ca: config.ca,\n cert: config.cert,\n key: config.key,\n };\n }\n\n async getRegistries(): Promise<Registries> {\n // eslint-disable-next-line global-require, import/no-dynamic-require\n const { getRegistries } = require('./get-registries');\n const { config } = await this.readConfig();\n const pnpmRegistry = await getRegistries(config);\n const defaultRegistry = new Registry(\n pnpmRegistry.default.uri,\n pnpmRegistry.default.alwaysAuth,\n pnpmRegistry.default.authHeaderValue,\n pnpmRegistry.default.originalAuthType,\n pnpmRegistry.default.originalAuthValue\n );\n\n const pnpmScoped = omit(pnpmRegistry, ['default']);\n const scopesRegistries: Record<string, Registry> = Object.keys(pnpmScoped).reduce((acc, scopedRegName) => {\n const scopedReg = pnpmScoped[scopedRegName];\n const name = scopedRegName.replace('@', '');\n acc[name] = new Registry(\n scopedReg.uri,\n scopedReg.alwaysAuth,\n scopedReg.authHeaderValue,\n scopedReg.originalAuthType,\n scopedReg.originalAuthValue\n );\n return acc;\n }, {});\n\n // Add bit registry server if not exist\n if (!scopesRegistries.bit) {\n scopesRegistries.bit = new Registry(BIT_DEV_REGISTRY, true);\n }\n\n return new Registries(defaultRegistry, scopesRegistries);\n }\n\n async getInjectedDirs(rootDir: string, componentDir: string, packageName: string): Promise<string[]> {\n const modulesState = await readModulesManifest(join(rootDir, 'node_modules'));\n if (modulesState?.injectedDeps == null) return [];\n return modulesState.injectedDeps[`node_modules/${packageName}`] ?? modulesState.injectedDeps[componentDir] ?? [];\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAeA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,kBAAkB,CAA2B;EAExDC,WAAW,CAASC,WAAmC,EAAUC,MAAc,EAAE;IAAA,KAA7DD,WAAmC,GAAnCA,WAAmC;IAAA,KAAUC,MAAc,GAAdA,MAAc;IAAA,oDAD1D,IAAAC,iBAAO,EAACC,wBAAU,CAAC;EAC0C;EAElF,MAAMC,OAAO,CACX;IAAEC,OAAO;IAAEC;EAA+B,CAAC,EAC3CC,cAA4C,GAAG,CAAC,CAAC,EAClC;IAAA;IACf;IACA;IACA,MAAM;MAAEH;IAAQ,CAAC,GAAGI,OAAO,CAAC,QAAQ,CAAC;IAErC,IAAI,CAACP,MAAM,CAACQ,KAAK,CAAE,oCAAmCJ,OAAQ,EAAC,CAAC;IAChE,IAAI,CAACJ,MAAM,CAACQ,KAAK,CAAC,uCAAuC,EAAEH,SAAS,CAAC;IACrE,IAA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CAAC,CAAC;;IAEN;IACA,IAAI,CAACJ,gBAAgB,CAACS,GAAG,EAAE;MACzBT,gBAAgB,CAACS,GAAG,GAAG,KAAIlB,8BAAQ,EAACmB,sCAAgB,EAAE,IAAI,CAAC;IAC7D;IAEA,OAAO,KAAIC,gCAAU,EAACrB,eAAe,EAAEU,gBAAgB,CAAC;EAC1D;EAEA,MAAMY,eAAe,CAAC5E,OAAe,EAAE6E,YAAoB,EAAErC,WAAmB,EAAqB;IAAA;IACnG,MAAMsC,YAAY,GAAG,MAAM,IAAAC,kCAAmB,EAAC,IAAAC,YAAI,EAAChF,OAAO,EAAE,cAAc,CAAC,CAAC;IAC7E,IAAI,CAAA8E,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,YAAY,KAAI,IAAI,EAAE,OAAO,EAAE;IACjD,wCAAOH,YAAY,CAACG,YAAY,CAAE,gBAAezC,WAAY,EAAC,CAAC,yEAAIsC,YAAY,CAACG,YAAY,CAACJ,YAAY,CAAC,uCAAI,EAAE;EAClH;AACF;AAAC"}
|
|
1
|
+
{"version":3,"names":["PnpmPackageManager","constructor","depResolver","logger","memoize","readConfig","install","rootDir","manifests","installOptions","require","debug","setStatusLine","off","registries","getRegistries","proxyConfig","getProxyConfig","networkConfig","getNetworkConfig","config","packageManagerConfigRootDir","useNesting","extendWithComponentsFromDir","storeDir","cacheDir","engineStrict","nodeLinker","nodeVersion","includeOptionalDeps","overrides","hoistPattern","publicHoistPattern","packageImportMethod","rootComponents","rootComponentsForCapsules","peerDependencyRules","sideEffectsCacheRead","sideEffectsCache","sideEffectsCacheWrite","pnpmHomeDir","on","console","consoleSuccess","getPeerDependencyIssues","lynx","resolveRemoteVersion","packageName","options","maxSockets","rawConfig","networkConcurrency","fetchRetries","fetchTimeout","fetchRetryMaxtimeout","fetchRetryMintimeout","strictSSL","ca","cert","key","pnpmRegistry","defaultRegistry","Registry","default","uri","alwaysAuth","authHeaderValue","originalAuthType","originalAuthValue","pnpmScoped","omit","scopesRegistries","Object","keys","reduce","acc","scopedRegName","scopedReg","name","replace","bit","BIT_DEV_REGISTRY","Registries","getInjectedDirs","componentDir","modulesState","readModulesManifest","join","injectedDeps","getWorkspaceDepsOfBitRoots","fromEntries","map","manifest"],"sources":["pnpm.package-manager.ts"],"sourcesContent":["import {\n DependencyResolverMain,\n extendWithComponentsFromDir,\n InstallationContext,\n PackageManager,\n PackageManagerInstallOptions,\n PackageManagerResolveRemoteVersionOptions,\n ResolvedPackageVersion,\n Registries,\n Registry,\n BIT_DEV_REGISTRY,\n PackageManagerProxyConfig,\n PackageManagerNetworkConfig,\n} from '@teambit/dependency-resolver';\nimport { Logger } from '@teambit/logger';\nimport { memoize, omit } from 'lodash';\nimport { PeerDependencyIssuesByProjects } from '@pnpm/core';\nimport { readModulesManifest } from '@pnpm/modules-yaml';\nimport { ProjectManifest } from '@pnpm/types';\nimport { join } from 'path';\nimport { readConfig } from './read-config';\n\nexport class PnpmPackageManager implements PackageManager {\n private readConfig = memoize(readConfig);\n constructor(private depResolver: DependencyResolverMain, private logger: Logger) {}\n\n async install(\n { rootDir, manifests }: InstallationContext,\n installOptions: PackageManagerInstallOptions = {}\n ): Promise<void> {\n // require it dynamically for performance purpose. the pnpm package require many files - do not move to static import\n // eslint-disable-next-line global-require, import/no-dynamic-require\n const { install } = require('./lynx');\n\n this.logger.debug(`running installation in root dir ${rootDir}`);\n this.logger.debug('components manifests for installation', manifests);\n this.logger.setStatusLine('installing dependencies using pnpm');\n // turn off the logger because it interrupts the pnpm output\n this.logger.off();\n const registries = await this.depResolver.getRegistries();\n const proxyConfig = await this.depResolver.getProxyConfig();\n const networkConfig = await this.depResolver.getNetworkConfig();\n const { config } = await this.readConfig(installOptions.packageManagerConfigRootDir);\n if (!installOptions.useNesting) {\n manifests = await extendWithComponentsFromDir(rootDir, manifests);\n }\n await install(\n rootDir,\n manifests,\n config.storeDir,\n config.cacheDir,\n registries,\n proxyConfig,\n networkConfig,\n {\n engineStrict: installOptions.engineStrict ?? config.engineStrict,\n nodeLinker: installOptions.nodeLinker,\n nodeVersion: installOptions.nodeVersion ?? config.nodeVersion,\n includeOptionalDeps: installOptions.includeOptionalDeps,\n overrides: installOptions.overrides,\n hoistPattern: config.hoistPattern,\n publicHoistPattern: ['@eslint/plugin-*', '*eslint-plugin*', '@prettier/plugin-*', '*prettier-plugin-*'],\n packageImportMethod: installOptions.packageImportMethod ?? config.packageImportMethod,\n rootComponents: installOptions.rootComponents,\n rootComponentsForCapsules: installOptions.rootComponentsForCapsules,\n peerDependencyRules: installOptions.peerDependencyRules,\n sideEffectsCacheRead: installOptions.sideEffectsCache ?? true,\n sideEffectsCacheWrite: installOptions.sideEffectsCache ?? true,\n pnpmHomeDir: config.pnpmHomeDir,\n },\n this.logger\n );\n this.logger.on();\n // Make a divider row to improve output\n this.logger.console('-------------------------');\n this.logger.consoleSuccess('installing dependencies using pnpm');\n }\n\n async getPeerDependencyIssues(\n rootDir: string,\n manifests: Record<string, ProjectManifest>,\n installOptions: PackageManagerInstallOptions = {}\n ): Promise<PeerDependencyIssuesByProjects> {\n const proxyConfig = await this.depResolver.getProxyConfig();\n const networkConfig = await this.depResolver.getNetworkConfig();\n const registries = await this.depResolver.getRegistries();\n // require it dynamically for performance purpose. the pnpm package require many files - do not move to static import\n // eslint-disable-next-line global-require, import/no-dynamic-require\n const lynx = require('./lynx');\n const { config } = await this.readConfig(installOptions.packageManagerConfigRootDir);\n return lynx.getPeerDependencyIssues(manifests, {\n storeDir: config.storeDir,\n cacheDir: config.cacheDir,\n proxyConfig,\n registries,\n rootDir,\n networkConfig,\n overrides: installOptions.overrides,\n packageImportMethod: installOptions.packageImportMethod ?? config.packageImportMethod,\n });\n }\n\n async resolveRemoteVersion(\n packageName: string,\n options: PackageManagerResolveRemoteVersionOptions\n ): Promise<ResolvedPackageVersion> {\n // require it dynamically for performance purpose. the pnpm package require many files - do not move to static import\n // eslint-disable-next-line global-require, import/no-dynamic-require\n const { resolveRemoteVersion } = require('./lynx');\n const registries = await this.depResolver.getRegistries();\n const proxyConfig = await this.depResolver.getProxyConfig();\n const networkConfig = await this.depResolver.getNetworkConfig();\n const { config } = await this.readConfig(options.packageManagerConfigRootDir);\n return resolveRemoteVersion(packageName, options.rootDir, config.cacheDir, registries, proxyConfig, networkConfig);\n }\n\n async getProxyConfig?(): Promise<PackageManagerProxyConfig> {\n // eslint-disable-next-line global-require, import/no-dynamic-require\n const { getProxyConfig } = require('./get-proxy-config');\n const { config } = await this.readConfig();\n return getProxyConfig(config);\n }\n\n async getNetworkConfig?(): Promise<PackageManagerNetworkConfig> {\n const { config } = await this.readConfig();\n // We need to use config.rawConfig as it will only contain the settings defined by the user.\n // config contains default values of the settings when they are not defined by the user.\n return {\n maxSockets: config.rawConfig['max-sockets'],\n networkConcurrency: config.rawConfig['network-concurrency'],\n fetchRetries: config.rawConfig['fetch-retries'],\n fetchTimeout: config.rawConfig['fetch-timeout'],\n fetchRetryMaxtimeout: config.rawConfig['fetch-retry-maxtimeout'],\n fetchRetryMintimeout: config.rawConfig['fetch-retry-mintimeout'],\n strictSSL: config.rawConfig['strict-ssl'],\n // These settings don't have default value, so it is safe to read them from config\n // ca is automatically populated from the content of the file specified by cafile.\n ca: config.ca,\n cert: config.cert,\n key: config.key,\n };\n }\n\n async getRegistries(): Promise<Registries> {\n // eslint-disable-next-line global-require, import/no-dynamic-require\n const { getRegistries } = require('./get-registries');\n const { config } = await this.readConfig();\n const pnpmRegistry = await getRegistries(config);\n const defaultRegistry = new Registry(\n pnpmRegistry.default.uri,\n pnpmRegistry.default.alwaysAuth,\n pnpmRegistry.default.authHeaderValue,\n pnpmRegistry.default.originalAuthType,\n pnpmRegistry.default.originalAuthValue\n );\n\n const pnpmScoped = omit(pnpmRegistry, ['default']);\n const scopesRegistries: Record<string, Registry> = Object.keys(pnpmScoped).reduce((acc, scopedRegName) => {\n const scopedReg = pnpmScoped[scopedRegName];\n const name = scopedRegName.replace('@', '');\n acc[name] = new Registry(\n scopedReg.uri,\n scopedReg.alwaysAuth,\n scopedReg.authHeaderValue,\n scopedReg.originalAuthType,\n scopedReg.originalAuthValue\n );\n return acc;\n }, {});\n\n // Add bit registry server if not exist\n if (!scopesRegistries.bit) {\n scopesRegistries.bit = new Registry(BIT_DEV_REGISTRY, true);\n }\n\n return new Registries(defaultRegistry, scopesRegistries);\n }\n\n async getInjectedDirs(rootDir: string, componentDir: string, packageName: string): Promise<string[]> {\n const modulesState = await readModulesManifest(join(rootDir, 'node_modules'));\n if (modulesState?.injectedDeps == null) return [];\n return modulesState.injectedDeps[`node_modules/${packageName}`] ?? modulesState.injectedDeps[componentDir] ?? [];\n }\n\n getWorkspaceDepsOfBitRoots(manifests: ProjectManifest[]): Record<string, string> {\n return Object.fromEntries(manifests.map((manifest) => [manifest.name, 'workspace:*']));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAeA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,kBAAkB,CAA2B;EAExDC,WAAW,CAASC,WAAmC,EAAUC,MAAc,EAAE;IAAA,KAA7DD,WAAmC,GAAnCA,WAAmC;IAAA,KAAUC,MAAc,GAAdA,MAAc;IAAA,oDAD1D,IAAAC,iBAAO,EAACC,wBAAU,CAAC;EAC0C;EAElF,MAAMC,OAAO,CACX;IAAEC,OAAO;IAAEC;EAA+B,CAAC,EAC3CC,cAA4C,GAAG,CAAC,CAAC,EAClC;IAAA;IACf;IACA;IACA,MAAM;MAAEH;IAAQ,CAAC,GAAGI,OAAO,CAAC,QAAQ,CAAC;IAErC,IAAI,CAACP,MAAM,CAACQ,KAAK,CAAE,oCAAmCJ,OAAQ,EAAC,CAAC;IAChE,IAAI,CAACJ,MAAM,CAACQ,KAAK,CAAC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,OAAOO,GAAG;IACZ,CAAC,EAAE,CAAC,CAAC,CAAC;;IAEN;IACA,IAAI,CAACJ,gBAAgB,CAACS,GAAG,EAAE;MACzBT,gBAAgB,CAACS,GAAG,GAAG,KAAIlB,8BAAQ,EAACmB,sCAAgB,EAAE,IAAI,CAAC;IAC7D;IAEA,OAAO,KAAIC,gCAAU,EAACrB,eAAe,EAAEU,gBAAgB,CAAC;EAC1D;EAEA,MAAMY,eAAe,CAAC5E,OAAe,EAAE6E,YAAoB,EAAErC,WAAmB,EAAqB;IAAA;IACnG,MAAMsC,YAAY,GAAG,MAAM,IAAAC,kCAAmB,EAAC,IAAAC,YAAI,EAAChF,OAAO,EAAE,cAAc,CAAC,CAAC;IAC7E,IAAI,CAAA8E,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,YAAY,KAAI,IAAI,EAAE,OAAO,EAAE;IACjD,wCAAOH,YAAY,CAACG,YAAY,CAAE,gBAAezC,WAAY,EAAC,CAAC,yEAAIsC,YAAY,CAACG,YAAY,CAACJ,YAAY,CAAC,uCAAI,EAAE;EAClH;EAEAK,0BAA0B,CAACjF,SAA4B,EAA0B;IAC/E,OAAOgE,MAAM,CAACkB,WAAW,CAAClF,SAAS,CAACmF,GAAG,CAAEC,QAAQ,IAAK,CAACA,QAAQ,CAACd,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC;EACxF;AACF;AAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.dependencies_pnpm@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.dependencies_pnpm@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.dependencies_pnpm@0.0.990/dist/pnpm.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.dependencies_pnpm@0.0.990/dist/pnpm.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,45 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/pnpm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.990",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/dependencies/pnpm",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.dependencies",
|
|
8
8
|
"name": "pnpm",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.990"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@pnpm/config": "16.
|
|
12
|
+
"@pnpm/config": "16.6.1",
|
|
13
13
|
"credentials-by-uri": "2.0.0",
|
|
14
14
|
"lodash": "4.17.21",
|
|
15
15
|
"nerf-dart": "1.0.0",
|
|
16
16
|
"@pnpm/logger": "5.0.0",
|
|
17
|
-
"@pnpm/client": "9.1.
|
|
18
|
-
"@pnpm/core": "7.
|
|
19
|
-
"@pnpm/default-reporter": "11.0.
|
|
20
|
-
"@pnpm/
|
|
17
|
+
"@pnpm/client": "9.1.3",
|
|
18
|
+
"@pnpm/core": "7.8.1",
|
|
19
|
+
"@pnpm/default-reporter": "11.0.33",
|
|
20
|
+
"@pnpm/modules-yaml": "11.1.0",
|
|
21
|
+
"@pnpm/package-store": "15.1.7",
|
|
21
22
|
"@pnpm/pick-registry-for-package": "4.0.3",
|
|
22
23
|
"@pnpm/sort-packages": "4.0.3",
|
|
23
|
-
"@pnpm/store-connection-manager": "5.2.
|
|
24
|
+
"@pnpm/store-connection-manager": "5.2.11",
|
|
24
25
|
"@pnpm/types": "8.10.0",
|
|
25
26
|
"@pnpm/workspace.pkgs-graph": "1.0.0",
|
|
27
|
+
"fs-extra": "10.0.0",
|
|
26
28
|
"parse-package-name": "0.1.0",
|
|
27
29
|
"semver": "7.3.4",
|
|
28
30
|
"@pnpm/error": "4.0.1",
|
|
29
|
-
"@pnpm/modules-yaml": "11.1.0",
|
|
30
31
|
"core-js": "^3.0.0",
|
|
31
32
|
"@babel/runtime": "7.20.0",
|
|
32
33
|
"@teambit/harmony": "0.4.6",
|
|
33
|
-
"@teambit/dependency-resolver": "0.0.
|
|
34
|
-
"@teambit/logger": "0.0.
|
|
34
|
+
"@teambit/dependency-resolver": "0.0.990",
|
|
35
|
+
"@teambit/logger": "0.0.757",
|
|
35
36
|
"@teambit/bit-error": "0.0.402",
|
|
36
|
-
"@teambit/cli": "0.0.
|
|
37
|
-
"@teambit/component": "0.0.
|
|
38
|
-
"@teambit/ui-foundation.ui.use-box.menu": "0.0.
|
|
39
|
-
"@teambit/ui": "0.0.
|
|
37
|
+
"@teambit/cli": "0.0.664",
|
|
38
|
+
"@teambit/component": "0.0.990",
|
|
39
|
+
"@teambit/ui-foundation.ui.use-box.menu": "0.0.133",
|
|
40
|
+
"@teambit/ui": "0.0.990"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@types/lodash": "4.14.165",
|
|
44
|
+
"@types/fs-extra": "9.0.7",
|
|
43
45
|
"@types/semver": "7.3.4",
|
|
44
46
|
"@types/react": "^17.0.8",
|
|
45
47
|
"@types/mocha": "9.1.0",
|
|
@@ -50,7 +52,7 @@
|
|
|
50
52
|
"@teambit/dependencies.aspect-docs.pnpm": "0.0.151"
|
|
51
53
|
},
|
|
52
54
|
"peerDependencies": {
|
|
53
|
-
"@teambit/legacy": "1.0.
|
|
55
|
+
"@teambit/legacy": "1.0.445",
|
|
54
56
|
"react": "^16.8.0 || ^17.0.0",
|
|
55
57
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
56
58
|
},
|
|
Binary file
|