@pnpm/store.create-cafs-store 1100.0.31 → 1100.0.32
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/CHANGELOG.md +19 -0
- package/lib/index.js +19 -9
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @pnpm/create-cafs-store
|
|
2
2
|
|
|
3
|
+
## 1100.0.32
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- `pnpm deploy` with a shared lockfile now copies workspace dependencies into the deploy directory, even when `packageImportMethod` is set to `hardlink`. Previously, their files were hard-linked to the workspace sources, so editing a source file also changed the deployed copy [pnpm/pnpm#12176](https://github.com/pnpm/pnpm/issues/12176).
|
|
8
|
+
|
|
9
|
+
- `pnpm install` no longer fails for an injected workspace dependency whose package publishes from a `publishConfig.directory` that its own `prepare` script builds. The injected copy now picks up that directory once `prepare` finishes building it. `pnpm install --frozen-lockfile` no longer reports the dependency as outdated while the directory has not been built yet. [pnpm/pnpm#7811](https://github.com/pnpm/pnpm/issues/7811)
|
|
10
|
+
|
|
11
|
+
- The side-effects cache now restores the symlinks that a build script creates inside a package. A warm install used to replace each of them with a copy of its target [#12859](https://github.com/pnpm/pnpm/issues/12859).
|
|
12
|
+
|
|
13
|
+
After upgrading, every package with a build script is built once more.
|
|
14
|
+
|
|
15
|
+
- Updated dependencies:
|
|
16
|
+
- @pnpm/building.pkg-requires-build@1100.0.19
|
|
17
|
+
- @pnpm/fetching.fetcher-base@1100.2.12
|
|
18
|
+
- @pnpm/fs.indexed-pkg-importer@1100.0.31
|
|
19
|
+
- @pnpm/store.cafs@1100.3.5
|
|
20
|
+
- @pnpm/store.controller-types@1101.3.2
|
|
21
|
+
|
|
3
22
|
## 1100.0.31
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/lib/index.js
CHANGED
|
@@ -11,9 +11,8 @@ export function createPackageImporterAsync(opts) {
|
|
|
11
11
|
const packageImportMethod = opts.packageImportMethod;
|
|
12
12
|
const gfm = getFlatMap.bind(null, opts.storeDir);
|
|
13
13
|
return async (to, opts) => {
|
|
14
|
-
const { filesMap, isBuilt } = gfm(opts.filesResponse, opts.sideEffectsCacheKey);
|
|
15
|
-
const
|
|
16
|
-
const pkgImportMethod = willBeBuilt
|
|
14
|
+
const { filesMap, isBuilt, symlinks } = gfm(opts.filesResponse, opts.sideEffectsCacheKey);
|
|
15
|
+
const pkgImportMethod = needsPrivateFiles(opts.filesResponse, !isBuilt && opts.requiresBuild === true)
|
|
17
16
|
? (packageImportMethod === 'copy' ? 'copy' : 'clone-or-copy')
|
|
18
17
|
: (packageImportMethod && packageImportMethod !== 'auto'
|
|
19
18
|
? packageImportMethod
|
|
@@ -26,6 +25,8 @@ export function createPackageImporterAsync(opts) {
|
|
|
26
25
|
force: opts.force,
|
|
27
26
|
keepModulesDir: Boolean(opts.keepModulesDir),
|
|
28
27
|
safeToSkip: opts.safeToSkip,
|
|
28
|
+
sourceExists: opts.filesResponse.sourceExists,
|
|
29
|
+
symlinks,
|
|
29
30
|
});
|
|
30
31
|
return { importMethod, isBuilt };
|
|
31
32
|
};
|
|
@@ -37,9 +38,8 @@ function createPackageImporter(opts) {
|
|
|
37
38
|
const packageImportMethod = opts.packageImportMethod;
|
|
38
39
|
const gfm = getFlatMap.bind(null, opts.storeDir);
|
|
39
40
|
return (to, opts) => {
|
|
40
|
-
const { filesMap, isBuilt } = gfm(opts.filesResponse, opts.sideEffectsCacheKey);
|
|
41
|
-
const
|
|
42
|
-
const pkgImportMethod = willBeBuilt
|
|
41
|
+
const { filesMap, isBuilt, symlinks } = gfm(opts.filesResponse, opts.sideEffectsCacheKey);
|
|
42
|
+
const pkgImportMethod = needsPrivateFiles(opts.filesResponse, !isBuilt && opts.requiresBuild === true)
|
|
43
43
|
? (packageImportMethod === 'copy' ? 'copy' : 'clone-or-copy')
|
|
44
44
|
: (packageImportMethod && packageImportMethod !== 'auto'
|
|
45
45
|
? packageImportMethod
|
|
@@ -52,10 +52,19 @@ function createPackageImporter(opts) {
|
|
|
52
52
|
force: opts.force,
|
|
53
53
|
keepModulesDir: Boolean(opts.keepModulesDir),
|
|
54
54
|
safeToSkip: opts.safeToSkip,
|
|
55
|
+
sourceExists: opts.filesResponse.sourceExists,
|
|
56
|
+
symlinks,
|
|
55
57
|
});
|
|
56
58
|
return { importMethod, isBuilt };
|
|
57
59
|
};
|
|
58
60
|
}
|
|
61
|
+
// A package that a build will still write to must not share inodes with its
|
|
62
|
+
// source. Neither may a local directory whose fetcher asked for private copies
|
|
63
|
+
// (`pnpm deploy`), even when a global `packageImportMethod` asks for hard links.
|
|
64
|
+
function needsPrivateFiles(filesResponse, willBeBuilt) {
|
|
65
|
+
return willBeBuilt ||
|
|
66
|
+
(filesResponse.resolvedFrom === 'local-dir' && filesResponse.packageImportMethod === 'clone-or-copy');
|
|
67
|
+
}
|
|
59
68
|
function getFlatMap(storeDir, filesResponse, targetEngine) {
|
|
60
69
|
if (targetEngine && filesResponse.sideEffectsMaps?.has(targetEngine)) {
|
|
61
70
|
const sideEffectMap = filesResponse.sideEffectsMaps.get(targetEngine);
|
|
@@ -63,6 +72,7 @@ function getFlatMap(storeDir, filesResponse, targetEngine) {
|
|
|
63
72
|
return {
|
|
64
73
|
filesMap,
|
|
65
74
|
isBuilt: true,
|
|
75
|
+
symlinks: sideEffectMap.symlinks,
|
|
66
76
|
};
|
|
67
77
|
}
|
|
68
78
|
return {
|
|
@@ -71,7 +81,7 @@ function getFlatMap(storeDir, filesResponse, targetEngine) {
|
|
|
71
81
|
};
|
|
72
82
|
}
|
|
73
83
|
// Apply side effects when we already have file location maps (fast path)
|
|
74
|
-
function applySideEffectsDiffWithMaps(baseFiles, { added, deleted }) {
|
|
84
|
+
function applySideEffectsDiffWithMaps(baseFiles, { added, deleted, symlinks }) {
|
|
75
85
|
const filesWithSideEffects = new Map();
|
|
76
86
|
// Add side effect files (already have file paths)
|
|
77
87
|
if (added) {
|
|
@@ -79,9 +89,9 @@ function applySideEffectsDiffWithMaps(baseFiles, { added, deleted }) {
|
|
|
79
89
|
filesWithSideEffects.set(name, filePath);
|
|
80
90
|
}
|
|
81
91
|
}
|
|
82
|
-
// Add base files that weren't deleted
|
|
92
|
+
// Add base files that weren't deleted or replaced by a symlink
|
|
83
93
|
for (const [fileName, filePath] of baseFiles) {
|
|
84
|
-
if (!deleted?.includes(fileName) && !filesWithSideEffects.has(fileName)) {
|
|
94
|
+
if (!deleted?.includes(fileName) && !filesWithSideEffects.has(fileName) && !symlinks?.has(fileName)) {
|
|
85
95
|
filesWithSideEffects.set(fileName, filePath);
|
|
86
96
|
}
|
|
87
97
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/store.create-cafs-store",
|
|
3
|
-
"version": "1100.0.
|
|
3
|
+
"version": "1100.0.32",
|
|
4
4
|
"description": "Create a CAFS store controller",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"test": "test"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@pnpm/building.pkg-requires-build": "1100.0.
|
|
41
|
-
"@pnpm/fetching.fetcher-base": "1100.2.
|
|
42
|
-
"@pnpm/fs.indexed-pkg-importer": "1100.0.
|
|
43
|
-
"@pnpm/store.cafs": "1100.3.
|
|
44
|
-
"@pnpm/store.controller-types": "1101.3.
|
|
40
|
+
"@pnpm/building.pkg-requires-build": "1100.0.19",
|
|
41
|
+
"@pnpm/fetching.fetcher-base": "1100.2.12",
|
|
42
|
+
"@pnpm/fs.indexed-pkg-importer": "1100.0.31",
|
|
43
|
+
"@pnpm/store.cafs": "1100.3.5",
|
|
44
|
+
"@pnpm/store.controller-types": "1101.3.2",
|
|
45
45
|
"memoize": "^11.0.0",
|
|
46
46
|
"ramda": "npm:@pnpm/ramda@0.28.1"
|
|
47
47
|
},
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@pnpm/logger": "1100.0.0",
|
|
53
|
-
"@pnpm/prepare": "1100.0.
|
|
54
|
-
"@pnpm/store.cafs-types": "1100.1.
|
|
55
|
-
"@pnpm/store.create-cafs-store": "1100.0.
|
|
53
|
+
"@pnpm/prepare": "1100.0.33",
|
|
54
|
+
"@pnpm/store.cafs-types": "1100.1.1",
|
|
55
|
+
"@pnpm/store.create-cafs-store": "1100.0.32",
|
|
56
56
|
"@types/ramda": "0.32.0"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|