@williamthorsen/release-kit 14.2.1 → 14.2.3
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/.meta/changelog.json +77 -0
- package/.readyup/kits/default.js +142 -152
- package/.readyup/kits/npm-auto-publish.js +183 -184
- package/.readyup/manifest.json +83 -9
- package/CHANGELOG.md +24 -0
- package/README.md +7 -1
- package/dist/esm/applyChangelogOverrides.d.ts +50 -0
- package/dist/esm/applyChangelogOverrides.js +162 -0
- package/dist/esm/attachChangelogDiagnostics.d.ts +1 -1
- package/dist/esm/bin/release-kit.js +6 -238
- package/dist/esm/buildChangelogEntries.d.ts +20 -31
- package/dist/esm/buildChangelogEntries.js +71 -188
- package/dist/esm/buildChangelogItem.d.ts +56 -0
- package/dist/esm/buildChangelogItem.js +119 -0
- package/dist/esm/buildReleasedResult.d.ts +20 -0
- package/dist/esm/buildReleasedResult.js +78 -0
- package/dist/esm/changelogJsonUtils.d.ts +1 -1
- package/dist/esm/changelogOverrides.d.ts +29 -143
- package/dist/esm/changelogOverrides.js +35 -467
- package/dist/esm/configSchema.d.ts +225 -0
- package/dist/esm/configSchema.js +103 -0
- package/dist/esm/createGithubReleaseCommand.js +4 -3
- package/dist/esm/decideDirectReleases.d.ts +30 -0
- package/dist/esm/decideDirectReleases.js +66 -0
- package/dist/esm/defaults.js +1 -4
- package/dist/esm/defineConfig.d.ts +2 -2
- package/dist/esm/deriveReleaseNotesConfig.d.ts +2 -1
- package/dist/esm/deriveReleaseNotesConfig.js +1 -1
- package/dist/esm/determineBumpType.js +4 -3
- package/dist/esm/enumerateReleaseWindows.js +4 -4
- package/dist/esm/formatPrepareFiles.d.ts +11 -0
- package/dist/esm/formatPrepareFiles.js +55 -0
- package/dist/esm/formatPrepareWarnings.d.ts +26 -0
- package/dist/esm/formatPrepareWarnings.js +72 -0
- package/dist/esm/help/initHelp.d.ts +4 -0
- package/dist/esm/help/initHelp.js +31 -0
- package/dist/esm/help/overridesHelp.d.ts +4 -0
- package/dist/esm/help/overridesHelp.js +32 -0
- package/dist/esm/help/releaseStepsHelp.d.ts +12 -0
- package/dist/esm/help/releaseStepsHelp.js +91 -0
- package/dist/esm/help/syncLabelsHelp.d.ts +8 -0
- package/dist/esm/help/syncLabelsHelp.js +55 -0
- package/dist/esm/help/usage.d.ts +2 -0
- package/dist/esm/help/usage.js +29 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/init/initCommand.js +3 -7
- package/dist/esm/loadChangelogOverrides.d.ts +31 -0
- package/dist/esm/loadChangelogOverrides.js +138 -0
- package/dist/esm/loadConfig.d.ts +0 -40
- package/dist/esm/loadConfig.js +0 -242
- package/dist/esm/loadValidatedConfig.d.ts +1 -1
- package/dist/esm/mergeConfig.d.ts +41 -0
- package/dist/esm/mergeConfig.js +118 -0
- package/dist/esm/monorepoConfigAssertions.d.ts +49 -0
- package/dist/esm/monorepoConfigAssertions.js +126 -0
- package/dist/esm/planChangelogFiles.d.ts +16 -0
- package/dist/esm/planChangelogFiles.js +41 -0
- package/dist/esm/prepareArgs.d.ts +55 -0
- package/dist/esm/prepareArgs.js +69 -0
- package/dist/esm/prepareCommand.d.ts +0 -48
- package/dist/esm/prepareCommand.js +11 -77
- package/dist/esm/prepareComposite.d.ts +16 -0
- package/dist/esm/prepareComposite.js +39 -0
- package/dist/esm/prepareRunContext.d.ts +38 -0
- package/dist/esm/prepareRunContext.js +39 -0
- package/dist/esm/prepareTarget.d.ts +2 -7
- package/dist/esm/prepareTarget.js +2 -118
- package/dist/esm/previewTagPrefixes.d.ts +1 -1
- package/dist/esm/releasePrepareTargets.js +13 -207
- package/dist/esm/renderReleaseNotes.js +6 -5
- package/dist/esm/reportPrepare.js +3 -123
- package/dist/esm/resolveCommandTags.d.ts +1 -1
- package/dist/esm/resolveCommandTags.js +2 -1
- package/dist/esm/resolveReleaseDeclaration.d.ts +2 -1
- package/dist/esm/resolveReleaseTargets.d.ts +2 -1
- package/dist/esm/resolveReleaseTargets.js +2 -1
- package/dist/esm/stripScope.js +4 -3
- package/dist/esm/sync-labels/generateCommand.d.ts +1 -1
- package/dist/esm/sync-labels/resolveLabels.d.ts +1 -1
- package/dist/esm/topologicalSort.d.ts +12 -0
- package/dist/esm/topologicalSort.js +60 -0
- package/dist/esm/types.d.ts +1 -225
- package/dist/esm/types.js +1 -103
- package/dist/esm/validateAllChangelogOverrides.d.ts +56 -0
- package/dist/esm/validateAllChangelogOverrides.js +138 -0
- package/dist/esm/validateConfig.d.ts +1 -1
- package/dist/esm/validateConfig.js +7 -9
- package/dist/esm/validateOverridesCommand.d.ts +1 -1
- package/dist/esm/validateOverridesCommand.js +2 -1
- package/package.json +4 -4
package/.meta/changelog.json
CHANGED
|
@@ -1,4 +1,81 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "14.2.3",
|
|
4
|
+
"date": "2026-10-18",
|
|
5
|
+
"sections": [
|
|
6
|
+
{
|
|
7
|
+
"title": "🐛 Bug fixes",
|
|
8
|
+
"audience": "all",
|
|
9
|
+
"items": [
|
|
10
|
+
{
|
|
11
|
+
"description": "Fixes the issue that the manifest of the `npm-auto-publish` kit recorded a different list of checks depending on the directory from which `rdy compile` ran, by declaring one fixed check, \"Repo publishes at least one package\", under which `rdy run` builds the npm session check and the per-package rows. (#1081)",
|
|
12
|
+
"migration": "Upgrade `readyup` to 0.42.0 or later before running the `npm-auto-publish` kit, because the kit now declares `minReadyupVersion` 0.42.0 and an older runner refuses to load it.",
|
|
13
|
+
"hash": "bea0d66f5b804bf51259fa094a890af80917abca",
|
|
14
|
+
"entry": 1
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"title": "♻️ Refactoring",
|
|
20
|
+
"audience": "dev",
|
|
21
|
+
"items": [
|
|
22
|
+
{
|
|
23
|
+
"description": "Splits `types.ts`, `loadConfig.ts`, `changelogOverrides.ts`, and `buildChangelogEntries.ts` to bring each under the 300-line `max-lines` limit, moving the config zod schemas into `configSchema.ts`, config merging into `mergeConfig.ts`, the cross-target checks into `monorepoConfigAssertions.ts`, override parsing, application, and repo-wide validation into `loadChangelogOverrides.ts`, `applyChangelogOverrides.ts`, and `validateAllChangelogOverrides.ts`, and changelog-item construction into `buildChangelogItem.ts`. (#1067)",
|
|
24
|
+
"hash": "a4322d91bd32df24cdeaff4c9c36f48a76f1f5b1",
|
|
25
|
+
"entry": 1
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"description": "Splits the `release-kit` bin, the `prepare` pipeline (`prepareCommand`, `prepareTarget`, `releasePrepareTargets`, and `reportPrepare`), and the `default` and `npm-auto-publish` readyup kits into smaller modules under `src`, `src/help`, and `.readyup/lib`, and recompiles the kit bundles without changing their check lists. (#1069)",
|
|
29
|
+
"hash": "723105c97c13ee85e7477f6b3073230e07ec5396",
|
|
30
|
+
"entry": 1
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"description": "Rewrites the code that the new and widened rules in `eslint-plugin-unicorn` 78 report, mostly by changing `flatMap` callbacks to return a single value rather than a one-element array. (#1072)",
|
|
34
|
+
"hash": "0eef39d82b4eb46f8d55f1cefe673bc8f54ee2dd",
|
|
35
|
+
"entry": 2
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"title": "🧪 Tests",
|
|
41
|
+
"audience": "dev",
|
|
42
|
+
"items": [
|
|
43
|
+
{
|
|
44
|
+
"description": "Splits the `release-kit` unit tests for `releasePrepareTargets`, `reportPrepare`, `prepareCommand`, `publishCommand`, `parseCommitMessage`, and `validateConfig` into `<subject>.<aspect>.unit.test.ts` files that each stay under the `max-lines` limit, and moves the mocks and fixtures that the split files share into modules under `src/test-utils/`. (#1066)",
|
|
45
|
+
"hash": "0e7aa3b387d2c06c27cf09b41a164cee93b3f418",
|
|
46
|
+
"entry": 1
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"version": "14.2.2",
|
|
54
|
+
"date": "2026-10-17",
|
|
55
|
+
"sections": [
|
|
56
|
+
{
|
|
57
|
+
"title": "📦 Dependencies",
|
|
58
|
+
"audience": "dev",
|
|
59
|
+
"items": [
|
|
60
|
+
{
|
|
61
|
+
"description": "Upgrades `@williamthorsen/eslint-config-typescript` from 18.0.0 to 19.0.0 and rewrites the code in `build-info`, `nmr-core`, `nmr`, and `release-kit` that its new and widened rules report, without changing behavior. (#1047)",
|
|
62
|
+
"hash": "610ee159fdc429681b1078b500a064c5df296724",
|
|
63
|
+
"entry": 1
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"description": "Upgrades `readyup` from 0.40.0 to 0.41.0 and recompiles the kits in `nmr`, `release-kit`, and `v11y-check`, whose manifests now record each checklist's check names under `checklistChecks`. (#1047)",
|
|
67
|
+
"hash": "610ee159fdc429681b1078b500a064c5df296724",
|
|
68
|
+
"entry": 2
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"description": "Upgrades `pnpm` to 12.11.2, `@types/node` to 24.19.2, `lefthook` to 2.2.1, `@williamthorsen/strict-lint` to 14.2.0, `@williamthorsen/tsconfig` to 0.11.0, `smol-toml` to 1.9.1, and `vite` to 8.3.4. (#1047)",
|
|
72
|
+
"hash": "610ee159fdc429681b1078b500a064c5df296724",
|
|
73
|
+
"entry": 3
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
},
|
|
2
79
|
{
|
|
3
80
|
"version": "14.2.1",
|
|
4
81
|
"date": "2026-10-13",
|
package/.readyup/kits/default.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
/** @noformat -- @generated. Do not edit. Compiled by rdy. */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export const __readyupVersion = "0.
|
|
3
|
+
export const __readyupVersion = "0.42.0";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
// .readyup/kits/default.ts
|
|
7
7
|
import { defineRdyKit } from "readyup";
|
|
8
8
|
import {
|
|
9
|
-
discoverWorkspaces,
|
|
9
|
+
discoverWorkspaces as discoverWorkspaces3,
|
|
10
10
|
fileContains,
|
|
11
11
|
fileDoesNotContain,
|
|
12
12
|
fileExists,
|
|
13
13
|
fileMatchesHash,
|
|
14
14
|
hasDevDependency,
|
|
15
|
-
hasMinDevDependencyVersion
|
|
16
|
-
readFile
|
|
15
|
+
hasMinDevDependencyVersion
|
|
17
16
|
} from "readyup/check-utils";
|
|
18
17
|
|
|
19
|
-
// src/changelogArchive.ts
|
|
20
|
-
var CHANGELOG_ARCHIVE_DIRECTORY = "changelogs";
|
|
21
|
-
|
|
22
18
|
// src/init/detectRepoType.ts
|
|
23
19
|
import { existsSync, readFileSync } from "node:fs";
|
|
24
20
|
|
|
@@ -53,6 +49,12 @@ function detectRepoType() {
|
|
|
53
49
|
return "single-package";
|
|
54
50
|
}
|
|
55
51
|
|
|
52
|
+
// .readyup/lib/changelog-checks.ts
|
|
53
|
+
import { discoverWorkspaces, readFile } from "readyup/check-utils";
|
|
54
|
+
|
|
55
|
+
// src/changelogArchive.ts
|
|
56
|
+
var CHANGELOG_ARCHIVE_DIRECTORY = "changelogs";
|
|
57
|
+
|
|
56
58
|
// src/packsPath.ts
|
|
57
59
|
function packsPath(filesField, path) {
|
|
58
60
|
if (!isStringArray(filesField)) return true;
|
|
@@ -99,24 +101,128 @@ function translateGlob(pattern) {
|
|
|
99
101
|
return source;
|
|
100
102
|
}
|
|
101
103
|
|
|
102
|
-
// .readyup/
|
|
103
|
-
function
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
return picked["version"];
|
|
104
|
+
// .readyup/lib/changelog-checks.ts
|
|
105
|
+
function changelogArchivesAreEnabled() {
|
|
106
|
+
const content = readFile(".config/release-kit.config.ts");
|
|
107
|
+
if (content === void 0) return false;
|
|
108
|
+
return /changelogMarkdown\s*:\s*\{[^}]*keepVersions\s*:/.test(content);
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
|
|
110
|
+
function changelogJsonIsEnabled() {
|
|
111
|
+
const content = readFile(".config/release-kit.config.ts");
|
|
112
|
+
if (content === void 0) return true;
|
|
113
|
+
return !/changelogJson\s*:\s*\{[^}]*enabled\s*:\s*false/.test(content);
|
|
112
114
|
}
|
|
113
115
|
var DEFAULT_CHANGELOG_JSON_PATH = ".meta/changelog.json";
|
|
116
|
+
function packagesShipChangelog() {
|
|
117
|
+
return reportWorkspacesOmitting("CHANGELOG.md");
|
|
118
|
+
}
|
|
119
|
+
function packagesShipChangelogArchives() {
|
|
120
|
+
return reportWorkspacesOmitting(`${CHANGELOG_ARCHIVE_DIRECTORY}/CHANGELOG-v1.md`, `${CHANGELOG_ARCHIVE_DIRECTORY}/`);
|
|
121
|
+
}
|
|
122
|
+
function packagesShipChangelogJson() {
|
|
123
|
+
return reportWorkspacesOmitting(resolveChangelogJsonOutputPath());
|
|
124
|
+
}
|
|
125
|
+
function resolveChangelogJsonOutputPath() {
|
|
126
|
+
const content = readFile(".config/release-kit.config.ts");
|
|
127
|
+
if (content === void 0) return DEFAULT_CHANGELOG_JSON_PATH;
|
|
128
|
+
const match = /changelogJson\s*:\s*\{[^}]*outputPath\s*:\s*['"]([^'"]+)['"]/.exec(content);
|
|
129
|
+
return match?.[1] ?? DEFAULT_CHANGELOG_JSON_PATH;
|
|
130
|
+
}
|
|
131
|
+
function reportWorkspacesOmitting(path, label = path) {
|
|
132
|
+
const failing = [];
|
|
133
|
+
const packageWorkspaces = discoverWorkspaces({ filter: (w) => w.isPackage });
|
|
134
|
+
for (const { dir, packageJson } of packageWorkspaces) {
|
|
135
|
+
if (!packsPath(packageJson["files"], path)) {
|
|
136
|
+
failing.push(dir === "." ? "package.json" : `${dir}/package.json`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (failing.length === 0) return true;
|
|
140
|
+
return {
|
|
141
|
+
ok: false,
|
|
142
|
+
detail: `files field omits ${label}: ${failing.join(", ")}`
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// .readyup/lib/config-checks.ts
|
|
147
|
+
import { discoverWorkspaces as discoverWorkspaces2, readFile as readFile2 } from "readyup/check-utils";
|
|
114
148
|
var CONFIG_EXPORT_PATTERNS = [
|
|
115
149
|
/export\s+default\b/,
|
|
116
150
|
/export\s+(?:const|let|var)\s+config\b/,
|
|
117
151
|
/export\s*\{[^}]*\b(?:config|default)\b[^}]*\}/,
|
|
118
152
|
/export\s*\*/
|
|
119
153
|
];
|
|
154
|
+
function configFileExportsConfig() {
|
|
155
|
+
const content = readFile2(".config/release-kit.config.ts");
|
|
156
|
+
if (content === void 0) return false;
|
|
157
|
+
return CONFIG_EXPORT_PATTERNS.some((pattern) => pattern.test(content));
|
|
158
|
+
}
|
|
159
|
+
function labelsHaveCurrentPresetHash(presetName, expectedHash) {
|
|
160
|
+
const content = readFile2(".github/labels.yaml");
|
|
161
|
+
if (content === void 0) return false;
|
|
162
|
+
const pattern = new RegExp(`^# ${presetName} preset hash: (.+)$`, "m");
|
|
163
|
+
const match = pattern.exec(content);
|
|
164
|
+
return match !== null && match[1] === expectedHash;
|
|
165
|
+
}
|
|
166
|
+
function readmeHasReleaseNotesMarkers(content) {
|
|
167
|
+
return content.includes("<!-- section:release-notes -->") && content.includes("<!-- /section:release-notes -->");
|
|
168
|
+
}
|
|
169
|
+
function readmesHaveReleaseNotesMarkers() {
|
|
170
|
+
const failing = [];
|
|
171
|
+
const packageWorkspaces = discoverWorkspaces2({ filter: (w) => w.isPackage });
|
|
172
|
+
for (const { dir } of packageWorkspaces) {
|
|
173
|
+
const readmePath = dir === "." ? "README.md" : `${dir}/README.md`;
|
|
174
|
+
const content = readFile2(readmePath);
|
|
175
|
+
if (content === void 0 || !readmeHasReleaseNotesMarkers(content)) {
|
|
176
|
+
failing.push(readmePath);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (failing.length === 0) return true;
|
|
180
|
+
return {
|
|
181
|
+
ok: false,
|
|
182
|
+
detail: `missing markers or README: ${failing.join(", ")}`
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function releaseNotesConfigIsConsistent() {
|
|
186
|
+
const content = readFile2(".config/release-kit.config.ts");
|
|
187
|
+
if (content === void 0) return true;
|
|
188
|
+
const changelogJsonDisabled = /changelogJson\s*:\s*\{[^}]*enabled\s*:\s*false/.test(content);
|
|
189
|
+
if (!changelogJsonDisabled) return true;
|
|
190
|
+
const hasReadmeInjection = /shouldInjectIntoReadme\s*:\s*true/.test(content);
|
|
191
|
+
return !hasReadmeInjection;
|
|
192
|
+
}
|
|
193
|
+
function releaseNotesInjectsIntoReadme() {
|
|
194
|
+
const content = readFile2(".config/release-kit.config.ts");
|
|
195
|
+
if (content === void 0) return false;
|
|
196
|
+
return /shouldInjectIntoReadme\s*:\s*true/.test(content);
|
|
197
|
+
}
|
|
198
|
+
function scopeLabelsHaveNoDescriptions() {
|
|
199
|
+
const content = readFile2(".github/labels.yaml");
|
|
200
|
+
if (content === void 0) return true;
|
|
201
|
+
const described = [];
|
|
202
|
+
let currentName;
|
|
203
|
+
for (const line of content.split("\n")) {
|
|
204
|
+
const nameMatch = /^- name:\s*(.*?)\s*$/.exec(line);
|
|
205
|
+
if (nameMatch) {
|
|
206
|
+
currentName = stripYamlQuotes(nameMatch[1] ?? "");
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
const descriptionMatch = /^\s+description:\s*(.*?)\s*$/.exec(line);
|
|
210
|
+
if (descriptionMatch && currentName?.startsWith("scope:") && stripYamlQuotes(descriptionMatch[1] ?? "") !== "") {
|
|
211
|
+
described.push(currentName);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (described.length === 0) return true;
|
|
215
|
+
return {
|
|
216
|
+
ok: false,
|
|
217
|
+
detail: `scope labels with a description: ${described.join(", ")}`
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function stripYamlQuotes(value) {
|
|
221
|
+
const match = /^(['"])(.*)\1$/.exec(value);
|
|
222
|
+
return match?.[2] ?? value;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// .readyup/lib/workflow-hashes.ts
|
|
120
226
|
var COMMON_PRESET_HASH = "1d3e2df1ccd7deea4707fa07a4ae171d761344b65c1a311467fc0f66b70ee646";
|
|
121
227
|
var SYNC_LABELS_WORKFLOW_HASH = "0a88829d154c0de7cdd4246fede99e9311a89ab4199034dbe601663d641ab1e4";
|
|
122
228
|
var RELEASE_WORKFLOW_HASH_MONOREPO = "f63f4cabb57f94ee6550f17a9874c7a346d46554595ddbcd46fdd3208d613437";
|
|
@@ -125,6 +231,18 @@ var PUBLISH_WORKFLOW_HASH_MONOREPO = "0afa9ffe914f3dc8f043e68252ebc604c8cc1a9534
|
|
|
125
231
|
var PUBLISH_WORKFLOW_HASH_SINGLE = "6f31183e0a1e66be791a19266c3b028dadbd9fe010f7fc4452f3f8970c937b43";
|
|
126
232
|
var CREATE_GITHUB_RELEASE_WORKFLOW_HASH_MONOREPO = "c455d88c93d855737c96079945ff729a9d094f846519c24afbefe83a425c1d7f";
|
|
127
233
|
var CREATE_GITHUB_RELEASE_WORKFLOW_HASH_SINGLE = "f595831ff28f8b3a01d97e6cb0cfe100262f7a8821091c6c458b0c0224cebba8";
|
|
234
|
+
|
|
235
|
+
// .readyup/kits/default.ts
|
|
236
|
+
function getMinVersion() {
|
|
237
|
+
const picked = { "version": "14.2.3" };
|
|
238
|
+
if (typeof picked["version"] !== "string") {
|
|
239
|
+
throw new TypeError("release-kit/package.json: 'version' must be a string");
|
|
240
|
+
}
|
|
241
|
+
return picked["version"];
|
|
242
|
+
}
|
|
243
|
+
function hasPublishablePackages() {
|
|
244
|
+
return discoverWorkspaces3({ filter: (w) => w.isPackage }).length > 0;
|
|
245
|
+
}
|
|
128
246
|
var default_default = defineRdyKit({
|
|
129
247
|
checklists: [
|
|
130
248
|
{
|
|
@@ -177,7 +295,7 @@ var default_default = defineRdyKit({
|
|
|
177
295
|
{
|
|
178
296
|
name: "publish.yaml workflow exists",
|
|
179
297
|
severity: "warn",
|
|
180
|
-
skip: () => !hasPublishablePackages()
|
|
298
|
+
skip: () => !hasPublishablePackages() && "no publishable packages",
|
|
181
299
|
check: () => fileExists(".github/workflows/publish.yaml"),
|
|
182
300
|
fix: "Add .github/workflows/publish.yaml using the publish workflow template",
|
|
183
301
|
checks: [
|
|
@@ -202,7 +320,7 @@ var default_default = defineRdyKit({
|
|
|
202
320
|
{
|
|
203
321
|
name: "create-github-release.yaml matches template",
|
|
204
322
|
severity: "warn",
|
|
205
|
-
skip: () => !fileExists(".github/workflows/create-github-release.yaml")
|
|
323
|
+
skip: () => !fileExists(".github/workflows/create-github-release.yaml") && "no create-github-release workflow (GitHub Releases not adopted)",
|
|
206
324
|
check: () => {
|
|
207
325
|
const hash = detectRepoType() === "monorepo" ? CREATE_GITHUB_RELEASE_WORKFLOW_HASH_MONOREPO : CREATE_GITHUB_RELEASE_WORKFLOW_HASH_SINGLE;
|
|
208
326
|
return fileMatchesHash(".github/workflows/create-github-release.yaml", hash);
|
|
@@ -212,7 +330,7 @@ var default_default = defineRdyKit({
|
|
|
212
330
|
{
|
|
213
331
|
name: ".config/release-kit.config.ts exports a config",
|
|
214
332
|
severity: "error",
|
|
215
|
-
skip: () => !fileExists(".config/release-kit.config.ts")
|
|
333
|
+
skip: () => !fileExists(".config/release-kit.config.ts") && "no release-kit config file",
|
|
216
334
|
check: () => configFileExportsConfig(),
|
|
217
335
|
fix: "Export the config from .config/release-kit.config.ts as a default export or as a named `config` export; release-kit does not resolve any other export",
|
|
218
336
|
checks: [
|
|
@@ -251,7 +369,7 @@ var default_default = defineRdyKit({
|
|
|
251
369
|
{
|
|
252
370
|
name: ".github/labels.yaml exists",
|
|
253
371
|
severity: "warn",
|
|
254
|
-
skip: () => !fileContains(".config/release-kit.config.ts", /repoLabels/)
|
|
372
|
+
skip: () => !fileContains(".config/release-kit.config.ts", /repoLabels/) && "no repoLabels config",
|
|
255
373
|
check: () => fileExists(".github/labels.yaml"),
|
|
256
374
|
fix: "Run `release-kit sync-labels generate` to produce the labels file",
|
|
257
375
|
checks: [
|
|
@@ -278,7 +396,7 @@ var default_default = defineRdyKit({
|
|
|
278
396
|
{
|
|
279
397
|
name: "published packages ship CHANGELOG.md",
|
|
280
398
|
severity: "warn",
|
|
281
|
-
skip: () => !hasPublishablePackages()
|
|
399
|
+
skip: () => !hasPublishablePackages() && "no publishable packages",
|
|
282
400
|
check: () => packagesShipChangelog(),
|
|
283
401
|
fix: 'Add "CHANGELOG.md" to the files field of each affected package.json'
|
|
284
402
|
},
|
|
@@ -287,7 +405,7 @@ var default_default = defineRdyKit({
|
|
|
287
405
|
severity: "warn",
|
|
288
406
|
skip: () => {
|
|
289
407
|
if (!hasPublishablePackages()) return "no publishable packages";
|
|
290
|
-
return changelogArchivesAreEnabled()
|
|
408
|
+
return !changelogArchivesAreEnabled() && "changelogMarkdown.keepVersions is not set";
|
|
291
409
|
},
|
|
292
410
|
check: () => packagesShipChangelogArchives(),
|
|
293
411
|
fix: 'Add "changelogs/" to the files field of each affected package.json, so that the links from CHANGELOG.md to its archive files resolve in the published package'
|
|
@@ -295,7 +413,7 @@ var default_default = defineRdyKit({
|
|
|
295
413
|
{
|
|
296
414
|
name: "changelog.json generation is enabled",
|
|
297
415
|
severity: "recommend",
|
|
298
|
-
skip: () => !hasPublishablePackages()
|
|
416
|
+
skip: () => !hasPublishablePackages() && "no publishable packages",
|
|
299
417
|
check: () => changelogJsonIsEnabled(),
|
|
300
418
|
fix: "Remove changelogJson.enabled: false from .config/release-kit.config.ts so that release-kit writes the machine-readable changelog that upgrade tooling reads before CHANGELOG.md",
|
|
301
419
|
checks: [
|
|
@@ -355,134 +473,6 @@ var default_default = defineRdyKit({
|
|
|
355
473
|
}
|
|
356
474
|
]
|
|
357
475
|
});
|
|
358
|
-
function changelogArchivesAreEnabled() {
|
|
359
|
-
const content = readFile(".config/release-kit.config.ts");
|
|
360
|
-
if (content === void 0) return false;
|
|
361
|
-
return /changelogMarkdown\s*:\s*\{[^}]*keepVersions\s*:/.test(content);
|
|
362
|
-
}
|
|
363
|
-
function changelogJsonIsEnabled() {
|
|
364
|
-
const content = readFile(".config/release-kit.config.ts");
|
|
365
|
-
if (content === void 0) return true;
|
|
366
|
-
return !/changelogJson\s*:\s*\{[^}]*enabled\s*:\s*false/.test(content);
|
|
367
|
-
}
|
|
368
|
-
function configFileExportsConfig() {
|
|
369
|
-
const content = readFile(".config/release-kit.config.ts");
|
|
370
|
-
if (content === void 0) return false;
|
|
371
|
-
return CONFIG_EXPORT_PATTERNS.some((pattern) => pattern.test(content));
|
|
372
|
-
}
|
|
373
|
-
function labelsHaveCurrentPresetHash(presetName, expectedHash) {
|
|
374
|
-
const content = readFile(".github/labels.yaml");
|
|
375
|
-
if (content === void 0) return false;
|
|
376
|
-
const pattern = new RegExp(`^# ${presetName} preset hash: (.+)$`, "m");
|
|
377
|
-
const match = pattern.exec(content);
|
|
378
|
-
return match !== null && match[1] === expectedHash;
|
|
379
|
-
}
|
|
380
|
-
function packagesShipChangelog() {
|
|
381
|
-
return reportWorkspacesOmitting("CHANGELOG.md");
|
|
382
|
-
}
|
|
383
|
-
function packagesShipChangelogArchives() {
|
|
384
|
-
return reportWorkspacesOmitting(`${CHANGELOG_ARCHIVE_DIRECTORY}/CHANGELOG-v1.md`, `${CHANGELOG_ARCHIVE_DIRECTORY}/`);
|
|
385
|
-
}
|
|
386
|
-
function packagesShipChangelogJson() {
|
|
387
|
-
return reportWorkspacesOmitting(resolveChangelogJsonOutputPath());
|
|
388
|
-
}
|
|
389
|
-
function readmeHasReleaseNotesMarkers(content) {
|
|
390
|
-
return content.includes("<!-- section:release-notes -->") && content.includes("<!-- /section:release-notes -->");
|
|
391
|
-
}
|
|
392
|
-
function readmesHaveReleaseNotesMarkers() {
|
|
393
|
-
const failing = [];
|
|
394
|
-
const packageWorkspaces = discoverWorkspaces({ filter: (w) => w.isPackage });
|
|
395
|
-
for (const { dir } of packageWorkspaces) {
|
|
396
|
-
const readmePath = dir === "." ? "README.md" : `${dir}/README.md`;
|
|
397
|
-
const content = readFile(readmePath);
|
|
398
|
-
if (content === void 0 || !readmeHasReleaseNotesMarkers(content)) {
|
|
399
|
-
failing.push(readmePath);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
if (failing.length === 0) return true;
|
|
403
|
-
return {
|
|
404
|
-
ok: false,
|
|
405
|
-
detail: `missing markers or README: ${failing.join(", ")}`
|
|
406
|
-
};
|
|
407
|
-
}
|
|
408
|
-
function releaseNotesConfigIsConsistent() {
|
|
409
|
-
const content = readFile(".config/release-kit.config.ts");
|
|
410
|
-
if (content === void 0) return true;
|
|
411
|
-
const changelogJsonDisabled = /changelogJson\s*:\s*\{[^}]*enabled\s*:\s*false/.test(content);
|
|
412
|
-
if (!changelogJsonDisabled) return true;
|
|
413
|
-
const hasReadmeInjection = /shouldInjectIntoReadme\s*:\s*true/.test(content);
|
|
414
|
-
return !hasReadmeInjection;
|
|
415
|
-
}
|
|
416
|
-
function releaseNotesInjectsIntoReadme() {
|
|
417
|
-
const content = readFile(".config/release-kit.config.ts");
|
|
418
|
-
if (content === void 0) return false;
|
|
419
|
-
return /shouldInjectIntoReadme\s*:\s*true/.test(content);
|
|
420
|
-
}
|
|
421
|
-
function reportWorkspacesOmitting(path, label = path) {
|
|
422
|
-
const failing = [];
|
|
423
|
-
const packageWorkspaces = discoverWorkspaces({ filter: (w) => w.isPackage });
|
|
424
|
-
for (const { dir, packageJson } of packageWorkspaces) {
|
|
425
|
-
if (!packsPath(packageJson["files"], path)) {
|
|
426
|
-
failing.push(dir === "." ? "package.json" : `${dir}/package.json`);
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
if (failing.length === 0) return true;
|
|
430
|
-
return {
|
|
431
|
-
ok: false,
|
|
432
|
-
detail: `files field omits ${label}: ${failing.join(", ")}`
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
function resolveChangelogJsonOutputPath() {
|
|
436
|
-
const content = readFile(".config/release-kit.config.ts");
|
|
437
|
-
if (content === void 0) return DEFAULT_CHANGELOG_JSON_PATH;
|
|
438
|
-
const match = /changelogJson\s*:\s*\{[^}]*outputPath\s*:\s*['"]([^'"]+)['"]/.exec(content);
|
|
439
|
-
return match?.[1] ?? DEFAULT_CHANGELOG_JSON_PATH;
|
|
440
|
-
}
|
|
441
|
-
function scopeLabelsHaveNoDescriptions() {
|
|
442
|
-
const content = readFile(".github/labels.yaml");
|
|
443
|
-
if (content === void 0) return true;
|
|
444
|
-
const described = [];
|
|
445
|
-
let currentName;
|
|
446
|
-
for (const line of content.split("\n")) {
|
|
447
|
-
const nameMatch = /^- name:\s*(.*?)\s*$/.exec(line);
|
|
448
|
-
if (nameMatch) {
|
|
449
|
-
currentName = stripYamlQuotes(nameMatch[1] ?? "");
|
|
450
|
-
continue;
|
|
451
|
-
}
|
|
452
|
-
const descriptionMatch = /^\s+description:\s*(.*?)\s*$/.exec(line);
|
|
453
|
-
if (descriptionMatch && currentName?.startsWith("scope:")) {
|
|
454
|
-
if (stripYamlQuotes(descriptionMatch[1] ?? "") !== "") described.push(currentName);
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
if (described.length === 0) return true;
|
|
458
|
-
return {
|
|
459
|
-
ok: false,
|
|
460
|
-
detail: `scope labels with a description: ${described.join(", ")}`
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
function stripYamlQuotes(value) {
|
|
464
|
-
const match = /^(['"])(.*)\1$/.exec(value);
|
|
465
|
-
return match?.[2] ?? value;
|
|
466
|
-
}
|
|
467
476
|
export {
|
|
468
|
-
|
|
469
|
-
CREATE_GITHUB_RELEASE_WORKFLOW_HASH_MONOREPO,
|
|
470
|
-
CREATE_GITHUB_RELEASE_WORKFLOW_HASH_SINGLE,
|
|
471
|
-
DEFAULT_CHANGELOG_JSON_PATH,
|
|
472
|
-
PUBLISH_WORKFLOW_HASH_MONOREPO,
|
|
473
|
-
PUBLISH_WORKFLOW_HASH_SINGLE,
|
|
474
|
-
RELEASE_WORKFLOW_HASH_MONOREPO,
|
|
475
|
-
RELEASE_WORKFLOW_HASH_SINGLE,
|
|
476
|
-
SYNC_LABELS_WORKFLOW_HASH,
|
|
477
|
-
changelogArchivesAreEnabled,
|
|
478
|
-
changelogJsonIsEnabled,
|
|
479
|
-
configFileExportsConfig,
|
|
480
|
-
default_default as default,
|
|
481
|
-
packagesShipChangelog,
|
|
482
|
-
packagesShipChangelogArchives,
|
|
483
|
-
packagesShipChangelogJson,
|
|
484
|
-
readmeHasReleaseNotesMarkers,
|
|
485
|
-
readmesHaveReleaseNotesMarkers,
|
|
486
|
-
resolveChangelogJsonOutputPath,
|
|
487
|
-
scopeLabelsHaveNoDescriptions
|
|
477
|
+
default_default as default
|
|
488
478
|
};
|