@pnpm/installing.deps-installer 1012.0.1
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/LICENSE +22 -0
- package/README.md +259 -0
- package/lib/api.d.ts +3 -0
- package/lib/api.js +4 -0
- package/lib/getPeerDependencyIssues.d.ts +5 -0
- package/lib/getPeerDependencyIssues.js +70 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +5 -0
- package/lib/install/checkCompatibility/BreakingChangeError.d.ts +12 -0
- package/lib/install/checkCompatibility/BreakingChangeError.js +13 -0
- package/lib/install/checkCompatibility/CatalogVersionMismatchError.d.ts +9 -0
- package/lib/install/checkCompatibility/CatalogVersionMismatchError.js +11 -0
- package/lib/install/checkCompatibility/ErrorRelatedSources.d.ts +5 -0
- package/lib/install/checkCompatibility/ErrorRelatedSources.js +2 -0
- package/lib/install/checkCompatibility/ModulesBreakingChangeError.d.ts +9 -0
- package/lib/install/checkCompatibility/ModulesBreakingChangeError.js +15 -0
- package/lib/install/checkCompatibility/UnexpectedStoreError.d.ts +11 -0
- package/lib/install/checkCompatibility/UnexpectedStoreError.js +13 -0
- package/lib/install/checkCompatibility/UnexpectedVirtualStoreDirError.d.ts +11 -0
- package/lib/install/checkCompatibility/UnexpectedVirtualStoreDirError.js +13 -0
- package/lib/install/checkCompatibility/index.d.ts +6 -0
- package/lib/install/checkCompatibility/index.js +32 -0
- package/lib/install/checkCustomResolverForceResolve.d.ts +10 -0
- package/lib/install/checkCustomResolverForceResolve.js +47 -0
- package/lib/install/extendInstallOptions.d.ts +163 -0
- package/lib/install/extendInstallOptions.js +156 -0
- package/lib/install/index.d.ts +110 -0
- package/lib/install/index.js +1346 -0
- package/lib/install/link.d.ts +51 -0
- package/lib/install/link.js +382 -0
- package/lib/install/reportPeerDependencyIssues.d.ts +12 -0
- package/lib/install/reportPeerDependencyIssues.js +116 -0
- package/lib/install/validateModules.d.ts +26 -0
- package/lib/install/validateModules.js +135 -0
- package/lib/parseWantedDependencies.d.ts +17 -0
- package/lib/parseWantedDependencies.js +51 -0
- package/lib/pnpmPkgJson.d.ts +3 -0
- package/lib/pnpmPkgJson.js +14 -0
- package/lib/types.d.ts +2 -0
- package/lib/types.js +2 -0
- package/lib/uninstall/removeDeps.d.ts +5 -0
- package/lib/uninstall/removeDeps.js +36 -0
- package/package.json +168 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type { Catalogs } from '@pnpm/catalogs.types';
|
|
2
|
+
import { type VersionOverride } from '@pnpm/config.parse-overrides';
|
|
3
|
+
import type { CustomFetcher, CustomResolver, PreResolutionHookContext } from '@pnpm/hooks.types';
|
|
4
|
+
import type { ProjectOptions } from '@pnpm/installing.context';
|
|
5
|
+
import type { HoistingLimits } from '@pnpm/installing.deps-restorer';
|
|
6
|
+
import type { IncludedDependencies } from '@pnpm/installing.modules-yaml';
|
|
7
|
+
import type { LockfileObject } from '@pnpm/lockfile.fs';
|
|
8
|
+
import type { WorkspacePackages } from '@pnpm/resolving.resolver-base';
|
|
9
|
+
import type { StoreController } from '@pnpm/store.controller-types';
|
|
10
|
+
import type { AllowedDeprecatedVersions, PackageExtension, PackageVulnerabilityAudit, PeerDependencyRules, ReadPackageHook, Registries, SupportedArchitectures, TrustPolicy } from '@pnpm/types';
|
|
11
|
+
import type { ReporterFunction } from '../types.js';
|
|
12
|
+
export interface StrictInstallOptions {
|
|
13
|
+
autoConfirmAllPrompts: boolean;
|
|
14
|
+
autoInstallPeers: boolean;
|
|
15
|
+
autoInstallPeersFromHighestMatch: boolean;
|
|
16
|
+
catalogs: Catalogs;
|
|
17
|
+
catalogMode: 'strict' | 'prefer' | 'manual';
|
|
18
|
+
cleanupUnusedCatalogs: boolean;
|
|
19
|
+
frozenLockfile: boolean;
|
|
20
|
+
frozenLockfileIfExists: boolean;
|
|
21
|
+
enableGlobalVirtualStore: boolean;
|
|
22
|
+
enablePnp: boolean;
|
|
23
|
+
extraBinPaths: string[];
|
|
24
|
+
extraEnv: Record<string, string>;
|
|
25
|
+
hoistingLimits?: HoistingLimits;
|
|
26
|
+
externalDependencies?: Set<string>;
|
|
27
|
+
useLockfile: boolean;
|
|
28
|
+
saveLockfile: boolean;
|
|
29
|
+
useGitBranchLockfile: boolean;
|
|
30
|
+
mergeGitBranchLockfiles: boolean;
|
|
31
|
+
linkWorkspacePackagesDepth: number;
|
|
32
|
+
lockfileOnly: boolean;
|
|
33
|
+
forceFullResolution: boolean;
|
|
34
|
+
fixLockfile: boolean;
|
|
35
|
+
dedupe: boolean;
|
|
36
|
+
ignoreCompatibilityDb: boolean;
|
|
37
|
+
ignoreDepScripts: boolean;
|
|
38
|
+
ignorePackageManifest: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* When true, skip fetching local dependencies (file: protocol pointing to directories).
|
|
41
|
+
* This is used by `pnpm fetch` which only downloads packages from the registry
|
|
42
|
+
* and doesn't need local packages that won't be available (e.g., in Docker builds).
|
|
43
|
+
*/
|
|
44
|
+
ignoreLocalPackages: boolean;
|
|
45
|
+
preferFrozenLockfile: boolean;
|
|
46
|
+
saveWorkspaceProtocol: boolean | 'rolling';
|
|
47
|
+
lockfileCheck?: (prev: LockfileObject, next: LockfileObject) => void;
|
|
48
|
+
lockfileIncludeTarballUrl?: boolean;
|
|
49
|
+
preferWorkspacePackages: boolean;
|
|
50
|
+
preserveWorkspaceProtocol: boolean;
|
|
51
|
+
saveCatalogName?: string;
|
|
52
|
+
scriptsPrependNodePath: boolean | 'warn-only';
|
|
53
|
+
scriptShell?: string;
|
|
54
|
+
shellEmulator: boolean;
|
|
55
|
+
storeController: StoreController;
|
|
56
|
+
storeDir: string;
|
|
57
|
+
reporter: ReporterFunction;
|
|
58
|
+
force: boolean;
|
|
59
|
+
forcePublicHoistPattern: boolean;
|
|
60
|
+
depth: number;
|
|
61
|
+
lockfileDir: string;
|
|
62
|
+
modulesDir: string;
|
|
63
|
+
rawConfig: Record<string, any>;
|
|
64
|
+
verifyStoreIntegrity: boolean;
|
|
65
|
+
engineStrict: boolean;
|
|
66
|
+
allowBuilds?: Record<string, boolean | string>;
|
|
67
|
+
nodeLinker: 'isolated' | 'hoisted' | 'pnp';
|
|
68
|
+
nodeVersion?: string;
|
|
69
|
+
packageExtensions: Record<string, PackageExtension>;
|
|
70
|
+
ignoredOptionalDependencies: string[];
|
|
71
|
+
pnpmfile: string[] | string;
|
|
72
|
+
ignorePnpmfile: boolean;
|
|
73
|
+
packageManager: {
|
|
74
|
+
name: string;
|
|
75
|
+
version: string;
|
|
76
|
+
};
|
|
77
|
+
pruneLockfileImporters: boolean;
|
|
78
|
+
hooks: {
|
|
79
|
+
readPackage?: ReadPackageHook[];
|
|
80
|
+
preResolution?: Array<(ctx: PreResolutionHookContext) => Promise<void>>;
|
|
81
|
+
afterAllResolved?: Array<(lockfile: LockfileObject) => LockfileObject | Promise<LockfileObject>>;
|
|
82
|
+
customResolvers?: CustomResolver[];
|
|
83
|
+
customFetchers?: CustomFetcher[];
|
|
84
|
+
calculatePnpmfileChecksum?: () => Promise<string | undefined>;
|
|
85
|
+
};
|
|
86
|
+
sideEffectsCacheRead: boolean;
|
|
87
|
+
sideEffectsCacheWrite: boolean;
|
|
88
|
+
strictPeerDependencies: boolean;
|
|
89
|
+
include: IncludedDependencies;
|
|
90
|
+
includeDirect: IncludedDependencies;
|
|
91
|
+
ignoreCurrentSpecifiers: boolean;
|
|
92
|
+
ignoreScripts: boolean;
|
|
93
|
+
childConcurrency: number;
|
|
94
|
+
userAgent: string;
|
|
95
|
+
unsafePerm: boolean;
|
|
96
|
+
registries: Registries;
|
|
97
|
+
tag: string;
|
|
98
|
+
overrides: Record<string, string>;
|
|
99
|
+
ownLifecycleHooksStdio: 'inherit' | 'pipe';
|
|
100
|
+
workspacePackages?: WorkspacePackages;
|
|
101
|
+
pruneStore: boolean;
|
|
102
|
+
virtualStoreDir?: string;
|
|
103
|
+
globalVirtualStoreDir: string;
|
|
104
|
+
dir: string;
|
|
105
|
+
symlink: boolean;
|
|
106
|
+
enableModulesDir: boolean;
|
|
107
|
+
virtualStoreOnly: boolean;
|
|
108
|
+
modulesCacheMaxAge: number;
|
|
109
|
+
peerDependencyRules: PeerDependencyRules;
|
|
110
|
+
allowedDeprecatedVersions: AllowedDeprecatedVersions;
|
|
111
|
+
allowUnusedPatches: boolean;
|
|
112
|
+
preferSymlinkedExecutables: boolean;
|
|
113
|
+
resolutionMode: 'highest' | 'time-based' | 'lowest-direct';
|
|
114
|
+
resolvePeersFromWorkspaceRoot: boolean;
|
|
115
|
+
ignoreWorkspaceCycles: boolean;
|
|
116
|
+
disallowWorkspaceCycles: boolean;
|
|
117
|
+
publicHoistPattern: string[] | undefined;
|
|
118
|
+
hoistPattern: string[] | undefined;
|
|
119
|
+
forceHoistPattern: boolean;
|
|
120
|
+
shamefullyHoist: boolean;
|
|
121
|
+
forceShamefullyHoist: boolean;
|
|
122
|
+
global: boolean;
|
|
123
|
+
globalBin?: string;
|
|
124
|
+
patchedDependencies?: Record<string, string>;
|
|
125
|
+
allProjects: ProjectOptions[];
|
|
126
|
+
resolveSymlinksInInjectedDirs: boolean;
|
|
127
|
+
dedupeDirectDeps: boolean;
|
|
128
|
+
dedupeInjectedDeps: boolean;
|
|
129
|
+
dedupePeerDependents: boolean;
|
|
130
|
+
extendNodePath: boolean;
|
|
131
|
+
excludeLinksFromLockfile: boolean;
|
|
132
|
+
confirmModulesPurge: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Don't relink local directory dependencies if they are not hard linked from the local directory.
|
|
135
|
+
*
|
|
136
|
+
* This option was added to fix an issue with Bit CLI.
|
|
137
|
+
* Bit compile adds dist directories to the injected dependencies, so if pnpm were to relink them,
|
|
138
|
+
* the dist directories would be deleted.
|
|
139
|
+
*
|
|
140
|
+
* The option might be used in the future to improve performance.
|
|
141
|
+
*/
|
|
142
|
+
disableRelinkLocalDirDeps: boolean;
|
|
143
|
+
supportedArchitectures?: SupportedArchitectures;
|
|
144
|
+
hoistWorkspacePackages?: boolean;
|
|
145
|
+
virtualStoreDirMaxLength: number;
|
|
146
|
+
peersSuffixMaxLength: number;
|
|
147
|
+
returnListOfDepsRequiringBuild?: boolean;
|
|
148
|
+
injectWorkspacePackages?: boolean;
|
|
149
|
+
ci?: boolean;
|
|
150
|
+
minimumReleaseAge?: number;
|
|
151
|
+
minimumReleaseAgeExclude?: string[];
|
|
152
|
+
trustPolicy?: TrustPolicy;
|
|
153
|
+
trustPolicyExclude?: string[];
|
|
154
|
+
trustPolicyIgnoreAfter?: number;
|
|
155
|
+
packageVulnerabilityAudit?: PackageVulnerabilityAudit;
|
|
156
|
+
blockExoticSubdeps?: boolean;
|
|
157
|
+
}
|
|
158
|
+
export type InstallOptions = Partial<StrictInstallOptions> & Pick<StrictInstallOptions, 'storeDir' | 'storeController'>;
|
|
159
|
+
export interface ProcessedInstallOptions extends StrictInstallOptions {
|
|
160
|
+
readPackageHook?: ReadPackageHook;
|
|
161
|
+
parsedOverrides: VersionOverride[];
|
|
162
|
+
}
|
|
163
|
+
export declare function extendOptions(opts: InstallOptions): ProcessedInstallOptions;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { DEFAULT_REGISTRIES, normalizeRegistries } from '@pnpm/config.normalize-registries';
|
|
3
|
+
import { parseOverrides } from '@pnpm/config.parse-overrides';
|
|
4
|
+
import { WANTED_LOCKFILE } from '@pnpm/constants';
|
|
5
|
+
import { PnpmError } from '@pnpm/error';
|
|
6
|
+
import { createReadPackageHook } from '@pnpm/hooks.read-package-hook';
|
|
7
|
+
import { pnpmPkgJson } from '../pnpmPkgJson.js';
|
|
8
|
+
const defaults = (opts) => {
|
|
9
|
+
const packageManager = opts.packageManager ?? {
|
|
10
|
+
name: pnpmPkgJson.name,
|
|
11
|
+
version: pnpmPkgJson.version,
|
|
12
|
+
};
|
|
13
|
+
return {
|
|
14
|
+
allowedDeprecatedVersions: {},
|
|
15
|
+
allowUnusedPatches: false,
|
|
16
|
+
autoConfirmAllPrompts: opts.autoConfirmAllPrompts ?? false,
|
|
17
|
+
autoInstallPeers: true,
|
|
18
|
+
autoInstallPeersFromHighestMatch: false,
|
|
19
|
+
catalogs: {},
|
|
20
|
+
childConcurrency: 5,
|
|
21
|
+
confirmModulesPurge: !(opts.autoConfirmAllPrompts || opts.force),
|
|
22
|
+
depth: 0,
|
|
23
|
+
dedupeInjectedDeps: true,
|
|
24
|
+
enableGlobalVirtualStore: false,
|
|
25
|
+
enablePnp: false,
|
|
26
|
+
engineStrict: false,
|
|
27
|
+
force: false,
|
|
28
|
+
forceFullResolution: false,
|
|
29
|
+
frozenLockfile: false,
|
|
30
|
+
hoistPattern: undefined,
|
|
31
|
+
publicHoistPattern: undefined,
|
|
32
|
+
hooks: {},
|
|
33
|
+
ignoreCurrentSpecifiers: false,
|
|
34
|
+
ignoreDepScripts: false,
|
|
35
|
+
ignoreScripts: false,
|
|
36
|
+
include: {
|
|
37
|
+
dependencies: true,
|
|
38
|
+
devDependencies: true,
|
|
39
|
+
optionalDependencies: true,
|
|
40
|
+
},
|
|
41
|
+
includeDirect: {
|
|
42
|
+
dependencies: true,
|
|
43
|
+
devDependencies: true,
|
|
44
|
+
optionalDependencies: true,
|
|
45
|
+
},
|
|
46
|
+
lockfileDir: opts.lockfileDir ?? opts.dir ?? process.cwd(),
|
|
47
|
+
lockfileOnly: false,
|
|
48
|
+
nodeVersion: opts.nodeVersion,
|
|
49
|
+
nodeLinker: 'isolated',
|
|
50
|
+
overrides: {},
|
|
51
|
+
ownLifecycleHooksStdio: 'inherit',
|
|
52
|
+
ignoreCompatibilityDb: false,
|
|
53
|
+
ignorePackageManifest: false,
|
|
54
|
+
ignoreLocalPackages: false,
|
|
55
|
+
packageExtensions: {},
|
|
56
|
+
ignoredOptionalDependencies: [],
|
|
57
|
+
packageManager,
|
|
58
|
+
preferFrozenLockfile: true,
|
|
59
|
+
preferWorkspacePackages: false,
|
|
60
|
+
preserveWorkspaceProtocol: true,
|
|
61
|
+
pruneLockfileImporters: false,
|
|
62
|
+
pruneStore: false,
|
|
63
|
+
rawConfig: {},
|
|
64
|
+
registries: DEFAULT_REGISTRIES,
|
|
65
|
+
resolutionMode: 'lowest-direct',
|
|
66
|
+
saveWorkspaceProtocol: 'rolling',
|
|
67
|
+
scriptsPrependNodePath: false,
|
|
68
|
+
shamefullyHoist: false,
|
|
69
|
+
shellEmulator: false,
|
|
70
|
+
sideEffectsCacheRead: false,
|
|
71
|
+
sideEffectsCacheWrite: false,
|
|
72
|
+
symlink: true,
|
|
73
|
+
storeController: opts.storeController,
|
|
74
|
+
storeDir: opts.storeDir,
|
|
75
|
+
strictPeerDependencies: false,
|
|
76
|
+
tag: 'latest',
|
|
77
|
+
unsafePerm: process.platform === 'win32' ||
|
|
78
|
+
process.platform === 'cygwin' ||
|
|
79
|
+
!process.setgid ||
|
|
80
|
+
process.getuid?.() !== 0,
|
|
81
|
+
catalogMode: 'manual',
|
|
82
|
+
cleanupUnusedCatalogs: false,
|
|
83
|
+
useLockfile: true,
|
|
84
|
+
saveLockfile: true,
|
|
85
|
+
useGitBranchLockfile: false,
|
|
86
|
+
mergeGitBranchLockfiles: false,
|
|
87
|
+
userAgent: `${packageManager.name}/${packageManager.version} npm/? node/${process.version} ${process.platform} ${process.arch}`,
|
|
88
|
+
verifyStoreIntegrity: true,
|
|
89
|
+
enableModulesDir: true,
|
|
90
|
+
virtualStoreOnly: false,
|
|
91
|
+
modulesCacheMaxAge: 7 * 24 * 60,
|
|
92
|
+
resolveSymlinksInInjectedDirs: false,
|
|
93
|
+
dedupeDirectDeps: true,
|
|
94
|
+
dedupePeerDependents: true,
|
|
95
|
+
resolvePeersFromWorkspaceRoot: true,
|
|
96
|
+
extendNodePath: true,
|
|
97
|
+
ignoreWorkspaceCycles: false,
|
|
98
|
+
disallowWorkspaceCycles: false,
|
|
99
|
+
excludeLinksFromLockfile: false,
|
|
100
|
+
virtualStoreDirMaxLength: 120,
|
|
101
|
+
peersSuffixMaxLength: 1000,
|
|
102
|
+
blockExoticSubdeps: false,
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
export function extendOptions(opts) {
|
|
106
|
+
if (opts) {
|
|
107
|
+
for (const key in opts) {
|
|
108
|
+
if (opts[key] === undefined) {
|
|
109
|
+
delete opts[key];
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const defaultOpts = defaults(opts);
|
|
114
|
+
const extendedOpts = {
|
|
115
|
+
...defaultOpts,
|
|
116
|
+
...opts,
|
|
117
|
+
storeDir: defaultOpts.storeDir,
|
|
118
|
+
parsedOverrides: parseOverrides(opts.overrides ?? {}, opts.catalogs ?? {}),
|
|
119
|
+
};
|
|
120
|
+
extendedOpts.readPackageHook = createReadPackageHook({
|
|
121
|
+
ignoreCompatibilityDb: extendedOpts.ignoreCompatibilityDb,
|
|
122
|
+
readPackageHook: extendedOpts.hooks?.readPackage,
|
|
123
|
+
overrides: extendedOpts.parsedOverrides,
|
|
124
|
+
lockfileDir: extendedOpts.lockfileDir,
|
|
125
|
+
packageExtensions: extendedOpts.packageExtensions,
|
|
126
|
+
ignoredOptionalDependencies: extendedOpts.ignoredOptionalDependencies,
|
|
127
|
+
});
|
|
128
|
+
if (extendedOpts.virtualStoreOnly && !extendedOpts.enableModulesDir && !extendedOpts.enableGlobalVirtualStore) {
|
|
129
|
+
throw new PnpmError('CONFIG_CONFLICT_VIRTUAL_STORE_ONLY_WITH_NO_MODULES_DIR', 'Cannot use virtualStoreOnly when enableModulesDir is false (the standard virtual store requires node_modules/.pnpm)');
|
|
130
|
+
}
|
|
131
|
+
if (extendedOpts.virtualStoreOnly) {
|
|
132
|
+
// Ensure .modules.yaml records empty hoist patterns so a subsequent
|
|
133
|
+
// normal install knows hoisting must be redone from scratch.
|
|
134
|
+
extendedOpts.hoistPattern = [];
|
|
135
|
+
extendedOpts.publicHoistPattern = [];
|
|
136
|
+
}
|
|
137
|
+
if (extendedOpts.lockfileOnly) {
|
|
138
|
+
extendedOpts.ignoreScripts = true;
|
|
139
|
+
if (!extendedOpts.useLockfile) {
|
|
140
|
+
throw new PnpmError('CONFIG_CONFLICT_LOCKFILE_ONLY_WITH_NO_LOCKFILE', `Cannot generate a ${WANTED_LOCKFILE} because lockfile is set to false`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (extendedOpts.userAgent.startsWith('npm/')) {
|
|
144
|
+
extendedOpts.userAgent = `${extendedOpts.packageManager.name}/${extendedOpts.packageManager.version} ${extendedOpts.userAgent}`;
|
|
145
|
+
}
|
|
146
|
+
extendedOpts.registries = normalizeRegistries(extendedOpts.registries);
|
|
147
|
+
extendedOpts.rawConfig['registry'] = extendedOpts.registries.default;
|
|
148
|
+
if (extendedOpts.enableGlobalVirtualStore && extendedOpts.virtualStoreDir == null) {
|
|
149
|
+
extendedOpts.virtualStoreDir = path.join(extendedOpts.storeDir, 'links');
|
|
150
|
+
}
|
|
151
|
+
extendedOpts.globalVirtualStoreDir = extendedOpts.enableGlobalVirtualStore
|
|
152
|
+
? extendedOpts.virtualStoreDir
|
|
153
|
+
: path.join(extendedOpts.storeDir, 'links');
|
|
154
|
+
return extendedOpts;
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=extendInstallOptions.js.map
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { Catalogs } from '@pnpm/catalogs.types';
|
|
2
|
+
import { PnpmError } from '@pnpm/error';
|
|
3
|
+
import { type PinnedVersion, type UpdateMatchingFunction, type WantedDependency } from '@pnpm/installing.deps-resolver';
|
|
4
|
+
import { type InstallationResultStats } from '@pnpm/installing.deps-restorer';
|
|
5
|
+
import type { PreferredVersions } from '@pnpm/resolving.resolver-base';
|
|
6
|
+
import type { DependenciesField, DepPath, IgnoredBuilds, PeerDependencyIssues, ProjectId, ProjectManifest, ProjectRootDir, ReadPackageHook } from '@pnpm/types';
|
|
7
|
+
import { type InstallOptions } from './extendInstallOptions.js';
|
|
8
|
+
interface InstallMutationOptions {
|
|
9
|
+
update?: boolean;
|
|
10
|
+
updateToLatest?: boolean;
|
|
11
|
+
updateMatching?: UpdateMatchingFunction;
|
|
12
|
+
updatePackageManifest?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface InstallDepsMutation extends InstallMutationOptions {
|
|
15
|
+
mutation: 'install';
|
|
16
|
+
pruneDirectDependencies?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface InstallSomeDepsMutation extends InstallMutationOptions {
|
|
19
|
+
allowNew?: boolean;
|
|
20
|
+
dependencySelectors: string[];
|
|
21
|
+
mutation: 'installSome';
|
|
22
|
+
peer?: boolean;
|
|
23
|
+
pruneDirectDependencies?: boolean;
|
|
24
|
+
pinnedVersion?: PinnedVersion;
|
|
25
|
+
targetDependenciesField?: DependenciesField;
|
|
26
|
+
}
|
|
27
|
+
export interface UninstallSomeDepsMutation {
|
|
28
|
+
mutation: 'uninstallSome';
|
|
29
|
+
dependencyNames: string[];
|
|
30
|
+
targetDependenciesField?: DependenciesField;
|
|
31
|
+
}
|
|
32
|
+
export type DependenciesMutation = InstallDepsMutation | InstallSomeDepsMutation | UninstallSomeDepsMutation;
|
|
33
|
+
type Opts = Omit<InstallOptions, 'allProjects'> & {
|
|
34
|
+
preferredVersions?: PreferredVersions;
|
|
35
|
+
pruneDirectDependencies?: boolean;
|
|
36
|
+
binsDir?: string;
|
|
37
|
+
} & InstallMutationOptions;
|
|
38
|
+
export interface InstallResult {
|
|
39
|
+
/**
|
|
40
|
+
* A partial of new or updated catalog config entries. A change will be
|
|
41
|
+
* produced if a dependency using the catalog protocol was newly added or
|
|
42
|
+
* updated during this install. To obtain the full catalog, callers should
|
|
43
|
+
* merge this object with the current catalog configs in pnpm-workspace.yaml.
|
|
44
|
+
*/
|
|
45
|
+
updatedCatalogs: Catalogs | undefined;
|
|
46
|
+
updatedManifest: ProjectManifest;
|
|
47
|
+
ignoredBuilds: IgnoredBuilds | undefined;
|
|
48
|
+
}
|
|
49
|
+
export declare function install(manifest: ProjectManifest, opts: Opts): Promise<InstallResult>;
|
|
50
|
+
export type MutatedProject = DependenciesMutation & {
|
|
51
|
+
rootDir: ProjectRootDir;
|
|
52
|
+
};
|
|
53
|
+
export type MutateModulesOptions = InstallOptions & {
|
|
54
|
+
preferredVersions?: PreferredVersions;
|
|
55
|
+
hooks?: {
|
|
56
|
+
readPackage?: ReadPackageHook[] | ReadPackageHook;
|
|
57
|
+
} | InstallOptions['hooks'];
|
|
58
|
+
};
|
|
59
|
+
export interface MutateModulesInSingleProjectResult {
|
|
60
|
+
updatedCatalogs: Catalogs | undefined;
|
|
61
|
+
updatedProject: UpdatedProject;
|
|
62
|
+
ignoredBuilds: IgnoredBuilds | undefined;
|
|
63
|
+
}
|
|
64
|
+
export declare function mutateModulesInSingleProject(project: MutatedProject & {
|
|
65
|
+
binsDir?: string;
|
|
66
|
+
manifest: ProjectManifest;
|
|
67
|
+
rootDir: ProjectRootDir;
|
|
68
|
+
modulesDir?: string;
|
|
69
|
+
}, maybeOpts: Omit<MutateModulesOptions, 'allProjects'> & InstallMutationOptions): Promise<MutateModulesInSingleProjectResult>;
|
|
70
|
+
export interface MutateModulesResult {
|
|
71
|
+
updatedCatalogs?: Catalogs;
|
|
72
|
+
updatedProjects: UpdatedProject[];
|
|
73
|
+
stats: InstallationResultStats;
|
|
74
|
+
depsRequiringBuild?: DepPath[];
|
|
75
|
+
ignoredBuilds: IgnoredBuilds | undefined;
|
|
76
|
+
}
|
|
77
|
+
export declare function mutateModules(projects: MutatedProject[], maybeOpts: MutateModulesOptions): Promise<MutateModulesResult>;
|
|
78
|
+
export declare function addDependenciesToPackage(manifest: ProjectManifest, dependencySelectors: string[], opts: Omit<InstallOptions, 'allProjects'> & {
|
|
79
|
+
bin?: string;
|
|
80
|
+
allowNew?: boolean;
|
|
81
|
+
peer?: boolean;
|
|
82
|
+
pinnedVersion?: 'major' | 'minor' | 'patch';
|
|
83
|
+
targetDependenciesField?: DependenciesField;
|
|
84
|
+
} & InstallMutationOptions): Promise<InstallResult>;
|
|
85
|
+
export type ImporterToUpdate = {
|
|
86
|
+
buildIndex: number;
|
|
87
|
+
binsDir: string;
|
|
88
|
+
id: ProjectId;
|
|
89
|
+
manifest: ProjectManifest;
|
|
90
|
+
originalManifest?: ProjectManifest;
|
|
91
|
+
modulesDir: string;
|
|
92
|
+
rootDir: ProjectRootDir;
|
|
93
|
+
pruneDirectDependencies: boolean;
|
|
94
|
+
removePackages?: string[];
|
|
95
|
+
updatePackageManifest: boolean;
|
|
96
|
+
wantedDependencies: Array<WantedDependency & {
|
|
97
|
+
isNew?: boolean;
|
|
98
|
+
updateSpec?: boolean;
|
|
99
|
+
}>;
|
|
100
|
+
} & DependenciesMutation;
|
|
101
|
+
export interface UpdatedProject {
|
|
102
|
+
originalManifest?: ProjectManifest;
|
|
103
|
+
manifest: ProjectManifest;
|
|
104
|
+
peerDependencyIssues?: PeerDependencyIssues;
|
|
105
|
+
rootDir: ProjectRootDir;
|
|
106
|
+
}
|
|
107
|
+
export declare class IgnoredBuildsError extends PnpmError {
|
|
108
|
+
constructor(ignoredBuilds: IgnoredBuilds);
|
|
109
|
+
}
|
|
110
|
+
export {};
|