@savvy-web/silk 1.3.11 → 2.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.
Files changed (159) hide show
  1. package/README.md +7 -5
  2. package/changesets-changelog.cjs +39298 -96760
  3. package/changesets-changelog.d.cts +24 -14
  4. package/changesets-changelog.d.ts +24 -14
  5. package/changesets-changelog.js +54057 -1
  6. package/changesets-markdownlint.cjs +39295 -96757
  7. package/changesets-markdownlint.d.cts +24 -14
  8. package/changesets-markdownlint.d.ts +24 -14
  9. package/changesets-markdownlint.js +54057 -1
  10. package/package.json +6 -5
  11. package/tsconfig/node/dist/tsconfig.tsbuildinfo +1 -1
  12. package/_virtual/_rolldown/runtime.cjs +0 -45
  13. package/_virtual/_rolldown/runtime.js +0 -45
  14. package/packages/silk-effects/dist/dev/pkg/_virtual/_rolldown/runtime.cjs +0 -15
  15. package/packages/silk-effects/dist/dev/pkg/_virtual/_rolldown/runtime.js +0 -14
  16. package/packages/silk-effects/dist/dev/pkg/changesets/api/categories.cjs +0 -247
  17. package/packages/silk-effects/dist/dev/pkg/changesets/api/categories.js +0 -247
  18. package/packages/silk-effects/dist/dev/pkg/changesets/api/changelog.cjs +0 -134
  19. package/packages/silk-effects/dist/dev/pkg/changesets/api/changelog.js +0 -134
  20. package/packages/silk-effects/dist/dev/pkg/changesets/api/dependency-table.cjs +0 -163
  21. package/packages/silk-effects/dist/dev/pkg/changesets/api/dependency-table.js +0 -163
  22. package/packages/silk-effects/dist/dev/pkg/changesets/api/linter.cjs +0 -170
  23. package/packages/silk-effects/dist/dev/pkg/changesets/api/linter.js +0 -170
  24. package/packages/silk-effects/dist/dev/pkg/changesets/api/transformer.cjs +0 -134
  25. package/packages/silk-effects/dist/dev/pkg/changesets/api/transformer.js +0 -134
  26. package/packages/silk-effects/dist/dev/pkg/changesets/categories/index.cjs +0 -317
  27. package/packages/silk-effects/dist/dev/pkg/changesets/categories/index.js +0 -299
  28. package/packages/silk-effects/dist/dev/pkg/changesets/categories/types.cjs +0 -65
  29. package/packages/silk-effects/dist/dev/pkg/changesets/categories/types.js +0 -65
  30. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/formatting.cjs +0 -114
  31. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/formatting.js +0 -113
  32. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/getDependencyReleaseLine.cjs +0 -118
  33. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/getDependencyReleaseLine.js +0 -118
  34. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/getReleaseLine.cjs +0 -122
  35. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/getReleaseLine.js +0 -122
  36. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/index.cjs +0 -97
  37. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/index.js +0 -97
  38. package/packages/silk-effects/dist/dev/pkg/changesets/constants.cjs +0 -43
  39. package/packages/silk-effects/dist/dev/pkg/changesets/constants.js +0 -42
  40. package/packages/silk-effects/dist/dev/pkg/changesets/errors.cjs +0 -386
  41. package/packages/silk-effects/dist/dev/pkg/changesets/errors.js +0 -371
  42. package/packages/silk-effects/dist/dev/pkg/changesets/index.cjs +0 -300
  43. package/packages/silk-effects/dist/dev/pkg/changesets/index.js +0 -179
  44. package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/index.cjs +0 -34
  45. package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/index.js +0 -29
  46. package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/content-structure.cjs +0 -98
  47. package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/content-structure.js +0 -98
  48. package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/dependency-table-format.cjs +0 -170
  49. package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/dependency-table-format.js +0 -170
  50. package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/heading-hierarchy.cjs +0 -61
  51. package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/heading-hierarchy.js +0 -61
  52. package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/required-sections.cjs +0 -54
  53. package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/required-sections.js +0 -54
  54. package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/uncategorized-content.cjs +0 -54
  55. package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/uncategorized-content.js +0 -54
  56. package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/utils.cjs +0 -31
  57. package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/utils.js +0 -30
  58. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/aggregate-dependency-tables.cjs +0 -47
  59. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/aggregate-dependency-tables.js +0 -47
  60. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/contributor-footnotes.cjs +0 -123
  61. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/contributor-footnotes.js +0 -123
  62. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/deduplicate-items.cjs +0 -32
  63. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/deduplicate-items.js +0 -32
  64. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/issue-link-refs.cjs +0 -59
  65. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/issue-link-refs.js +0 -59
  66. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/maintenance-note.cjs +0 -61
  67. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/maintenance-note.js +0 -61
  68. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/merge-sections.cjs +0 -43
  69. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/merge-sections.js +0 -43
  70. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/normalize-format.cjs +0 -47
  71. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/normalize-format.js +0 -47
  72. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/reorder-sections.cjs +0 -34
  73. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/reorder-sections.js +0 -34
  74. package/packages/silk-effects/dist/dev/pkg/changesets/remark/presets.cjs +0 -120
  75. package/packages/silk-effects/dist/dev/pkg/changesets/remark/presets.js +0 -119
  76. package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/content-structure.cjs +0 -22
  77. package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/content-structure.js +0 -22
  78. package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/dependency-table-format.cjs +0 -40
  79. package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/dependency-table-format.js +0 -40
  80. package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/heading-hierarchy.cjs +0 -19
  81. package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/heading-hierarchy.js +0 -19
  82. package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/required-sections.cjs +0 -17
  83. package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/required-sections.js +0 -17
  84. package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/uncategorized-content.cjs +0 -31
  85. package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/uncategorized-content.js +0 -31
  86. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/changeset.cjs +0 -148
  87. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/changeset.js +0 -145
  88. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/dependency-table.cjs +0 -203
  89. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/dependency-table.js +0 -198
  90. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/git.cjs +0 -69
  91. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/git.js +0 -68
  92. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/github.cjs +0 -177
  93. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/github.js +0 -174
  94. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/options.cjs +0 -183
  95. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/options.js +0 -181
  96. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/package-scope.cjs +0 -129
  97. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/package-scope.js +0 -127
  98. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/primitives.cjs +0 -72
  99. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/primitives.js +0 -71
  100. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/release-plan.cjs +0 -62
  101. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/release-plan.js +0 -56
  102. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/version-files.cjs +0 -154
  103. package/packages/silk-effects/dist/dev/pkg/changesets/schemas/version-files.js +0 -150
  104. package/packages/silk-effects/dist/dev/pkg/changesets/services/branch-analyzer.cjs +0 -300
  105. package/packages/silk-effects/dist/dev/pkg/changesets/services/branch-analyzer.js +0 -294
  106. package/packages/silk-effects/dist/dev/pkg/changesets/services/changelog.cjs +0 -50
  107. package/packages/silk-effects/dist/dev/pkg/changesets/services/changelog.js +0 -49
  108. package/packages/silk-effects/dist/dev/pkg/changesets/services/config-inspector.cjs +0 -489
  109. package/packages/silk-effects/dist/dev/pkg/changesets/services/config-inspector.js +0 -481
  110. package/packages/silk-effects/dist/dev/pkg/changesets/services/deps-regen.cjs +0 -375
  111. package/packages/silk-effects/dist/dev/pkg/changesets/services/deps-regen.js +0 -371
  112. package/packages/silk-effects/dist/dev/pkg/changesets/services/github.cjs +0 -160
  113. package/packages/silk-effects/dist/dev/pkg/changesets/services/github.js +0 -157
  114. package/packages/silk-effects/dist/dev/pkg/changesets/services/maintenance-reason.cjs +0 -68
  115. package/packages/silk-effects/dist/dev/pkg/changesets/services/maintenance-reason.js +0 -66
  116. package/packages/silk-effects/dist/dev/pkg/changesets/services/markdown.cjs +0 -87
  117. package/packages/silk-effects/dist/dev/pkg/changesets/services/markdown.js +0 -85
  118. package/packages/silk-effects/dist/dev/pkg/changesets/services/release-planner.cjs +0 -338
  119. package/packages/silk-effects/dist/dev/pkg/changesets/services/release-planner.js +0 -334
  120. package/packages/silk-effects/dist/dev/pkg/changesets/utils/commit-parser.cjs +0 -81
  121. package/packages/silk-effects/dist/dev/pkg/changesets/utils/commit-parser.js +0 -80
  122. package/packages/silk-effects/dist/dev/pkg/changesets/utils/dep-diff.cjs +0 -111
  123. package/packages/silk-effects/dist/dev/pkg/changesets/utils/dep-diff.js +0 -111
  124. package/packages/silk-effects/dist/dev/pkg/changesets/utils/dependency-table.cjs +0 -351
  125. package/packages/silk-effects/dist/dev/pkg/changesets/utils/dependency-table.js +0 -347
  126. package/packages/silk-effects/dist/dev/pkg/changesets/utils/git.cjs +0 -51
  127. package/packages/silk-effects/dist/dev/pkg/changesets/utils/git.js +0 -51
  128. package/packages/silk-effects/dist/dev/pkg/changesets/utils/issue-refs.cjs +0 -102
  129. package/packages/silk-effects/dist/dev/pkg/changesets/utils/issue-refs.js +0 -101
  130. package/packages/silk-effects/dist/dev/pkg/changesets/utils/jsonpath.cjs +0 -178
  131. package/packages/silk-effects/dist/dev/pkg/changesets/utils/jsonpath.js +0 -175
  132. package/packages/silk-effects/dist/dev/pkg/changesets/utils/logger.cjs +0 -51
  133. package/packages/silk-effects/dist/dev/pkg/changesets/utils/logger.js +0 -50
  134. package/packages/silk-effects/dist/dev/pkg/changesets/utils/markdown-link.cjs +0 -59
  135. package/packages/silk-effects/dist/dev/pkg/changesets/utils/markdown-link.js +0 -57
  136. package/packages/silk-effects/dist/dev/pkg/changesets/utils/publishability.cjs +0 -50
  137. package/packages/silk-effects/dist/dev/pkg/changesets/utils/publishability.js +0 -50
  138. package/packages/silk-effects/dist/dev/pkg/changesets/utils/remark-pipeline.cjs +0 -81
  139. package/packages/silk-effects/dist/dev/pkg/changesets/utils/remark-pipeline.js +0 -79
  140. package/packages/silk-effects/dist/dev/pkg/changesets/utils/section-parser.cjs +0 -94
  141. package/packages/silk-effects/dist/dev/pkg/changesets/utils/section-parser.js +0 -94
  142. package/packages/silk-effects/dist/dev/pkg/changesets/utils/strip-frontmatter.cjs +0 -47
  143. package/packages/silk-effects/dist/dev/pkg/changesets/utils/strip-frontmatter.js +0 -46
  144. package/packages/silk-effects/dist/dev/pkg/changesets/utils/version-blocks.cjs +0 -110
  145. package/packages/silk-effects/dist/dev/pkg/changesets/utils/version-blocks.js +0 -108
  146. package/packages/silk-effects/dist/dev/pkg/changesets/utils/version-files.cjs +0 -336
  147. package/packages/silk-effects/dist/dev/pkg/changesets/utils/version-files.js +0 -336
  148. package/packages/silk-effects/dist/dev/pkg/changesets/vendor/github-info.cjs +0 -55
  149. package/packages/silk-effects/dist/dev/pkg/changesets/vendor/github-info.js +0 -55
  150. package/packages/silk-effects/dist/dev/pkg/errors/ChangesetConfigError.cjs +0 -21
  151. package/packages/silk-effects/dist/dev/pkg/errors/ChangesetConfigError.js +0 -21
  152. package/packages/silk-effects/dist/dev/pkg/schemas/VersioningSchemas.cjs +0 -101
  153. package/packages/silk-effects/dist/dev/pkg/schemas/VersioningSchemas.js +0 -99
  154. package/packages/silk-effects/dist/dev/pkg/services/ChangesetConfig.cjs +0 -81
  155. package/packages/silk-effects/dist/dev/pkg/services/ChangesetConfig.js +0 -80
  156. package/packages/silk-effects/dist/dev/pkg/services/ChangesetConfigReader.cjs +0 -109
  157. package/packages/silk-effects/dist/dev/pkg/services/ChangesetConfigReader.js +0 -108
  158. package/packages/silk-effects/dist/dev/pkg/services/SilkPublishability.cjs +0 -238
  159. package/packages/silk-effects/dist/dev/pkg/services/SilkPublishability.js +0 -236
@@ -1,178 +0,0 @@
1
-
2
- //#region ../silk-effects/dist/dev/pkg/changesets/utils/jsonpath.js
3
- /**
4
- * Tokenize a JSONPath string into segments.
5
- *
6
- * @remarks
7
- * Strips the leading `$.` prefix, then splits on `.` boundaries while
8
- * preserving bracket expressions (`[*]`, `[0]`). Each token is converted
9
- * to the corresponding {@link Segment} discriminated union variant.
10
- *
11
- * @param path - JSONPath string (e.g., `"$.foo[*].bar"`)
12
- * @returns Array of path segments
13
- * @throws If the path does not start with `$.`
14
- * @throws If the path cannot be tokenized after the `$.` prefix
15
- *
16
- * @example
17
- * ```typescript
18
- * import { parseJsonPath } from "../utils/jsonpath.js";
19
- *
20
- * const segments = parseJsonPath("$.packages[*].version");
21
- * // [
22
- * // { type: "property", key: "packages" },
23
- * // { type: "wildcard" },
24
- * // { type: "property", key: "version" },
25
- * // ]
26
- * ```
27
- *
28
- * @internal
29
- */
30
- function parseJsonPath(path) {
31
- if (!path.startsWith("$.")) throw new Error(`Invalid JSONPath: must start with "$." — got "${path}"`);
32
- const segments = [];
33
- const raw = path.slice(2);
34
- if (raw === "") return segments;
35
- const tokens = raw.match(/[^.[\]]+|\[\*\]|\[\d+\]/g);
36
- if (!tokens) throw new Error(`Invalid JSONPath: could not parse "${path}"`);
37
- for (const token of tokens) if (token === "[*]") segments.push({ type: "wildcard" });
38
- else if (token.startsWith("[") && token.endsWith("]")) segments.push({
39
- type: "index",
40
- index: Number.parseInt(token.slice(1, -1), 10)
41
- });
42
- else segments.push({
43
- type: "property",
44
- key: token
45
- });
46
- return segments;
47
- }
48
- /**
49
- * Collect all values matching a JSONPath expression.
50
- *
51
- * @remarks
52
- * Uses a breadth-first expansion: starting with the root object,
53
- * each segment fans out the current set of matched nodes. Wildcards
54
- * expand arrays into their individual elements. Non-object/non-array
55
- * nodes at any intermediate step are silently skipped.
56
- *
57
- * @param obj - The object to query
58
- * @param path - JSONPath string (e.g., `"$.version"`)
59
- * @returns Array of all matched values (empty if no matches)
60
- *
61
- * @example
62
- * ```typescript
63
- * import { jsonPathGet } from "../utils/jsonpath.js";
64
- *
65
- * const obj = { packages: [{ version: "1.0.0" }, { version: "2.0.0" }] };
66
- * const versions = jsonPathGet(obj, "$.packages[*].version");
67
- * // ["1.0.0", "2.0.0"]
68
- * ```
69
- *
70
- * @internal
71
- */
72
- function jsonPathGet(obj, path) {
73
- const segments = parseJsonPath(path);
74
- let current = [obj];
75
- for (const segment of segments) {
76
- const next = [];
77
- for (const node of current) {
78
- if (node === null || node === void 0 || typeof node !== "object") continue;
79
- switch (segment.type) {
80
- case "property": {
81
- const value = node[segment.key];
82
- if (value !== void 0) next.push(value);
83
- break;
84
- }
85
- case "index":
86
- if (Array.isArray(node) && segment.index < node.length) next.push(node[segment.index]);
87
- break;
88
- case "wildcard":
89
- if (Array.isArray(node)) next.push(...node);
90
- break;
91
- }
92
- }
93
- current = next;
94
- }
95
- return current;
96
- }
97
- /**
98
- * Mutate all matching locations in an object in-place.
99
- *
100
- * @remarks
101
- * Walks to the parent(s) of the final segment, then sets the value
102
- * at each matching location. Only updates existing keys/indices;
103
- * does not create new properties or extend arrays. Returns the count
104
- * of locations actually updated.
105
- *
106
- * @param obj - The object to modify in-place
107
- * @param path - JSONPath string (e.g., `"$.packages[*].version"`)
108
- * @param value - The value to set at each matching location
109
- * @returns The number of locations updated (0 if no matches or empty path)
110
- *
111
- * @example
112
- * ```typescript
113
- * import { jsonPathSet } from "../utils/jsonpath.js";
114
- *
115
- * const obj = { version: "1.0.0" };
116
- * const count = jsonPathSet(obj, "$.version", "2.0.0");
117
- * // count === 1, obj.version === "2.0.0"
118
- * ```
119
- *
120
- * @internal
121
- */
122
- function jsonPathSet(obj, path, value) {
123
- const segments = parseJsonPath(path);
124
- if (segments.length === 0) return 0;
125
- const lastSegment = segments[segments.length - 1];
126
- const parentSegments = segments.slice(0, -1);
127
- let parents = [obj];
128
- for (const segment of parentSegments) {
129
- const next = [];
130
- for (const node of parents) {
131
- if (node === null || node === void 0 || typeof node !== "object") continue;
132
- switch (segment.type) {
133
- case "property": {
134
- const child = node[segment.key];
135
- if (child !== void 0) next.push(child);
136
- break;
137
- }
138
- case "index":
139
- if (Array.isArray(node) && segment.index < node.length) next.push(node[segment.index]);
140
- break;
141
- case "wildcard":
142
- if (Array.isArray(node)) next.push(...node);
143
- break;
144
- }
145
- }
146
- parents = next;
147
- }
148
- let count = 0;
149
- for (const parent of parents) {
150
- if (parent === null || parent === void 0 || typeof parent !== "object") continue;
151
- switch (lastSegment.type) {
152
- case "property":
153
- if (lastSegment.key in parent) {
154
- parent[lastSegment.key] = value;
155
- count++;
156
- }
157
- break;
158
- case "index":
159
- if (Array.isArray(parent) && lastSegment.index < parent.length) {
160
- parent[lastSegment.index] = value;
161
- count++;
162
- }
163
- break;
164
- case "wildcard":
165
- if (Array.isArray(parent)) for (let i = 0; i < parent.length; i++) {
166
- parent[i] = value;
167
- count++;
168
- }
169
- break;
170
- }
171
- }
172
- return count;
173
- }
174
-
175
- //#endregion
176
- exports.jsonPathGet = jsonPathGet;
177
- exports.jsonPathSet = jsonPathSet;
178
- exports.parseJsonPath = parseJsonPath;
@@ -1,175 +0,0 @@
1
- //#region ../silk-effects/dist/dev/pkg/changesets/utils/jsonpath.js
2
- /**
3
- * Tokenize a JSONPath string into segments.
4
- *
5
- * @remarks
6
- * Strips the leading `$.` prefix, then splits on `.` boundaries while
7
- * preserving bracket expressions (`[*]`, `[0]`). Each token is converted
8
- * to the corresponding {@link Segment} discriminated union variant.
9
- *
10
- * @param path - JSONPath string (e.g., `"$.foo[*].bar"`)
11
- * @returns Array of path segments
12
- * @throws If the path does not start with `$.`
13
- * @throws If the path cannot be tokenized after the `$.` prefix
14
- *
15
- * @example
16
- * ```typescript
17
- * import { parseJsonPath } from "../utils/jsonpath.js";
18
- *
19
- * const segments = parseJsonPath("$.packages[*].version");
20
- * // [
21
- * // { type: "property", key: "packages" },
22
- * // { type: "wildcard" },
23
- * // { type: "property", key: "version" },
24
- * // ]
25
- * ```
26
- *
27
- * @internal
28
- */
29
- function parseJsonPath(path) {
30
- if (!path.startsWith("$.")) throw new Error(`Invalid JSONPath: must start with "$." — got "${path}"`);
31
- const segments = [];
32
- const raw = path.slice(2);
33
- if (raw === "") return segments;
34
- const tokens = raw.match(/[^.[\]]+|\[\*\]|\[\d+\]/g);
35
- if (!tokens) throw new Error(`Invalid JSONPath: could not parse "${path}"`);
36
- for (const token of tokens) if (token === "[*]") segments.push({ type: "wildcard" });
37
- else if (token.startsWith("[") && token.endsWith("]")) segments.push({
38
- type: "index",
39
- index: Number.parseInt(token.slice(1, -1), 10)
40
- });
41
- else segments.push({
42
- type: "property",
43
- key: token
44
- });
45
- return segments;
46
- }
47
- /**
48
- * Collect all values matching a JSONPath expression.
49
- *
50
- * @remarks
51
- * Uses a breadth-first expansion: starting with the root object,
52
- * each segment fans out the current set of matched nodes. Wildcards
53
- * expand arrays into their individual elements. Non-object/non-array
54
- * nodes at any intermediate step are silently skipped.
55
- *
56
- * @param obj - The object to query
57
- * @param path - JSONPath string (e.g., `"$.version"`)
58
- * @returns Array of all matched values (empty if no matches)
59
- *
60
- * @example
61
- * ```typescript
62
- * import { jsonPathGet } from "../utils/jsonpath.js";
63
- *
64
- * const obj = { packages: [{ version: "1.0.0" }, { version: "2.0.0" }] };
65
- * const versions = jsonPathGet(obj, "$.packages[*].version");
66
- * // ["1.0.0", "2.0.0"]
67
- * ```
68
- *
69
- * @internal
70
- */
71
- function jsonPathGet(obj, path) {
72
- const segments = parseJsonPath(path);
73
- let current = [obj];
74
- for (const segment of segments) {
75
- const next = [];
76
- for (const node of current) {
77
- if (node === null || node === void 0 || typeof node !== "object") continue;
78
- switch (segment.type) {
79
- case "property": {
80
- const value = node[segment.key];
81
- if (value !== void 0) next.push(value);
82
- break;
83
- }
84
- case "index":
85
- if (Array.isArray(node) && segment.index < node.length) next.push(node[segment.index]);
86
- break;
87
- case "wildcard":
88
- if (Array.isArray(node)) next.push(...node);
89
- break;
90
- }
91
- }
92
- current = next;
93
- }
94
- return current;
95
- }
96
- /**
97
- * Mutate all matching locations in an object in-place.
98
- *
99
- * @remarks
100
- * Walks to the parent(s) of the final segment, then sets the value
101
- * at each matching location. Only updates existing keys/indices;
102
- * does not create new properties or extend arrays. Returns the count
103
- * of locations actually updated.
104
- *
105
- * @param obj - The object to modify in-place
106
- * @param path - JSONPath string (e.g., `"$.packages[*].version"`)
107
- * @param value - The value to set at each matching location
108
- * @returns The number of locations updated (0 if no matches or empty path)
109
- *
110
- * @example
111
- * ```typescript
112
- * import { jsonPathSet } from "../utils/jsonpath.js";
113
- *
114
- * const obj = { version: "1.0.0" };
115
- * const count = jsonPathSet(obj, "$.version", "2.0.0");
116
- * // count === 1, obj.version === "2.0.0"
117
- * ```
118
- *
119
- * @internal
120
- */
121
- function jsonPathSet(obj, path, value) {
122
- const segments = parseJsonPath(path);
123
- if (segments.length === 0) return 0;
124
- const lastSegment = segments[segments.length - 1];
125
- const parentSegments = segments.slice(0, -1);
126
- let parents = [obj];
127
- for (const segment of parentSegments) {
128
- const next = [];
129
- for (const node of parents) {
130
- if (node === null || node === void 0 || typeof node !== "object") continue;
131
- switch (segment.type) {
132
- case "property": {
133
- const child = node[segment.key];
134
- if (child !== void 0) next.push(child);
135
- break;
136
- }
137
- case "index":
138
- if (Array.isArray(node) && segment.index < node.length) next.push(node[segment.index]);
139
- break;
140
- case "wildcard":
141
- if (Array.isArray(node)) next.push(...node);
142
- break;
143
- }
144
- }
145
- parents = next;
146
- }
147
- let count = 0;
148
- for (const parent of parents) {
149
- if (parent === null || parent === void 0 || typeof parent !== "object") continue;
150
- switch (lastSegment.type) {
151
- case "property":
152
- if (lastSegment.key in parent) {
153
- parent[lastSegment.key] = value;
154
- count++;
155
- }
156
- break;
157
- case "index":
158
- if (Array.isArray(parent) && lastSegment.index < parent.length) {
159
- parent[lastSegment.index] = value;
160
- count++;
161
- }
162
- break;
163
- case "wildcard":
164
- if (Array.isArray(parent)) for (let i = 0; i < parent.length; i++) {
165
- parent[i] = value;
166
- count++;
167
- }
168
- break;
169
- }
170
- }
171
- return count;
172
- }
173
-
174
- //#endregion
175
- export { jsonPathGet, jsonPathSet, parseJsonPath };
@@ -1,51 +0,0 @@
1
-
2
- //#region ../silk-effects/dist/dev/pkg/changesets/utils/logger.js
3
- /**
4
- * Simple logging utility for changelog generation.
5
- *
6
- * @remarks
7
- * Provides environment-aware warning output:
8
- * - **GitHub Actions**: emits `::warning::` annotations that surface in
9
- * the Actions UI
10
- * - **Local development**: falls back to `console.warn`
11
- * - **Test environment**: suppressed entirely when `process.env.VITEST`
12
- * is set, preventing noisy test output
13
- *
14
- * @internal
15
- */
16
- /**
17
- * Log a warning message.
18
- *
19
- * @remarks
20
- * Detection order:
21
- * 1. If `process.env.VITEST` is set, the message is silently discarded.
22
- * 2. If `process.env.GITHUB_ACTIONS === "true"`, the message is emitted
23
- * as a `::warning::` annotation.
24
- * 3. Otherwise, `console.warn` is used.
25
- *
26
- * @param message - The warning message
27
- * @param args - Additional arguments (concatenated with a space in CI mode)
28
- *
29
- * @example
30
- * ```typescript
31
- * import { logWarning } from "../utils/logger.js";
32
- *
33
- * logWarning("Duplicate dependency entry", "effect@3.19.0");
34
- * // In CI: "::warning::Duplicate dependency entry effect@3.19.0"
35
- * // Locally: console.warn("Duplicate dependency entry", "effect@3.19.0")
36
- * ```
37
- *
38
- * @internal
39
- */
40
- function logWarning(message, ...args) {
41
- /* v8 ignore start — environment-specific */
42
- if (typeof process !== "undefined" && process.env.VITEST) return;
43
- if (typeof process !== "undefined" && process.env.GITHUB_ACTIONS === "true") {
44
- const text = args.length > 0 ? `${message} ${args.join(" ")}` : message;
45
- console.warn(`::warning::${text}`);
46
- } else console.warn(message, ...args);
47
- /* v8 ignore stop */
48
- }
49
-
50
- //#endregion
51
- exports.logWarning = logWarning;
@@ -1,50 +0,0 @@
1
- //#region ../silk-effects/dist/dev/pkg/changesets/utils/logger.js
2
- /**
3
- * Simple logging utility for changelog generation.
4
- *
5
- * @remarks
6
- * Provides environment-aware warning output:
7
- * - **GitHub Actions**: emits `::warning::` annotations that surface in
8
- * the Actions UI
9
- * - **Local development**: falls back to `console.warn`
10
- * - **Test environment**: suppressed entirely when `process.env.VITEST`
11
- * is set, preventing noisy test output
12
- *
13
- * @internal
14
- */
15
- /**
16
- * Log a warning message.
17
- *
18
- * @remarks
19
- * Detection order:
20
- * 1. If `process.env.VITEST` is set, the message is silently discarded.
21
- * 2. If `process.env.GITHUB_ACTIONS === "true"`, the message is emitted
22
- * as a `::warning::` annotation.
23
- * 3. Otherwise, `console.warn` is used.
24
- *
25
- * @param message - The warning message
26
- * @param args - Additional arguments (concatenated with a space in CI mode)
27
- *
28
- * @example
29
- * ```typescript
30
- * import { logWarning } from "../utils/logger.js";
31
- *
32
- * logWarning("Duplicate dependency entry", "effect@3.19.0");
33
- * // In CI: "::warning::Duplicate dependency entry effect@3.19.0"
34
- * // Locally: console.warn("Duplicate dependency entry", "effect@3.19.0")
35
- * ```
36
- *
37
- * @internal
38
- */
39
- function logWarning(message, ...args) {
40
- /* v8 ignore start — environment-specific */
41
- if (typeof process !== "undefined" && process.env.VITEST) return;
42
- if (typeof process !== "undefined" && process.env.GITHUB_ACTIONS === "true") {
43
- const text = args.length > 0 ? `${message} ${args.join(" ")}` : message;
44
- console.warn(`::warning::${text}`);
45
- } else console.warn(message, ...args);
46
- /* v8 ignore stop */
47
- }
48
-
49
- //#endregion
50
- export { logWarning };
@@ -1,59 +0,0 @@
1
-
2
- //#region ../silk-effects/dist/dev/pkg/changesets/utils/markdown-link.js
3
- /**
4
- * Markdown link extraction utilities.
5
- *
6
- * @remarks
7
- * Handles the inconsistency where `\@changesets/get-github-info` sometimes
8
- * returns markdown-formatted links (e.g., `[#17](https://...)`) instead
9
- * of plain URLs. Provides a regex pattern and extraction function to
10
- * normalize these values.
11
- *
12
- * @see {@link Changelog} for the public API that uses link extraction
13
- * during changelog generation
14
- *
15
- * @internal
16
- */
17
- /**
18
- * Pattern matching markdown link format: `[text](url)`.
19
- *
20
- * Capture groups:
21
- * - `[1]` — link text (e.g., `#17`)
22
- * - `[2]` — URL (e.g., `https://github.com/owner/repo/pull/17`)
23
- *
24
- * @internal
25
- */
26
- const MARKDOWN_LINK_PATTERN = /\[([^\]]+)\]\(([^)]+)\)/;
27
- /**
28
- * Extract a plain URL from a markdown-formatted link.
29
- *
30
- * @remarks
31
- * The `\@changesets/get-github-info` package sometimes returns markdown links
32
- * like `[#17](https://github.com/owner/repo/pull/17)` instead of plain URLs.
33
- * This helper extracts the URL portion, or returns the input unchanged if
34
- * it is already a plain URL.
35
- *
36
- * @param linkOrUrl - A markdown link or plain URL string
37
- * @returns The extracted plain URL
38
- *
39
- * @example
40
- * ```typescript
41
- * import { extractUrlFromMarkdown } from "../utils/markdown-link.js";
42
- *
43
- * extractUrlFromMarkdown("[#17](https://github.com/o/r/pull/17)");
44
- * // "https://github.com/o/r/pull/17"
45
- *
46
- * extractUrlFromMarkdown("https://github.com/o/r/pull/17");
47
- * // "https://github.com/o/r/pull/17" (returned unchanged)
48
- * ```
49
- *
50
- * @internal
51
- */
52
- function extractUrlFromMarkdown(linkOrUrl) {
53
- const match = MARKDOWN_LINK_PATTERN.exec(linkOrUrl);
54
- return match ? match[2] : linkOrUrl;
55
- }
56
-
57
- //#endregion
58
- exports.MARKDOWN_LINK_PATTERN = MARKDOWN_LINK_PATTERN;
59
- exports.extractUrlFromMarkdown = extractUrlFromMarkdown;
@@ -1,57 +0,0 @@
1
- //#region ../silk-effects/dist/dev/pkg/changesets/utils/markdown-link.js
2
- /**
3
- * Markdown link extraction utilities.
4
- *
5
- * @remarks
6
- * Handles the inconsistency where `\@changesets/get-github-info` sometimes
7
- * returns markdown-formatted links (e.g., `[#17](https://...)`) instead
8
- * of plain URLs. Provides a regex pattern and extraction function to
9
- * normalize these values.
10
- *
11
- * @see {@link Changelog} for the public API that uses link extraction
12
- * during changelog generation
13
- *
14
- * @internal
15
- */
16
- /**
17
- * Pattern matching markdown link format: `[text](url)`.
18
- *
19
- * Capture groups:
20
- * - `[1]` — link text (e.g., `#17`)
21
- * - `[2]` — URL (e.g., `https://github.com/owner/repo/pull/17`)
22
- *
23
- * @internal
24
- */
25
- const MARKDOWN_LINK_PATTERN = /\[([^\]]+)\]\(([^)]+)\)/;
26
- /**
27
- * Extract a plain URL from a markdown-formatted link.
28
- *
29
- * @remarks
30
- * The `\@changesets/get-github-info` package sometimes returns markdown links
31
- * like `[#17](https://github.com/owner/repo/pull/17)` instead of plain URLs.
32
- * This helper extracts the URL portion, or returns the input unchanged if
33
- * it is already a plain URL.
34
- *
35
- * @param linkOrUrl - A markdown link or plain URL string
36
- * @returns The extracted plain URL
37
- *
38
- * @example
39
- * ```typescript
40
- * import { extractUrlFromMarkdown } from "../utils/markdown-link.js";
41
- *
42
- * extractUrlFromMarkdown("[#17](https://github.com/o/r/pull/17)");
43
- * // "https://github.com/o/r/pull/17"
44
- *
45
- * extractUrlFromMarkdown("https://github.com/o/r/pull/17");
46
- * // "https://github.com/o/r/pull/17" (returned unchanged)
47
- * ```
48
- *
49
- * @internal
50
- */
51
- function extractUrlFromMarkdown(linkOrUrl) {
52
- const match = MARKDOWN_LINK_PATTERN.exec(linkOrUrl);
53
- return match ? match[2] : linkOrUrl;
54
- }
55
-
56
- //#endregion
57
- export { MARKDOWN_LINK_PATTERN, extractUrlFromMarkdown };
@@ -1,50 +0,0 @@
1
- const require_PublishabilityDetector = require('../../../../../../../node_modules/.pnpm/workspaces-effect@2.0.1_@effect_platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/services/PublishabilityDetector.cjs');
2
- let effect = require("effect");
3
-
4
- //#region ../silk-effects/dist/dev/pkg/changesets/utils/publishability.js
5
- /**
6
- * Publishability helpers for the changeset CLI commands.
7
- *
8
- * @remarks
9
- * Provides `listPublishablePackageNames`, a convenience wrapper around
10
- * {@link SilkPublishability} that returns a `Set<string>` of
11
- * publishable package names. Used by the `deps detect` and `deps regen`
12
- * commands to filter out workspace packages whose dependency changes
13
- * would never reach a release.
14
- *
15
- */
16
- /**
17
- * Compute the set of currently-publishable workspace package names.
18
- *
19
- * @remarks
20
- * Uses the currently-active {@link SilkPublishability} — wire the
21
- * {@link SilkPublishabilityDetectorLive} layer to get silk semantics.
22
- *
23
- * `root` is passed through verbatim to `detector.detect(pkg, root)` for every
24
- * package — it must be the project root (the directory containing
25
- * `.changeset/`), NOT the individual package's directory. The vanilla
26
- * `PublishabilityDetectorLive` and plain `SilkPublishabilityDetectorLive`
27
- * both ignore this argument, but the ignore/mode-aware
28
- * `PublishabilityDetectorAdaptiveLive` reads `.changeset/config.json`
29
- * relative to it, so passing a package subdirectory silently makes every
30
- * package resolve to "not publishable". Mirrors
31
- * {@link SilkPublishability.listPublishable}, which takes the same
32
- * single-root parameter for the same reason.
33
- *
34
- * @param packages - The workspace packages to evaluate
35
- * @param root - Absolute path to the project root containing `.changeset/`
36
- * @returns An Effect yielding a `Set` of publishable package names
37
- *
38
- * @public
39
- */
40
- function listPublishablePackageNames(packages, root) {
41
- return effect.Effect.gen(function* () {
42
- const detector = yield* require_PublishabilityDetector.PublishabilityDetector;
43
- const names = /* @__PURE__ */ new Set();
44
- for (const pkg of packages) if ((yield* detector.detect(pkg, root)).length > 0) names.add(pkg.name);
45
- return names;
46
- });
47
- }
48
-
49
- //#endregion
50
- exports.listPublishablePackageNames = listPublishablePackageNames;
@@ -1,50 +0,0 @@
1
- import { PublishabilityDetector } from "../../../../../../../node_modules/.pnpm/workspaces-effect@2.0.1_@effect_platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/services/PublishabilityDetector.js";
2
- import { Effect } from "effect";
3
-
4
- //#region ../silk-effects/dist/dev/pkg/changesets/utils/publishability.js
5
- /**
6
- * Publishability helpers for the changeset CLI commands.
7
- *
8
- * @remarks
9
- * Provides `listPublishablePackageNames`, a convenience wrapper around
10
- * {@link SilkPublishability} that returns a `Set<string>` of
11
- * publishable package names. Used by the `deps detect` and `deps regen`
12
- * commands to filter out workspace packages whose dependency changes
13
- * would never reach a release.
14
- *
15
- */
16
- /**
17
- * Compute the set of currently-publishable workspace package names.
18
- *
19
- * @remarks
20
- * Uses the currently-active {@link SilkPublishability} — wire the
21
- * {@link SilkPublishabilityDetectorLive} layer to get silk semantics.
22
- *
23
- * `root` is passed through verbatim to `detector.detect(pkg, root)` for every
24
- * package — it must be the project root (the directory containing
25
- * `.changeset/`), NOT the individual package's directory. The vanilla
26
- * `PublishabilityDetectorLive` and plain `SilkPublishabilityDetectorLive`
27
- * both ignore this argument, but the ignore/mode-aware
28
- * `PublishabilityDetectorAdaptiveLive` reads `.changeset/config.json`
29
- * relative to it, so passing a package subdirectory silently makes every
30
- * package resolve to "not publishable". Mirrors
31
- * {@link SilkPublishability.listPublishable}, which takes the same
32
- * single-root parameter for the same reason.
33
- *
34
- * @param packages - The workspace packages to evaluate
35
- * @param root - Absolute path to the project root containing `.changeset/`
36
- * @returns An Effect yielding a `Set` of publishable package names
37
- *
38
- * @public
39
- */
40
- function listPublishablePackageNames(packages, root) {
41
- return Effect.gen(function* () {
42
- const detector = yield* PublishabilityDetector;
43
- const names = /* @__PURE__ */ new Set();
44
- for (const pkg of packages) if ((yield* detector.detect(pkg, root)).length > 0) names.add(pkg.name);
45
- return names;
46
- });
47
- }
48
-
49
- //#endregion
50
- export { listPublishablePackageNames };