@savvy-web/pnpm-plugin-silk 0.1.0 → 0.3.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.
- package/README.md +17 -20
- package/index.cjs +38 -7
- package/index.d.ts +18 -0
- package/package.json +16 -9
- package/pnpmfile.cjs +73 -12
- package/tsdoc-metadata.json +1 -1
package/README.md
CHANGED
|
@@ -2,23 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@savvy-web/pnpm-plugin-silk)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](https://nodejs.org/)
|
|
6
6
|
[](https://pnpm.io/)
|
|
7
7
|
|
|
8
8
|
Centralized dependency version management for the Silk ecosystem via pnpm
|
|
9
|
-
config dependencies. Share curated dependency catalogs,
|
|
10
|
-
across multiple repositories from a single source
|
|
9
|
+
config dependencies. Share curated dependency catalogs, security overrides,
|
|
10
|
+
and build configurations across multiple repositories from a single source
|
|
11
|
+
of truth.
|
|
11
12
|
|
|
12
13
|
## Features
|
|
13
14
|
|
|
14
15
|
- **Dual catalog strategy** - Current versions for direct dependencies
|
|
15
16
|
(`catalog:silk`), permissive ranges for peer dependencies (`catalog:silkPeers`)
|
|
16
|
-
- **
|
|
17
|
-
|
|
18
|
-
- **
|
|
19
|
-
|
|
20
|
-
- **
|
|
21
|
-
|
|
17
|
+
- **Security overrides** - Centralized CVE fixes via `silkOverrides` that
|
|
18
|
+
propagate to all consuming repositories
|
|
19
|
+
- **Build configuration sync** - Shared `onlyBuiltDependencies` and
|
|
20
|
+
`publicHoistPattern` settings
|
|
21
|
+
- **Non-destructive merging** - Local definitions always take precedence with
|
|
22
|
+
clear warnings for divergences
|
|
22
23
|
|
|
23
24
|
## Installation
|
|
24
25
|
|
|
@@ -33,12 +34,9 @@ hash:
|
|
|
33
34
|
|
|
34
35
|
```yaml
|
|
35
36
|
configDependencies:
|
|
36
|
-
"@savvy-web/pnpm-plugin-silk": "0.
|
|
37
|
+
"@savvy-web/pnpm-plugin-silk": "0.2.0+sha512-..."
|
|
37
38
|
```
|
|
38
39
|
|
|
39
|
-
> **Note:** Config dependencies require exact versions with SHA-512 integrity
|
|
40
|
-
> checksums. The `pnpm add --config` command generates this automatically.
|
|
41
|
-
|
|
42
40
|
## Quick Start
|
|
43
41
|
|
|
44
42
|
Reference Silk catalogs in your `package.json`:
|
|
@@ -55,17 +53,16 @@ Reference Silk catalogs in your `package.json`:
|
|
|
55
53
|
}
|
|
56
54
|
```
|
|
57
55
|
|
|
58
|
-
The `silk` catalog provides current/latest versions for
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
## Documentation
|
|
56
|
+
The `silk` catalog provides current/latest versions for direct dependencies,
|
|
57
|
+
while `silkPeers` provides permissive ranges for peer dependencies. Security
|
|
58
|
+
overrides, build script allowlists, and hoist patterns are automatically
|
|
59
|
+
merged during `pnpm install`.
|
|
63
60
|
|
|
64
|
-
|
|
65
|
-
configuration, see [docs/](./docs/).
|
|
61
|
+
## More Information
|
|
66
62
|
|
|
67
63
|
- [Contributing](./CONTRIBUTING.md) - Development setup and guidelines
|
|
68
64
|
- [Security Policy](./SECURITY.md) - Vulnerability reporting
|
|
65
|
+
- [Design Documentation](./.claude/design/pnpm-plugin-silk/catalog-management.md) - Architecture and implementation details
|
|
69
66
|
|
|
70
67
|
## License
|
|
71
68
|
|
package/index.cjs
CHANGED
|
@@ -28,11 +28,19 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
const silkCatalogs = {
|
|
29
29
|
silk: {
|
|
30
30
|
"@changesets/cli": "^2.29.8",
|
|
31
|
-
"@
|
|
31
|
+
"@commitlint/cli": "^20.4.1",
|
|
32
|
+
"@commitlint/config-conventional": "^20.4.1",
|
|
33
|
+
"@microsoft/api-extractor": "^7.56.2",
|
|
32
34
|
"@rslib/core": "^0.19.4",
|
|
33
35
|
"@types/node": "^25.2.0",
|
|
34
36
|
"@typescript/native-preview": "^7.0.0-dev.20260203.1",
|
|
35
37
|
"@vitest/coverage-v8": "^4.0.18",
|
|
38
|
+
commitizen: "^4.3.1",
|
|
39
|
+
husky: "^9.1.7",
|
|
40
|
+
"lint-staged": "^16.2.7",
|
|
41
|
+
"markdownlint-cli2": "^0.20.0",
|
|
42
|
+
"markdownlint-cli2-formatter-codequality": "^0.0.7",
|
|
43
|
+
tsx: "^4.21.0",
|
|
36
44
|
turbo: "^2.8.3",
|
|
37
45
|
typescript: "^5.9.3",
|
|
38
46
|
vitest: "^4.0.18"
|
|
@@ -41,17 +49,40 @@ const silkCatalogs = {
|
|
|
41
49
|
"@biomejs/biome": "^2.3.12",
|
|
42
50
|
"@commitlint/cli": "^20.4.1",
|
|
43
51
|
"@commitlint/config-conventional": "^20.4.1",
|
|
44
|
-
"@microsoft/api-extractor": "^7.
|
|
45
|
-
"@rslib/core": "^0.19.3",
|
|
52
|
+
"@microsoft/api-extractor": "^7.56.2",
|
|
46
53
|
"@types/node": "^25.0.10",
|
|
47
54
|
"@typescript/native-preview": "^7.0.0-dev.20260124.1",
|
|
48
55
|
commitizen: "^4.3.1",
|
|
49
56
|
husky: "^9.1.7",
|
|
50
|
-
"lint-staged": "^16.2.7",
|
|
51
|
-
"markdownlint-cli2": "^0.20.0",
|
|
52
|
-
"markdownlint-cli2-formatter-codequality": "^0.0.7",
|
|
53
57
|
typescript: "^5.9.3"
|
|
54
|
-
}
|
|
58
|
+
},
|
|
59
|
+
silkOverrides: {
|
|
60
|
+
"@isaacs/brace-expansion": ">=5.0.1",
|
|
61
|
+
lodash: ">=4.17.23",
|
|
62
|
+
tmp: ">=0.2.4"
|
|
63
|
+
},
|
|
64
|
+
silkOnlyBuiltDependencies: [
|
|
65
|
+
"@parcel/watcher",
|
|
66
|
+
"@savvy-web/commitlint",
|
|
67
|
+
"@savvy-web/lint-staged",
|
|
68
|
+
"core-js",
|
|
69
|
+
"esbuild",
|
|
70
|
+
"msgpackr-extract"
|
|
71
|
+
],
|
|
72
|
+
silkPublicHoistPattern: [
|
|
73
|
+
"@commitlint/cli",
|
|
74
|
+
"@commitlint/config-conventional",
|
|
75
|
+
"@commitlint/cz-commitlint",
|
|
76
|
+
"@microsoft/api-extractor",
|
|
77
|
+
"@rslib/core",
|
|
78
|
+
"@typescript/native-preview",
|
|
79
|
+
"husky",
|
|
80
|
+
"lint-staged",
|
|
81
|
+
"markdownlint-cli2",
|
|
82
|
+
"markdownlint-cli2-formatter-codequality",
|
|
83
|
+
"turbo",
|
|
84
|
+
"typescript"
|
|
85
|
+
]
|
|
55
86
|
};
|
|
56
87
|
exports.silkCatalogs = __webpack_exports__.silkCatalogs;
|
|
57
88
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
package/index.d.ts
CHANGED
|
@@ -72,6 +72,21 @@ export declare interface SilkCatalogs {
|
|
|
72
72
|
* Use with `catalog:silkPeers` in package.json.
|
|
73
73
|
*/
|
|
74
74
|
readonly silkPeers: Catalog;
|
|
75
|
+
/**
|
|
76
|
+
* Security overrides for known CVEs.
|
|
77
|
+
* Synced to pnpm `overrides` configuration.
|
|
78
|
+
*/
|
|
79
|
+
readonly silkOverrides: Catalog;
|
|
80
|
+
/**
|
|
81
|
+
* Packages allowed to run build scripts during install.
|
|
82
|
+
* Synced to pnpm `onlyBuiltDependencies` configuration.
|
|
83
|
+
*/
|
|
84
|
+
readonly silkOnlyBuiltDependencies: readonly string[];
|
|
85
|
+
/**
|
|
86
|
+
* Packages to hoist to the virtual store root.
|
|
87
|
+
* Synced to pnpm `publicHoistPattern` configuration.
|
|
88
|
+
*/
|
|
89
|
+
readonly silkPublicHoistPattern: readonly string[];
|
|
75
90
|
}
|
|
76
91
|
|
|
77
92
|
/**
|
|
@@ -79,6 +94,9 @@ export declare interface SilkCatalogs {
|
|
|
79
94
|
*
|
|
80
95
|
* - `silk`: Current/latest versions for direct dependencies
|
|
81
96
|
* - `silkPeers`: Permissive ranges for peerDependencies
|
|
97
|
+
* - `silkOverrides`: Security overrides for known CVEs
|
|
98
|
+
* - `silkOnlyBuiltDependencies`: Packages allowed to run build scripts
|
|
99
|
+
* - `silkPublicHoistPattern`: Packages to hoist to virtual store root
|
|
82
100
|
*/
|
|
83
101
|
export declare const silkCatalogs: SilkCatalogs;
|
|
84
102
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvy-web/pnpm-plugin-silk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "pnpm config dependency for centralized catalog management across the Silk ecosystem.",
|
|
6
6
|
"keywords": [
|
|
@@ -32,14 +32,21 @@
|
|
|
32
32
|
"import": "./index.js"
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
|
-
"
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@types/node": "^25.2.0",
|
|
37
|
+
"@typescript/native-preview": "^7.0.0-dev.20260203.1",
|
|
38
|
+
"typescript": "^5.9.3"
|
|
39
|
+
},
|
|
40
|
+
"peerDependenciesMeta": {
|
|
41
|
+
"@types/node": {
|
|
42
|
+
"optional": false
|
|
43
|
+
},
|
|
44
|
+
"@typescript/native-preview": {
|
|
45
|
+
"optional": false
|
|
46
|
+
},
|
|
47
|
+
"typescript": {
|
|
48
|
+
"optional": false
|
|
49
|
+
}
|
|
43
50
|
},
|
|
44
51
|
"files": [
|
|
45
52
|
"!pnpm-plugin-silk.api.json",
|
package/pnpmfile.cjs
CHANGED
|
@@ -3,11 +3,19 @@ var __webpack_exports__ = {};
|
|
|
3
3
|
const silkCatalogs = {
|
|
4
4
|
silk: {
|
|
5
5
|
"@changesets/cli": "^2.29.8",
|
|
6
|
-
"@
|
|
6
|
+
"@commitlint/cli": "^20.4.1",
|
|
7
|
+
"@commitlint/config-conventional": "^20.4.1",
|
|
8
|
+
"@microsoft/api-extractor": "^7.56.2",
|
|
7
9
|
"@rslib/core": "^0.19.4",
|
|
8
10
|
"@types/node": "^25.2.0",
|
|
9
11
|
"@typescript/native-preview": "^7.0.0-dev.20260203.1",
|
|
10
12
|
"@vitest/coverage-v8": "^4.0.18",
|
|
13
|
+
commitizen: "^4.3.1",
|
|
14
|
+
husky: "^9.1.7",
|
|
15
|
+
"lint-staged": "^16.2.7",
|
|
16
|
+
"markdownlint-cli2": "^0.20.0",
|
|
17
|
+
"markdownlint-cli2-formatter-codequality": "^0.0.7",
|
|
18
|
+
tsx: "^4.21.0",
|
|
11
19
|
turbo: "^2.8.3",
|
|
12
20
|
typescript: "^5.9.3",
|
|
13
21
|
vitest: "^4.0.18"
|
|
@@ -16,17 +24,40 @@ const silkCatalogs = {
|
|
|
16
24
|
"@biomejs/biome": "^2.3.12",
|
|
17
25
|
"@commitlint/cli": "^20.4.1",
|
|
18
26
|
"@commitlint/config-conventional": "^20.4.1",
|
|
19
|
-
"@microsoft/api-extractor": "^7.
|
|
20
|
-
"@rslib/core": "^0.19.3",
|
|
27
|
+
"@microsoft/api-extractor": "^7.56.2",
|
|
21
28
|
"@types/node": "^25.0.10",
|
|
22
29
|
"@typescript/native-preview": "^7.0.0-dev.20260124.1",
|
|
23
30
|
commitizen: "^4.3.1",
|
|
24
31
|
husky: "^9.1.7",
|
|
25
|
-
"lint-staged": "^16.2.7",
|
|
26
|
-
"markdownlint-cli2": "^0.20.0",
|
|
27
|
-
"markdownlint-cli2-formatter-codequality": "^0.0.7",
|
|
28
32
|
typescript: "^5.9.3"
|
|
29
|
-
}
|
|
33
|
+
},
|
|
34
|
+
silkOverrides: {
|
|
35
|
+
"@isaacs/brace-expansion": ">=5.0.1",
|
|
36
|
+
lodash: ">=4.17.23",
|
|
37
|
+
tmp: ">=0.2.4"
|
|
38
|
+
},
|
|
39
|
+
silkOnlyBuiltDependencies: [
|
|
40
|
+
"@parcel/watcher",
|
|
41
|
+
"@savvy-web/commitlint",
|
|
42
|
+
"@savvy-web/lint-staged",
|
|
43
|
+
"core-js",
|
|
44
|
+
"esbuild",
|
|
45
|
+
"msgpackr-extract"
|
|
46
|
+
],
|
|
47
|
+
silkPublicHoistPattern: [
|
|
48
|
+
"@commitlint/cli",
|
|
49
|
+
"@commitlint/config-conventional",
|
|
50
|
+
"@commitlint/cz-commitlint",
|
|
51
|
+
"@microsoft/api-extractor",
|
|
52
|
+
"@rslib/core",
|
|
53
|
+
"@typescript/native-preview",
|
|
54
|
+
"husky",
|
|
55
|
+
"lint-staged",
|
|
56
|
+
"markdownlint-cli2",
|
|
57
|
+
"markdownlint-cli2-formatter-codequality",
|
|
58
|
+
"turbo",
|
|
59
|
+
"typescript"
|
|
60
|
+
]
|
|
30
61
|
};
|
|
31
62
|
const WARNING_BOX_WIDTH = 75;
|
|
32
63
|
function formatOverrideWarning(overrides) {
|
|
@@ -72,20 +103,50 @@ function mergeSingleCatalog(catalogName, silkCatalog, localCatalog, overrides) {
|
|
|
72
103
|
}
|
|
73
104
|
return merged;
|
|
74
105
|
}
|
|
106
|
+
function mergeOverrides(silkOverrides, localOverrides, overrideWarnings) {
|
|
107
|
+
const merged = {
|
|
108
|
+
...silkOverrides
|
|
109
|
+
};
|
|
110
|
+
if (!localOverrides) return merged;
|
|
111
|
+
for (const [pkg, localVersion] of Object.entries(localOverrides)){
|
|
112
|
+
const silkVersion = silkOverrides[pkg];
|
|
113
|
+
if (void 0 !== silkVersion && silkVersion !== localVersion) overrideWarnings.push({
|
|
114
|
+
catalog: "overrides",
|
|
115
|
+
package: pkg,
|
|
116
|
+
silkVersion,
|
|
117
|
+
localVersion
|
|
118
|
+
});
|
|
119
|
+
merged[pkg] = localVersion;
|
|
120
|
+
}
|
|
121
|
+
return merged;
|
|
122
|
+
}
|
|
123
|
+
function mergeStringArrays(silkArray, localArray) {
|
|
124
|
+
const merged = new Set(silkArray);
|
|
125
|
+
if (localArray) for (const item of localArray)merged.add(item);
|
|
126
|
+
return [
|
|
127
|
+
...merged
|
|
128
|
+
].sort((a, b)=>a.localeCompare(b));
|
|
129
|
+
}
|
|
75
130
|
function updateConfig(config) {
|
|
76
131
|
try {
|
|
77
|
-
const
|
|
132
|
+
const warnings = [];
|
|
78
133
|
const existingCatalogs = config.catalogs ?? {};
|
|
79
|
-
const mergedSilk = mergeSingleCatalog("silk", silkCatalogs.silk, existingCatalogs.silk,
|
|
80
|
-
const mergedSilkPeers = mergeSingleCatalog("silkPeers", silkCatalogs.silkPeers, existingCatalogs.silkPeers,
|
|
81
|
-
|
|
134
|
+
const mergedSilk = mergeSingleCatalog("silk", silkCatalogs.silk, existingCatalogs.silk, warnings);
|
|
135
|
+
const mergedSilkPeers = mergeSingleCatalog("silkPeers", silkCatalogs.silkPeers, existingCatalogs.silkPeers, warnings);
|
|
136
|
+
const mergedOverrides = mergeOverrides(silkCatalogs.silkOverrides, config.overrides, warnings);
|
|
137
|
+
const mergedOnlyBuiltDependencies = mergeStringArrays(silkCatalogs.silkOnlyBuiltDependencies, config.onlyBuiltDependencies);
|
|
138
|
+
const mergedPublicHoistPattern = mergeStringArrays(silkCatalogs.silkPublicHoistPattern, config.publicHoistPattern);
|
|
139
|
+
warnOverrides(warnings);
|
|
82
140
|
return {
|
|
83
141
|
...config,
|
|
84
142
|
catalogs: {
|
|
85
143
|
...existingCatalogs,
|
|
86
144
|
silk: mergedSilk,
|
|
87
145
|
silkPeers: mergedSilkPeers
|
|
88
|
-
}
|
|
146
|
+
},
|
|
147
|
+
overrides: mergedOverrides,
|
|
148
|
+
onlyBuiltDependencies: mergedOnlyBuiltDependencies,
|
|
149
|
+
publicHoistPattern: mergedPublicHoistPattern
|
|
89
150
|
};
|
|
90
151
|
} catch (error) {
|
|
91
152
|
console.warn("[pnpm-plugin-silk] Error merging catalogs, using local config only:", error instanceof Error ? error.message : String(error));
|