@williamthorsen/release-kit 10.4.4 → 10.6.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/.meta/changelog.json +1502 -0
- package/.readyup/kits/default.js +120 -4
- package/.readyup/kits/npm-auto-publish.js +11 -3
- package/.readyup/manifest.json +16 -11
- package/CHANGELOG.md +57 -0
- package/README.md +64 -4
- package/dist/esm/assertCleanWorkingTree.d.ts +5 -0
- package/dist/esm/buildChangelogEntries.d.ts +22 -0
- package/dist/esm/buildChangelogEntries.js +5 -0
- package/dist/esm/buildDependencyGraph.d.ts +16 -0
- package/dist/esm/buildEmptyReleaseEntry.d.ts +8 -0
- package/dist/esm/buildReleaseSummary.d.ts +10 -0
- package/dist/esm/buildSyntheticChangelogEntry.d.ts +6 -0
- package/dist/esm/bumpVersion.d.ts +8 -0
- package/dist/esm/changelogJsonFile.d.ts +11 -0
- package/dist/esm/changelogJsonUtils.d.ts +16 -2
- package/dist/esm/changelogJsonUtils.js +0 -13
- package/dist/esm/changelogOverrides.d.ts +143 -0
- package/dist/esm/changelogOverrides.js +8 -0
- package/dist/esm/checkWorkTypesDrift.d.ts +25 -0
- package/dist/esm/collectPolicyViolations.d.ts +9 -0
- package/dist/esm/commitCommand.d.ts +6 -0
- package/dist/esm/compareVersions.d.ts +7 -0
- package/dist/esm/createGithubRelease.d.ts +30 -0
- package/dist/esm/createGithubReleaseCommand.d.ts +7 -0
- package/dist/esm/createTags.d.ts +5 -0
- package/dist/esm/decideRelease.d.ts +37 -0
- package/dist/esm/defaults.d.ts +25 -0
- package/dist/esm/defineConfig.d.ts +9 -0
- package/dist/esm/deleteFileIfExists.d.ts +1 -0
- package/dist/esm/deriveWorkspaceConfig.d.ts +9 -0
- package/dist/esm/detectPackageManager.d.ts +6 -0
- package/dist/esm/detectUndeclaredTagPrefixes.d.ts +18 -0
- package/dist/esm/determineBumpFromCommits.d.ts +5 -0
- package/dist/esm/determineBumpType.d.ts +12 -0
- package/dist/esm/discoverWorkspaces.d.ts +12 -0
- package/dist/esm/extractMigration.d.ts +14 -0
- package/dist/esm/extractMigration.js +18 -0
- package/dist/esm/format.d.ts +3 -0
- package/dist/esm/formatPrivateSkip.d.ts +6 -0
- package/dist/esm/generateChangelogs.d.ts +25 -0
- package/dist/esm/getCommitsSinceTarget.d.ts +16 -0
- package/dist/esm/hasPrettierConfig.d.ts +6 -0
- package/dist/esm/help/prepareHelp.d.ts +6 -0
- package/dist/esm/init/checks.d.ts +4 -0
- package/dist/esm/init/detectRepoType.d.ts +7 -0
- package/dist/esm/init/initCommand.d.ts +6 -0
- package/dist/esm/init/parseJsonRecord.d.ts +4 -0
- package/dist/esm/init/scaffold.d.ts +3 -1
- package/dist/esm/init/templates.d.ts +13 -0
- package/dist/esm/injectReleaseNotesIntoReadme.d.ts +39 -0
- package/dist/esm/injectSection.d.ts +6 -0
- package/dist/esm/loadConfig.d.ts +46 -0
- package/dist/esm/loadValidatedConfig.d.ts +8 -0
- package/dist/esm/packsPath.d.ts +15 -0
- package/dist/esm/packsPath.js +47 -0
- package/dist/esm/parseCommitMessage.d.ts +42 -0
- package/dist/esm/parseRequestedTags.d.ts +7 -0
- package/dist/esm/planReleaseNotesPreviews.d.ts +20 -0
- package/dist/esm/planVersionBump.d.ts +12 -0
- package/dist/esm/prepareCommand.d.ts +10 -0
- package/dist/esm/previewTagPrefixes.d.ts +21 -1
- package/dist/esm/propagateBumps.d.ts +15 -0
- package/dist/esm/publish.d.ts +1 -0
- package/dist/esm/publishCommand.d.ts +4 -0
- package/dist/esm/pushCommand.d.ts +4 -0
- package/dist/esm/pushRelease.d.ts +6 -0
- package/dist/esm/readCurrentVersion.d.ts +1 -0
- package/dist/esm/releaseFiles.d.ts +22 -0
- package/dist/esm/releasePlan.d.ts +23 -0
- package/dist/esm/releasePrepare.d.ts +40 -0
- package/dist/esm/releasePrepare.js +0 -3
- package/dist/esm/releasePrepareMono.d.ts +8 -0
- package/dist/esm/releasePrepareMono.js +0 -4
- package/dist/esm/releasePrepareProject.d.ts +42 -0
- package/dist/esm/renderChangelogMarkdown.d.ts +17 -0
- package/dist/esm/renderReleaseNotes.d.ts +25 -0
- package/dist/esm/reportPrepare.d.ts +14 -0
- package/dist/esm/reportPrepare.js +4 -2
- package/dist/esm/resolveCliffConfigPath.d.ts +10 -0
- package/dist/esm/resolveCommandTags.d.ts +13 -1
- package/dist/esm/resolveReleaseNotesConfig.d.ts +14 -0
- package/dist/esm/resolveReleaseTags.d.ts +22 -0
- package/dist/esm/runGitCliff.d.ts +37 -1
- package/dist/esm/runGitCliff.js +4 -10
- package/dist/esm/showTagPrefixesCommand.d.ts +11 -0
- package/dist/esm/stripScope.d.ts +7 -0
- package/dist/esm/sync-labels/generateCommand.d.ts +17 -0
- package/dist/esm/sync-labels/initCommand.d.ts +9 -0
- package/dist/esm/sync-labels/presets.d.ts +6 -0
- package/dist/esm/sync-labels/resolveLabels.d.ts +10 -0
- package/dist/esm/sync-labels/retiredConfig.d.ts +8 -0
- package/dist/esm/sync-labels/syncCommand.d.ts +6 -0
- package/dist/esm/sync-labels/templates.d.ts +14 -0
- package/dist/esm/sync-labels/types.d.ts +4 -0
- package/dist/esm/syncWorkTypes.d.ts +18 -0
- package/dist/esm/tagCommand.d.ts +1 -0
- package/dist/esm/typeGuards.d.ts +2 -0
- package/dist/esm/types.d.ts +302 -0
- package/dist/esm/validateConfig.d.ts +14 -1
- package/dist/esm/validateOnlyExcludesStrandedDependents.d.ts +21 -0
- package/dist/esm/validateOverridesCommand.d.ts +30 -0
- package/dist/esm/workTypesData.d.ts +27 -0
- package/dist/esm/workTypesUtils.d.ts +17 -0
- package/package.json +12 -11
|
@@ -1,14 +1,44 @@
|
|
|
1
1
|
import { type ValidateAllChangelogOverridesInputs, type ValidateAllChangelogOverridesResult } from './changelogOverrides.js';
|
|
2
2
|
import type { ChangelogEntry, ReleaseConfig } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Result of {@link validateOverridesCommand}: tiered exit code paired with a human-readable
|
|
5
|
+
* message. Mirrors the shape of `checkWorkTypesDrift` so the CLI dispatch layer can stay
|
|
6
|
+
* uniformly thin.
|
|
7
|
+
*
|
|
8
|
+
* Exit codes:
|
|
9
|
+
* - `0` — clean: no errors, no warnings.
|
|
10
|
+
* - `1` — only stale-key warnings.
|
|
11
|
+
* - `2` — schema/parse or ambiguous-prefix errors (errors dominate when both classes exist).
|
|
12
|
+
*/
|
|
3
13
|
export interface ValidateOverridesCommandResult {
|
|
4
14
|
exitCode: 0 | 1 | 2;
|
|
5
15
|
message: string;
|
|
6
16
|
}
|
|
17
|
+
/** Injection seams for unit testing. Production callers leave defaults; tests substitute deterministic fakes. */
|
|
7
18
|
export interface ValidateOverridesCommandDependencies {
|
|
8
19
|
discoverWorkspaces?: () => Promise<string[] | undefined>;
|
|
9
20
|
loadConfig?: () => Promise<unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* Build changelog entries for a scope. Defaults to `buildChangelogEntries`, the same path
|
|
23
|
+
* `release-kit prepare` uses — anchoring `validate`'s hash universe to `prepare`'s by
|
|
24
|
+
* construction. `tagPattern` and `includePaths` are passed straight through to git-cliff.
|
|
25
|
+
*/
|
|
10
26
|
buildEntries?: (config: Pick<ReleaseConfig, 'cliffConfigPath' | 'changelogJson'>, tagPattern?: string, includePaths?: string[]) => ChangelogEntry[];
|
|
27
|
+
/** Pluggable validator (default: the production library function). Tests use this to drive specific result shapes through the formatter. */
|
|
11
28
|
validate?: (inputs: ValidateAllChangelogOverridesInputs) => ValidateAllChangelogOverridesResult;
|
|
12
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Validate every changelog override file across the project and per-workspace scopes, and
|
|
32
|
+
* return a tiered exit-code-plus-message result. Performs workspace discovery, config load,
|
|
33
|
+
* and per-scope hash collection, then delegates the actual validation to
|
|
34
|
+
* {@link validateAllChangelogOverrides}.
|
|
35
|
+
*
|
|
36
|
+
* Single-package and monorepo modes are handled uniformly: single-package collapses to one
|
|
37
|
+
* project scope; monorepo expands to a project scope plus one scope per workspace.
|
|
38
|
+
*/
|
|
13
39
|
export declare function validateOverridesCommand(dependencies?: ValidateOverridesCommandDependencies): Promise<ValidateOverridesCommandResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Pure formatter — take an aggregated validation result, return the tiered exit code and a
|
|
42
|
+
* rendered message. Exported for unit testing without going through the full discovery path.
|
|
43
|
+
*/
|
|
14
44
|
export declare function formatValidateOverridesResult(result: ValidateAllChangelogOverridesResult): ValidateOverridesCommandResult;
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical work-types data — runtime mirror of `work-types.json`.
|
|
3
|
+
*
|
|
4
|
+
* `work-types.json` is the canonical SSOT for the taxonomy and is the file
|
|
5
|
+
* `release-kit work-types check` / `:sync` operate on. This `.ts` mirror exists for
|
|
6
|
+
* runtime consumption: ESM JSON imports require an `import attributes` clause that
|
|
7
|
+
* esbuild's `bundle: false` mode strips, so a plain TS module is the most reliable way
|
|
8
|
+
* to ship the data to consumers.
|
|
9
|
+
*
|
|
10
|
+
* A drift test (`workTypesData.unit.test.ts`) asserts that this constant deep-equals the
|
|
11
|
+
* parsed contents of `work-types.json`. To change the taxonomy, edit BOTH files (or run
|
|
12
|
+
* `nmr work-types:sync` to pull from upstream).
|
|
13
|
+
*/
|
|
14
|
+
/** Schema for a single entry. */
|
|
1
15
|
export interface WorkTypeEntry {
|
|
2
16
|
tier: string;
|
|
3
17
|
key: string;
|
|
@@ -7,16 +21,29 @@ export interface WorkTypeEntry {
|
|
|
7
21
|
breakingPolicy: 'forbidden' | 'optional' | 'required';
|
|
8
22
|
excludedFromChangelog?: boolean;
|
|
9
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Schema for an orthogonal section marker (e.g., breaking-changes indicator).
|
|
26
|
+
*
|
|
27
|
+
* Stored as plain text — consumers add formatting (bold, prefix punctuation) when
|
|
28
|
+
* constructing the rendered form. Keeps the SSOT format-agnostic across Markdown,
|
|
29
|
+
* HTML, terminal, and plain-text consumers.
|
|
30
|
+
*/
|
|
10
31
|
export interface MarkerEntry {
|
|
11
32
|
emoji: string;
|
|
12
33
|
label: string;
|
|
13
34
|
}
|
|
35
|
+
/** Schema for the full data. */
|
|
14
36
|
export interface WorkTypesData {
|
|
15
37
|
tiers: string[];
|
|
16
38
|
types: WorkTypeEntry[];
|
|
39
|
+
/**
|
|
40
|
+
* Cross-cutting section markers keyed by marker name. The `breaking` marker is
|
|
41
|
+
* canonical and required; additional keys are permitted for forward-compatibility.
|
|
42
|
+
*/
|
|
17
43
|
markers: {
|
|
18
44
|
[key: string]: MarkerEntry;
|
|
19
45
|
breaking: MarkerEntry;
|
|
20
46
|
};
|
|
21
47
|
}
|
|
48
|
+
/** Canonical work-types data, kept in lockstep with `work-types.json`. */
|
|
22
49
|
export declare const WORK_TYPES_DATA: WorkTypesData;
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared helpers for the work-types canonical-source tooling.
|
|
3
|
+
*
|
|
4
|
+
* Both `checkWorkTypesDrift` and `syncWorkTypes` need to validate the upstream JSON's top-level
|
|
5
|
+
* shape and render unknown errors as strings. Keeping a single copy here avoids byte-for-byte
|
|
6
|
+
* duplication between the two entry points.
|
|
7
|
+
*/
|
|
8
|
+
/** Sanity-check that the parsed upstream JSON carries the expected top-level shape. */
|
|
1
9
|
export declare function hasExpectedTopLevelShape(value: unknown): value is {
|
|
2
10
|
tiers: unknown[];
|
|
3
11
|
types: unknown[];
|
|
4
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Build the `init` argument for `fetch` to reach codeassembly's canonical work-types files.
|
|
15
|
+
*
|
|
16
|
+
* Returns `{ headers: { Authorization: 'Bearer <token>' } }` when `GITHUB_TOKEN` is set in the
|
|
17
|
+
* environment; returns `undefined` otherwise so the call site stays byte-identical to an
|
|
18
|
+
* unauthenticated request. Centralised here so `checkWorkTypesDrift` and `syncWorkTypes`
|
|
19
|
+
* cannot diverge on auth handling. Tests stub the env via `vi.stubEnv` rather than parameter
|
|
20
|
+
* injection, so this reads `process.env` directly.
|
|
21
|
+
*/
|
|
5
22
|
export declare function buildFetchInit(): RequestInit | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@williamthorsen/release-kit",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.6.0",
|
|
4
4
|
"description": "Version-bumping and changelog-generation toolkit for release workflows",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"changelog",
|
|
@@ -38,30 +38,31 @@
|
|
|
38
38
|
"release-kit": "./bin/release-kit.js"
|
|
39
39
|
},
|
|
40
40
|
"files": [
|
|
41
|
+
".meta/changelog.json",
|
|
41
42
|
".readyup/kits/*.js",
|
|
42
43
|
".readyup/manifest.json",
|
|
44
|
+
"CHANGELOG.md",
|
|
43
45
|
"bin",
|
|
44
|
-
"dist/*",
|
|
45
46
|
"cliff.toml.template",
|
|
47
|
+
"dist/*",
|
|
46
48
|
"presets/**",
|
|
47
|
-
"schemas/**"
|
|
48
|
-
"CHANGELOG.md"
|
|
49
|
+
"schemas/**"
|
|
49
50
|
],
|
|
50
51
|
"dependencies": {
|
|
51
|
-
"@williamthorsen/
|
|
52
|
+
"@williamthorsen/nmr-core": "0.11.0",
|
|
53
|
+
"@williamthorsen/toolbelt.errors": "0.7.0",
|
|
52
54
|
"glob": "13.0.6",
|
|
53
55
|
"json-stringify-pretty-compact": "4.0.0",
|
|
54
56
|
"semver": "7.8.5",
|
|
55
57
|
"yaml": "2.9.0",
|
|
56
|
-
"zod": "4.4
|
|
57
|
-
"@williamthorsen/nmr-core": "0.10.3"
|
|
58
|
+
"zod": "4.5.4"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@types/semver": "7.8.0",
|
|
61
|
-
"@williamthorsen/toolbelt.filesystem": "0.8.
|
|
62
|
-
"@williamthorsen/toolbelt.testing": "0.
|
|
63
|
-
"@williamthorsen/toolbelt.vitest": "0.
|
|
64
|
-
"readyup": "0.
|
|
62
|
+
"@williamthorsen/toolbelt.filesystem": "0.8.3",
|
|
63
|
+
"@williamthorsen/toolbelt.testing": "0.5.1",
|
|
64
|
+
"@williamthorsen/toolbelt.vitest": "0.9.0",
|
|
65
|
+
"readyup": "0.35.0",
|
|
65
66
|
"smol-toml": "1.8.0"
|
|
66
67
|
},
|
|
67
68
|
"engines": {
|