@pnpm/store.controller 1101.0.13 → 1102.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.
@@ -22,6 +22,7 @@ export interface CreatePackageStoreOptions {
22
22
  strictStorePkgContentCheck?: boolean;
23
23
  clearResolutionCache: () => void;
24
24
  customFetchers?: CustomFetcher[];
25
+ frozenStore?: boolean;
25
26
  storeIndex: StoreIndex;
26
27
  }
27
28
  export declare function createPackageStore(resolve: ResolveFunction, fetchers: Fetchers, initOpts: CreatePackageStoreOptions): StoreController;
@@ -1,5 +1,6 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
+ import { PnpmError } from '@pnpm/error';
3
4
  import { createPackageRequester } from '@pnpm/installing.package-requester';
4
5
  import { createCafsStore, createPackageImporterAsync } from '@pnpm/store.create-cafs-store';
5
6
  import { addFilesFromDir, importPackage, initStoreDir } from '@pnpm/worker';
@@ -8,6 +9,13 @@ export {};
8
9
  export function createPackageStore(resolve, fetchers, initOpts) {
9
10
  const storeDir = initOpts.storeDir;
10
11
  if (!fs.existsSync(path.join(storeDir, 'files'))) {
12
+ // A missing `{storeDir}/files` means the store has no content directory yet.
13
+ // Under frozenStore the store is meant to be a complete, read-only seed, so
14
+ // this is a setup error: initializing it would be a write into a read-only
15
+ // store. Fail fast with actionable guidance instead of swallowing the write.
16
+ if (initOpts.frozenStore) {
17
+ throw new PnpmError('FROZEN_STORE_INCOMPLETE', `frozenStore is enabled but the store at ${storeDir} is missing its content directory (${path.join(storeDir, 'files')}). The store must be fully seeded before it can be used read-only.`);
18
+ }
11
19
  initStoreDir(storeDir).catch(() => { });
12
20
  }
13
21
  const cafs = createCafsStore(storeDir, {
@@ -29,6 +37,7 @@ export function createPackageStore(resolve, fetchers, initOpts) {
29
37
  virtualStoreDirMaxLength: initOpts.virtualStoreDirMaxLength,
30
38
  strictStorePkgContentCheck: initOpts.strictStorePkgContentCheck,
31
39
  customFetchers: initOpts.customFetchers,
40
+ frozenStore: initOpts.frozenStore,
32
41
  });
33
42
  return {
34
43
  close: async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/store.controller",
3
- "version": "1101.0.13",
3
+ "version": "1102.0.0",
4
4
  "description": "A storage for packages",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -43,31 +43,31 @@
43
43
  "ramda": "npm:@pnpm/ramda@0.28.1",
44
44
  "ssri": "13.0.1",
45
45
  "symlink-dir": "^10.0.1",
46
- "@pnpm/crypto.hash": "1100.0.1",
47
46
  "@pnpm/error": "1100.0.0",
48
- "@pnpm/fetching.fetcher-base": "1100.1.8",
49
- "@pnpm/installing.package-requester": "1101.1.0",
50
- "@pnpm/resolving.resolver-base": "1100.4.1",
51
- "@pnpm/hooks.types": "1100.0.11",
52
- "@pnpm/store.cafs": "1100.1.9",
53
- "@pnpm/store.create-cafs-store": "1100.0.13",
54
- "@pnpm/store.index": "1100.1.0",
55
- "@pnpm/store.controller-types": "1100.1.4",
56
- "@pnpm/types": "1101.3.1"
47
+ "@pnpm/crypto.hash": "1100.0.1",
48
+ "@pnpm/fetching.fetcher-base": "1100.1.9",
49
+ "@pnpm/hooks.types": "1100.0.12",
50
+ "@pnpm/resolving.resolver-base": "1100.4.2",
51
+ "@pnpm/store.cafs": "1100.1.10",
52
+ "@pnpm/installing.package-requester": "1102.0.0",
53
+ "@pnpm/store.controller-types": "1100.1.5",
54
+ "@pnpm/store.index": "1100.2.0",
55
+ "@pnpm/store.create-cafs-store": "1100.0.14",
56
+ "@pnpm/types": "1101.3.2"
57
57
  },
58
58
  "peerDependencies": {
59
- "@pnpm/logger": "^1001.0.1",
60
- "@pnpm/worker": "^1100.1.11"
59
+ "@pnpm/logger": "^1100.0.0",
60
+ "@pnpm/worker": "^1100.2.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@jest/globals": "30.3.0",
63
+ "@jest/globals": "30.4.1",
64
64
  "@types/ramda": "0.31.1",
65
65
  "@types/ssri": "^7.1.5",
66
66
  "tempy": "3.0.0",
67
67
  "@pnpm/logger": "1100.0.0",
68
- "@pnpm/installing.client": "1100.2.7",
69
- "@pnpm/prepare": "1100.0.15",
70
- "@pnpm/store.controller": "1101.0.13"
68
+ "@pnpm/prepare": "1100.0.16",
69
+ "@pnpm/installing.client": "1100.2.8",
70
+ "@pnpm/store.controller": "1102.0.0"
71
71
  },
72
72
  "engines": {
73
73
  "node": ">=22.13"