@detergent-software/atk 6.1.0-dev.2 → 6.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/build/commands/index.js +1 -1
- package/build/commands/index.js.map +1 -1
- package/build/commands/release-notes.d.ts +2 -6
- package/build/commands/release-notes.d.ts.map +1 -1
- package/build/commands/release-notes.js +8 -26
- package/build/commands/release-notes.js.map +1 -1
- package/build/lib/release-notes.d.ts +16 -47
- package/build/lib/release-notes.d.ts.map +1 -1
- package/build/lib/release-notes.js +27 -43
- package/build/lib/release-notes.js.map +1 -1
- package/package.json +1 -1
package/build/commands/index.js
CHANGED
|
@@ -21,7 +21,7 @@ const commands = [
|
|
|
21
21
|
['prune', 'Remove orphaned dependencies'],
|
|
22
22
|
['publish', 'Publish an asset or bundle to the registry'],
|
|
23
23
|
['register', 'Drop a manifest.json into an existing local directory'],
|
|
24
|
-
['release-notes', 'Show
|
|
24
|
+
['release-notes', 'Show release notes for ATK versions newer than the one you have installed'],
|
|
25
25
|
['schema', 'Show the schema for an asset type, bundle, adapter, lockfile, config, or registry'],
|
|
26
26
|
['search', 'Search for assets in the registry'],
|
|
27
27
|
['setup', 'Initialize ATK in a project — select tools and create config files'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,MAAM,CAAC,MAAM,WAAW,GAAG,sDAAsD,CAAC;AAElF,MAAM,QAAQ,GAAG;IACf,CAAC,OAAO,EAAE,gDAAgD,CAAC;IAC3D,CAAC,QAAQ,EAAE,yCAAyC,CAAC;IACrD,CAAC,OAAO,EAAE,2BAA2B,CAAC;IACtC,CAAC,UAAU,EAAE,mDAAmD,CAAC;IACjE,CAAC,QAAQ,EAAE,+CAA+C,CAAC;IAC3D,CAAC,MAAM,EAAE,mDAAmD,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IAAI,eACF,IAAI,EACL,KAAC,IAAI,IAAC,IAAI,kBAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAQ,OAAE,IAAI,KAFxC,IAAI,CAGR,CACR,CAAC,IACE,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const description = "Show
|
|
2
|
+
export declare const description = "Show release notes for ATK versions newer than the one you have installed";
|
|
3
3
|
export declare const options: z.ZodObject<{
|
|
4
|
-
all: z.ZodDefault<z.ZodBoolean>;
|
|
5
4
|
json: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
-
prerelease: z.ZodDefault<z.ZodBoolean>;
|
|
7
5
|
}, z.core.$strip>;
|
|
8
|
-
export declare const args: z.ZodTuple<[z.ZodOptional<z.ZodString>], null>;
|
|
9
6
|
type Props = {
|
|
10
|
-
args: z.infer<typeof args>;
|
|
11
7
|
options: z.infer<typeof options>;
|
|
12
8
|
};
|
|
13
|
-
export default function ReleaseNotes({
|
|
9
|
+
export default function ReleaseNotes({ options: { json } }: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
10
|
export {};
|
|
15
11
|
//# sourceMappingURL=release-notes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-notes.d.ts","sourceRoot":"","sources":["../../src/commands/release-notes.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"release-notes.d.ts","sourceRoot":"","sources":["../../src/commands/release-notes.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,WAAW,8EAA8E,CAAC;AAEvG,eAAO,MAAM,OAAO;;iBAKlB,CAAC;AAEH,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,2CAuDhE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text, useStdout } from 'ink';
|
|
3
3
|
import { option } from 'pastel';
|
|
4
4
|
import { z } from 'zod';
|
|
@@ -8,29 +8,18 @@ import { getBreakpoint } from '../lib/breakpoints.js';
|
|
|
8
8
|
import { renderMarkdown } from '../lib/markdown.js';
|
|
9
9
|
import { renderJson, useNonInteractive } from '../lib/output.js';
|
|
10
10
|
import { getReleaseNotes } from '../lib/release-notes.js';
|
|
11
|
-
export const description = 'Show
|
|
11
|
+
export const description = 'Show release notes for ATK versions newer than the one you have installed';
|
|
12
12
|
export const options = z.object({
|
|
13
|
-
all: z
|
|
14
|
-
.boolean()
|
|
15
|
-
.default(false)
|
|
16
|
-
.describe(option({ alias: 'a', description: 'Show the full release history instead of just the most recent' })),
|
|
17
13
|
json: z
|
|
18
14
|
.boolean()
|
|
19
15
|
.default(false)
|
|
20
16
|
.describe(option({ alias: 'j', description: 'Output raw JSON (for scripting and CI)' })),
|
|
21
|
-
prerelease: z
|
|
22
|
-
.boolean()
|
|
23
|
-
.default(false)
|
|
24
|
-
.describe(option({ alias: 'p', description: 'Include pre-releases (-dev.N, betas) in the listing' })),
|
|
25
17
|
});
|
|
26
|
-
export
|
|
27
|
-
z.string().optional().describe('A specific version to show notes for (e.g. 1.3.0)'),
|
|
28
|
-
]);
|
|
29
|
-
export default function ReleaseNotes({ args: [version], options: { all, json, prerelease } }) {
|
|
18
|
+
export default function ReleaseNotes({ options: { json } }) {
|
|
30
19
|
const { json: effectiveJson } = useNonInteractive(json);
|
|
31
20
|
const { stdout } = useStdout();
|
|
32
21
|
const bp = getBreakpoint(stdout?.columns ?? 120);
|
|
33
|
-
const state = useCommand(async (progress) => getReleaseNotes(
|
|
22
|
+
const state = useCommand(async (progress) => getReleaseNotes(progress), [], 'Fetching release notes...');
|
|
34
23
|
if (state.status === 'loading') {
|
|
35
24
|
return _jsx(Spinner, { message: state.message });
|
|
36
25
|
}
|
|
@@ -50,19 +39,12 @@ export default function ReleaseNotes({ args: [version], options: { all, json, pr
|
|
|
50
39
|
if (effectiveJson) {
|
|
51
40
|
return renderJson(data);
|
|
52
41
|
}
|
|
53
|
-
if (data.outcome === '
|
|
54
|
-
return
|
|
55
|
-
}
|
|
56
|
-
if (data.outcome === 'not-found') {
|
|
57
|
-
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { color: 'yellow', children: ["No release found for v", data.requestedVersion, "."] }), _jsx(Text, { dimColor: true, children: "Run atk release-notes to list available versions." })] }));
|
|
58
|
-
}
|
|
59
|
-
if (data.outcome === 'single') {
|
|
60
|
-
return _jsx(ReleaseEntry, { narrow: bp === 'narrow', release: data.release, showSpacer: false });
|
|
42
|
+
if (data.outcome === 'up-to-date') {
|
|
43
|
+
return (_jsxs(Text, { color: 'green', children: ["\u2713 You're on the latest version (v", data.currentVersion, ")."] }));
|
|
61
44
|
}
|
|
62
|
-
|
|
63
|
-
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { children: [_jsx(Text, { bold: true, children: data.releases.length }), " of ", _jsx(Text, { bold: true, children: data.total }), ' ', data.total === 1 ? 'release' : 'releases', " \u00B7 installed ", _jsxs(Text, { dimColor: true, children: ["v", data.currentVersion] }), " \u00B7 latest", ' ', _jsxs(Text, { bold: true, children: ["v", data.latestVersion] })] }), _jsx(Box, { height: 1 }), data.releases.map((release, index) => (_jsx(ReleaseEntry, { narrow: bp === 'narrow', release: release, showSpacer: index > 0 }, release.version))), hidden > 0 ? (_jsxs(_Fragment, { children: [_jsx(Box, { height: 1 }), _jsxs(Text, { dimColor: true, children: [hidden, " older not shown. Use --all to see everything."] })] })) : null] }));
|
|
45
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { children: [_jsx(Text, { bold: true, children: data.releases.length }), " newer", ' ', data.releases.length === 1 ? 'release' : 'releases', " since", ' ', _jsxs(Text, { dimColor: true, children: ["v", data.currentVersion] }), " \u2192 latest ", _jsxs(Text, { bold: true, children: ["v", data.latestVersion] })] }), _jsx(Box, { height: 1 }), data.releases.map((release, index) => (_jsx(ReleaseEntry, { narrow: bp === 'narrow', release: release, showSpacer: index > 0 }, release.version)))] }));
|
|
64
46
|
}
|
|
65
47
|
function ReleaseEntry({ narrow, release, showSpacer }) {
|
|
66
|
-
return (_jsxs(Box, { flexDirection: 'column', children: [showSpacer ? _jsx(Box, { height: 1 }) : null, _jsxs(Text, { children: [_jsxs(Text, { bold: true, color: '#FF8800', children: ["v", release.version] }), release.channel === 'dev' ? _jsx(Text, { dimColor: true, children: " (dev)" }) : null, release.publishedAt ? _jsxs(Text, { dimColor: true, children: [" \u00B7 ", release.publishedAt.slice(0, 10)] }) : null
|
|
48
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [showSpacer ? _jsx(Box, { height: 1 }) : null, _jsxs(Text, { children: [_jsxs(Text, { bold: true, color: '#FF8800', children: ["v", release.version] }), release.channel === 'dev' ? _jsx(Text, { dimColor: true, children: " (dev)" }) : null, release.publishedAt ? _jsxs(Text, { dimColor: true, children: [" \u00B7 ", release.publishedAt.slice(0, 10)] }) : null] }), _jsx(Box, { marginTop: narrow ? 0 : 1, children: _jsx(Text, { children: renderMarkdown(release.body.trim() || '_No release notes._') }) })] }));
|
|
67
49
|
}
|
|
68
50
|
//# sourceMappingURL=release-notes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-notes.js","sourceRoot":"","sources":["../../src/commands/release-notes.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAA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AC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACxB,UAAU,CAAC,CAAC,CAAC,KAAC,GAAG,IAAC,MAAM,EAAE,CAAC,GAAI,CAAC,CAAC,CAAC,IAAI,EACvC,MAAC,IAAI,eACH,MAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,SAAS,kBACtB,OAAO,CAAC,OAAO,IACZ,EACN,OAAO,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,QAAQ,6BAAc,CAAC,CAAC,CAAC,IAAI,EAC/D,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,MAAC,IAAI,IAAC,QAAQ,+BAAK,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAQ,CAAC,CAAC,CAAC,IAAI,IACpF,EACP,KAAC,GAAG,IAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAC5B,KAAC,IAAI,cAAE,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,qBAAqB,CAAC,GAAQ,GACvE,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
/** Default number of releases shown in list mode before `--all` is needed. */
|
|
2
|
-
export declare const DEFAULT_RELEASE_LIMIT = 15;
|
|
3
1
|
/** Release channel. `latest` = stable; `dev` = pre-release (`-dev.N`, betas, etc.). */
|
|
4
2
|
export type ReleaseChannel = 'dev' | 'latest';
|
|
5
|
-
/** A single published release. */
|
|
3
|
+
/** A single published release, newer than the installed CLI version. */
|
|
6
4
|
export interface ReleaseNote {
|
|
7
5
|
/** Raw markdown body of the GitHub release (changelog). */
|
|
8
6
|
body: string;
|
|
9
7
|
/** Resolved channel for this release. */
|
|
10
8
|
channel: ReleaseChannel;
|
|
11
|
-
/** True when this is the version currently installed. */
|
|
12
|
-
installed: boolean;
|
|
13
|
-
/** True when this version is newer than the installed CLI version. */
|
|
14
|
-
newer: boolean;
|
|
15
9
|
/** GitHub's `prerelease` flag for the release. */
|
|
16
10
|
prerelease: boolean;
|
|
17
11
|
/** ISO timestamp the release was published, or null if unknown. */
|
|
@@ -19,35 +13,15 @@ export interface ReleaseNote {
|
|
|
19
13
|
/** Semver version parsed from the release tag (leading `v` stripped). */
|
|
20
14
|
version: string;
|
|
21
15
|
}
|
|
22
|
-
/**
|
|
23
|
-
export interface ReleaseNotesOptions {
|
|
24
|
-
/** Ignore the limit and return the full (channel-filtered) history. */
|
|
25
|
-
all?: boolean;
|
|
26
|
-
/** Include pre-releases. Defaults to the channel implied by the installed build. */
|
|
27
|
-
includePrerelease?: boolean;
|
|
28
|
-
/** Max releases to return in list mode (defaults to `DEFAULT_RELEASE_LIMIT`). */
|
|
29
|
-
limit?: number;
|
|
30
|
-
/** Look up a single release by version (tag normalized; ignores channel filter). */
|
|
31
|
-
version?: string;
|
|
32
|
-
}
|
|
33
|
-
/** Result of gathering release notes. */
|
|
16
|
+
/** Result of gathering release notes for versions newer than the installed CLI. */
|
|
34
17
|
export type ReleaseNotesOutcome = {
|
|
35
18
|
currentVersion: string;
|
|
36
19
|
latestVersion: string;
|
|
37
|
-
outcome: '
|
|
20
|
+
outcome: 'notes';
|
|
38
21
|
releases: ReleaseNote[];
|
|
39
|
-
total: number;
|
|
40
|
-
} | {
|
|
41
|
-
currentVersion: string;
|
|
42
|
-
outcome: 'empty';
|
|
43
22
|
} | {
|
|
44
23
|
currentVersion: string;
|
|
45
|
-
outcome: '
|
|
46
|
-
requestedVersion: string;
|
|
47
|
-
} | {
|
|
48
|
-
currentVersion: string;
|
|
49
|
-
outcome: 'single';
|
|
50
|
-
release: ReleaseNote;
|
|
24
|
+
outcome: 'up-to-date';
|
|
51
25
|
};
|
|
52
26
|
/** Shape of a GitHub Releases API list entry (only the fields we use). */
|
|
53
27
|
interface GitHubRelease {
|
|
@@ -57,34 +31,29 @@ interface GitHubRelease {
|
|
|
57
31
|
tag_name?: string;
|
|
58
32
|
}
|
|
59
33
|
/**
|
|
60
|
-
* Fetch GitHub Releases for the CLI repo and return
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* and capped at a limit, with each entry flagged for whether it is the installed
|
|
64
|
-
* version or newer than it. With a `version`, returns that single release's notes
|
|
65
|
-
* (pre-releases included, regardless of channel).
|
|
34
|
+
* Fetch GitHub Releases for the CLI repo and return the subset newer than the
|
|
35
|
+
* installed `CLI_VERSION`, up to and including the latest — the full gap between
|
|
36
|
+
* the installed version and the latest, ordered newest-first.
|
|
66
37
|
*
|
|
67
|
-
* Channel selection mirrors the update banner: pre-release builds
|
|
68
|
-
* pre-releases
|
|
69
|
-
* via `includePrerelease`.
|
|
38
|
+
* Channel selection mirrors the update banner: pre-release builds track the
|
|
39
|
+
* `dev` channel (including `-dev.N` pre-releases), stable builds track `latest`.
|
|
70
40
|
*
|
|
71
41
|
* Unlike the silent update banner, auth and network failures propagate so the
|
|
72
42
|
* command can surface them via `ErrorView`.
|
|
73
43
|
*/
|
|
74
|
-
export declare function getReleaseNotes(
|
|
44
|
+
export declare function getReleaseNotes(progress?: (message: string) => void): Promise<ReleaseNotesOutcome>;
|
|
75
45
|
/**
|
|
76
|
-
* Pure selection logic: from raw GitHub releases,
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* any network access.
|
|
46
|
+
* Pure selection logic: from raw GitHub releases, keep those that match the
|
|
47
|
+
* requested channel and whose semver is greater than `currentVersion`, ordered
|
|
48
|
+
* newest-first. Exported separately so channel filtering, gap selection, and
|
|
49
|
+
* version comparison are unit-testable without any network access.
|
|
81
50
|
*
|
|
82
51
|
* - Tags are normalized by stripping a leading `v`; entries that aren't valid
|
|
83
52
|
* semver are skipped.
|
|
84
53
|
* - A release's channel is `dev` when GitHub's `prerelease` flag is set OR the
|
|
85
54
|
* version carries a semver pre-release component; otherwise `latest`.
|
|
86
|
-
* -
|
|
55
|
+
* - The `latest` channel keeps only stable releases; the `dev` channel keeps all.
|
|
87
56
|
*/
|
|
88
|
-
export declare function selectReleaseNotes(raw: GitHubRelease[], currentVersion: string,
|
|
57
|
+
export declare function selectReleaseNotes(raw: GitHubRelease[], currentVersion: string, channel: ReleaseChannel): ReleaseNote[];
|
|
89
58
|
export {};
|
|
90
59
|
//# sourceMappingURL=release-notes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-notes.d.ts","sourceRoot":"","sources":["../../src/lib/release-notes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"release-notes.d.ts","sourceRoot":"","sources":["../../src/lib/release-notes.ts"],"names":[],"mappings":"AAOA,uFAAuF;AACvF,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE9C,wEAAwE;AACxE,MAAM,WAAW,WAAW;IAC1B,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,OAAO,EAAE,cAAc,CAAC;IACxB,kDAAkD;IAClD,UAAU,EAAE,OAAO,CAAC;IACpB,mEAAmE;IACnE,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,mFAAmF;AACnF,MAAM,MAAM,mBAAmB,GAC3B;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,WAAW,EAAE,CAAA;CAAE,GAC5F;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC;AAEtD,0EAA0E;AAC1E,UAAU,aAAa;IACrB,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAID;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAwBxG;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,aAAa,EAAE,EACpB,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,cAAc,GACtB,WAAW,EAAE,CAgCf"}
|
|
@@ -1,27 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { gt as semverGt, prerelease as semverPrerelease, rcompare as semverRcompare, valid as semverValid } from 'semver';
|
|
2
2
|
import { getGitHubToken } from './auth.js';
|
|
3
3
|
import { fetchWithRetry } from './fetch-retry.js';
|
|
4
4
|
import { buildGitHubHeaders, DEFAULT_CLI_REPO, httpErrorMessage } from './github.js';
|
|
5
5
|
import { CLI_VERSION, isPreRelease } from './version.js';
|
|
6
|
-
/** Default number of releases shown in list mode before `--all` is needed. */
|
|
7
|
-
export const DEFAULT_RELEASE_LIMIT = 15;
|
|
8
6
|
const RELEASES_URL = `https://api.github.com/repos/${DEFAULT_CLI_REPO}/releases?per_page=100`;
|
|
9
7
|
/**
|
|
10
|
-
* Fetch GitHub Releases for the CLI repo and return
|
|
8
|
+
* Fetch GitHub Releases for the CLI repo and return the subset newer than the
|
|
9
|
+
* installed `CLI_VERSION`, up to and including the latest — the full gap between
|
|
10
|
+
* the installed version and the latest, ordered newest-first.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* version or newer than it. With a `version`, returns that single release's notes
|
|
15
|
-
* (pre-releases included, regardless of channel).
|
|
16
|
-
*
|
|
17
|
-
* Channel selection mirrors the update banner: pre-release builds include `-dev.N`
|
|
18
|
-
* pre-releases by default, stable builds show stable releases only — overridable
|
|
19
|
-
* via `includePrerelease`.
|
|
12
|
+
* Channel selection mirrors the update banner: pre-release builds track the
|
|
13
|
+
* `dev` channel (including `-dev.N` pre-releases), stable builds track `latest`.
|
|
20
14
|
*
|
|
21
15
|
* Unlike the silent update banner, auth and network failures propagate so the
|
|
22
16
|
* command can surface them via `ErrorView`.
|
|
23
17
|
*/
|
|
24
|
-
export async function getReleaseNotes(
|
|
18
|
+
export async function getReleaseNotes(progress) {
|
|
25
19
|
progress?.('Authenticating...');
|
|
26
20
|
const token = await getGitHubToken();
|
|
27
21
|
progress?.('Fetching releases...');
|
|
@@ -30,43 +24,31 @@ export async function getReleaseNotes(options = {}, progress) {
|
|
|
30
24
|
throw new Error(httpErrorMessage(response.status, 'CLI releases'));
|
|
31
25
|
}
|
|
32
26
|
const raw = (await response.json());
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
const release = selectReleaseNotes(raw, CLI_VERSION, true).find((r) => semverEq(r.version, requested));
|
|
38
|
-
return release
|
|
39
|
-
? { currentVersion: CLI_VERSION, outcome: 'single', release }
|
|
40
|
-
: { currentVersion: CLI_VERSION, outcome: 'not-found', requestedVersion: requested };
|
|
41
|
-
}
|
|
42
|
-
const includePrerelease = options.includePrerelease ?? isPreRelease();
|
|
43
|
-
const all = selectReleaseNotes(raw, CLI_VERSION, includePrerelease);
|
|
44
|
-
if (all.length === 0) {
|
|
45
|
-
return { currentVersion: CLI_VERSION, outcome: 'empty' };
|
|
27
|
+
const channel = isPreRelease() ? 'dev' : 'latest';
|
|
28
|
+
const releases = selectReleaseNotes(raw, CLI_VERSION, channel);
|
|
29
|
+
if (releases.length === 0) {
|
|
30
|
+
return { currentVersion: CLI_VERSION, outcome: 'up-to-date' };
|
|
46
31
|
}
|
|
47
|
-
const limit = options.all ? all.length : (options.limit ?? DEFAULT_RELEASE_LIMIT);
|
|
48
32
|
return {
|
|
49
33
|
currentVersion: CLI_VERSION,
|
|
50
|
-
latestVersion:
|
|
51
|
-
outcome: '
|
|
52
|
-
releases
|
|
53
|
-
total: all.length,
|
|
34
|
+
latestVersion: releases[0].version,
|
|
35
|
+
outcome: 'notes',
|
|
36
|
+
releases,
|
|
54
37
|
};
|
|
55
38
|
}
|
|
56
39
|
/**
|
|
57
|
-
* Pure selection logic: from raw GitHub releases,
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* any network access.
|
|
40
|
+
* Pure selection logic: from raw GitHub releases, keep those that match the
|
|
41
|
+
* requested channel and whose semver is greater than `currentVersion`, ordered
|
|
42
|
+
* newest-first. Exported separately so channel filtering, gap selection, and
|
|
43
|
+
* version comparison are unit-testable without any network access.
|
|
62
44
|
*
|
|
63
45
|
* - Tags are normalized by stripping a leading `v`; entries that aren't valid
|
|
64
46
|
* semver are skipped.
|
|
65
47
|
* - A release's channel is `dev` when GitHub's `prerelease` flag is set OR the
|
|
66
48
|
* version carries a semver pre-release component; otherwise `latest`.
|
|
67
|
-
* -
|
|
49
|
+
* - The `latest` channel keeps only stable releases; the `dev` channel keeps all.
|
|
68
50
|
*/
|
|
69
|
-
export function selectReleaseNotes(raw, currentVersion,
|
|
51
|
+
export function selectReleaseNotes(raw, currentVersion, channel) {
|
|
70
52
|
const notes = [];
|
|
71
53
|
for (const entry of raw) {
|
|
72
54
|
const version = normalizeTag(entry.tag_name);
|
|
@@ -74,15 +56,17 @@ export function selectReleaseNotes(raw, currentVersion, includePrerelease) {
|
|
|
74
56
|
continue;
|
|
75
57
|
}
|
|
76
58
|
const prerelease = entry.prerelease === true;
|
|
77
|
-
const
|
|
78
|
-
|
|
59
|
+
const releaseChannel = prerelease || semverPrerelease(version) !== null ? 'dev' : 'latest';
|
|
60
|
+
// On the stable channel, ignore pre-releases entirely.
|
|
61
|
+
if (channel === 'latest' && releaseChannel === 'dev') {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (!semverGt(version, currentVersion)) {
|
|
79
65
|
continue;
|
|
80
66
|
}
|
|
81
67
|
notes.push({
|
|
82
68
|
body: entry.body ?? '',
|
|
83
|
-
channel,
|
|
84
|
-
installed: semverValid(currentVersion) ? semverEq(version, currentVersion) : false,
|
|
85
|
-
newer: semverValid(currentVersion) ? semverGt(version, currentVersion) : false,
|
|
69
|
+
channel: releaseChannel,
|
|
86
70
|
prerelease,
|
|
87
71
|
publishedAt: entry.published_at ?? null,
|
|
88
72
|
version,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-notes.js","sourceRoot":"","sources":["../../src/lib/release-notes.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"release-notes.js","sourceRoot":"","sources":["../../src/lib/release-notes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,UAAU,IAAI,gBAAgB,EAAE,QAAQ,IAAI,cAAc,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1H,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAgCzD,MAAM,YAAY,GAAG,gCAAgC,gBAAgB,wBAAwB,CAAC;AAE9F;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,QAAoC;IACxE,QAAQ,EAAE,CAAC,mBAAmB,CAAC,CAAC;IAChC,MAAM,KAAK,GAAG,MAAM,cAAc,EAAE,CAAC;IAErC,QAAQ,EAAE,CAAC,sBAAsB,CAAC,CAAC;IACnC,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5F,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CA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