@savvy-web/silk 2.0.0 → 2.1.1

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 +109 -61
  3. package/changesets-changelog.d.cts +1 -1
  4. package/changesets-changelog.d.ts +1 -1
  5. package/changesets-changelog.js +54099 -1
  6. package/changesets-markdownlint.cjs +109 -61
  7. package/changesets-markdownlint.d.cts +1 -1
  8. package/changesets-markdownlint.d.ts +1 -1
  9. package/changesets-markdownlint.js +54099 -1
  10. package/package.json +5 -4
  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 -352
  119. package/packages/silk-effects/dist/dev/pkg/changesets/services/release-planner.js +0 -348
  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 -77
  149. package/packages/silk-effects/dist/dev/pkg/changesets/vendor/github-info.js +0 -77
  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,123 +0,0 @@
1
- const require_index = require('../../../../../../../../node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.cjs');
2
- const require_version_blocks = require('../../utils/version-blocks.cjs');
3
-
4
- //#region ../silk-effects/dist/dev/pkg/changesets/remark/plugins/contributor-footnotes.js
5
- /**
6
- * Pattern matching `Thanks @user!` at end of text.
7
- *
8
- * @internal
9
- */
10
- const ATTRIBUTION_PLAIN_RE = /\s*Thanks @(\w[\w-]*)!$/;
11
- /**
12
- * Try to extract a linked attribution from the end of a paragraph's children.
13
- * Pattern: text "...Thanks " + link "\@user" + text "!"
14
- *
15
- * @param children - The phrasing content children of a paragraph node
16
- * @returns The contributor and the index to start removal from, or `undefined`
17
- *
18
- * @internal
19
- */
20
- function extractLinkedAttribution(children) {
21
- if (children.length < 3) return void 0;
22
- const last = children[children.length - 1];
23
- const secondLast = children[children.length - 2];
24
- const thirdLast = children[children.length - 3];
25
- if (last.type !== "text" || last.value !== "!") return void 0;
26
- if (secondLast.type !== "link") return void 0;
27
- const linkNode = secondLast;
28
- if (linkNode.children.length !== 1 || linkNode.children[0].type !== "text") return void 0;
29
- const linkText = linkNode.children[0].value;
30
- if (!linkText.startsWith("@")) return void 0;
31
- const username = linkText.slice(1);
32
- if (thirdLast.type !== "text") return void 0;
33
- const textNode = thirdLast;
34
- if (!/\s*Thanks $/.test(textNode.value)) return void 0;
35
- return {
36
- contributor: {
37
- username,
38
- url: linkNode.url
39
- },
40
- removeFrom: children.length - 3
41
- };
42
- }
43
- const ContributorFootnotesPlugin = () => {
44
- return (tree) => {
45
- const blocks = require_version_blocks.getVersionBlocks(tree);
46
- for (let b = blocks.length - 1; b >= 0; b--) {
47
- const block = blocks[b];
48
- const contributors = /* @__PURE__ */ new Map();
49
- for (let i = block.startIndex; i < block.endIndex; i++) {
50
- const node = tree.children[i];
51
- if (node.type !== "list") continue;
52
- require_index.visit(node, "paragraph", (para) => {
53
- const linked = extractLinkedAttribution(para.children);
54
- if (linked) {
55
- const key = linked.contributor.username.toLowerCase();
56
- if (!contributors.has(key)) contributors.set(key, linked.contributor);
57
- const textNode = para.children[linked.removeFrom];
58
- textNode.value = textNode.value.replace(/\s*Thanks $/, "");
59
- para.children.splice(linked.removeFrom + 1, 2);
60
- if (textNode.value === "") para.children.splice(linked.removeFrom, 1);
61
- return;
62
- }
63
- const last = para.children[para.children.length - 1];
64
- if (last?.type === "text") {
65
- const textNode = last;
66
- const match = textNode.value.match(ATTRIBUTION_PLAIN_RE);
67
- if (match) {
68
- const username = match[1];
69
- const key = username.toLowerCase();
70
- if (!contributors.has(key)) contributors.set(key, {
71
- username,
72
- url: void 0
73
- });
74
- textNode.value = textNode.value.replace(ATTRIBUTION_PLAIN_RE, "");
75
- }
76
- }
77
- });
78
- }
79
- if (contributors.size === 0) continue;
80
- const sorted = [...contributors.values()].sort((a, b) => a.username.toLowerCase().localeCompare(b.username.toLowerCase()));
81
- const phrasingChildren = [];
82
- phrasingChildren.push({
83
- type: "text",
84
- value: "Thanks to "
85
- });
86
- for (let i = 0; i < sorted.length; i++) {
87
- const contrib = sorted[i];
88
- if (i > 0 && sorted.length > 2) phrasingChildren.push({
89
- type: "text",
90
- value: ", "
91
- });
92
- if (i > 0 && i === sorted.length - 1) phrasingChildren.push({
93
- type: "text",
94
- value: sorted.length === 2 ? " and " : "and "
95
- });
96
- if (contrib.url) phrasingChildren.push({
97
- type: "link",
98
- url: contrib.url,
99
- children: [{
100
- type: "text",
101
- value: `@${contrib.username}`
102
- }]
103
- });
104
- else phrasingChildren.push({
105
- type: "text",
106
- value: `@${contrib.username}`
107
- });
108
- }
109
- phrasingChildren.push({
110
- type: "text",
111
- value: " for their contributions!"
112
- });
113
- const paragraph = {
114
- type: "paragraph",
115
- children: phrasingChildren
116
- };
117
- tree.children.splice(block.endIndex, 0, paragraph);
118
- }
119
- };
120
- };
121
-
122
- //#endregion
123
- exports.ContributorFootnotesPlugin = ContributorFootnotesPlugin;
@@ -1,123 +0,0 @@
1
- import { visit } from "../../../../../../../../node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.js";
2
- import { getVersionBlocks } from "../../utils/version-blocks.js";
3
-
4
- //#region ../silk-effects/dist/dev/pkg/changesets/remark/plugins/contributor-footnotes.js
5
- /**
6
- * Pattern matching `Thanks @user!` at end of text.
7
- *
8
- * @internal
9
- */
10
- const ATTRIBUTION_PLAIN_RE = /\s*Thanks @(\w[\w-]*)!$/;
11
- /**
12
- * Try to extract a linked attribution from the end of a paragraph's children.
13
- * Pattern: text "...Thanks " + link "\@user" + text "!"
14
- *
15
- * @param children - The phrasing content children of a paragraph node
16
- * @returns The contributor and the index to start removal from, or `undefined`
17
- *
18
- * @internal
19
- */
20
- function extractLinkedAttribution(children) {
21
- if (children.length < 3) return void 0;
22
- const last = children[children.length - 1];
23
- const secondLast = children[children.length - 2];
24
- const thirdLast = children[children.length - 3];
25
- if (last.type !== "text" || last.value !== "!") return void 0;
26
- if (secondLast.type !== "link") return void 0;
27
- const linkNode = secondLast;
28
- if (linkNode.children.length !== 1 || linkNode.children[0].type !== "text") return void 0;
29
- const linkText = linkNode.children[0].value;
30
- if (!linkText.startsWith("@")) return void 0;
31
- const username = linkText.slice(1);
32
- if (thirdLast.type !== "text") return void 0;
33
- const textNode = thirdLast;
34
- if (!/\s*Thanks $/.test(textNode.value)) return void 0;
35
- return {
36
- contributor: {
37
- username,
38
- url: linkNode.url
39
- },
40
- removeFrom: children.length - 3
41
- };
42
- }
43
- const ContributorFootnotesPlugin = () => {
44
- return (tree) => {
45
- const blocks = getVersionBlocks(tree);
46
- for (let b = blocks.length - 1; b >= 0; b--) {
47
- const block = blocks[b];
48
- const contributors = /* @__PURE__ */ new Map();
49
- for (let i = block.startIndex; i < block.endIndex; i++) {
50
- const node = tree.children[i];
51
- if (node.type !== "list") continue;
52
- visit(node, "paragraph", (para) => {
53
- const linked = extractLinkedAttribution(para.children);
54
- if (linked) {
55
- const key = linked.contributor.username.toLowerCase();
56
- if (!contributors.has(key)) contributors.set(key, linked.contributor);
57
- const textNode = para.children[linked.removeFrom];
58
- textNode.value = textNode.value.replace(/\s*Thanks $/, "");
59
- para.children.splice(linked.removeFrom + 1, 2);
60
- if (textNode.value === "") para.children.splice(linked.removeFrom, 1);
61
- return;
62
- }
63
- const last = para.children[para.children.length - 1];
64
- if (last?.type === "text") {
65
- const textNode = last;
66
- const match = textNode.value.match(ATTRIBUTION_PLAIN_RE);
67
- if (match) {
68
- const username = match[1];
69
- const key = username.toLowerCase();
70
- if (!contributors.has(key)) contributors.set(key, {
71
- username,
72
- url: void 0
73
- });
74
- textNode.value = textNode.value.replace(ATTRIBUTION_PLAIN_RE, "");
75
- }
76
- }
77
- });
78
- }
79
- if (contributors.size === 0) continue;
80
- const sorted = [...contributors.values()].sort((a, b) => a.username.toLowerCase().localeCompare(b.username.toLowerCase()));
81
- const phrasingChildren = [];
82
- phrasingChildren.push({
83
- type: "text",
84
- value: "Thanks to "
85
- });
86
- for (let i = 0; i < sorted.length; i++) {
87
- const contrib = sorted[i];
88
- if (i > 0 && sorted.length > 2) phrasingChildren.push({
89
- type: "text",
90
- value: ", "
91
- });
92
- if (i > 0 && i === sorted.length - 1) phrasingChildren.push({
93
- type: "text",
94
- value: sorted.length === 2 ? " and " : "and "
95
- });
96
- if (contrib.url) phrasingChildren.push({
97
- type: "link",
98
- url: contrib.url,
99
- children: [{
100
- type: "text",
101
- value: `@${contrib.username}`
102
- }]
103
- });
104
- else phrasingChildren.push({
105
- type: "text",
106
- value: `@${contrib.username}`
107
- });
108
- }
109
- phrasingChildren.push({
110
- type: "text",
111
- value: " for their contributions!"
112
- });
113
- const paragraph = {
114
- type: "paragraph",
115
- children: phrasingChildren
116
- };
117
- tree.children.splice(block.endIndex, 0, paragraph);
118
- }
119
- };
120
- };
121
-
122
- //#endregion
123
- export { ContributorFootnotesPlugin };
@@ -1,32 +0,0 @@
1
- const require_index = require('../../../../../../../../node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.cjs');
2
- const require_version_blocks = require('../../utils/version-blocks.cjs');
3
-
4
- //#region ../silk-effects/dist/dev/pkg/changesets/remark/plugins/deduplicate-items.js
5
- const DeduplicateItemsPlugin = () => {
6
- return (tree) => {
7
- const blocks = require_version_blocks.getVersionBlocks(tree);
8
- for (const block of blocks) {
9
- const sections = require_version_blocks.getBlockSections(tree, block);
10
- for (const section of sections) {
11
- const seen = /* @__PURE__ */ new Set();
12
- for (const node of section.contentNodes) {
13
- if (node.type !== "list") continue;
14
- const list = node;
15
- list.children = list.children.filter((item) => {
16
- const text = require_index.toString(item);
17
- if (seen.has(text)) return false;
18
- seen.add(text);
19
- return true;
20
- });
21
- }
22
- }
23
- }
24
- tree.children = tree.children.filter((node) => {
25
- if (node.type === "list") return node.children.length > 0;
26
- return true;
27
- });
28
- };
29
- };
30
-
31
- //#endregion
32
- exports.DeduplicateItemsPlugin = DeduplicateItemsPlugin;
@@ -1,32 +0,0 @@
1
- import { toString } from "../../../../../../../../node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.js";
2
- import { getBlockSections, getVersionBlocks } from "../../utils/version-blocks.js";
3
-
4
- //#region ../silk-effects/dist/dev/pkg/changesets/remark/plugins/deduplicate-items.js
5
- const DeduplicateItemsPlugin = () => {
6
- return (tree) => {
7
- const blocks = getVersionBlocks(tree);
8
- for (const block of blocks) {
9
- const sections = getBlockSections(tree, block);
10
- for (const section of sections) {
11
- const seen = /* @__PURE__ */ new Set();
12
- for (const node of section.contentNodes) {
13
- if (node.type !== "list") continue;
14
- const list = node;
15
- list.children = list.children.filter((item) => {
16
- const text = toString(item);
17
- if (seen.has(text)) return false;
18
- seen.add(text);
19
- return true;
20
- });
21
- }
22
- }
23
- }
24
- tree.children = tree.children.filter((node) => {
25
- if (node.type === "list") return node.children.length > 0;
26
- return true;
27
- });
28
- };
29
- };
30
-
31
- //#endregion
32
- export { DeduplicateItemsPlugin };
@@ -1,59 +0,0 @@
1
- const require_index = require('../../../../../../../../node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/index.cjs');
2
- const require_index$1 = require('../../../../../../../../node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.cjs');
3
- const require_version_blocks = require('../../utils/version-blocks.cjs');
4
-
5
- //#region ../silk-effects/dist/dev/pkg/changesets/remark/plugins/issue-link-refs.js
6
- /**
7
- * Pattern matching issue numbers like `#123`.
8
- *
9
- * @internal
10
- */
11
- const ISSUE_RE = /^#\d+$/;
12
- const IssueLinkRefsPlugin = () => {
13
- return (tree) => {
14
- const blocks = require_version_blocks.getVersionBlocks(tree);
15
- for (let b = blocks.length - 1; b >= 0; b--) {
16
- const block = blocks[b];
17
- const definitions = /* @__PURE__ */ new Map();
18
- for (let i = block.startIndex; i < block.endIndex; i++) {
19
- const node = tree.children[i];
20
- require_index$1.visit(node, "link", (linkNode, index, parent) => {
21
- if (!parent || index === void 0) return;
22
- if (linkNode.children.length !== 1 || linkNode.children[0].type !== "text") return;
23
- const text = linkNode.children[0].value;
24
- if (!ISSUE_RE.test(text)) return;
25
- const label = text;
26
- if (!definitions.has(label)) definitions.set(label, {
27
- label,
28
- url: linkNode.url
29
- });
30
- const ref = {
31
- type: "linkReference",
32
- identifier: label,
33
- label,
34
- referenceType: "full",
35
- children: [{
36
- type: "text",
37
- value: label
38
- }]
39
- };
40
- parent.children[index] = ref;
41
- return require_index.SKIP;
42
- });
43
- }
44
- if (definitions.size === 0) continue;
45
- const defNodes = [...definitions.values()].sort((a, b) => {
46
- return Number.parseInt(a.label.slice(1), 10) - Number.parseInt(b.label.slice(1), 10);
47
- }).map((def) => ({
48
- type: "definition",
49
- identifier: def.label,
50
- label: def.label,
51
- url: def.url
52
- }));
53
- tree.children.splice(block.endIndex, 0, ...defNodes);
54
- }
55
- };
56
- };
57
-
58
- //#endregion
59
- exports.IssueLinkRefsPlugin = IssueLinkRefsPlugin;
@@ -1,59 +0,0 @@
1
- import { SKIP } from "../../../../../../../../node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/index.js";
2
- import { visit } from "../../../../../../../../node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.js";
3
- import { getVersionBlocks } from "../../utils/version-blocks.js";
4
-
5
- //#region ../silk-effects/dist/dev/pkg/changesets/remark/plugins/issue-link-refs.js
6
- /**
7
- * Pattern matching issue numbers like `#123`.
8
- *
9
- * @internal
10
- */
11
- const ISSUE_RE = /^#\d+$/;
12
- const IssueLinkRefsPlugin = () => {
13
- return (tree) => {
14
- const blocks = getVersionBlocks(tree);
15
- for (let b = blocks.length - 1; b >= 0; b--) {
16
- const block = blocks[b];
17
- const definitions = /* @__PURE__ */ new Map();
18
- for (let i = block.startIndex; i < block.endIndex; i++) {
19
- const node = tree.children[i];
20
- visit(node, "link", (linkNode, index, parent) => {
21
- if (!parent || index === void 0) return;
22
- if (linkNode.children.length !== 1 || linkNode.children[0].type !== "text") return;
23
- const text = linkNode.children[0].value;
24
- if (!ISSUE_RE.test(text)) return;
25
- const label = text;
26
- if (!definitions.has(label)) definitions.set(label, {
27
- label,
28
- url: linkNode.url
29
- });
30
- const ref = {
31
- type: "linkReference",
32
- identifier: label,
33
- label,
34
- referenceType: "full",
35
- children: [{
36
- type: "text",
37
- value: label
38
- }]
39
- };
40
- parent.children[index] = ref;
41
- return SKIP;
42
- });
43
- }
44
- if (definitions.size === 0) continue;
45
- const defNodes = [...definitions.values()].sort((a, b) => {
46
- return Number.parseInt(a.label.slice(1), 10) - Number.parseInt(b.label.slice(1), 10);
47
- }).map((def) => ({
48
- type: "definition",
49
- identifier: def.label,
50
- label: def.label,
51
- url: def.url
52
- }));
53
- tree.children.splice(block.endIndex, 0, ...defNodes);
54
- }
55
- };
56
- };
57
-
58
- //#endregion
59
- export { IssueLinkRefsPlugin };
@@ -1,61 +0,0 @@
1
- const require_version_blocks = require('../../utils/version-blocks.cjs');
2
-
3
- //#region ../silk-effects/dist/dev/pkg/changesets/remark/plugins/maintenance-note.js
4
- function buildNoteChildren(reason) {
5
- if (reason.kind === "unspecified" || reason.triggers.length === 0) return [{
6
- type: "text",
7
- value: "Version-only release to keep workspace versions consistent; no changes to this package."
8
- }];
9
- const label = reason.kind === "fixed" ? "fixed version group" : "linked version group";
10
- const children = [{
11
- type: "text",
12
- value: "Released in lockstep with "
13
- }];
14
- reason.triggers.forEach((trigger, index) => {
15
- if (index > 0) children.push({
16
- type: "text",
17
- value: ", "
18
- });
19
- children.push({
20
- type: "inlineCode",
21
- value: `${trigger.name}@${trigger.version}`
22
- });
23
- });
24
- children.push({
25
- type: "text",
26
- value: ` (${label}).`
27
- });
28
- return children;
29
- }
30
- const MaintenanceNotePlugin = (options) => {
31
- return (tree) => {
32
- const block = require_version_blocks.getVersionBlocks(tree).find((b) => require_version_blocks.getHeadingText(tree.children[b.headingIndex]) === options.version);
33
- if (!block) return;
34
- if (block.endIndex > block.startIndex) return;
35
- const heading = {
36
- type: "heading",
37
- depth: 3,
38
- children: [{
39
- type: "text",
40
- value: "Maintenance"
41
- }]
42
- };
43
- const list = {
44
- type: "list",
45
- ordered: false,
46
- spread: false,
47
- children: [{
48
- type: "listItem",
49
- spread: false,
50
- children: [{
51
- type: "paragraph",
52
- children: buildNoteChildren(options.reason)
53
- }]
54
- }]
55
- };
56
- tree.children.splice(block.startIndex, 0, heading, list);
57
- };
58
- };
59
-
60
- //#endregion
61
- exports.MaintenanceNotePlugin = MaintenanceNotePlugin;
@@ -1,61 +0,0 @@
1
- import { getHeadingText, getVersionBlocks } from "../../utils/version-blocks.js";
2
-
3
- //#region ../silk-effects/dist/dev/pkg/changesets/remark/plugins/maintenance-note.js
4
- function buildNoteChildren(reason) {
5
- if (reason.kind === "unspecified" || reason.triggers.length === 0) return [{
6
- type: "text",
7
- value: "Version-only release to keep workspace versions consistent; no changes to this package."
8
- }];
9
- const label = reason.kind === "fixed" ? "fixed version group" : "linked version group";
10
- const children = [{
11
- type: "text",
12
- value: "Released in lockstep with "
13
- }];
14
- reason.triggers.forEach((trigger, index) => {
15
- if (index > 0) children.push({
16
- type: "text",
17
- value: ", "
18
- });
19
- children.push({
20
- type: "inlineCode",
21
- value: `${trigger.name}@${trigger.version}`
22
- });
23
- });
24
- children.push({
25
- type: "text",
26
- value: ` (${label}).`
27
- });
28
- return children;
29
- }
30
- const MaintenanceNotePlugin = (options) => {
31
- return (tree) => {
32
- const block = getVersionBlocks(tree).find((b) => getHeadingText(tree.children[b.headingIndex]) === options.version);
33
- if (!block) return;
34
- if (block.endIndex > block.startIndex) return;
35
- const heading = {
36
- type: "heading",
37
- depth: 3,
38
- children: [{
39
- type: "text",
40
- value: "Maintenance"
41
- }]
42
- };
43
- const list = {
44
- type: "list",
45
- ordered: false,
46
- spread: false,
47
- children: [{
48
- type: "listItem",
49
- spread: false,
50
- children: [{
51
- type: "paragraph",
52
- children: buildNoteChildren(options.reason)
53
- }]
54
- }]
55
- };
56
- tree.children.splice(block.startIndex, 0, heading, list);
57
- };
58
- };
59
-
60
- //#endregion
61
- export { MaintenanceNotePlugin };
@@ -1,43 +0,0 @@
1
- const require_index = require('../../categories/index.cjs');
2
- const require_version_blocks = require('../../utils/version-blocks.cjs');
3
-
4
- //#region ../silk-effects/dist/dev/pkg/changesets/remark/plugins/merge-sections.js
5
- const MergeSectionsPlugin = () => {
6
- return (tree) => {
7
- const blocks = require_version_blocks.getVersionBlocks(tree);
8
- for (let b = blocks.length - 1; b >= 0; b--) {
9
- const sections = require_version_blocks.getBlockSections(tree, blocks[b]);
10
- if (sections.length <= 1) continue;
11
- const groups = /* @__PURE__ */ new Map();
12
- for (let s = 0; s < sections.length; s++) {
13
- const text = require_version_blocks.getHeadingText(sections[s].heading);
14
- const category = require_index.fromHeading(text);
15
- const key = category ? category.heading.toLowerCase() : text.toLowerCase();
16
- const existing = groups.get(key);
17
- if (existing) existing.push(s);
18
- else groups.set(key, [s]);
19
- }
20
- const indicesToRemove = [];
21
- for (const indices of groups.values()) {
22
- if (indices.length <= 1) continue;
23
- const target = sections[indices[0]];
24
- const targetEndIndex = target.headingIndex + 1 + target.contentNodes.length;
25
- const mergedContent = [];
26
- for (let d = 1; d < indices.length; d++) {
27
- const dup = sections[indices[d]];
28
- mergedContent.push(...dup.contentNodes);
29
- indicesToRemove.push(dup.headingIndex);
30
- for (let c = 0; c < dup.contentNodes.length; c++) indicesToRemove.push(dup.headingIndex + 1 + c);
31
- }
32
- tree.children.splice(targetEndIndex, 0, ...mergedContent);
33
- const shift = mergedContent.length;
34
- for (let r = 0; r < indicesToRemove.length; r++) if (indicesToRemove[r] >= targetEndIndex) indicesToRemove[r] += shift;
35
- }
36
- indicesToRemove.sort((a, b) => b - a);
37
- for (const idx of indicesToRemove) tree.children.splice(idx, 1);
38
- }
39
- };
40
- };
41
-
42
- //#endregion
43
- exports.MergeSectionsPlugin = MergeSectionsPlugin;
@@ -1,43 +0,0 @@
1
- import { fromHeading } from "../../categories/index.js";
2
- import { getBlockSections, getHeadingText, getVersionBlocks } from "../../utils/version-blocks.js";
3
-
4
- //#region ../silk-effects/dist/dev/pkg/changesets/remark/plugins/merge-sections.js
5
- const MergeSectionsPlugin = () => {
6
- return (tree) => {
7
- const blocks = getVersionBlocks(tree);
8
- for (let b = blocks.length - 1; b >= 0; b--) {
9
- const sections = getBlockSections(tree, blocks[b]);
10
- if (sections.length <= 1) continue;
11
- const groups = /* @__PURE__ */ new Map();
12
- for (let s = 0; s < sections.length; s++) {
13
- const text = getHeadingText(sections[s].heading);
14
- const category = fromHeading(text);
15
- const key = category ? category.heading.toLowerCase() : text.toLowerCase();
16
- const existing = groups.get(key);
17
- if (existing) existing.push(s);
18
- else groups.set(key, [s]);
19
- }
20
- const indicesToRemove = [];
21
- for (const indices of groups.values()) {
22
- if (indices.length <= 1) continue;
23
- const target = sections[indices[0]];
24
- const targetEndIndex = target.headingIndex + 1 + target.contentNodes.length;
25
- const mergedContent = [];
26
- for (let d = 1; d < indices.length; d++) {
27
- const dup = sections[indices[d]];
28
- mergedContent.push(...dup.contentNodes);
29
- indicesToRemove.push(dup.headingIndex);
30
- for (let c = 0; c < dup.contentNodes.length; c++) indicesToRemove.push(dup.headingIndex + 1 + c);
31
- }
32
- tree.children.splice(targetEndIndex, 0, ...mergedContent);
33
- const shift = mergedContent.length;
34
- for (let r = 0; r < indicesToRemove.length; r++) if (indicesToRemove[r] >= targetEndIndex) indicesToRemove[r] += shift;
35
- }
36
- indicesToRemove.sort((a, b) => b - a);
37
- for (const idx of indicesToRemove) tree.children.splice(idx, 1);
38
- }
39
- };
40
- };
41
-
42
- //#endregion
43
- export { MergeSectionsPlugin };