@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.
- package/README.md +7 -5
- package/changesets-changelog.cjs +39298 -96760
- package/changesets-changelog.d.cts +24 -14
- package/changesets-changelog.d.ts +24 -14
- package/changesets-changelog.js +54057 -1
- package/changesets-markdownlint.cjs +39295 -96757
- package/changesets-markdownlint.d.cts +24 -14
- package/changesets-markdownlint.d.ts +24 -14
- package/changesets-markdownlint.js +54057 -1
- package/package.json +6 -5
- package/tsconfig/node/dist/tsconfig.tsbuildinfo +1 -1
- package/_virtual/_rolldown/runtime.cjs +0 -45
- package/_virtual/_rolldown/runtime.js +0 -45
- package/packages/silk-effects/dist/dev/pkg/_virtual/_rolldown/runtime.cjs +0 -15
- package/packages/silk-effects/dist/dev/pkg/_virtual/_rolldown/runtime.js +0 -14
- package/packages/silk-effects/dist/dev/pkg/changesets/api/categories.cjs +0 -247
- package/packages/silk-effects/dist/dev/pkg/changesets/api/categories.js +0 -247
- package/packages/silk-effects/dist/dev/pkg/changesets/api/changelog.cjs +0 -134
- package/packages/silk-effects/dist/dev/pkg/changesets/api/changelog.js +0 -134
- package/packages/silk-effects/dist/dev/pkg/changesets/api/dependency-table.cjs +0 -163
- package/packages/silk-effects/dist/dev/pkg/changesets/api/dependency-table.js +0 -163
- package/packages/silk-effects/dist/dev/pkg/changesets/api/linter.cjs +0 -170
- package/packages/silk-effects/dist/dev/pkg/changesets/api/linter.js +0 -170
- package/packages/silk-effects/dist/dev/pkg/changesets/api/transformer.cjs +0 -134
- package/packages/silk-effects/dist/dev/pkg/changesets/api/transformer.js +0 -134
- package/packages/silk-effects/dist/dev/pkg/changesets/categories/index.cjs +0 -317
- package/packages/silk-effects/dist/dev/pkg/changesets/categories/index.js +0 -299
- package/packages/silk-effects/dist/dev/pkg/changesets/categories/types.cjs +0 -65
- package/packages/silk-effects/dist/dev/pkg/changesets/categories/types.js +0 -65
- package/packages/silk-effects/dist/dev/pkg/changesets/changelog/formatting.cjs +0 -114
- package/packages/silk-effects/dist/dev/pkg/changesets/changelog/formatting.js +0 -113
- package/packages/silk-effects/dist/dev/pkg/changesets/changelog/getDependencyReleaseLine.cjs +0 -118
- package/packages/silk-effects/dist/dev/pkg/changesets/changelog/getDependencyReleaseLine.js +0 -118
- package/packages/silk-effects/dist/dev/pkg/changesets/changelog/getReleaseLine.cjs +0 -122
- package/packages/silk-effects/dist/dev/pkg/changesets/changelog/getReleaseLine.js +0 -122
- package/packages/silk-effects/dist/dev/pkg/changesets/changelog/index.cjs +0 -97
- package/packages/silk-effects/dist/dev/pkg/changesets/changelog/index.js +0 -97
- package/packages/silk-effects/dist/dev/pkg/changesets/constants.cjs +0 -43
- package/packages/silk-effects/dist/dev/pkg/changesets/constants.js +0 -42
- package/packages/silk-effects/dist/dev/pkg/changesets/errors.cjs +0 -386
- package/packages/silk-effects/dist/dev/pkg/changesets/errors.js +0 -371
- package/packages/silk-effects/dist/dev/pkg/changesets/index.cjs +0 -300
- package/packages/silk-effects/dist/dev/pkg/changesets/index.js +0 -179
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/index.cjs +0 -34
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/index.js +0 -29
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/content-structure.cjs +0 -98
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/content-structure.js +0 -98
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/dependency-table-format.cjs +0 -170
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/dependency-table-format.js +0 -170
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/heading-hierarchy.cjs +0 -61
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/heading-hierarchy.js +0 -61
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/required-sections.cjs +0 -54
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/required-sections.js +0 -54
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/uncategorized-content.cjs +0 -54
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/uncategorized-content.js +0 -54
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/utils.cjs +0 -31
- package/packages/silk-effects/dist/dev/pkg/changesets/markdownlint/rules/utils.js +0 -30
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/aggregate-dependency-tables.cjs +0 -47
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/aggregate-dependency-tables.js +0 -47
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/contributor-footnotes.cjs +0 -123
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/contributor-footnotes.js +0 -123
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/deduplicate-items.cjs +0 -32
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/deduplicate-items.js +0 -32
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/issue-link-refs.cjs +0 -59
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/issue-link-refs.js +0 -59
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/maintenance-note.cjs +0 -61
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/maintenance-note.js +0 -61
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/merge-sections.cjs +0 -43
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/merge-sections.js +0 -43
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/normalize-format.cjs +0 -47
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/normalize-format.js +0 -47
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/reorder-sections.cjs +0 -34
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/plugins/reorder-sections.js +0 -34
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/presets.cjs +0 -120
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/presets.js +0 -119
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/content-structure.cjs +0 -22
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/content-structure.js +0 -22
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/dependency-table-format.cjs +0 -40
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/dependency-table-format.js +0 -40
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/heading-hierarchy.cjs +0 -19
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/heading-hierarchy.js +0 -19
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/required-sections.cjs +0 -17
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/required-sections.js +0 -17
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/uncategorized-content.cjs +0 -31
- package/packages/silk-effects/dist/dev/pkg/changesets/remark/rules/uncategorized-content.js +0 -31
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/changeset.cjs +0 -148
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/changeset.js +0 -145
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/dependency-table.cjs +0 -203
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/dependency-table.js +0 -198
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/git.cjs +0 -69
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/git.js +0 -68
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/github.cjs +0 -177
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/github.js +0 -174
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/options.cjs +0 -183
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/options.js +0 -181
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/package-scope.cjs +0 -129
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/package-scope.js +0 -127
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/primitives.cjs +0 -72
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/primitives.js +0 -71
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/release-plan.cjs +0 -62
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/release-plan.js +0 -56
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/version-files.cjs +0 -154
- package/packages/silk-effects/dist/dev/pkg/changesets/schemas/version-files.js +0 -150
- package/packages/silk-effects/dist/dev/pkg/changesets/services/branch-analyzer.cjs +0 -300
- package/packages/silk-effects/dist/dev/pkg/changesets/services/branch-analyzer.js +0 -294
- package/packages/silk-effects/dist/dev/pkg/changesets/services/changelog.cjs +0 -50
- package/packages/silk-effects/dist/dev/pkg/changesets/services/changelog.js +0 -49
- package/packages/silk-effects/dist/dev/pkg/changesets/services/config-inspector.cjs +0 -489
- package/packages/silk-effects/dist/dev/pkg/changesets/services/config-inspector.js +0 -481
- package/packages/silk-effects/dist/dev/pkg/changesets/services/deps-regen.cjs +0 -375
- package/packages/silk-effects/dist/dev/pkg/changesets/services/deps-regen.js +0 -371
- package/packages/silk-effects/dist/dev/pkg/changesets/services/github.cjs +0 -160
- package/packages/silk-effects/dist/dev/pkg/changesets/services/github.js +0 -157
- package/packages/silk-effects/dist/dev/pkg/changesets/services/maintenance-reason.cjs +0 -68
- package/packages/silk-effects/dist/dev/pkg/changesets/services/maintenance-reason.js +0 -66
- package/packages/silk-effects/dist/dev/pkg/changesets/services/markdown.cjs +0 -87
- package/packages/silk-effects/dist/dev/pkg/changesets/services/markdown.js +0 -85
- package/packages/silk-effects/dist/dev/pkg/changesets/services/release-planner.cjs +0 -338
- package/packages/silk-effects/dist/dev/pkg/changesets/services/release-planner.js +0 -334
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/commit-parser.cjs +0 -81
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/commit-parser.js +0 -80
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/dep-diff.cjs +0 -111
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/dep-diff.js +0 -111
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/dependency-table.cjs +0 -351
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/dependency-table.js +0 -347
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/git.cjs +0 -51
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/git.js +0 -51
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/issue-refs.cjs +0 -102
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/issue-refs.js +0 -101
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/jsonpath.cjs +0 -178
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/jsonpath.js +0 -175
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/logger.cjs +0 -51
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/logger.js +0 -50
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/markdown-link.cjs +0 -59
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/markdown-link.js +0 -57
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/publishability.cjs +0 -50
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/publishability.js +0 -50
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/remark-pipeline.cjs +0 -81
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/remark-pipeline.js +0 -79
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/section-parser.cjs +0 -94
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/section-parser.js +0 -94
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/strip-frontmatter.cjs +0 -47
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/strip-frontmatter.js +0 -46
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/version-blocks.cjs +0 -110
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/version-blocks.js +0 -108
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/version-files.cjs +0 -336
- package/packages/silk-effects/dist/dev/pkg/changesets/utils/version-files.js +0 -336
- package/packages/silk-effects/dist/dev/pkg/changesets/vendor/github-info.cjs +0 -55
- package/packages/silk-effects/dist/dev/pkg/changesets/vendor/github-info.js +0 -55
- package/packages/silk-effects/dist/dev/pkg/errors/ChangesetConfigError.cjs +0 -21
- package/packages/silk-effects/dist/dev/pkg/errors/ChangesetConfigError.js +0 -21
- package/packages/silk-effects/dist/dev/pkg/schemas/VersioningSchemas.cjs +0 -101
- package/packages/silk-effects/dist/dev/pkg/schemas/VersioningSchemas.js +0 -99
- package/packages/silk-effects/dist/dev/pkg/services/ChangesetConfig.cjs +0 -81
- package/packages/silk-effects/dist/dev/pkg/services/ChangesetConfig.js +0 -80
- package/packages/silk-effects/dist/dev/pkg/services/ChangesetConfigReader.cjs +0 -109
- package/packages/silk-effects/dist/dev/pkg/services/ChangesetConfigReader.js +0 -108
- package/packages/silk-effects/dist/dev/pkg/services/SilkPublishability.cjs +0 -238
- package/packages/silk-effects/dist/dev/pkg/services/SilkPublishability.js +0 -236
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { resolveCommitType } from "../categories/index.js";
|
|
2
|
-
import { GitHubService } from "../services/github.js";
|
|
3
|
-
import { GitHubInfoSchema } from "../schemas/github.js";
|
|
4
|
-
import { parseCommitMessage } from "../utils/commit-parser.js";
|
|
5
|
-
import { parseIssueReferences } from "../utils/issue-refs.js";
|
|
6
|
-
import { logWarning } from "../utils/logger.js";
|
|
7
|
-
import { parseChangesetSections } from "../utils/section-parser.js";
|
|
8
|
-
import { formatChangelogEntry, formatPRAndUserAttribution } from "./formatting.js";
|
|
9
|
-
import { Effect, Schema } from "effect";
|
|
10
|
-
|
|
11
|
-
//#region ../silk-effects/dist/dev/pkg/changesets/changelog/getReleaseLine.js
|
|
12
|
-
/**
|
|
13
|
-
* Core formatter: getReleaseLine.
|
|
14
|
-
*
|
|
15
|
-
* Formats a single changeset into a changelog entry. This is the primary
|
|
16
|
-
* formatting function in the changelog pipeline, responsible for transforming
|
|
17
|
-
* a `NewChangesetWithCommit` into structured markdown output.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* The formatter supports two distinct input modes:
|
|
21
|
-
*
|
|
22
|
-
* 1. **Section-aware changesets** — When the changeset summary contains h2
|
|
23
|
-
* headings (e.g., `## Features`, `## Bug Fixes`), each section is rendered
|
|
24
|
-
* as an h3 heading with list items beneath it. This mode
|
|
25
|
-
* produces multi-line output suitable for rich changelogs.
|
|
26
|
-
*
|
|
27
|
-
* 2. **Flat-text changesets** — When the summary is plain text without section
|
|
28
|
-
* headings, the formatter falls back to backward-compatible single-line
|
|
29
|
-
* output. The conventional commit type is resolved via `resolveCommitType`
|
|
30
|
-
* to determine the changelog category.
|
|
31
|
-
*
|
|
32
|
-
* In both modes, the formatter:
|
|
33
|
-
* - Fetches GitHub metadata (PR number, author) via {@link GitHubService}
|
|
34
|
-
* - Extracts and renders issue references (Closes, Fixes, Refs)
|
|
35
|
-
* - Appends PR and user attribution when available
|
|
36
|
-
*
|
|
37
|
-
* @see {@link formatChangelogEntry} for the low-level entry formatting
|
|
38
|
-
* @see {@link formatPRAndUserAttribution} for attribution suffix generation
|
|
39
|
-
* @see {@link getDependencyReleaseLine} for the companion dependency formatter
|
|
40
|
-
*
|
|
41
|
-
* @internal
|
|
42
|
-
*/
|
|
43
|
-
/**
|
|
44
|
-
* Format a single changeset into a markdown release line.
|
|
45
|
-
*
|
|
46
|
-
* This is the core Effect program that implements the `getReleaseLine` contract
|
|
47
|
-
* from the Changesets API. It requires {@link GitHubService} in its environment
|
|
48
|
-
* for resolving commit metadata.
|
|
49
|
-
*
|
|
50
|
-
* @remarks
|
|
51
|
-
* The formatting pipeline proceeds in seven steps:
|
|
52
|
-
*
|
|
53
|
-
* 1. **Fetch GitHub info** — If the changeset has a commit hash, query
|
|
54
|
-
* the {@link GitHubService} for PR number, author, and links. Failures
|
|
55
|
-
* are caught and logged as warnings (attribution is simply omitted).
|
|
56
|
-
* 2. **Parse sections** — Attempt to split the summary into h2-delimited
|
|
57
|
-
* sections using `parseChangesetSections`.
|
|
58
|
-
* 3. **Parse conventional commit** — Extract the commit type, scope, and
|
|
59
|
-
* breaking flag from the first line of the summary.
|
|
60
|
-
* 4. **Extract issue references** — Parse the body for `Closes #N`,
|
|
61
|
-
* `Fixes #N`, and `Refs #N` patterns.
|
|
62
|
-
* 5. **Build attribution** — Format PR link and user credit from GitHub info.
|
|
63
|
-
* 6. **Section-aware output** — If sections were found, render each as an
|
|
64
|
-
* h3 heading with list items.
|
|
65
|
-
* 7. **Flat-text fallback** — Otherwise, produce a single `- entry` line
|
|
66
|
-
* with the resolved category heading.
|
|
67
|
-
*
|
|
68
|
-
* @param changeset - The changeset to format, including commit hash and summary text
|
|
69
|
-
* @param versionType - The semantic version bump type (`major`, `minor`, or `patch`),
|
|
70
|
-
* used as fallback when no conventional commit type is detected
|
|
71
|
-
* @param options - Validated configuration options (must include `repo` in `owner/repo` format)
|
|
72
|
-
* @returns An `Effect` that resolves to a formatted markdown string
|
|
73
|
-
*/
|
|
74
|
-
function getReleaseLine(changeset, versionType, options) {
|
|
75
|
-
return Effect.gen(function* () {
|
|
76
|
-
let commitInfo = null;
|
|
77
|
-
if (changeset.commit) commitInfo = yield* (yield* GitHubService).getInfo({
|
|
78
|
-
commit: changeset.commit,
|
|
79
|
-
repo: options.repo
|
|
80
|
-
}).pipe(Effect.flatMap((raw) => Schema.decodeUnknown(GitHubInfoSchema)(raw).pipe(Effect.map(() => raw), Effect.catchAll(() => Effect.succeed(raw)))), Effect.catchAll((error) => {
|
|
81
|
-
logWarning("Could not fetch GitHub info for commit:", changeset.commit ?? "", String(error));
|
|
82
|
-
return Effect.succeed(null);
|
|
83
|
-
}));
|
|
84
|
-
const parsed = parseChangesetSections(changeset.summary);
|
|
85
|
-
const firstLine = changeset.summary.split("\n")[0];
|
|
86
|
-
const commitMsg = parseCommitMessage(firstLine);
|
|
87
|
-
const issueRefs = parseIssueReferences(changeset.summary.split("\n").slice(1).join("\n"));
|
|
88
|
-
const attribution = commitInfo ? formatPRAndUserAttribution(commitInfo.pull ?? void 0, commitInfo.user ?? void 0, commitInfo.links) : "";
|
|
89
|
-
if (parsed.sections.length > 0) {
|
|
90
|
-
const lines = [];
|
|
91
|
-
if (parsed.preamble) {
|
|
92
|
-
lines.push(parsed.preamble);
|
|
93
|
-
lines.push("");
|
|
94
|
-
}
|
|
95
|
-
for (const section of parsed.sections) {
|
|
96
|
-
lines.push(`### ${section.category.heading}`);
|
|
97
|
-
lines.push("");
|
|
98
|
-
if (section.content) {
|
|
99
|
-
const contentLines = section.content.split("\n");
|
|
100
|
-
const firstContentLine = contentLines[0];
|
|
101
|
-
if (firstContentLine.startsWith("- ") || firstContentLine.startsWith("* ")) {
|
|
102
|
-
lines.push(firstContentLine);
|
|
103
|
-
lines.push(...contentLines.slice(1));
|
|
104
|
-
} else {
|
|
105
|
-
lines.push(`- ${firstContentLine}`);
|
|
106
|
-
lines.push(...contentLines.slice(1).map((line) => line.length > 0 ? ` ${line}` : line));
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
lines.push("");
|
|
110
|
-
}
|
|
111
|
-
return `${lines.join("\n").trimEnd()}${attribution}`;
|
|
112
|
-
}
|
|
113
|
-
return `- ${formatChangelogEntry({
|
|
114
|
-
type: resolveCommitType(commitMsg.type ?? versionType, commitMsg.scope, commitMsg.breaking).heading,
|
|
115
|
-
summary: changeset.summary,
|
|
116
|
-
issues: issueRefs
|
|
117
|
-
}, { repo: options.repo })}${attribution}`;
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
//#endregion
|
|
122
|
-
export { getReleaseLine };
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
const require_options = require('../schemas/options.cjs');
|
|
2
|
-
const require_github = require('../services/github.cjs');
|
|
3
|
-
const require_markdown = require('../services/markdown.cjs');
|
|
4
|
-
const require_getDependencyReleaseLine = require('./getDependencyReleaseLine.cjs');
|
|
5
|
-
const require_getReleaseLine = require('./getReleaseLine.cjs');
|
|
6
|
-
let effect = require("effect");
|
|
7
|
-
|
|
8
|
-
//#region ../silk-effects/dist/dev/pkg/changesets/changelog/index.js
|
|
9
|
-
/**
|
|
10
|
-
* Changesets API changelog formatter — `\@savvy-web/changesets/changelog`
|
|
11
|
-
*
|
|
12
|
-
* This module is the default export consumed by the Changesets CLI via the
|
|
13
|
-
* `changelog` field in `.changeset/config.json`. It implements the
|
|
14
|
-
* `ChangelogFunctions` interface from `\@changesets/types`, wiring the
|
|
15
|
-
* Effect-based formatting pipeline into the async API that Changesets expects.
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* The module composes two Effect programs — {@link getReleaseLine} and
|
|
19
|
-
* {@link getDependencyReleaseLine} — and runs each through
|
|
20
|
-
* `Effect.runPromise` with a merged layer of {@link GitHubLive} (for commit
|
|
21
|
-
* metadata) and {@link MarkdownLive} (for mdast parsing). Options are
|
|
22
|
-
* validated at the boundary via `validateChangesetOptions` before being
|
|
23
|
-
* passed to the formatters.
|
|
24
|
-
*
|
|
25
|
-
* ### Configuration
|
|
26
|
-
*
|
|
27
|
-
* Add the following to your `.changeset/config.json`:
|
|
28
|
-
*
|
|
29
|
-
* ```json
|
|
30
|
-
* {
|
|
31
|
-
* "changelog": ["\@savvy-web/changesets/changelog", { "repo": "savvy-web/package-name" }]
|
|
32
|
-
* }
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* The `repo` option is **required** and must be in `owner/repo` format.
|
|
36
|
-
*
|
|
37
|
-
* ### Pipeline
|
|
38
|
-
*
|
|
39
|
-
* 1. **Options validation** — the raw `options` object from the Changesets
|
|
40
|
-
* config is decoded through `ChangesetOptionsSchema`.
|
|
41
|
-
* 2. **Release line formatting** — each changeset is formatted by
|
|
42
|
-
* `getReleaseLine`, which resolves GitHub metadata, parses sections,
|
|
43
|
-
* and produces structured markdown with attribution.
|
|
44
|
-
* 3. **Dependency table formatting** — bulk dependency updates are
|
|
45
|
-
* formatted by `getDependencyReleaseLine` into a markdown table.
|
|
46
|
-
*
|
|
47
|
-
* @example Configuring in `.changeset/config.json`
|
|
48
|
-
* ```json
|
|
49
|
-
* {
|
|
50
|
-
* "$schema": "https://unpkg.com/\@changesets/config\@3.1.1/schema.json",
|
|
51
|
-
* "changelog": ["\@savvy-web/changesets/changelog", { "repo": "savvy-web/my-package" }],
|
|
52
|
-
* "commit": false,
|
|
53
|
-
* "access": "public"
|
|
54
|
-
* }
|
|
55
|
-
* ```
|
|
56
|
-
*
|
|
57
|
-
* @see {@link getReleaseLine} in `./getReleaseLine.ts` for individual changeset formatting
|
|
58
|
-
* @see {@link getDependencyReleaseLine} in `./getDependencyReleaseLine.ts` for dependency table formatting
|
|
59
|
-
*/
|
|
60
|
-
/**
|
|
61
|
-
* Combined layer providing all services needed by the formatters.
|
|
62
|
-
*
|
|
63
|
-
* Merges {@link GitHubLive} and {@link MarkdownLive} into a single layer
|
|
64
|
-
* that satisfies the environment requirements of both `getReleaseLine`
|
|
65
|
-
* (which needs `GitHubService` and `MarkdownService`) and
|
|
66
|
-
* `getDependencyReleaseLine` (which needs `GitHubService`).
|
|
67
|
-
*
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
|
-
const MainLayer = effect.Layer.mergeAll(require_github.GitHubLive, require_markdown.MarkdownLive);
|
|
71
|
-
/**
|
|
72
|
-
* Changesets API `ChangelogFunctions` implementation.
|
|
73
|
-
*
|
|
74
|
-
* This object satisfies the `ChangelogFunctions` contract from
|
|
75
|
-
* `\@changesets/types`. Each method validates options, runs the
|
|
76
|
-
* corresponding Effect program with the merged service layer, and
|
|
77
|
-
* returns a `Promise<string>`.
|
|
78
|
-
*
|
|
79
|
-
* @internal
|
|
80
|
-
*/
|
|
81
|
-
const changelogFunctions = {
|
|
82
|
-
getReleaseLine: async (changeset, versionType, options) => {
|
|
83
|
-
const program = effect.Effect.gen(function* () {
|
|
84
|
-
return yield* require_getReleaseLine.getReleaseLine(changeset, versionType, yield* require_options.validateChangesetOptions(options));
|
|
85
|
-
});
|
|
86
|
-
return effect.Effect.runPromise(program.pipe(effect.Effect.provide(MainLayer)));
|
|
87
|
-
},
|
|
88
|
-
getDependencyReleaseLine: async (changesets, dependenciesUpdated, options) => {
|
|
89
|
-
const program = effect.Effect.gen(function* () {
|
|
90
|
-
return yield* require_getDependencyReleaseLine.getDependencyReleaseLine(changesets, dependenciesUpdated, yield* require_options.validateChangesetOptions(options));
|
|
91
|
-
});
|
|
92
|
-
return effect.Effect.runPromise(program.pipe(effect.Effect.provide(MainLayer)));
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
//#endregion
|
|
97
|
-
exports.default = changelogFunctions;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { validateChangesetOptions } from "../schemas/options.js";
|
|
2
|
-
import { GitHubLive } from "../services/github.js";
|
|
3
|
-
import { MarkdownLive } from "../services/markdown.js";
|
|
4
|
-
import { getDependencyReleaseLine } from "./getDependencyReleaseLine.js";
|
|
5
|
-
import { getReleaseLine } from "./getReleaseLine.js";
|
|
6
|
-
import { Effect, Layer } from "effect";
|
|
7
|
-
|
|
8
|
-
//#region ../silk-effects/dist/dev/pkg/changesets/changelog/index.js
|
|
9
|
-
/**
|
|
10
|
-
* Changesets API changelog formatter — `\@savvy-web/changesets/changelog`
|
|
11
|
-
*
|
|
12
|
-
* This module is the default export consumed by the Changesets CLI via the
|
|
13
|
-
* `changelog` field in `.changeset/config.json`. It implements the
|
|
14
|
-
* `ChangelogFunctions` interface from `\@changesets/types`, wiring the
|
|
15
|
-
* Effect-based formatting pipeline into the async API that Changesets expects.
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* The module composes two Effect programs — {@link getReleaseLine} and
|
|
19
|
-
* {@link getDependencyReleaseLine} — and runs each through
|
|
20
|
-
* `Effect.runPromise` with a merged layer of {@link GitHubLive} (for commit
|
|
21
|
-
* metadata) and {@link MarkdownLive} (for mdast parsing). Options are
|
|
22
|
-
* validated at the boundary via `validateChangesetOptions` before being
|
|
23
|
-
* passed to the formatters.
|
|
24
|
-
*
|
|
25
|
-
* ### Configuration
|
|
26
|
-
*
|
|
27
|
-
* Add the following to your `.changeset/config.json`:
|
|
28
|
-
*
|
|
29
|
-
* ```json
|
|
30
|
-
* {
|
|
31
|
-
* "changelog": ["\@savvy-web/changesets/changelog", { "repo": "savvy-web/package-name" }]
|
|
32
|
-
* }
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* The `repo` option is **required** and must be in `owner/repo` format.
|
|
36
|
-
*
|
|
37
|
-
* ### Pipeline
|
|
38
|
-
*
|
|
39
|
-
* 1. **Options validation** — the raw `options` object from the Changesets
|
|
40
|
-
* config is decoded through `ChangesetOptionsSchema`.
|
|
41
|
-
* 2. **Release line formatting** — each changeset is formatted by
|
|
42
|
-
* `getReleaseLine`, which resolves GitHub metadata, parses sections,
|
|
43
|
-
* and produces structured markdown with attribution.
|
|
44
|
-
* 3. **Dependency table formatting** — bulk dependency updates are
|
|
45
|
-
* formatted by `getDependencyReleaseLine` into a markdown table.
|
|
46
|
-
*
|
|
47
|
-
* @example Configuring in `.changeset/config.json`
|
|
48
|
-
* ```json
|
|
49
|
-
* {
|
|
50
|
-
* "$schema": "https://unpkg.com/\@changesets/config\@3.1.1/schema.json",
|
|
51
|
-
* "changelog": ["\@savvy-web/changesets/changelog", { "repo": "savvy-web/my-package" }],
|
|
52
|
-
* "commit": false,
|
|
53
|
-
* "access": "public"
|
|
54
|
-
* }
|
|
55
|
-
* ```
|
|
56
|
-
*
|
|
57
|
-
* @see {@link getReleaseLine} in `./getReleaseLine.ts` for individual changeset formatting
|
|
58
|
-
* @see {@link getDependencyReleaseLine} in `./getDependencyReleaseLine.ts` for dependency table formatting
|
|
59
|
-
*/
|
|
60
|
-
/**
|
|
61
|
-
* Combined layer providing all services needed by the formatters.
|
|
62
|
-
*
|
|
63
|
-
* Merges {@link GitHubLive} and {@link MarkdownLive} into a single layer
|
|
64
|
-
* that satisfies the environment requirements of both `getReleaseLine`
|
|
65
|
-
* (which needs `GitHubService` and `MarkdownService`) and
|
|
66
|
-
* `getDependencyReleaseLine` (which needs `GitHubService`).
|
|
67
|
-
*
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
|
-
const MainLayer = Layer.mergeAll(GitHubLive, MarkdownLive);
|
|
71
|
-
/**
|
|
72
|
-
* Changesets API `ChangelogFunctions` implementation.
|
|
73
|
-
*
|
|
74
|
-
* This object satisfies the `ChangelogFunctions` contract from
|
|
75
|
-
* `\@changesets/types`. Each method validates options, runs the
|
|
76
|
-
* corresponding Effect program with the merged service layer, and
|
|
77
|
-
* returns a `Promise<string>`.
|
|
78
|
-
*
|
|
79
|
-
* @internal
|
|
80
|
-
*/
|
|
81
|
-
const changelogFunctions = {
|
|
82
|
-
getReleaseLine: async (changeset, versionType, options) => {
|
|
83
|
-
const program = Effect.gen(function* () {
|
|
84
|
-
return yield* getReleaseLine(changeset, versionType, yield* validateChangesetOptions(options));
|
|
85
|
-
});
|
|
86
|
-
return Effect.runPromise(program.pipe(Effect.provide(MainLayer)));
|
|
87
|
-
},
|
|
88
|
-
getDependencyReleaseLine: async (changesets, dependenciesUpdated, options) => {
|
|
89
|
-
const program = Effect.gen(function* () {
|
|
90
|
-
return yield* getDependencyReleaseLine(changesets, dependenciesUpdated, yield* validateChangesetOptions(options));
|
|
91
|
-
});
|
|
92
|
-
return Effect.runPromise(program.pipe(Effect.provide(MainLayer)));
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
//#endregion
|
|
97
|
-
export { changelogFunctions as default };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../silk-effects/dist/dev/pkg/changesets/constants.js
|
|
3
|
-
/**
|
|
4
|
-
* Constants for changeset lint rule documentation URLs.
|
|
5
|
-
*
|
|
6
|
-
* @remarks
|
|
7
|
-
* Each lint rule in the \@savvy-web/changesets remark-lint plugin has a
|
|
8
|
-
* corresponding documentation page hosted on GitHub. These URLs are
|
|
9
|
-
* referenced in lint diagnostic messages to help users understand and
|
|
10
|
-
* resolve validation errors.
|
|
11
|
-
*
|
|
12
|
-
* Rule codes follow the `CSH` prefix convention:
|
|
13
|
-
* - `CSH001` -- Changeset heading validation
|
|
14
|
-
* - `CSH002` -- Changeset summary validation
|
|
15
|
-
* - `CSH003` -- Dependency table structure validation
|
|
16
|
-
* - `CSH004` -- Changeset body content validation
|
|
17
|
-
* - `CSH005` -- Frontmatter validation
|
|
18
|
-
*
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
/** Base URL for rule documentation on GitHub. */
|
|
22
|
-
const DOCS_BASE = "https://github.com/savvy-web/changesets/blob/main/docs/rules";
|
|
23
|
-
/**
|
|
24
|
-
* Documentation URLs for each changeset lint rule.
|
|
25
|
-
*
|
|
26
|
-
* @remarks
|
|
27
|
-
* Keyed by rule code (`CSH001`--`CSH005`). Each value is a full URL
|
|
28
|
-
* pointing to the rule's documentation page on GitHub. Used by the
|
|
29
|
-
* remark-lint plugins to attach documentation links to diagnostic
|
|
30
|
-
* messages.
|
|
31
|
-
*
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
const RULE_DOCS = {
|
|
35
|
-
CSH001: `${DOCS_BASE}/CSH001.md`,
|
|
36
|
-
CSH002: `${DOCS_BASE}/CSH002.md`,
|
|
37
|
-
CSH003: `${DOCS_BASE}/CSH003.md`,
|
|
38
|
-
CSH004: `${DOCS_BASE}/CSH004.md`,
|
|
39
|
-
CSH005: `${DOCS_BASE}/CSH005.md`
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
exports.RULE_DOCS = RULE_DOCS;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
//#region ../silk-effects/dist/dev/pkg/changesets/constants.js
|
|
2
|
-
/**
|
|
3
|
-
* Constants for changeset lint rule documentation URLs.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* Each lint rule in the \@savvy-web/changesets remark-lint plugin has a
|
|
7
|
-
* corresponding documentation page hosted on GitHub. These URLs are
|
|
8
|
-
* referenced in lint diagnostic messages to help users understand and
|
|
9
|
-
* resolve validation errors.
|
|
10
|
-
*
|
|
11
|
-
* Rule codes follow the `CSH` prefix convention:
|
|
12
|
-
* - `CSH001` -- Changeset heading validation
|
|
13
|
-
* - `CSH002` -- Changeset summary validation
|
|
14
|
-
* - `CSH003` -- Dependency table structure validation
|
|
15
|
-
* - `CSH004` -- Changeset body content validation
|
|
16
|
-
* - `CSH005` -- Frontmatter validation
|
|
17
|
-
*
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
/** Base URL for rule documentation on GitHub. */
|
|
21
|
-
const DOCS_BASE = "https://github.com/savvy-web/changesets/blob/main/docs/rules";
|
|
22
|
-
/**
|
|
23
|
-
* Documentation URLs for each changeset lint rule.
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
* Keyed by rule code (`CSH001`--`CSH005`). Each value is a full URL
|
|
27
|
-
* pointing to the rule's documentation page on GitHub. Used by the
|
|
28
|
-
* remark-lint plugins to attach documentation links to diagnostic
|
|
29
|
-
* messages.
|
|
30
|
-
*
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
const RULE_DOCS = {
|
|
34
|
-
CSH001: `${DOCS_BASE}/CSH001.md`,
|
|
35
|
-
CSH002: `${DOCS_BASE}/CSH002.md`,
|
|
36
|
-
CSH003: `${DOCS_BASE}/CSH003.md`,
|
|
37
|
-
CSH004: `${DOCS_BASE}/CSH004.md`,
|
|
38
|
-
CSH005: `${DOCS_BASE}/CSH005.md`
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
//#endregion
|
|
42
|
-
export { RULE_DOCS };
|