@savvy-web/pnpm-plugin-silk 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Savvy Web Strategy, LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # @savvy-web/pnpm-plugin-silk
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@savvy-web/pnpm-plugin-silk)](https://www.npmjs.com/package/@savvy-web/pnpm-plugin-silk)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D22-brightgreen)](https://nodejs.org/)
6
+ [![pnpm](https://img.shields.io/badge/pnpm-%3E%3D10-orange)](https://pnpm.io/)
7
+
8
+ Centralized dependency version management for the Silk ecosystem via pnpm
9
+ config dependencies. Share curated dependency catalogs, patches, and overrides
10
+ across multiple repositories from a single source of truth.
11
+
12
+ ## Features
13
+
14
+ - **Dual catalog strategy** - Current versions for direct dependencies
15
+ (`catalog:silk`), permissive ranges for peer dependencies (`catalog:silkPeers`)
16
+ - **Non-destructive merging** - Plugin catalogs merge with local definitions;
17
+ local entries always take precedence
18
+ - **Override warnings** - Clear console output when local versions override
19
+ Silk-managed defaults
20
+ - **Zero runtime dependencies** - Self-contained CommonJS bundle that pnpm loads
21
+ directly
22
+
23
+ ## Installation
24
+
25
+ Add as a config dependency using pnpm:
26
+
27
+ ```bash
28
+ pnpm add --config @savvy-web/pnpm-plugin-silk
29
+ ```
30
+
31
+ This adds the package to your `pnpm-workspace.yaml` with the required integrity
32
+ hash:
33
+
34
+ ```yaml
35
+ configDependencies:
36
+ "@savvy-web/pnpm-plugin-silk": "0.1.0+sha512-abc123..."
37
+ ```
38
+
39
+ > **Note:** Config dependencies require exact versions with SHA-512 integrity
40
+ > checksums. The `pnpm add --config` command generates this automatically.
41
+
42
+ ## Quick Start
43
+
44
+ Reference Silk catalogs in your `package.json`:
45
+
46
+ ```json
47
+ {
48
+ "devDependencies": {
49
+ "typescript": "catalog:silk",
50
+ "vitest": "catalog:silk"
51
+ },
52
+ "peerDependencies": {
53
+ "typescript": "catalog:silkPeers"
54
+ }
55
+ }
56
+ ```
57
+
58
+ The `silk` catalog provides current/latest versions for your direct
59
+ dependencies, while `silkPeers` provides permissive ranges that allow consumers
60
+ to use older compatible versions.
61
+
62
+ ## Documentation
63
+
64
+ For catalog contents, local overrides, TypeScript API, and advanced
65
+ configuration, see [docs/](./docs/).
66
+
67
+ - [Contributing](./CONTRIBUTING.md) - Development setup and guidelines
68
+ - [Security Policy](./SECURITY.md) - Vulnerability reporting
69
+
70
+ ## License
71
+
72
+ [MIT](./LICENSE)
package/index.cjs ADDED
@@ -0,0 +1,62 @@
1
+ var __webpack_require__ = {};
2
+ (()=>{
3
+ __webpack_require__.d = (exports1, definition)=>{
4
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
5
+ enumerable: true,
6
+ get: definition[key]
7
+ });
8
+ };
9
+ })();
10
+ (()=>{
11
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
12
+ })();
13
+ (()=>{
14
+ __webpack_require__.r = (exports1)=>{
15
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
16
+ value: 'Module'
17
+ });
18
+ Object.defineProperty(exports1, '__esModule', {
19
+ value: true
20
+ });
21
+ };
22
+ })();
23
+ var __webpack_exports__ = {};
24
+ __webpack_require__.r(__webpack_exports__);
25
+ __webpack_require__.d(__webpack_exports__, {
26
+ silkCatalogs: ()=>silkCatalogs
27
+ });
28
+ const silkCatalogs = {
29
+ silk: {
30
+ "@changesets/cli": "^2.29.8",
31
+ "@microsoft/api-extractor": "^7.56.0",
32
+ "@rslib/core": "^0.19.4",
33
+ "@types/node": "^25.2.0",
34
+ "@typescript/native-preview": "^7.0.0-dev.20260203.1",
35
+ "@vitest/coverage-v8": "^4.0.18",
36
+ turbo: "^2.8.3",
37
+ typescript: "^5.9.3",
38
+ vitest: "^4.0.18"
39
+ },
40
+ silkPeers: {
41
+ "@biomejs/biome": "^2.3.12",
42
+ "@commitlint/cli": "^20.4.1",
43
+ "@commitlint/config-conventional": "^20.4.1",
44
+ "@microsoft/api-extractor": "^7.55.2",
45
+ "@rslib/core": "^0.19.3",
46
+ "@types/node": "^25.0.10",
47
+ "@typescript/native-preview": "^7.0.0-dev.20260124.1",
48
+ commitizen: "^4.3.1",
49
+ 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
+ typescript: "^5.9.3"
54
+ }
55
+ };
56
+ exports.silkCatalogs = __webpack_exports__.silkCatalogs;
57
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
58
+ "silkCatalogs"
59
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
60
+ Object.defineProperty(exports, '__esModule', {
61
+ value: true
62
+ });
package/index.d.ts ADDED
@@ -0,0 +1,85 @@
1
+ /**
2
+ * pnpm-plugin-silk - Centralized catalog management for the Silk ecosystem.
3
+ *
4
+ * @remarks
5
+ * This package provides curated dependency versions via pnpm config dependencies.
6
+ * Use `catalog:silk` for pinned current versions and `catalog:silkPeers` for
7
+ * permissive peer dependency ranges that automatically merge into consuming repositories.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * import { silkCatalogs } from "@savvy-web/pnpm-plugin-silk";
12
+ * import type { Catalog, SilkCatalogs } from "@savvy-web/pnpm-plugin-silk";
13
+ *
14
+ * // Access current versions for direct dependencies
15
+ * console.log(silkCatalogs.silk.typescript); // "^5.9.3"
16
+ *
17
+ * // Access permissive ranges for peer dependencies
18
+ * console.log(silkCatalogs.silkPeers.typescript); // "^5.9.3"
19
+ * ```
20
+ *
21
+ * @see {@link silkCatalogs} for the pre-configured catalog instance
22
+ * @see {@link SilkCatalogs} for the catalog interface
23
+ *
24
+ * @packageDocumentation
25
+ */
26
+
27
+ /**
28
+ * A catalog is a record mapping package names to semver version ranges.
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * import type { Catalog } from "@savvy-web/pnpm-plugin-silk";
33
+ *
34
+ * const myCatalog: Catalog = {
35
+ * typescript: "^5.9.0",
36
+ * vitest: "^4.0.0",
37
+ * };
38
+ * ```
39
+ *
40
+ * @public
41
+ */
42
+ export declare type Catalog = Record<string, string>;
43
+
44
+ /**
45
+ * The Silk catalogs structure containing two named catalogs for version management.
46
+ *
47
+ * @remarks
48
+ * Use {@link silkCatalogs} to access the pre-configured catalog instance.
49
+ * The `silk` catalog contains pinned current versions for direct dependencies,
50
+ * while `silkPeers` contains permissive ranges suitable for peerDependencies.
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * import { silkCatalogs } from "@savvy-web/pnpm-plugin-silk";
55
+ * import type { SilkCatalogs } from "@savvy-web/pnpm-plugin-silk";
56
+ *
57
+ * // Access the pre-configured catalogs
58
+ * const typescriptVersion = silkCatalogs.silk.typescript;
59
+ * const peerRange = silkCatalogs.silkPeers.typescript;
60
+ * ```
61
+ *
62
+ * @public
63
+ */
64
+ export declare interface SilkCatalogs {
65
+ /**
66
+ * Current/latest versions for direct dependencies.
67
+ * Use with `catalog:silk` in package.json.
68
+ */
69
+ readonly silk: Catalog;
70
+ /**
71
+ * Permissive ranges for peerDependencies.
72
+ * Use with `catalog:silkPeers` in package.json.
73
+ */
74
+ readonly silkPeers: Catalog;
75
+ }
76
+
77
+ /**
78
+ * The complete Silk catalogs generated from pnpm-workspace.yaml.
79
+ *
80
+ * - `silk`: Current/latest versions for direct dependencies
81
+ * - `silkPeers`: Permissive ranges for peerDependencies
82
+ */
83
+ export declare const silkCatalogs: SilkCatalogs;
84
+
85
+ export { }
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@savvy-web/pnpm-plugin-silk",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "description": "pnpm config dependency for centralized catalog management across the Silk ecosystem.",
6
+ "keywords": [
7
+ "pnpm",
8
+ "pnpm-plugin",
9
+ "config-dependency",
10
+ "catalog",
11
+ "monorepo",
12
+ "silk"
13
+ ],
14
+ "homepage": "https://github.com/savvy-web/pnpm-plugin-silk#readme",
15
+ "bugs": {
16
+ "url": "https://github.com/savvy-web/pnpm-plugin-silk/issues"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/savvy-web/pnpm-plugin-silk.git"
21
+ },
22
+ "license": "MIT",
23
+ "author": {
24
+ "name": "C. Spencer Beggs",
25
+ "email": "spencer@savvyweb.systems",
26
+ "url": "https://savvyweb.systems"
27
+ },
28
+ "type": "commonjs",
29
+ "exports": {
30
+ ".": {
31
+ "types": "./index.d.ts",
32
+ "import": "./index.js"
33
+ }
34
+ },
35
+ "optionalDependencies": {
36
+ "@commitlint/cli": "^20.4.1",
37
+ "@commitlint/config-conventional": "^20.4.1",
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
+ },
44
+ "files": [
45
+ "!pnpm-plugin-silk.api.json",
46
+ "!tsconfig.json",
47
+ "!tsdoc.json",
48
+ "LICENSE",
49
+ "README.md",
50
+ "index.cjs",
51
+ "index.d.ts",
52
+ "package.json",
53
+ "pnpmfile.cjs",
54
+ "tsdoc-metadata.json"
55
+ ]
56
+ }
package/pnpmfile.cjs ADDED
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ var __webpack_exports__ = {};
3
+ const silkCatalogs = {
4
+ silk: {
5
+ "@changesets/cli": "^2.29.8",
6
+ "@microsoft/api-extractor": "^7.56.0",
7
+ "@rslib/core": "^0.19.4",
8
+ "@types/node": "^25.2.0",
9
+ "@typescript/native-preview": "^7.0.0-dev.20260203.1",
10
+ "@vitest/coverage-v8": "^4.0.18",
11
+ turbo: "^2.8.3",
12
+ typescript: "^5.9.3",
13
+ vitest: "^4.0.18"
14
+ },
15
+ silkPeers: {
16
+ "@biomejs/biome": "^2.3.12",
17
+ "@commitlint/cli": "^20.4.1",
18
+ "@commitlint/config-conventional": "^20.4.1",
19
+ "@microsoft/api-extractor": "^7.55.2",
20
+ "@rslib/core": "^0.19.3",
21
+ "@types/node": "^25.0.10",
22
+ "@typescript/native-preview": "^7.0.0-dev.20260124.1",
23
+ commitizen: "^4.3.1",
24
+ 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
+ typescript: "^5.9.3"
29
+ }
30
+ };
31
+ const WARNING_BOX_WIDTH = 75;
32
+ function formatOverrideWarning(overrides) {
33
+ if (0 === overrides.length) return "";
34
+ const lines = [];
35
+ const border = "─".repeat(WARNING_BOX_WIDTH - 2);
36
+ lines.push(`┌${border}┐`);
37
+ lines.push(`│ ⚠️ SILK CATALOG OVERRIDE DETECTED${" ".repeat(WARNING_BOX_WIDTH - 39)}│`);
38
+ lines.push(`├${border}┤`);
39
+ lines.push(`│ The following entries override Silk-managed versions:${" ".repeat(WARNING_BOX_WIDTH - 58)}│`);
40
+ lines.push(`│${" ".repeat(WARNING_BOX_WIDTH - 2)}│`);
41
+ for (const override of overrides){
42
+ const catalogPath = `catalogs.${override.catalog}.${override.package}`;
43
+ const silkLine = ` Silk version: ${override.silkVersion}`;
44
+ const localLine = ` Local override: ${override.localVersion}`;
45
+ lines.push(`│ ${catalogPath}${" ".repeat(WARNING_BOX_WIDTH - catalogPath.length - 4)}│`);
46
+ lines.push(`│${silkLine}${" ".repeat(WARNING_BOX_WIDTH - silkLine.length - 2)}│`);
47
+ lines.push(`│${localLine}${" ".repeat(WARNING_BOX_WIDTH - localLine.length - 2)}│`);
48
+ lines.push(`│${" ".repeat(WARNING_BOX_WIDTH - 2)}│`);
49
+ }
50
+ lines.push(`│ Local versions will be used. To use Silk defaults, remove these${" ".repeat(WARNING_BOX_WIDTH - 69)}│`);
51
+ lines.push(`│ entries from your pnpm-workspace.yaml catalogs section.${" ".repeat(WARNING_BOX_WIDTH - 62)}│`);
52
+ lines.push(`└${border}┘`);
53
+ return lines.join("\n");
54
+ }
55
+ function warnOverrides(overrides) {
56
+ if (overrides.length > 0) console.warn(formatOverrideWarning(overrides));
57
+ }
58
+ function mergeSingleCatalog(catalogName, silkCatalog, localCatalog, overrides) {
59
+ const merged = {
60
+ ...silkCatalog
61
+ };
62
+ if (!localCatalog) return merged;
63
+ for (const [pkg, localVersion] of Object.entries(localCatalog)){
64
+ const silkVersion = silkCatalog[pkg];
65
+ if (void 0 !== silkVersion && silkVersion !== localVersion) overrides.push({
66
+ catalog: catalogName,
67
+ package: pkg,
68
+ silkVersion,
69
+ localVersion
70
+ });
71
+ merged[pkg] = localVersion;
72
+ }
73
+ return merged;
74
+ }
75
+ function updateConfig(config) {
76
+ try {
77
+ const overrides = [];
78
+ const existingCatalogs = config.catalogs ?? {};
79
+ const mergedSilk = mergeSingleCatalog("silk", silkCatalogs.silk, existingCatalogs.silk, overrides);
80
+ const mergedSilkPeers = mergeSingleCatalog("silkPeers", silkCatalogs.silkPeers, existingCatalogs.silkPeers, overrides);
81
+ warnOverrides(overrides);
82
+ return {
83
+ ...config,
84
+ catalogs: {
85
+ ...existingCatalogs,
86
+ silk: mergedSilk,
87
+ silkPeers: mergedSilkPeers
88
+ }
89
+ };
90
+ } catch (error) {
91
+ console.warn("[pnpm-plugin-silk] Error merging catalogs, using local config only:", error instanceof Error ? error.message : String(error));
92
+ return config;
93
+ }
94
+ }
95
+ module.exports = {
96
+ hooks: {
97
+ updateConfig: updateConfig
98
+ }
99
+ };
100
+ for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
101
+ Object.defineProperty(exports, '__esModule', {
102
+ value: true
103
+ });
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.56.0"
9
+ }
10
+ ]
11
+ }