@pnpm/installing.env-installer 1000.0.19 → 1100.0.0

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.
@@ -2,6 +2,7 @@ import { type EnvLockfile } from '@pnpm/lockfile.fs';
2
2
  import type { StoreController } from '@pnpm/store.controller';
3
3
  import type { ConfigDependencies, Registries } from '@pnpm/types';
4
4
  export interface InstallConfigDepsOpts {
5
+ frozenLockfile?: boolean;
5
6
  registries: Registries;
6
7
  rootDir: string;
7
8
  store: StoreController;
@@ -9,7 +9,7 @@ import { readEnvLockfile } from '@pnpm/lockfile.fs';
9
9
  import { safeReadPackageJsonFromDir } from '@pnpm/pkg-manifest.reader';
10
10
  import { rimraf } from '@zkochan/rimraf';
11
11
  import getNpmTarballUrl from 'get-npm-tarball-url';
12
- import symlinkDir from 'symlink-dir';
12
+ import { symlinkDir } from 'symlink-dir';
13
13
  import { migrateConfigDepsToLockfile } from './migrateConfigDeps.js';
14
14
  /**
15
15
  * Install config dependencies using the env lockfile.
@@ -81,6 +81,9 @@ async function normalizeForInstall(configDepsOrLockfile, opts) {
81
81
  return normalizeFromLockfile(envLockfile, opts.registries);
82
82
  }
83
83
  // No env lockfile yet — migrate from old inline integrity format
84
+ if (opts.frozenLockfile) {
85
+ throw new PnpmError('FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE', 'Cannot migrate configDependencies with "frozen-lockfile" because the lockfile is not up to date');
86
+ }
84
87
  return migrateConfigDepsToLockfile(configDepsOrLockfile, opts);
85
88
  }
86
89
  function isEnvLockfile(obj) {
@@ -1,10 +1,10 @@
1
1
  import { type CreateFetchFromRegistryOptions } from '@pnpm/network.fetch';
2
2
  import { type ResolverFactoryOptions } from '@pnpm/resolving.npm-resolver';
3
- import type { ConfigDependencies } from '@pnpm/types';
3
+ import type { ConfigDependencies, RegistryConfig } from '@pnpm/types';
4
4
  import { type InstallConfigDepsOpts } from './installConfigDeps.js';
5
5
  export type ResolveAndInstallConfigDepsOpts = CreateFetchFromRegistryOptions & ResolverFactoryOptions & InstallConfigDepsOpts & {
6
6
  rootDir: string;
7
- userConfig?: Record<string, string>;
7
+ configByUri?: Record<string, RegistryConfig>;
8
8
  };
9
9
  /**
10
10
  * Resolves any config dependencies that are missing from the env lockfile,
@@ -65,6 +65,9 @@ export async function resolveAndInstallConfigDeps(configDeps, opts) {
65
65
  }
66
66
  depsToResolve.push({ name, specifier });
67
67
  }
68
+ if (opts.frozenLockfile && (lockfileChanged || depsToResolve.length > 0)) {
69
+ throw new PnpmError('FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE', 'Cannot update configDependencies with "frozen-lockfile" because the lockfile is not up to date');
70
+ }
68
71
  if (depsToResolve.length === 0) {
69
72
  if (lockfileChanged) {
70
73
  await writeEnvLockfile(opts.rootDir, envLockfile);
@@ -73,9 +76,8 @@ export async function resolveAndInstallConfigDeps(configDeps, opts) {
73
76
  return;
74
77
  }
75
78
  // Resolve missing deps
76
- const userConfig = opts.userConfig ?? {};
77
79
  const fetch = createFetchFromRegistry(opts);
78
- const getAuthHeader = createGetAuthHeaderByURI({ allSettings: userConfig, userSettings: userConfig });
80
+ const getAuthHeader = createGetAuthHeaderByURI(opts.configByUri ?? {}, opts.registries?.default);
79
81
  const { resolveFromNpm } = createNpmResolver(fetch, getAuthHeader, opts);
80
82
  await Promise.all(depsToResolve.map(async ({ name, specifier }) => {
81
83
  const resolution = await resolveFromNpm({ alias: name, bareSpecifier: specifier }, {
@@ -1,10 +1,10 @@
1
1
  import { type CreateFetchFromRegistryOptions } from '@pnpm/network.fetch';
2
2
  import { type ResolverFactoryOptions } from '@pnpm/resolving.npm-resolver';
3
- import type { ConfigDependencies } from '@pnpm/types';
3
+ import type { ConfigDependencies, RegistryConfig } from '@pnpm/types';
4
4
  import { type InstallConfigDepsOpts } from './installConfigDeps.js';
5
5
  export type ResolveConfigDepsOpts = CreateFetchFromRegistryOptions & ResolverFactoryOptions & InstallConfigDepsOpts & {
6
6
  configDependencies?: ConfigDependencies;
7
7
  rootDir: string;
8
- userConfig?: Record<string, string>;
8
+ configByUri?: Record<string, RegistryConfig>;
9
9
  };
10
10
  export declare function resolveConfigDeps(configDeps: string[], opts: ResolveConfigDepsOpts): Promise<void>;
@@ -9,8 +9,11 @@ import { createNpmResolver } from '@pnpm/resolving.npm-resolver';
9
9
  import { parseWantedDependency } from '@pnpm/resolving.parse-wanted-dependency';
10
10
  import { installConfigDeps } from './installConfigDeps.js';
11
11
  export async function resolveConfigDeps(configDeps, opts) {
12
+ if (opts.frozenLockfile) {
13
+ throw new PnpmError('FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILE', 'Cannot resolve configDependencies with "frozen-lockfile" because the lockfile is not up to date');
14
+ }
12
15
  const fetch = createFetchFromRegistry(opts);
13
- const getAuthHeader = createGetAuthHeaderByURI({ allSettings: opts.userConfig, userSettings: opts.userConfig });
16
+ const getAuthHeader = createGetAuthHeaderByURI(opts.configByUri ?? {}, opts.registries?.default);
14
17
  const { resolveFromNpm } = createNpmResolver(fetch, getAuthHeader, opts);
15
18
  // Extract existing specifiers from configDependencies (handles both old and new formats)
16
19
  const configDependencySpecifiers = extractSpecifiers(opts.configDependencies);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/installing.env-installer",
3
- "version": "1000.0.19",
3
+ "version": "1100.0.0",
4
4
  "description": "Installer for configurational dependencies",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -27,39 +27,39 @@
27
27
  "dependencies": {
28
28
  "@zkochan/rimraf": "^4.0.0",
29
29
  "get-npm-tarball-url": "^2.1.0",
30
- "symlink-dir": "^7.0.0",
31
- "@pnpm/config.writer": "1000.0.14",
32
- "@pnpm/config.pick-registry-for-package": "1000.0.11",
33
- "@pnpm/constants": "1001.3.1",
34
- "@pnpm/core-loggers": "1001.0.4",
35
- "@pnpm/error": "1000.0.5",
36
- "@pnpm/installing.deps-resolver": "1008.3.1",
37
- "@pnpm/deps.graph-hasher": "1002.0.8",
38
- "@pnpm/fs.read-modules-dir": "1000.0.0",
39
- "@pnpm/lockfile.fs": "1001.1.21",
40
- "@pnpm/lockfile.pruner": "1001.0.17",
41
- "@pnpm/lockfile.types": "1002.0.2",
42
- "@pnpm/network.auth-header": "1000.0.6",
43
- "@pnpm/lockfile.utils": "1003.0.3",
44
- "@pnpm/network.fetch": "1000.2.6",
45
- "@pnpm/pkg-manifest.reader": "1000.1.2",
46
- "@pnpm/resolving.npm-resolver": "1004.4.1",
47
- "@pnpm/resolving.parse-wanted-dependency": "1001.0.0",
48
- "@pnpm/store.controller-types": "1004.1.0",
49
- "@pnpm/store.controller": "1004.0.0",
50
- "@pnpm/types": "1000.9.0"
30
+ "symlink-dir": "^10.0.1",
31
+ "@pnpm/config.pick-registry-for-package": "1100.0.0",
32
+ "@pnpm/core-loggers": "1100.0.0",
33
+ "@pnpm/config.writer": "1100.0.0",
34
+ "@pnpm/constants": "1100.0.0",
35
+ "@pnpm/deps.graph-hasher": "1100.0.0",
36
+ "@pnpm/fs.read-modules-dir": "1100.0.0",
37
+ "@pnpm/installing.deps-resolver": "1100.0.0",
38
+ "@pnpm/error": "1100.0.0",
39
+ "@pnpm/lockfile.fs": "1100.0.0",
40
+ "@pnpm/lockfile.types": "1100.0.0",
41
+ "@pnpm/network.fetch": "1100.0.0",
42
+ "@pnpm/network.auth-header": "1100.0.0",
43
+ "@pnpm/lockfile.pruner": "1100.0.0",
44
+ "@pnpm/pkg-manifest.reader": "1100.0.0",
45
+ "@pnpm/resolving.npm-resolver": "1100.0.0",
46
+ "@pnpm/lockfile.utils": "1100.0.0",
47
+ "@pnpm/store.controller": "1100.0.0",
48
+ "@pnpm/store.controller-types": "1100.0.0",
49
+ "@pnpm/resolving.parse-wanted-dependency": "1100.0.0",
50
+ "@pnpm/types": "1100.0.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@pnpm/logger": ">=1001.0.0 <1002.0.0",
54
- "@pnpm/worker": "^1000.3.0"
54
+ "@pnpm/worker": "^1100.0.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@pnpm/registry-mock": "5.2.4",
57
+ "@pnpm/registry-mock": "6.0.0",
58
58
  "load-json-file": "^7.0.1",
59
59
  "read-yaml-file": "^3.0.0",
60
- "@pnpm/installing.env-installer": "1000.0.19",
61
- "@pnpm/testing.temp-store": "1000.0.23",
62
- "@pnpm/prepare": "1000.0.4"
60
+ "@pnpm/testing.temp-store": "1100.0.0",
61
+ "@pnpm/prepare": "1100.0.0",
62
+ "@pnpm/installing.env-installer": "1100.0.0"
63
63
  },
64
64
  "engines": {
65
65
  "node": ">=22.13"
@@ -69,9 +69,9 @@
69
69
  },
70
70
  "scripts": {
71
71
  "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
72
- "_test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest",
73
- "test": "pnpm run compile && pnpm run _test",
72
+ "test": "pn compile && pn .test",
74
73
  "start": "tsgo --watch",
75
- "compile": "tsgo --build && pnpm run lint --fix"
74
+ "compile": "tsgo --build && pn lint --fix",
75
+ ".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
76
76
  }
77
77
  }