@savvy-web/silk 1.1.0 → 1.1.2

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.
@@ -74158,6 +74158,26 @@ const DEFAULT_REGISTRIES = {
74158
74158
  github: "https://npm.pkg.github.com"
74159
74159
  };
74160
74160
  /**
74161
+ * Whether a registry endpoint participates in npm-style SLSA provenance.
74162
+ *
74163
+ * @remarks
74164
+ * The npm public registry and GitHub Packages both accept provenance attestations through the
74165
+ * Sigstore/OIDC trusted-publishing flow, so a {@link PublishTarget} bound to either is marked
74166
+ * `provenance: true` by default — this is what gates the release action's attestation step. JSR
74167
+ * and custom registries do not participate and resolve to `false`. Matching is endpoint-based
74168
+ * (not target-key based) so a custom key pointed at one of these registries still opts in.
74169
+ */
74170
+ const provenanceForRegistry = (registry) => {
74171
+ const normalized = /^[a-z]+:\/\//i.test(registry) ? registry : `https://${registry}`;
74172
+ let hostname;
74173
+ try {
74174
+ hostname = new URL(normalized).hostname.toLowerCase();
74175
+ } catch {
74176
+ return false;
74177
+ }
74178
+ return hostname === "registry.npmjs.org" || hostname === "npm.pkg.github.com";
74179
+ };
74180
+ /**
74161
74181
  * Silk publishability rules over `workspaces-effect`'s {@link PublishTarget}.
74162
74182
  *
74163
74183
  * @remarks
@@ -74199,28 +74219,41 @@ var SilkPublishability = class {
74199
74219
  name: t.name,
74200
74220
  registry: t.registry,
74201
74221
  directory: dirByGroup.get(t.group) ?? `dist/prod/${t.group}/pkg`,
74202
- access
74222
+ access,
74223
+ provenance: provenanceForRegistry(t.registry)
74203
74224
  }));
74204
74225
  }
74205
- return Object.keys(targets).map((id) => new PublishTarget({
74226
+ return Object.entries(targets).map(([id, target]) => {
74227
+ const registry = typeof target === "object" && target !== null && typeof target.registry === "string" ? target.registry : DEFAULT_REGISTRIES[id] ?? pc?.registry ?? NPM_DEFAULT;
74228
+ return new PublishTarget({
74229
+ name: pkgName,
74230
+ registry,
74231
+ directory: `dist/prod/${id}/pkg`,
74232
+ access,
74233
+ provenance: provenanceForRegistry(registry)
74234
+ });
74235
+ });
74236
+ }
74237
+ if (pc && (pc.access === "public" || pc.access === "restricted")) {
74238
+ const registry = pc.registry ?? NPM_DEFAULT;
74239
+ return [new PublishTarget({
74206
74240
  name: pkgName,
74207
- registry: DEFAULT_REGISTRIES[id] ?? pc?.registry ?? NPM_DEFAULT,
74208
- directory: `dist/prod/${id}/pkg`,
74209
- access
74210
- }));
74241
+ registry,
74242
+ directory: pc.directory ?? ".",
74243
+ access: pc.access,
74244
+ provenance: provenanceForRegistry(registry)
74245
+ })];
74246
+ }
74247
+ if (raw.private !== true) {
74248
+ const registry = pc?.registry ?? NPM_DEFAULT;
74249
+ return [new PublishTarget({
74250
+ name: pkgName,
74251
+ registry,
74252
+ directory: pc?.directory ?? ".",
74253
+ access: pc?.access ?? "public",
74254
+ provenance: provenanceForRegistry(registry)
74255
+ })];
74211
74256
  }
74212
- if (pc && (pc.access === "public" || pc.access === "restricted")) return [new PublishTarget({
74213
- name: pkgName,
74214
- registry: pc.registry ?? NPM_DEFAULT,
74215
- directory: pc.directory ?? ".",
74216
- access: pc.access
74217
- })];
74218
- if (raw.private !== true) return [new PublishTarget({
74219
- name: pkgName,
74220
- registry: pc?.registry ?? NPM_DEFAULT,
74221
- directory: pc?.directory ?? ".",
74222
- access: pc?.access ?? "public"
74223
- })];
74224
74257
  return [];
74225
74258
  }
74226
74259
  /**
@@ -74162,6 +74162,26 @@ const DEFAULT_REGISTRIES = {
74162
74162
  github: "https://npm.pkg.github.com"
74163
74163
  };
74164
74164
  /**
74165
+ * Whether a registry endpoint participates in npm-style SLSA provenance.
74166
+ *
74167
+ * @remarks
74168
+ * The npm public registry and GitHub Packages both accept provenance attestations through the
74169
+ * Sigstore/OIDC trusted-publishing flow, so a {@link PublishTarget} bound to either is marked
74170
+ * `provenance: true` by default — this is what gates the release action's attestation step. JSR
74171
+ * and custom registries do not participate and resolve to `false`. Matching is endpoint-based
74172
+ * (not target-key based) so a custom key pointed at one of these registries still opts in.
74173
+ */
74174
+ const provenanceForRegistry = (registry) => {
74175
+ const normalized = /^[a-z]+:\/\//i.test(registry) ? registry : `https://${registry}`;
74176
+ let hostname;
74177
+ try {
74178
+ hostname = new URL(normalized).hostname.toLowerCase();
74179
+ } catch {
74180
+ return false;
74181
+ }
74182
+ return hostname === "registry.npmjs.org" || hostname === "npm.pkg.github.com";
74183
+ };
74184
+ /**
74165
74185
  * Silk publishability rules over `workspaces-effect`'s {@link PublishTarget}.
74166
74186
  *
74167
74187
  * @remarks
@@ -74203,28 +74223,41 @@ var SilkPublishability = class {
74203
74223
  name: t.name,
74204
74224
  registry: t.registry,
74205
74225
  directory: dirByGroup.get(t.group) ?? `dist/prod/${t.group}/pkg`,
74206
- access
74226
+ access,
74227
+ provenance: provenanceForRegistry(t.registry)
74207
74228
  }));
74208
74229
  }
74209
- return Object.keys(targets).map((id) => new PublishTarget({
74230
+ return Object.entries(targets).map(([id, target]) => {
74231
+ const registry = typeof target === "object" && target !== null && typeof target.registry === "string" ? target.registry : DEFAULT_REGISTRIES[id] ?? pc?.registry ?? NPM_DEFAULT;
74232
+ return new PublishTarget({
74233
+ name: pkgName,
74234
+ registry,
74235
+ directory: `dist/prod/${id}/pkg`,
74236
+ access,
74237
+ provenance: provenanceForRegistry(registry)
74238
+ });
74239
+ });
74240
+ }
74241
+ if (pc && (pc.access === "public" || pc.access === "restricted")) {
74242
+ const registry = pc.registry ?? NPM_DEFAULT;
74243
+ return [new PublishTarget({
74210
74244
  name: pkgName,
74211
- registry: DEFAULT_REGISTRIES[id] ?? pc?.registry ?? NPM_DEFAULT,
74212
- directory: `dist/prod/${id}/pkg`,
74213
- access
74214
- }));
74245
+ registry,
74246
+ directory: pc.directory ?? ".",
74247
+ access: pc.access,
74248
+ provenance: provenanceForRegistry(registry)
74249
+ })];
74250
+ }
74251
+ if (raw.private !== true) {
74252
+ const registry = pc?.registry ?? NPM_DEFAULT;
74253
+ return [new PublishTarget({
74254
+ name: pkgName,
74255
+ registry,
74256
+ directory: pc?.directory ?? ".",
74257
+ access: pc?.access ?? "public",
74258
+ provenance: provenanceForRegistry(registry)
74259
+ })];
74215
74260
  }
74216
- if (pc && (pc.access === "public" || pc.access === "restricted")) return [new PublishTarget({
74217
- name: pkgName,
74218
- registry: pc.registry ?? NPM_DEFAULT,
74219
- directory: pc.directory ?? ".",
74220
- access: pc.access
74221
- })];
74222
- if (raw.private !== true) return [new PublishTarget({
74223
- name: pkgName,
74224
- registry: pc?.registry ?? NPM_DEFAULT,
74225
- directory: pc?.directory ?? ".",
74226
- access: pc?.access ?? "public"
74227
- })];
74228
74261
  return [];
74229
74262
  }
74230
74263
  /**
package/lint.d.ts CHANGED
@@ -143,7 +143,7 @@ declare const MARKDOWNLINT_TEMPLATE: {
143
143
  readonly fix: true;
144
144
  readonly gitignore: true;
145
145
  readonly noBanner: true;
146
- readonly ignores: readonly ["**/node_modules", "**/.cache", "**/coverage", "**/.coverage", "**/dist", "**/CHANGELOG.md", "**/.claude/plans", "**/docs/superpowers", "**/__test__/**/fixtures/**", "**/__fixtures__/**"];
146
+ readonly ignores: readonly ["**/.git", "**/node_modules", "**/.cache", "**/coverage", "**/.coverage", "**/dist", "**/CHANGELOG.md", "**/.claude/plans", "**/docs/superpowers", "**/__test__/**/fixtures/**", "**/__fixtures__/**"];
147
147
  readonly customRules: readonly ["@savvy-web/silk/changesets/markdownlint"];
148
148
  readonly config: {
149
149
  readonly default: true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@savvy-web/silk",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "private": false,
5
5
  "description": "The single Silk Suite dev-tooling package — changeset, commitlint, lint, and biome conventions",
6
6
  "homepage": "https://github.com/savvy-web/systems/tree/main/packages/silk",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@effect/platform": "^0.96.1",
69
- "@savvy-web/silk-effects": "1.2.0",
69
+ "@savvy-web/silk-effects": "1.3.1",
70
70
  "effect": "^3.21.3",
71
71
  "semver": "^7.8.4"
72
72
  },
@@ -75,8 +75,8 @@
75
75
  "@changesets/cli": "^2.31.0",
76
76
  "@commitlint/cli": "^21.0.1",
77
77
  "@commitlint/config-conventional": "^21.0.2",
78
- "@savvy-web/cli": "1.1.0",
79
- "@savvy-web/mcp": "1.1.0",
78
+ "@savvy-web/cli": "1.1.2",
79
+ "@savvy-web/mcp": "1.1.2",
80
80
  "@types/node": "^25.9.0",
81
81
  "@typescript/native-preview": "^7.0.0-dev.20260513.1",
82
82
  "commitizen": "^4.3.0",
@@ -16,6 +16,26 @@ const DEFAULT_REGISTRIES = {
16
16
  github: "https://npm.pkg.github.com"
17
17
  };
18
18
  /**
19
+ * Whether a registry endpoint participates in npm-style SLSA provenance.
20
+ *
21
+ * @remarks
22
+ * The npm public registry and GitHub Packages both accept provenance attestations through the
23
+ * Sigstore/OIDC trusted-publishing flow, so a {@link PublishTarget} bound to either is marked
24
+ * `provenance: true` by default — this is what gates the release action's attestation step. JSR
25
+ * and custom registries do not participate and resolve to `false`. Matching is endpoint-based
26
+ * (not target-key based) so a custom key pointed at one of these registries still opts in.
27
+ */
28
+ const provenanceForRegistry = (registry) => {
29
+ const normalized = /^[a-z]+:\/\//i.test(registry) ? registry : `https://${registry}`;
30
+ let hostname;
31
+ try {
32
+ hostname = new URL(normalized).hostname.toLowerCase();
33
+ } catch {
34
+ return false;
35
+ }
36
+ return hostname === "registry.npmjs.org" || hostname === "npm.pkg.github.com";
37
+ };
38
+ /**
19
39
  * Silk publishability rules over `workspaces-effect`'s {@link PublishTarget}.
20
40
  *
21
41
  * @remarks
@@ -57,28 +77,41 @@ var SilkPublishability = class {
57
77
  name: t.name,
58
78
  registry: t.registry,
59
79
  directory: dirByGroup.get(t.group) ?? `dist/prod/${t.group}/pkg`,
60
- access
80
+ access,
81
+ provenance: provenanceForRegistry(t.registry)
61
82
  }));
62
83
  }
63
- return Object.keys(targets).map((id) => new require_index.PublishTarget({
84
+ return Object.entries(targets).map(([id, target]) => {
85
+ const registry = typeof target === "object" && target !== null && typeof target.registry === "string" ? target.registry : DEFAULT_REGISTRIES[id] ?? pc?.registry ?? NPM_DEFAULT;
86
+ return new require_index.PublishTarget({
87
+ name: pkgName,
88
+ registry,
89
+ directory: `dist/prod/${id}/pkg`,
90
+ access,
91
+ provenance: provenanceForRegistry(registry)
92
+ });
93
+ });
94
+ }
95
+ if (pc && (pc.access === "public" || pc.access === "restricted")) {
96
+ const registry = pc.registry ?? NPM_DEFAULT;
97
+ return [new require_index.PublishTarget({
98
+ name: pkgName,
99
+ registry,
100
+ directory: pc.directory ?? ".",
101
+ access: pc.access,
102
+ provenance: provenanceForRegistry(registry)
103
+ })];
104
+ }
105
+ if (raw.private !== true) {
106
+ const registry = pc?.registry ?? NPM_DEFAULT;
107
+ return [new require_index.PublishTarget({
64
108
  name: pkgName,
65
- registry: DEFAULT_REGISTRIES[id] ?? pc?.registry ?? NPM_DEFAULT,
66
- directory: `dist/prod/${id}/pkg`,
67
- access
68
- }));
109
+ registry,
110
+ directory: pc?.directory ?? ".",
111
+ access: pc?.access ?? "public",
112
+ provenance: provenanceForRegistry(registry)
113
+ })];
69
114
  }
70
- if (pc && (pc.access === "public" || pc.access === "restricted")) return [new require_index.PublishTarget({
71
- name: pkgName,
72
- registry: pc.registry ?? NPM_DEFAULT,
73
- directory: pc.directory ?? ".",
74
- access: pc.access
75
- })];
76
- if (raw.private !== true) return [new require_index.PublishTarget({
77
- name: pkgName,
78
- registry: pc?.registry ?? NPM_DEFAULT,
79
- directory: pc?.directory ?? ".",
80
- access: pc?.access ?? "public"
81
- })];
82
115
  return [];
83
116
  }
84
117
  /**
@@ -16,6 +16,26 @@ const DEFAULT_REGISTRIES = {
16
16
  github: "https://npm.pkg.github.com"
17
17
  };
18
18
  /**
19
+ * Whether a registry endpoint participates in npm-style SLSA provenance.
20
+ *
21
+ * @remarks
22
+ * The npm public registry and GitHub Packages both accept provenance attestations through the
23
+ * Sigstore/OIDC trusted-publishing flow, so a {@link PublishTarget} bound to either is marked
24
+ * `provenance: true` by default — this is what gates the release action's attestation step. JSR
25
+ * and custom registries do not participate and resolve to `false`. Matching is endpoint-based
26
+ * (not target-key based) so a custom key pointed at one of these registries still opts in.
27
+ */
28
+ const provenanceForRegistry = (registry) => {
29
+ const normalized = /^[a-z]+:\/\//i.test(registry) ? registry : `https://${registry}`;
30
+ let hostname;
31
+ try {
32
+ hostname = new URL(normalized).hostname.toLowerCase();
33
+ } catch {
34
+ return false;
35
+ }
36
+ return hostname === "registry.npmjs.org" || hostname === "npm.pkg.github.com";
37
+ };
38
+ /**
19
39
  * Silk publishability rules over `workspaces-effect`'s {@link PublishTarget}.
20
40
  *
21
41
  * @remarks
@@ -57,28 +77,41 @@ var SilkPublishability = class {
57
77
  name: t.name,
58
78
  registry: t.registry,
59
79
  directory: dirByGroup.get(t.group) ?? `dist/prod/${t.group}/pkg`,
60
- access
80
+ access,
81
+ provenance: provenanceForRegistry(t.registry)
61
82
  }));
62
83
  }
63
- return Object.keys(targets).map((id) => new PublishTarget({
84
+ return Object.entries(targets).map(([id, target]) => {
85
+ const registry = typeof target === "object" && target !== null && typeof target.registry === "string" ? target.registry : DEFAULT_REGISTRIES[id] ?? pc?.registry ?? NPM_DEFAULT;
86
+ return new PublishTarget({
87
+ name: pkgName,
88
+ registry,
89
+ directory: `dist/prod/${id}/pkg`,
90
+ access,
91
+ provenance: provenanceForRegistry(registry)
92
+ });
93
+ });
94
+ }
95
+ if (pc && (pc.access === "public" || pc.access === "restricted")) {
96
+ const registry = pc.registry ?? NPM_DEFAULT;
97
+ return [new PublishTarget({
98
+ name: pkgName,
99
+ registry,
100
+ directory: pc.directory ?? ".",
101
+ access: pc.access,
102
+ provenance: provenanceForRegistry(registry)
103
+ })];
104
+ }
105
+ if (raw.private !== true) {
106
+ const registry = pc?.registry ?? NPM_DEFAULT;
107
+ return [new PublishTarget({
64
108
  name: pkgName,
65
- registry: DEFAULT_REGISTRIES[id] ?? pc?.registry ?? NPM_DEFAULT,
66
- directory: `dist/prod/${id}/pkg`,
67
- access
68
- }));
109
+ registry,
110
+ directory: pc?.directory ?? ".",
111
+ access: pc?.access ?? "public",
112
+ provenance: provenanceForRegistry(registry)
113
+ })];
69
114
  }
70
- if (pc && (pc.access === "public" || pc.access === "restricted")) return [new PublishTarget({
71
- name: pkgName,
72
- registry: pc.registry ?? NPM_DEFAULT,
73
- directory: pc.directory ?? ".",
74
- access: pc.access
75
- })];
76
- if (raw.private !== true) return [new PublishTarget({
77
- name: pkgName,
78
- registry: pc?.registry ?? NPM_DEFAULT,
79
- directory: pc?.directory ?? ".",
80
- access: pc?.access ?? "public"
81
- })];
82
115
  return [];
83
116
  }
84
117
  /**