@williamthorsen/release-kit 10.5.0 → 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 +111 -2
- package/.readyup/manifest.json +9 -4
- package/CHANGELOG.md +37 -0
- package/README.md +57 -5
- package/dist/esm/buildChangelogEntries.js +5 -0
- package/dist/esm/changelogJsonUtils.d.ts +5 -7
- package/dist/esm/changelogJsonUtils.js +0 -13
- package/dist/esm/changelogOverrides.js +8 -0
- package/dist/esm/extractMigration.d.ts +14 -0
- package/dist/esm/extractMigration.js +18 -0
- package/dist/esm/packsPath.d.ts +15 -0
- package/dist/esm/packsPath.js +47 -0
- package/dist/esm/releasePrepare.js +0 -3
- package/dist/esm/releasePrepareMono.js +0 -4
- package/dist/esm/reportPrepare.js +4 -2
- package/dist/esm/runGitCliff.d.ts +16 -23
- package/dist/esm/runGitCliff.js +4 -10
- package/dist/esm/types.d.ts +9 -0
- package/package.json +11 -10
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The exact `git-cliff` version every invocation resolves.
|
|
3
|
+
*
|
|
4
|
+
* npm's `git-cliff` trails the upstream release, so this pin normally sits behind the newest version cliff
|
|
5
|
+
* itself reports. Bumping it is an edit to this line, once npm publishes the version you want.
|
|
6
|
+
*/
|
|
7
|
+
export declare const GIT_CLIFF_VERSION = "2.13.1";
|
|
8
|
+
/** The npx arguments that precede the cliff args at every invocation, and that the dry-run report renders. */
|
|
9
|
+
export declare const GIT_CLIFF_NPX_ARGS: readonly string[];
|
|
1
10
|
/**
|
|
2
11
|
* Invokes `git-cliff` via `npx` and returns the output it produced.
|
|
3
12
|
*
|
|
@@ -9,15 +18,14 @@
|
|
|
9
18
|
* entire matching tag history on every run, so its size grows without bound with the repo;
|
|
10
19
|
* a file accommodates that, while a pipe is bounded by `maxBuffer`.
|
|
11
20
|
*
|
|
12
|
-
* The
|
|
13
|
-
*
|
|
14
|
-
*
|
|
21
|
+
* The npx spec names an exact version, which leaves npm no staleness to check, so `--prefer-offline` skips the
|
|
22
|
+
* per-call registry revalidation round-trip (~2.5 s per invocation on a warm cache) without stranding the run
|
|
23
|
+
* on whatever the cache happens to hold.
|
|
15
24
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* subsequent `--prefer-offline` calls run against a current binary.
|
|
25
|
+
* Two env entries are set for the child. `npm_config_progress=false` suppresses npx's animated stderr spinner,
|
|
26
|
+
* which otherwise renders as a transient flicker. `RUST_LOG=warn` drops cliff's INFO lines, among them the
|
|
27
|
+
* crates.io update notice it emits on every invocation while npm trails upstream, and leaves warnings and errors
|
|
28
|
+
* in place; an inherited `RUST_LOG` wins, so raising the level for debugging still works.
|
|
21
29
|
*
|
|
22
30
|
* The helper injects `--config <path>` and `--output <path>` itself — callers must NOT include either in `cliffArgs`.
|
|
23
31
|
* `--output` is appended last so a caller that passes one anyway cannot redirect the output the helper then reads.
|
|
@@ -28,18 +36,3 @@
|
|
|
28
36
|
* The temp-dir cleanup runs in a `finally` so it still happens on throw.
|
|
29
37
|
*/
|
|
30
38
|
export declare function runGitCliff(cliffConfigPath: string, cliffArgs: readonly string[]): string;
|
|
31
|
-
/**
|
|
32
|
-
* Revalidate npx's cache for `git-cliff` once per `prepare` run.
|
|
33
|
-
*
|
|
34
|
-
* Spawns `npx --yes git-cliff --version` *without* `--prefer-offline`, so that npm performs its normal
|
|
35
|
-
* registry-staleness check and refreshes the cached binary if a newer version is available.
|
|
36
|
-
* Subsequent `runGitCliff` calls within the same run keep `--prefer-offline` (preserving the per-call perf win)
|
|
37
|
-
* but now run against an up-to-date cache, so git-cliff's own self-update notice no longer fires repeatedly.
|
|
38
|
-
*
|
|
39
|
-
* Stdio: stdin ignored, stdout piped (the version line is suppressed as noise), stderr inherited (npm errors and
|
|
40
|
-
* any rare upgrade notice surface, but only once per run). `maxBuffer` is declared even though the piped output
|
|
41
|
-
* is a single version line, because every call that pipes stdout declares one.
|
|
42
|
-
*
|
|
43
|
-
* Errors propagate unchanged — a failed cache refresh fails the prepare run loudly rather than silently degrading.
|
|
44
|
-
*/
|
|
45
|
-
export declare function refreshGitCliffCache(): void;
|
package/dist/esm/runGitCliff.js
CHANGED
|
@@ -2,7 +2,8 @@ import { execFileSync } from 'node:child_process';
|
|
|
2
2
|
import { copyFileSync, mkdtempSync, readFileSync, rmSync } from 'node:fs';
|
|
3
3
|
import { tmpdir } from 'node:os';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
|
-
|
|
5
|
+
export const GIT_CLIFF_VERSION = '2.13.1';
|
|
6
|
+
export const GIT_CLIFF_NPX_ARGS = ['--prefer-offline', '--yes', `git-cliff@${GIT_CLIFF_VERSION}`];
|
|
6
7
|
export function runGitCliff(cliffConfigPath, cliffArgs) {
|
|
7
8
|
const tempDir = mkdtempSync(join(tmpdir(), 'cliff-'));
|
|
8
9
|
try {
|
|
@@ -12,9 +13,9 @@ export function runGitCliff(cliffConfigPath, cliffArgs) {
|
|
|
12
13
|
copyFileSync(cliffConfigPath, configPath);
|
|
13
14
|
}
|
|
14
15
|
const outputPath = join(tempDir, 'output.json');
|
|
15
|
-
execFileSync('npx', [
|
|
16
|
+
execFileSync('npx', [...GIT_CLIFF_NPX_ARGS, '--config', configPath, ...cliffArgs, '--output', outputPath], {
|
|
16
17
|
stdio: ['ignore', 'ignore', 'inherit'],
|
|
17
|
-
env: { ...process.env, npm_config_progress: 'false' },
|
|
18
|
+
env: { ...process.env, npm_config_progress: 'false', RUST_LOG: process.env['RUST_LOG'] ?? 'warn' },
|
|
18
19
|
});
|
|
19
20
|
return readFileSync(outputPath, 'utf8');
|
|
20
21
|
}
|
|
@@ -22,10 +23,3 @@ export function runGitCliff(cliffConfigPath, cliffArgs) {
|
|
|
22
23
|
rmSync(tempDir, { recursive: true, force: true });
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
|
-
export function refreshGitCliffCache() {
|
|
26
|
-
execFileSync('npx', ['--yes', 'git-cliff', '--version'], {
|
|
27
|
-
maxBuffer: GIT_OUTPUT_LIMIT,
|
|
28
|
-
stdio: ['ignore', 'pipe', 'inherit'],
|
|
29
|
-
env: { ...process.env, npm_config_progress: 'false' },
|
|
30
|
-
});
|
|
31
|
-
}
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -18,6 +18,15 @@ export interface ChangelogItem {
|
|
|
18
18
|
* with the canonical SSOT values) to surface them prominently in release notes.
|
|
19
19
|
*/
|
|
20
20
|
breaking?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Migration instruction for a consumer, taken from the `Migration:` paragraph of `body`.
|
|
23
|
+
*
|
|
24
|
+
* Derived from `body` wherever `body` is set, and absent where the body carries no labeled
|
|
25
|
+
* paragraph. Independent of `breaking`: a `fix` that tightens validation cannot carry `!` under
|
|
26
|
+
* the default breaking policy and still imposes a migration. `body` keeps the paragraph, so
|
|
27
|
+
* `CHANGELOG.md` goes on rendering it in place.
|
|
28
|
+
*/
|
|
29
|
+
migration?: string;
|
|
21
30
|
/**
|
|
22
31
|
* Full git commit SHA when known. Captured from git-cliff's `--context` output and
|
|
23
32
|
* persisted in `changelog.json` so that override files can target items by hash. Synthetic
|
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,29 +38,30 @@
|
|
|
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/nmr-core": "0.
|
|
52
|
-
"@williamthorsen/toolbelt.errors": "0.
|
|
52
|
+
"@williamthorsen/nmr-core": "0.11.0",
|
|
53
|
+
"@williamthorsen/toolbelt.errors": "0.7.0",
|
|
53
54
|
"glob": "13.0.6",
|
|
54
55
|
"json-stringify-pretty-compact": "4.0.0",
|
|
55
56
|
"semver": "7.8.5",
|
|
56
57
|
"yaml": "2.9.0",
|
|
57
|
-
"zod": "4.4
|
|
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.5.
|
|
63
|
-
"@williamthorsen/toolbelt.vitest": "0.
|
|
62
|
+
"@williamthorsen/toolbelt.filesystem": "0.8.3",
|
|
63
|
+
"@williamthorsen/toolbelt.testing": "0.5.1",
|
|
64
|
+
"@williamthorsen/toolbelt.vitest": "0.9.0",
|
|
64
65
|
"readyup": "0.35.0",
|
|
65
66
|
"smol-toml": "1.8.0"
|
|
66
67
|
},
|