@savvy-web/silk 1.3.10 → 2.0.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 (36) hide show
  1. package/changesets-changelog.cjs +39308 -96625
  2. package/changesets-changelog.d.cts +137 -36
  3. package/changesets-changelog.d.ts +137 -36
  4. package/changesets-markdownlint.cjs +39305 -96622
  5. package/changesets-markdownlint.d.cts +137 -36
  6. package/changesets-markdownlint.d.ts +137 -36
  7. package/package.json +12 -12
  8. package/packages/silk-effects/dist/dev/pkg/changesets/api/changelog.cjs +2 -2
  9. package/packages/silk-effects/dist/dev/pkg/changesets/api/changelog.js +2 -2
  10. package/packages/silk-effects/dist/dev/pkg/changesets/api/transformer.cjs +24 -30
  11. package/packages/silk-effects/dist/dev/pkg/changesets/api/transformer.js +24 -30
  12. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/formatting.cjs +4 -10
  13. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/formatting.js +4 -10
  14. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/getDependencyReleaseLine.cjs +13 -9
  15. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/getDependencyReleaseLine.js +13 -9
  16. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/getReleaseLine.cjs +8 -8
  17. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/getReleaseLine.js +8 -8
  18. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/index.cjs +1 -1
  19. package/packages/silk-effects/dist/dev/pkg/changesets/changelog/index.js +1 -1
  20. package/packages/silk-effects/dist/dev/pkg/changesets/index.cjs +12 -2
  21. package/packages/silk-effects/dist/dev/pkg/changesets/index.js +9 -3
  22. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/deduplicate-items.cjs +11 -9
  23. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/deduplicate-items.js +11 -9
  24. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/maintenance-note.cjs +61 -0
  25. package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/maintenance-note.js +61 -0
  26. package/packages/silk-effects/dist/dev/pkg/changesets/remark/presets.cjs +1 -1
  27. package/packages/silk-effects/dist/dev/pkg/changesets/remark/presets.js +1 -1
  28. package/packages/silk-effects/dist/dev/pkg/changesets/services/maintenance-reason.cjs +68 -0
  29. package/packages/silk-effects/dist/dev/pkg/changesets/services/maintenance-reason.js +66 -0
  30. package/packages/silk-effects/dist/dev/pkg/changesets/services/release-planner.cjs +105 -59
  31. package/packages/silk-effects/dist/dev/pkg/changesets/services/release-planner.js +104 -58
  32. package/packages/silk-effects/dist/dev/pkg/changesets/vendor/github-info.cjs +33 -11
  33. package/packages/silk-effects/dist/dev/pkg/changesets/vendor/github-info.js +33 -11
  34. package/packages/silk-effects/dist/dev/pkg/schemas/VersioningSchemas.cjs +1 -1
  35. package/packages/silk-effects/dist/dev/pkg/schemas/VersioningSchemas.js +1 -1
  36. package/tsconfig/node/dist/tsconfig.tsbuildinfo +1 -1
@@ -19,12 +19,15 @@ import { HeadingHierarchyRule } from "./remark/rules/heading-hierarchy.js";
19
19
  import { RequiredSectionsRule } from "./remark/rules/required-sections.js";
20
20
  import { UncategorizedContentRule } from "./remark/rules/uncategorized-content.js";
21
21
  import { ChangesetLinter } from "./api/linter.js";
22
+ import { MaintenanceNotePlugin } from "./remark/plugins/maintenance-note.js";
23
+ import { AggregateDependencyTablesPlugin } from "./remark/plugins/aggregate-dependency-tables.js";
22
24
  import { ContributorFootnotesPlugin } from "./remark/plugins/contributor-footnotes.js";
23
25
  import { DeduplicateItemsPlugin } from "./remark/plugins/deduplicate-items.js";
24
26
  import { IssueLinkRefsPlugin } from "./remark/plugins/issue-link-refs.js";
25
27
  import { MergeSectionsPlugin } from "./remark/plugins/merge-sections.js";
26
28
  import { NormalizeFormatPlugin } from "./remark/plugins/normalize-format.js";
27
29
  import { ReorderSectionsPlugin } from "./remark/plugins/reorder-sections.js";
30
+ import { SilkChangesetPreset, SilkChangesetTransformPreset } from "./remark/presets.js";
28
31
  import { ChangelogTransformer } from "./api/transformer.js";
29
32
  import { ClassificationReasonSchema, ClassificationSchema, ConfigInspector, ConfigInspectorBase, ConfigInspectorLive, InspectedConfigSchema, ResolvedPackageScopeSchema, ResolvedVersionFileSchema, makeConfigInspectorTest } from "./services/config-inspector.js";
30
33
  import { BranchAnalysisSchema, BranchAnalyzer, BranchAnalyzerBase, BranchAnalyzerLive, BranchFileEntrySchema, FileStatusSchema, makeBranchAnalyzerTest } from "./services/branch-analyzer.js";
@@ -33,6 +36,7 @@ import { computeWorkspaceDependencyDiffs } from "./utils/dep-diff.js";
33
36
  import { gitMergeBase } from "./utils/git.js";
34
37
  import { listPublishablePackageNames } from "./utils/publishability.js";
35
38
  import { DepsRegen, DepsRegenBase, DepsRegenDefault, DepsRegenLive, isPureDependencyChangeset } from "./services/deps-regen.js";
39
+ import { MaintenanceReasonSchema, MaintenanceTriggerSchema, deriveMaintenanceReason } from "./services/maintenance-reason.js";
36
40
  import { VersionFiles } from "./utils/version-files.js";
37
41
  import { ReleasePlanner, ReleasePlannerBase, ReleasePlannerLive, makeReleasePlannerTest } from "./services/release-planner.js";
38
42
  import { SectionCategorySchema } from "./categories/types.js";
@@ -45,8 +49,6 @@ import { HeadingHierarchyRule as HeadingHierarchyRule$1 } from "./markdownlint/r
45
49
  import { RequiredSectionsRule as RequiredSectionsRule$1 } from "./markdownlint/rules/required-sections.js";
46
50
  import { UncategorizedContentRule as UncategorizedContentRule$1 } from "./markdownlint/rules/uncategorized-content.js";
47
51
  import SilkChangesetsRules from "./markdownlint/index.js";
48
- import { AggregateDependencyTablesPlugin } from "./remark/plugins/aggregate-dependency-tables.js";
49
- import { SilkChangesetPreset, SilkChangesetTransformPreset } from "./remark/presets.js";
50
52
 
51
53
  //#region ../silk-effects/dist/dev/pkg/changesets/index.js
52
54
  var changesets_exports = /* @__PURE__ */ __exportAll({
@@ -113,6 +115,9 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
113
115
  JsonPathSchema: () => JsonPathSchema,
114
116
  LegacyVersionFileConfigSchema: () => LegacyVersionFileConfigSchema,
115
117
  LegacyVersionFilesSchema: () => LegacyVersionFilesSchema,
118
+ MaintenanceNotePlugin: () => MaintenanceNotePlugin,
119
+ MaintenanceReasonSchema: () => MaintenanceReasonSchema,
120
+ MaintenanceTriggerSchema: () => MaintenanceTriggerSchema,
116
121
  MarkdownLive: () => MarkdownLive,
117
122
  MarkdownParseError: () => MarkdownParseError,
118
123
  MarkdownParseErrorBase: () => MarkdownParseErrorBase,
@@ -159,6 +164,7 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
159
164
  VersionTypeSchema: () => VersionTypeSchema,
160
165
  changelogFunctions: () => changelogFunctions,
161
166
  computeWorkspaceDependencyDiffs: () => computeWorkspaceDependencyDiffs,
167
+ deriveMaintenanceReason: () => deriveMaintenanceReason,
162
168
  gitMergeBase: () => gitMergeBase,
163
169
  isPureDependencyChangeset: () => isPureDependencyChangeset,
164
170
  listPublishablePackageNames: () => listPublishablePackageNames,
@@ -170,4 +176,4 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
170
176
  });
171
177
 
172
178
  //#endregion
173
- export { AggregateDependencyTablesPlugin, AppliedReleaseEntrySchema, AppliedReleaseSchema, BranchAnalysisSchema, BranchAnalyzer, BranchAnalyzerBase, BranchAnalyzerLive, BranchFileEntrySchema, BumpTypeSchema, Categories, Changelog, ChangelogService, ChangelogServiceBase, ChangelogTransformer, ChangesetIOError, ChangesetIOErrorBase, ChangesetLinter, ChangesetOptionsSchema, ChangesetPreviewSchema, ChangesetSchema, ChangesetSummarySchema, ChangesetValidationError, ChangesetValidationErrorBase, ClassificationReasonSchema, ClassificationSchema, CommitHashSchema, ConfigInspector, ConfigInspectorBase, ConfigInspectorLive, ConfigurationError, ConfigurationErrorBase, ContentStructureRule, ContributorFootnotesPlugin, DeduplicateItemsPlugin, DependencyActionSchema, DependencyTable, DependencyTableFormatRule, DependencyTableRowSchema, DependencyTableSchema, DependencyTableTypeSchema, DependencyTypeSchema, DependencyUpdateSchema, DepsRegen, DepsRegenBase, DepsRegenDefault, DepsRegenLive, FileStatusSchema, GitError, GitErrorBase, GitHubApiError, GitHubApiErrorBase, GitHubInfoSchema, GitHubLive, GitHubService, GitHubServiceBase, GlobSchema, HeadingHierarchyRule, InspectedConfigSchema, IssueLinkRefsPlugin, IssueNumberSchema, JsonPathSchema, LegacyVersionFileConfigSchema, LegacyVersionFilesSchema, MarkdownLive, MarkdownParseError, MarkdownParseErrorBase, MarkdownService, MarkdownServiceBase, ContentStructureRule$1 as MarkdownlintContentStructureRule, DependencyTableFormatRule$1 as MarkdownlintDependencyTableFormatRule, HeadingHierarchyRule$1 as MarkdownlintHeadingHierarchyRule, RequiredSectionsRule$1 as MarkdownlintRequiredSectionsRule, UncategorizedContentRule$1 as MarkdownlintUncategorizedContentRule, MergeSectionsPlugin, NonEmptyString, NormalizeFormatPlugin, PackageScopeSchema, PackagesRecordSchema, PendingChangesetSchema, PositiveInteger, PreviewReleaseSchema, ReleasePlanError, ReleasePlanErrorBase, ReleasePlanner, ReleasePlannerBase, ReleasePlannerLive, ReorderSectionsPlugin, RepoSchema, RequiredSectionsRule, ResolvedPackageScopeSchema, ResolvedVersionFileSchema, SectionCategorySchema, SilkChangesetPreset, SilkChangesetTransformPreset, SilkChangesetsRules, UncategorizedContentRule, UrlOrMarkdownLinkSchema, UsernameSchema, VERSION_RE, VersionFileConfigSchema, VersionFileError, VersionFileErrorBase, VersionFileUpdateRecordSchema, VersionFiles, VersionFilesSchema, VersionOrEmptySchema, VersionTypeSchema, changelogFunctions, changesets_exports, computeWorkspaceDependencyDiffs, gitMergeBase, isPureDependencyChangeset, listPublishablePackageNames, makeBranchAnalyzerTest, makeConfigInspectorTest, makeGitHubTest, makeReleasePlannerTest, serializeDependencyTableToMarkdown };
179
+ export { AggregateDependencyTablesPlugin, AppliedReleaseEntrySchema, AppliedReleaseSchema, BranchAnalysisSchema, BranchAnalyzer, BranchAnalyzerBase, BranchAnalyzerLive, BranchFileEntrySchema, BumpTypeSchema, Categories, Changelog, ChangelogService, ChangelogServiceBase, ChangelogTransformer, ChangesetIOError, ChangesetIOErrorBase, ChangesetLinter, ChangesetOptionsSchema, ChangesetPreviewSchema, ChangesetSchema, ChangesetSummarySchema, ChangesetValidationError, ChangesetValidationErrorBase, ClassificationReasonSchema, ClassificationSchema, CommitHashSchema, ConfigInspector, ConfigInspectorBase, ConfigInspectorLive, ConfigurationError, ConfigurationErrorBase, ContentStructureRule, ContributorFootnotesPlugin, DeduplicateItemsPlugin, DependencyActionSchema, DependencyTable, DependencyTableFormatRule, DependencyTableRowSchema, DependencyTableSchema, DependencyTableTypeSchema, DependencyTypeSchema, DependencyUpdateSchema, DepsRegen, DepsRegenBase, DepsRegenDefault, DepsRegenLive, FileStatusSchema, GitError, GitErrorBase, GitHubApiError, GitHubApiErrorBase, GitHubInfoSchema, GitHubLive, GitHubService, GitHubServiceBase, GlobSchema, HeadingHierarchyRule, InspectedConfigSchema, IssueLinkRefsPlugin, IssueNumberSchema, JsonPathSchema, LegacyVersionFileConfigSchema, LegacyVersionFilesSchema, MaintenanceNotePlugin, MaintenanceReasonSchema, MaintenanceTriggerSchema, MarkdownLive, MarkdownParseError, MarkdownParseErrorBase, MarkdownService, MarkdownServiceBase, ContentStructureRule$1 as MarkdownlintContentStructureRule, DependencyTableFormatRule$1 as MarkdownlintDependencyTableFormatRule, HeadingHierarchyRule$1 as MarkdownlintHeadingHierarchyRule, RequiredSectionsRule$1 as MarkdownlintRequiredSectionsRule, UncategorizedContentRule$1 as MarkdownlintUncategorizedContentRule, MergeSectionsPlugin, NonEmptyString, NormalizeFormatPlugin, PackageScopeSchema, PackagesRecordSchema, PendingChangesetSchema, PositiveInteger, PreviewReleaseSchema, ReleasePlanError, ReleasePlanErrorBase, ReleasePlanner, ReleasePlannerBase, ReleasePlannerLive, ReorderSectionsPlugin, RepoSchema, RequiredSectionsRule, ResolvedPackageScopeSchema, ResolvedVersionFileSchema, SectionCategorySchema, SilkChangesetPreset, SilkChangesetTransformPreset, SilkChangesetsRules, UncategorizedContentRule, UrlOrMarkdownLinkSchema, UsernameSchema, VERSION_RE, VersionFileConfigSchema, VersionFileError, VersionFileErrorBase, VersionFileUpdateRecordSchema, VersionFiles, VersionFilesSchema, VersionOrEmptySchema, VersionTypeSchema, changelogFunctions, changesets_exports, computeWorkspaceDependencyDiffs, deriveMaintenanceReason, gitMergeBase, isPureDependencyChangeset, listPublishablePackageNames, makeBranchAnalyzerTest, makeConfigInspectorTest, makeGitHubTest, makeReleasePlannerTest, serializeDependencyTableToMarkdown };
@@ -7,16 +7,18 @@ const DeduplicateItemsPlugin = () => {
7
7
  const blocks = require_version_blocks.getVersionBlocks(tree);
8
8
  for (const block of blocks) {
9
9
  const sections = require_version_blocks.getBlockSections(tree, block);
10
- for (const section of sections) for (const node of section.contentNodes) {
11
- if (node.type !== "list") continue;
12
- const list = node;
10
+ for (const section of sections) {
13
11
  const seen = /* @__PURE__ */ new Set();
14
- list.children = list.children.filter((item) => {
15
- const text = require_index.toString(item);
16
- if (seen.has(text)) return false;
17
- seen.add(text);
18
- return true;
19
- });
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
+ }
20
22
  }
21
23
  }
22
24
  tree.children = tree.children.filter((node) => {
@@ -7,16 +7,18 @@ const DeduplicateItemsPlugin = () => {
7
7
  const blocks = getVersionBlocks(tree);
8
8
  for (const block of blocks) {
9
9
  const sections = getBlockSections(tree, block);
10
- for (const section of sections) for (const node of section.contentNodes) {
11
- if (node.type !== "list") continue;
12
- const list = node;
10
+ for (const section of sections) {
13
11
  const seen = /* @__PURE__ */ new Set();
14
- list.children = list.children.filter((item) => {
15
- const text = toString(item);
16
- if (seen.has(text)) return false;
17
- seen.add(text);
18
- return true;
19
- });
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
+ }
20
22
  }
21
23
  }
22
24
  tree.children = tree.children.filter((node) => {
@@ -0,0 +1,61 @@
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;
@@ -0,0 +1,61 @@
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 };
@@ -3,13 +3,13 @@ const require_dependency_table_format = require('./rules/dependency-table-format
3
3
  const require_heading_hierarchy = require('./rules/heading-hierarchy.cjs');
4
4
  const require_required_sections = require('./rules/required-sections.cjs');
5
5
  const require_uncategorized_content = require('./rules/uncategorized-content.cjs');
6
+ const require_aggregate_dependency_tables = require('./plugins/aggregate-dependency-tables.cjs');
6
7
  const require_contributor_footnotes = require('./plugins/contributor-footnotes.cjs');
7
8
  const require_deduplicate_items = require('./plugins/deduplicate-items.cjs');
8
9
  const require_issue_link_refs = require('./plugins/issue-link-refs.cjs');
9
10
  const require_merge_sections = require('./plugins/merge-sections.cjs');
10
11
  const require_normalize_format = require('./plugins/normalize-format.cjs');
11
12
  const require_reorder_sections = require('./plugins/reorder-sections.cjs');
12
- const require_aggregate_dependency_tables = require('./plugins/aggregate-dependency-tables.cjs');
13
13
 
14
14
  //#region ../silk-effects/dist/dev/pkg/changesets/remark/presets.js
15
15
  /**
@@ -3,13 +3,13 @@ import { DependencyTableFormatRule } from "./rules/dependency-table-format.js";
3
3
  import { HeadingHierarchyRule } from "./rules/heading-hierarchy.js";
4
4
  import { RequiredSectionsRule } from "./rules/required-sections.js";
5
5
  import { UncategorizedContentRule } from "./rules/uncategorized-content.js";
6
+ import { AggregateDependencyTablesPlugin } from "./plugins/aggregate-dependency-tables.js";
6
7
  import { ContributorFootnotesPlugin } from "./plugins/contributor-footnotes.js";
7
8
  import { DeduplicateItemsPlugin } from "./plugins/deduplicate-items.js";
8
9
  import { IssueLinkRefsPlugin } from "./plugins/issue-link-refs.js";
9
10
  import { MergeSectionsPlugin } from "./plugins/merge-sections.js";
10
11
  import { NormalizeFormatPlugin } from "./plugins/normalize-format.js";
11
12
  import { ReorderSectionsPlugin } from "./plugins/reorder-sections.js";
12
- import { AggregateDependencyTablesPlugin } from "./plugins/aggregate-dependency-tables.js";
13
13
 
14
14
  //#region ../silk-effects/dist/dev/pkg/changesets/remark/presets.js
15
15
  /**
@@ -0,0 +1,68 @@
1
+ const require_ChangesetConfig = require('../../services/ChangesetConfig.cjs');
2
+ let effect = require("effect");
3
+
4
+ //#region ../silk-effects/dist/dev/pkg/changesets/services/maintenance-reason.js
5
+ /**
6
+ * A group co-member whose own changesets forced this release.
7
+ *
8
+ * @public
9
+ */
10
+ const MaintenanceTriggerSchema = effect.Schema.Struct({
11
+ /** Package name of the triggering co-member. */
12
+ name: effect.Schema.String,
13
+ /** The co-member's new version in the same release plan. */
14
+ version: effect.Schema.String
15
+ });
16
+ /**
17
+ * Why a package is releasing with no changesets of its own.
18
+ *
19
+ * @public
20
+ */
21
+ const MaintenanceReasonSchema = effect.Schema.Struct({
22
+ /** Coupling that forced the release; `"unspecified"` when undetermined. */
23
+ kind: effect.Schema.Literal("fixed", "linked", "unspecified"),
24
+ /** Triggering co-members; empty for `"unspecified"`. */
25
+ triggers: effect.Schema.Array(MaintenanceTriggerSchema)
26
+ });
27
+ /**
28
+ * Derive the {@link MaintenanceReason} for a release, or `undefined` when the
29
+ * release has its own changesets (not a maintenance release).
30
+ *
31
+ * @param release - The release to classify.
32
+ * @param plan - The full release plan (source of group co-members).
33
+ * @param config - Resolved changesets config (`fixed` / `linked` groups).
34
+ * @returns The reason, or `undefined` for releases with their own changesets.
35
+ *
36
+ * @remarks
37
+ * Group entries are matched with {@link ChangesetConfig.matches} — exact names
38
+ * and trailing `"@scope/*"` prefixes only, a subset of the micromatch globs
39
+ * changesets accepts. A group entry using richer glob syntax (e.g. `"pkg-*"`)
40
+ * will not match here; the release then degrades gracefully to the
41
+ * `"unspecified"` fallback sentence instead of naming its triggers.
42
+ *
43
+ * @public
44
+ */
45
+ function deriveMaintenanceReason(release, plan, config) {
46
+ if (release.changesets.length > 0) return void 0;
47
+ const groupKinds = [["fixed", config.fixed], ["linked", config.linked]];
48
+ for (const [kind, groups] of groupKinds) for (const group of groups) {
49
+ if (!group.some((pattern) => require_ChangesetConfig.ChangesetConfig.matches(release.name, pattern))) continue;
50
+ const triggers = plan.releases.filter((r) => r.name !== release.name && r.changesets.length > 0 && group.some((pattern) => require_ChangesetConfig.ChangesetConfig.matches(r.name, pattern))).map((r) => ({
51
+ name: r.name,
52
+ version: r.newVersion
53
+ }));
54
+ if (triggers.length > 0) return {
55
+ kind,
56
+ triggers
57
+ };
58
+ }
59
+ return {
60
+ kind: "unspecified",
61
+ triggers: []
62
+ };
63
+ }
64
+
65
+ //#endregion
66
+ exports.MaintenanceReasonSchema = MaintenanceReasonSchema;
67
+ exports.MaintenanceTriggerSchema = MaintenanceTriggerSchema;
68
+ exports.deriveMaintenanceReason = deriveMaintenanceReason;
@@ -0,0 +1,66 @@
1
+ import { ChangesetConfig } from "../../services/ChangesetConfig.js";
2
+ import { Schema } from "effect";
3
+
4
+ //#region ../silk-effects/dist/dev/pkg/changesets/services/maintenance-reason.js
5
+ /**
6
+ * A group co-member whose own changesets forced this release.
7
+ *
8
+ * @public
9
+ */
10
+ const MaintenanceTriggerSchema = Schema.Struct({
11
+ /** Package name of the triggering co-member. */
12
+ name: Schema.String,
13
+ /** The co-member's new version in the same release plan. */
14
+ version: Schema.String
15
+ });
16
+ /**
17
+ * Why a package is releasing with no changesets of its own.
18
+ *
19
+ * @public
20
+ */
21
+ const MaintenanceReasonSchema = Schema.Struct({
22
+ /** Coupling that forced the release; `"unspecified"` when undetermined. */
23
+ kind: Schema.Literal("fixed", "linked", "unspecified"),
24
+ /** Triggering co-members; empty for `"unspecified"`. */
25
+ triggers: Schema.Array(MaintenanceTriggerSchema)
26
+ });
27
+ /**
28
+ * Derive the {@link MaintenanceReason} for a release, or `undefined` when the
29
+ * release has its own changesets (not a maintenance release).
30
+ *
31
+ * @param release - The release to classify.
32
+ * @param plan - The full release plan (source of group co-members).
33
+ * @param config - Resolved changesets config (`fixed` / `linked` groups).
34
+ * @returns The reason, or `undefined` for releases with their own changesets.
35
+ *
36
+ * @remarks
37
+ * Group entries are matched with {@link ChangesetConfig.matches} — exact names
38
+ * and trailing `"@scope/*"` prefixes only, a subset of the micromatch globs
39
+ * changesets accepts. A group entry using richer glob syntax (e.g. `"pkg-*"`)
40
+ * will not match here; the release then degrades gracefully to the
41
+ * `"unspecified"` fallback sentence instead of naming its triggers.
42
+ *
43
+ * @public
44
+ */
45
+ function deriveMaintenanceReason(release, plan, config) {
46
+ if (release.changesets.length > 0) return void 0;
47
+ const groupKinds = [["fixed", config.fixed], ["linked", config.linked]];
48
+ for (const [kind, groups] of groupKinds) for (const group of groups) {
49
+ if (!group.some((pattern) => ChangesetConfig.matches(release.name, pattern))) continue;
50
+ const triggers = plan.releases.filter((r) => r.name !== release.name && r.changesets.length > 0 && group.some((pattern) => ChangesetConfig.matches(r.name, pattern))).map((r) => ({
51
+ name: r.name,
52
+ version: r.newVersion
53
+ }));
54
+ if (triggers.length > 0) return {
55
+ kind,
56
+ triggers
57
+ };
58
+ }
59
+ return {
60
+ kind: "unspecified",
61
+ triggers: []
62
+ };
63
+ }
64
+
65
+ //#endregion
66
+ export { MaintenanceReasonSchema, MaintenanceTriggerSchema, deriveMaintenanceReason };