@detergent-software/atk 9.6.1-dev.13 → 9.6.1-dev.15
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/CHANGELOG.md +20 -0
- package/README.md +8 -8
- package/build/commands/_app.d.ts +28 -0
- package/build/commands/_app.d.ts.map +1 -1
- package/build/commands/_app.js +41 -22
- package/build/commands/_app.js.map +1 -1
- package/build/commands/upgrade.d.ts +5 -2
- package/build/commands/upgrade.d.ts.map +1 -1
- package/build/commands/upgrade.js +2 -4
- package/build/commands/upgrade.js.map +1 -1
- package/build/hooks/useRenderOnResize.d.ts +11 -0
- package/build/hooks/useRenderOnResize.d.ts.map +1 -0
- package/build/hooks/useRenderOnResize.js +35 -0
- package/build/hooks/useRenderOnResize.js.map +1 -0
- package/build/lib/ink-stdout.d.ts +17 -0
- package/build/lib/ink-stdout.d.ts.map +1 -0
- package/build/lib/ink-stdout.js +34 -0
- package/build/lib/ink-stdout.js.map +1 -0
- package/build/lib/pastel/read-custom-app.d.ts +11 -1
- package/build/lib/pastel/read-custom-app.d.ts.map +1 -1
- package/build/lib/pastel/read-custom-app.js +2 -1
- package/build/lib/pastel/read-custom-app.js.map +1 -1
- package/build/lib/pastel/render-command.d.ts.map +1 -1
- package/build/lib/pastel/render-command.js +4 -3
- package/build/lib/pastel/render-command.js.map +1 -1
- package/build/lib/update-check.d.ts +25 -19
- package/build/lib/update-check.d.ts.map +1 -1
- package/build/lib/update-check.js +50 -61
- package/build/lib/update-check.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## [9.6.1-dev.15](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/branchCompare?baseVersion=GTv9.6.1-dev.14&targetVersion=GTv9.6.1-dev.15) (2026-11-11)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **cli:** decide the update banner before the first frame ([c1d18f8](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/commit/c1d18f8d705acbaf25e35e80b2c25537240b17dc))
|
|
6
|
+
|
|
7
|
+
### Refactoring
|
|
8
|
+
|
|
9
|
+
* **cli:** tidy the update banner's shell checks after review ([6b01bb9](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/commit/6b01bb95bf9074e07f800fb2cf6e46745bd98233))
|
|
10
|
+
|
|
11
|
+
## [9.6.1-dev.14](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/branchCompare?baseVersion=GTv9.6.1-dev.13&targetVersion=GTv9.6.1-dev.14) (2026-11-11)
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **cli:** keep Ink's redraw while a prompt takes keys ([f71f470](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/commit/f71f470125c1d4eb914b6ffcb30a765b706f86f6))
|
|
16
|
+
* **cli:** refit atk browse and atk list when the terminal is resized ([ce4a956](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/commit/ce4a956d2f87515fd331612e297a24ec36e825b6))
|
|
17
|
+
* **cli:** refit before Ink's own resize redraw ([9781d16](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/commit/9781d166f3398324acbc9ef47018a3f440f6c027))
|
|
18
|
+
* **cli:** return the stdout view from chained stream calls ([9169ca2](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/commit/9169ca282e95bada9a0c29e181916bea4f4cfb40))
|
|
19
|
+
* **cli:** stop Ink clearing the terminal after a long output ([3d74f20](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/commit/3d74f20298ddebcafe4a961d061ecf1fc2d564b7))
|
|
20
|
+
|
|
1
21
|
## [9.6.1-dev.13](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/branchCompare?baseVersion=GTv9.6.1-dev.12&targetVersion=GTv9.6.1-dev.13) (2026-11-11)
|
|
2
22
|
|
|
3
23
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -399,14 +399,14 @@ atk config org --reset
|
|
|
399
399
|
|
|
400
400
|
### Available Keys
|
|
401
401
|
|
|
402
|
-
| Key | Default | Description
|
|
403
|
-
| ----------------- | ----------------------------------------- |
|
|
404
|
-
| `apiUrl` | `https://func-atk-prod.azurewebsites.net` | ATK API base URL. The `ATK_API_URL` environment variable overrides it (e.g. to point at dev).
|
|
405
|
-
| `cacheDir` | `~/.atk/cache/` | Override cache directory
|
|
406
|
-
| `cacheTtlMinutes` | `5` | Cache TTL in minutes for registry data
|
|
407
|
-
| `checkUpdates` | `true` | Show a banner when a newer ATK version is available
|
|
408
|
-
| `org` | _(not set)_ | Default organization scope for asset resolution
|
|
409
|
-
| `userRoot` | _(home directory)_ | Root of the user scope (`--user`). A relative or `~/` path is under the home directory. `ATK_USER_ROOT` overrides it.
|
|
402
|
+
| Key | Default | Description |
|
|
403
|
+
| ----------------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
404
|
+
| `apiUrl` | `https://func-atk-prod.azurewebsites.net` | ATK API base URL. The `ATK_API_URL` environment variable overrides it (e.g. to point at dev). |
|
|
405
|
+
| `cacheDir` | `~/.atk/cache/` | Override cache directory |
|
|
406
|
+
| `cacheTtlMinutes` | `5` | Cache TTL in minutes for registry data |
|
|
407
|
+
| `checkUpdates` | `true` | Show a banner when a newer ATK version is available (in `--json` output, an `update-available` entry in `notices`). It reads the version from a cache that a background request to npm refreshes at most once a day, so a new release shows from the run after that refresh |
|
|
408
|
+
| `org` | _(not set)_ | Default organization scope for asset resolution |
|
|
409
|
+
| `userRoot` | _(home directory)_ | Root of the user scope (`--user`). A relative or `~/` path is under the home directory. `ATK_USER_ROOT` overrides it. |
|
|
410
410
|
|
|
411
411
|
### Environment Variables
|
|
412
412
|
|
package/build/commands/_app.d.ts
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
|
+
import { type RenderOptions } from 'ink';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import type { AppProps } from '../lib/pastel/index.js';
|
|
4
|
+
import { type RawModeState } from '../lib/ink-stdout.js';
|
|
3
5
|
export default function App({ commandProps, Component }: AppProps): React.JSX.Element;
|
|
6
|
+
/**
|
|
7
|
+
* What the shell settles before its first frame: the update banner, from the npm cache with no wait on npm. A banner
|
|
8
|
+
* that arrived later would change a frame that may already be taller than the terminal, and a print-once output would
|
|
9
|
+
* then be written twice, its top left in the scrollback (ATK-966). A command that declares `hidesUpdateBanner` (`atk
|
|
10
|
+
* upgrade`, which the banner would tell the user to run) never shows it. A run with no shell (`--json`, no TTY) reads
|
|
11
|
+
* nothing: `cli.tsx` notes the update for its payload.
|
|
12
|
+
*/
|
|
13
|
+
export declare function beforeRender(Component: object, options: Record<string, unknown>, streams?: {
|
|
14
|
+
stdin: {
|
|
15
|
+
isTTY?: boolean;
|
|
16
|
+
};
|
|
17
|
+
stdout: {
|
|
18
|
+
isTTY?: boolean;
|
|
19
|
+
};
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Ink's render options for this run. A full-screen screen (`browse`, `list`), in a terminal and without `--json`, gives
|
|
23
|
+
* Ink the terminal's height: the screen sizes itself by it. Every other run gives it only while a prompt takes keys, so
|
|
24
|
+
* output nobody can type into never makes Ink clear the terminal, however long it is (ATK-965).
|
|
25
|
+
*/
|
|
26
|
+
export declare function renderOptions(Component: AppProps['Component'], options: Record<string, unknown>, streams?: {
|
|
27
|
+
stdin: RawModeState & {
|
|
28
|
+
isTTY?: boolean;
|
|
29
|
+
};
|
|
30
|
+
stdout: NodeJS.WriteStream;
|
|
31
|
+
}): RenderOptions;
|
|
4
32
|
//# sourceMappingURL=_app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_app.d.ts","sourceRoot":"","sources":["../../src/commands/_app.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_app.d.ts","sourceRoot":"","sources":["../../src/commands/_app.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,aAAa,EAAQ,MAAM,KAAK,CAAC;AAIrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAWvD,OAAO,EAAE,KAAK,YAAY,EAAgB,MAAM,sBAAsB,CAAC;AAoEvE,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,QAAQ,qBAyDhE;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,GAAE;IAAE,KAAK,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAAC,MAAM,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAAY,GAC7E,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,EAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,GAAE;IAAE,KAAK,EAAE,YAAY,GAAG;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAA;CAAY,GAC3F,aAAa,CAGf"}
|
package/build/commands/_app.js
CHANGED
|
@@ -10,11 +10,13 @@ import MeasuredBox from '../components/MeasuredBox.js';
|
|
|
10
10
|
import NoticeBanner from '../components/NoticeBanner.js';
|
|
11
11
|
import UpdateBanner from '../components/UpdateBanner.js';
|
|
12
12
|
import { useMeasuredRows } from '../hooks/useMeasuredRows.js';
|
|
13
|
+
import { useRenderOnResize } from '../hooks/useRenderOnResize.js';
|
|
13
14
|
import { declaresFullScreen, ShellContext } from '../hooks/useShell.js';
|
|
14
15
|
import { errorGuidance } from '../lib/errors.js';
|
|
16
|
+
import { rowsWhileRaw } from '../lib/ink-stdout.js';
|
|
15
17
|
import { getNotices, subscribeNotices } from '../lib/notices.js';
|
|
16
|
-
import { renderJson, useCanPrompt } from '../lib/output.js';
|
|
17
|
-
import {
|
|
18
|
+
import { processCanPrompt, renderJson, useCanPrompt } from '../lib/output.js';
|
|
19
|
+
import { getUpdateBanner, hideUpdateBanner, loadUpdateBanner, subscribeUpdateBanner } from '../lib/update-check.js';
|
|
18
20
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
19
21
|
const pkg = JSON.parse(readFileSync(join(__dirname, '..', '..', 'package.json'), 'utf8'));
|
|
20
22
|
/** The empty row the shell draws above the header and below the command */
|
|
@@ -63,35 +65,52 @@ export default function App({ commandProps, Component }) {
|
|
|
63
65
|
// Once-per-run notices arrive while the command runs; subscribing
|
|
64
66
|
// re-renders the shell in place.
|
|
65
67
|
const notices = React.useSyncExternalStore(subscribeNotices, getNotices, getNotices);
|
|
66
|
-
//
|
|
67
|
-
const
|
|
68
|
-
const [updateInfo, setUpdateInfo] = React.useState(null);
|
|
69
|
-
React.useEffect(() => {
|
|
70
|
-
if (effectiveJson)
|
|
71
|
-
return;
|
|
72
|
-
let cancelled = false;
|
|
73
|
-
getUpdateInfo()
|
|
74
|
-
.then((info) => {
|
|
75
|
-
if (!cancelled)
|
|
76
|
-
setUpdateInfo(info);
|
|
77
|
-
})
|
|
78
|
-
.catch(() => {
|
|
79
|
-
// getUpdateInfo never throws, but guard defensively.
|
|
80
|
-
});
|
|
81
|
-
return () => {
|
|
82
|
-
cancelled = true;
|
|
83
|
-
};
|
|
84
|
-
}, [effectiveJson]);
|
|
68
|
+
// Loaded by `beforeRender`, so it is in the first frame; `atk doctor --fix` hides it once its upgrade made it stale.
|
|
69
|
+
const updateInfo = React.useSyncExternalStore(subscribeUpdateBanner, getUpdateBanner, getUpdateBanner);
|
|
85
70
|
// A full-screen screen (`browse`, `list`) asks for the one-line header and sizes itself by the rows the shell
|
|
86
71
|
// really draws, measured with the update banner and notices as they arrive (ATK-961).
|
|
87
72
|
const [fullScreen, setFullScreen] = React.useState(() => declaresFullScreen(Component, commandProps.options));
|
|
88
73
|
const aboveRef = React.useRef(null);
|
|
89
74
|
const aboveRows = useMeasuredRows(aboveRef, fullScreen);
|
|
75
|
+
// A resize renders the whole tree again: the shell measures its rewrapped rows and the screen refits (ATK-964)
|
|
76
|
+
useRenderOnResize(!effectiveJson);
|
|
90
77
|
const shell = React.useMemo(() => ({ rows: 2 * SHELL_MARGIN + aboveRows, setFullScreen }), [aboveRows]);
|
|
91
78
|
if (effectiveJson) {
|
|
92
79
|
return (_jsx(CommandErrorBoundary, { json: true, children: _jsx(Component, { ...commandProps }) }));
|
|
93
80
|
}
|
|
94
|
-
return (_jsx(ShellContext.Provider, { value: shell, children: _jsxs(Box, { flexDirection: 'column', marginBottom: SHELL_MARGIN, marginTop: SHELL_MARGIN, children: [_jsxs(MeasuredBox, { clip: fullScreen, measureRef: aboveRef, rows: aboveRows, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Header, { compact: fullScreen, version: pkg.version }) }), updateInfo &&
|
|
81
|
+
return (_jsx(ShellContext.Provider, { value: shell, children: _jsxs(Box, { flexDirection: 'column', marginBottom: SHELL_MARGIN, marginTop: SHELL_MARGIN, children: [_jsxs(MeasuredBox, { clip: fullScreen, measureRef: aboveRef, rows: aboveRows, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Header, { compact: fullScreen, version: pkg.version }) }), updateInfo && (_jsx(Box, { marginBottom: 1, children: _jsx(UpdateBanner, { info: updateInfo }) })), notices.length > 0 && (_jsx(Box, { marginBottom: 1, children: _jsx(NoticeBanner, { notices: notices }) }))] }), _jsx(CommandErrorBoundary, { json: false, children: _jsx(Component, { ...commandProps }) })] }) }));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* What the shell settles before its first frame: the update banner, from the npm cache with no wait on npm. A banner
|
|
85
|
+
* that arrived later would change a frame that may already be taller than the terminal, and a print-once output would
|
|
86
|
+
* then be written twice, its top left in the scrollback (ATK-966). A command that declares `hidesUpdateBanner` (`atk
|
|
87
|
+
* upgrade`, which the banner would tell the user to run) never shows it. A run with no shell (`--json`, no TTY) reads
|
|
88
|
+
* nothing: `cli.tsx` notes the update for its payload.
|
|
89
|
+
*/
|
|
90
|
+
export async function beforeRender(Component, options, streams = process) {
|
|
91
|
+
if (!drawsShell(options, streams))
|
|
92
|
+
return;
|
|
93
|
+
if ('hidesUpdateBanner' in Component && Component.hidesUpdateBanner === true) {
|
|
94
|
+
hideUpdateBanner();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
await loadUpdateBanner();
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Ink's render options for this run. A full-screen screen (`browse`, `list`), in a terminal and without `--json`, gives
|
|
101
|
+
* Ink the terminal's height: the screen sizes itself by it. Every other run gives it only while a prompt takes keys, so
|
|
102
|
+
* output nobody can type into never makes Ink clear the terminal, however long it is (ATK-965).
|
|
103
|
+
*/
|
|
104
|
+
export function renderOptions(Component, options, streams = process) {
|
|
105
|
+
const fullScreenRun = declaresFullScreen(Component, options) && drawsShell(options, streams);
|
|
106
|
+
return { stdout: fullScreenRun ? streams.stdout : rowsWhileRaw(streams.stdout, streams.stdin) };
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Whether this run draws the shell, decided before Ink renders: a terminal (stdin and stdout TTYs), without `--json`.
|
|
110
|
+
* App decides the same from Ink's streams (`effectiveJson`).
|
|
111
|
+
*/
|
|
112
|
+
function drawsShell(options, streams) {
|
|
113
|
+
return !options['json'] && processCanPrompt(streams.stdin, streams.stdout);
|
|
95
114
|
}
|
|
96
115
|
/** `ATK_DEBUG` (any value but empty or `0`) adds the stack trace to a crash's output. */
|
|
97
116
|
function isDebug() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_app.js","sourceRoot":"","sources":["../../src/commands/_app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"_app.js","sourceRoot":"","sources":["../../src/commands/_app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAuC,IAAI,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,SAAS,MAAM,4BAA4B,CAAC;AACnD,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,OAAO,WAAW,MAAM,8BAA8B,CAAC;AACvD,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,YAAY,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAqB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEp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CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7E,CAAC;AAED,yFAAyF;AACzF,SAAS,OAAO;IACd,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACvC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,GAAG,CAAC;AAC9D,CAAC"}
|
|
@@ -11,6 +11,9 @@ export declare const options: z.ZodObject<{
|
|
|
11
11
|
type Props = {
|
|
12
12
|
options: z.infer<typeof options>;
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
declare function Upgrade({ options: { allowDowngrade, json, tag } }: Props): import("react").JSX.Element;
|
|
15
|
+
declare namespace Upgrade {
|
|
16
|
+
var hidesUpdateBanner: boolean;
|
|
17
|
+
}
|
|
18
|
+
export default Upgrade;
|
|
16
19
|
//# sourceMappingURL=upgrade.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,WAAW,yGACgF,CAAC;AAEzG,eAAO,MAAM,OAAO;;;;;;;iBAoBlB,CAAC;AAEH,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF,iBAAwB,OAAO,CAAC,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,+BAoDhF;kBApDuB,OAAO;;;eAAP,OAAO"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
3
|
import { z } from 'zod';
|
|
5
4
|
import { ErrorView, Spinner } from '../components/index.js';
|
|
6
5
|
import { useCommand } from '../hooks/useCommand.js';
|
|
@@ -8,7 +7,6 @@ import { removeNotice } from '../lib/notices.js';
|
|
|
8
7
|
import { renderJson, useNonInteractive } from '../lib/output.js';
|
|
9
8
|
import { option } from '../lib/pastel/index.js';
|
|
10
9
|
import { defaultUpgradeDeps, UPGRADE_TAGS, upgradeCli } from '../lib/self-upgrade.js';
|
|
11
|
-
import { hideUpdateBanner } from '../lib/update-check.js';
|
|
12
10
|
export const description = 'Upgrade the ATK CLI itself to the newest version on npm (to update installed assets, use atk update)';
|
|
13
11
|
export const options = z.object({
|
|
14
12
|
allowDowngrade: z
|
|
@@ -29,8 +27,6 @@ export const options = z.object({
|
|
|
29
27
|
});
|
|
30
28
|
export default function Upgrade({ options: { allowDowngrade, json, tag } }) {
|
|
31
29
|
const { json: effectiveJson } = useNonInteractive(json);
|
|
32
|
-
// The shell's update banner says to run this command; it runs before the shell's update check answers.
|
|
33
|
-
useEffect(hideUpdateBanner, []);
|
|
34
30
|
const state = useCommand(async (progress) => {
|
|
35
31
|
const result = await upgradeCli({ allowDowngrade, tag }, defaultUpgradeDeps(progress));
|
|
36
32
|
// The update check ran before the command, against the old version: its notice is stale now.
|
|
@@ -61,4 +57,6 @@ export default function Upgrade({ options: { allowDowngrade, json, tag } }) {
|
|
|
61
57
|
}
|
|
62
58
|
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { children: [_jsx(Text, { color: 'green', children: "\u2713" }), " ", data.outcome === 'upgraded' ? 'Upgraded' : 'Downgraded', " ATK ", data.from, " \u2192", ' ', _jsx(Text, { bold: true, children: data.to }), " (npm ", data.tag, ")"] }), _jsx(Text, { dimColor: true, children: "Run atk release-notes to see what's new." })] }));
|
|
63
59
|
}
|
|
60
|
+
// The shell's update banner would tell the user to run this command: it never shows it (ATK-877, ATK-966)
|
|
61
|
+
Upgrade.hidesUpdateBanner = true;
|
|
64
62
|
//# sourceMappingURL=upgrade.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../src/commands/upgrade.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../src/commands/upgrade.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,UAAU,EAAsB,MAAM,wBAAwB,CAAC;AAE1G,MAAM,CAAC,MAAM,WAAW,GACtB,sGAAsG,CAAC;AAEzG,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,cAAc,EAAE,CAAC;SACd,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,MAAM,CAAC,EAAE,WAAW,EAAE,oFAAoF,EAAE,CAAC,CAC9G;IACH,IAAI,EAAE,CAAC;SACJ,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;SACd,Q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EAAE,GAAQ,YAAO,IAAI,CAAC,GAAG,SACrC,EACP,KAAC,IAAI,IAAC,QAAQ,+DAAqD,IAC/D,CACP,CAAC;AACJ,CAAC;AAED,0GAA0G;AAC1G,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders the component, and so the tree under it, again when the terminal is resized. Ink only lays its last tree
|
|
3
|
+
* out again and redraws it on a resize, so without a render, whatever sized itself from `stdout.columns` or
|
|
4
|
+
* `stdout.rows` (a full-screen list's viewport) or measured itself (the shell's banner) keeps the old size (ATK-964).
|
|
5
|
+
*
|
|
6
|
+
* The listener goes ahead of Ink's own: Ink's root is a legacy one, so the render happens at once, and Ink's redraw
|
|
7
|
+
* that follows draws the refitted tree rather than the old one at the new size. While `active` is false nothing is
|
|
8
|
+
* subscribed.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useRenderOnResize(active?: boolean): void;
|
|
11
|
+
//# sourceMappingURL=useRenderOnResize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRenderOnResize.d.ts","sourceRoot":"","sources":["../../src/hooks/useRenderOnResize.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,UAAO,GAAG,IAAI,CAkBrD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useStdout } from 'ink';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Renders the component, and so the tree under it, again when the terminal is resized. Ink only lays its last tree
|
|
5
|
+
* out again and redraws it on a resize, so without a render, whatever sized itself from `stdout.columns` or
|
|
6
|
+
* `stdout.rows` (a full-screen list's viewport) or measured itself (the shell's banner) keeps the old size (ATK-964).
|
|
7
|
+
*
|
|
8
|
+
* The listener goes ahead of Ink's own: Ink's root is a legacy one, so the render happens at once, and Ink's redraw
|
|
9
|
+
* that follows draws the refitted tree rather than the old one at the new size. While `active` is false nothing is
|
|
10
|
+
* subscribed.
|
|
11
|
+
*/
|
|
12
|
+
export function useRenderOnResize(active = true) {
|
|
13
|
+
const { stdout } = useStdout();
|
|
14
|
+
const [, setSize] = useState(() => sizeOf(stdout));
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!active)
|
|
17
|
+
return;
|
|
18
|
+
// Equal sizes keep the last state, so a resize back to the size of the last render doesn't render again
|
|
19
|
+
const onResize = () => setSize((last) => {
|
|
20
|
+
const next = sizeOf(stdout);
|
|
21
|
+
return next === last ? last : next;
|
|
22
|
+
});
|
|
23
|
+
stdout.prependListener('resize', onResize);
|
|
24
|
+
// A resize between the first render and this effect has no event left to catch
|
|
25
|
+
onResize();
|
|
26
|
+
return () => {
|
|
27
|
+
stdout.off('resize', onResize);
|
|
28
|
+
};
|
|
29
|
+
}, [active, stdout]);
|
|
30
|
+
}
|
|
31
|
+
/** The size as one comparable value */
|
|
32
|
+
function sizeOf(stdout) {
|
|
33
|
+
return `${String(stdout.columns)}x${String(stdout.rows)}`;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=useRenderOnResize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRenderOnResize.js","sourceRoot":"","sources":["../../src/hooks/useRenderOnResize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAM,GAAG,IAAI;IAC7C,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACnD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM;YAAE,OAAO;QACpB,wGAAwG;QACxG,MAAM,QAAQ,GAAG,GAAG,EAAE,CACpB,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACf,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;YAC5B,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QACrC,CAAC,CAAC,CAAC;QACL,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC3C,+EAA+E;QAC/E,QAAQ,EAAE,CAAC;QACX,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACjC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AACvB,CAAC;AAED,uCAAuC;AACvC,SAAS,MAAM,CAAC,MAA0B;IACxC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** The part of stdin that says whether a prompt is taking keys. */
|
|
2
|
+
export interface RawModeState {
|
|
3
|
+
readonly isRaw?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* `stdout` as Ink should see it outside a full-screen screen: the same stream, whose height (`rows`) shows only while
|
|
7
|
+
* stdin is in raw mode, that is, while a prompt or picker takes keys (Ink turns raw mode on for an active `useInput`
|
|
8
|
+
* and off again). Otherwise `rows` is `undefined`, as a pipe's is.
|
|
9
|
+
*
|
|
10
|
+
* Ink 6 writes `ESC[2J`, clearing the whole terminal, on any render after a frame at least `rows` tall. While a prompt
|
|
11
|
+
* is up that is its redraw of a frame taller than the window, and it stays. Once nothing takes keys the frame is output,
|
|
12
|
+
* and the next render (Ink's unmount always renders once more) would only wipe the terminal: a long `atk list --tree`
|
|
13
|
+
* or `atk info` cleared it on exit (ATK-965). Everything else (`write`, `columns`, `isTTY`, `resize` events, the
|
|
14
|
+
* writable state) is the real stream's, called on it.
|
|
15
|
+
*/
|
|
16
|
+
export declare function rowsWhileRaw<S extends NodeJS.WriteStream>(stdout: S, stdin: RawModeState): S;
|
|
17
|
+
//# sourceMappingURL=ink-stdout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ink-stdout.d.ts","sourceRoot":"","sources":["../../src/lib/ink-stdout.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,GAAG,CAAC,CAmB5F"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `stdout` as Ink should see it outside a full-screen screen: the same stream, whose height (`rows`) shows only while
|
|
3
|
+
* stdin is in raw mode, that is, while a prompt or picker takes keys (Ink turns raw mode on for an active `useInput`
|
|
4
|
+
* and off again). Otherwise `rows` is `undefined`, as a pipe's is.
|
|
5
|
+
*
|
|
6
|
+
* Ink 6 writes `ESC[2J`, clearing the whole terminal, on any render after a frame at least `rows` tall. While a prompt
|
|
7
|
+
* is up that is its redraw of a frame taller than the window, and it stays. Once nothing takes keys the frame is output,
|
|
8
|
+
* and the next render (Ink's unmount always renders once more) would only wipe the terminal: a long `atk list --tree`
|
|
9
|
+
* or `atk info` cleared it on exit (ATK-965). Everything else (`write`, `columns`, `isTTY`, `resize` events, the
|
|
10
|
+
* writable state) is the real stream's, called on it.
|
|
11
|
+
*/
|
|
12
|
+
export function rowsWhileRaw(stdout, stdin) {
|
|
13
|
+
// Each method is wrapped once, so reading it twice gives the same function (`off` finds what `on` added). It runs on
|
|
14
|
+
// the real stream, and a call that returns the stream for chaining (`on`, `cork` …) gets the view back.
|
|
15
|
+
const wrapped = new WeakMap();
|
|
16
|
+
const view = new Proxy(stdout, {
|
|
17
|
+
get(target, property) {
|
|
18
|
+
if (property === 'rows')
|
|
19
|
+
return stdin.isRaw ? target.rows : undefined;
|
|
20
|
+
const value = Reflect.get(target, property, target);
|
|
21
|
+
if (typeof value !== 'function' || property === 'constructor')
|
|
22
|
+
return value;
|
|
23
|
+
if (!wrapped.has(value)) {
|
|
24
|
+
wrapped.set(value, (...args) => {
|
|
25
|
+
const result = Reflect.apply(value, target, args);
|
|
26
|
+
return result === target ? view : result;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return wrapped.get(value);
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
return view;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=ink-stdout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ink-stdout.js","sourceRoot":"","sources":["../../src/lib/ink-stdout.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAA+B,MAAS,EAAE,KAAmB;IACvF,qHAAqH;IACrH,wGAAwG;IACxG,MAAM,OAAO,GAAG,IAAI,OAAO,EAAmB,CAAC;IAC/C,MAAM,IAAI,GAAM,IAAI,KAAK,CAAC,MAAM,EAAE;QAChC,GAAG,CAAC,MAAM,EAAE,QAAQ;YAClB,IAAI,QAAQ,KAAK,MAAM;gBAAE,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;YACtE,MAAM,KAAK,GAAY,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC7D,IAAI,OAAO,KAAK,KAAK,UAAU,IAAI,QAAQ,KAAK,aAAa;gBAAE,OAAO,KAAK,CAAC;YAC5E,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBACxB,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAe,EAAW,EAAE;oBACjD,MAAM,MAAM,GAAY,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;oBAC3D,OAAO,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;gBAC3C,CAAC,CAAC,CAAC;YACL,CAAC;YACD,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;KACF,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
import { type RenderOptions } from 'ink';
|
|
1
2
|
import { type ComponentType } from 'react';
|
|
2
3
|
import { type AppProps } from './types.js';
|
|
3
|
-
|
|
4
|
+
/** Work the app finishes before the first frame of one run of `Component` with its parsed `options`. */
|
|
5
|
+
export type AppBeforeRender = (Component: AppProps['Component'], options: Record<string, unknown>) => Promise<void>;
|
|
6
|
+
/** Ink's render options for one run of `Component` with its parsed `options`. */
|
|
7
|
+
export type AppRenderOptions = (Component: AppProps['Component'], options: Record<string, unknown>) => RenderOptions;
|
|
8
|
+
export type CustomApp = {
|
|
9
|
+
App: ComponentType<AppProps>;
|
|
10
|
+
beforeRender: AppBeforeRender | undefined;
|
|
11
|
+
renderOptions: AppRenderOptions | undefined;
|
|
12
|
+
};
|
|
13
|
+
export default function readCustomApp(directory: string): Promise<CustomApp | undefined>;
|
|
4
14
|
//# sourceMappingURL=read-custom-app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-custom-app.d.ts","sourceRoot":"","sources":["../../../src/lib/pastel/read-custom-app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read-custom-app.d.ts","sourceRoot":"","sources":["../../../src/lib/pastel/read-custom-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,KAAK,CAAC;AAIzC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,wGAAwG;AACxG,MAAM,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEpH,iFAAiF;AACjF,MAAM,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,aAAa,CAAC;AAErH,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC7B,YAAY,EAAE,eAAe,GAAG,SAAS,CAAC;IAC1C,aAAa,EAAE,gBAAgB,GAAG,SAAS,CAAC;CAC7C,CAAC;AAQF,wBAA8B,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAkB7F"}
|
|
@@ -6,6 +6,7 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
6
6
|
}
|
|
7
7
|
return path;
|
|
8
8
|
};
|
|
9
|
+
import {} from 'ink';
|
|
9
10
|
import fs from 'node:fs/promises';
|
|
10
11
|
import path from 'node:path';
|
|
11
12
|
import { pathToFileURL } from 'node:url';
|
|
@@ -21,7 +22,7 @@ export default async function readCustomApp(directory) {
|
|
|
21
22
|
const filePath = path.join(directory, file);
|
|
22
23
|
const fileUrl = pathToFileURL(filePath);
|
|
23
24
|
const m = (await import(__rewriteRelativeImportExtension(fileUrl.href)));
|
|
24
|
-
customApp = m.default;
|
|
25
|
+
customApp = { App: m.default, beforeRender: m.beforeRender, renderOptions: m.renderOptions };
|
|
25
26
|
break;
|
|
26
27
|
}
|
|
27
28
|
return customApp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-custom-app.js","sourceRoot":"","sources":["../../../src/lib/pastel/read-custom-app.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAsB,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAiB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"read-custom-app.js","sourceRoot":"","sources":["../../../src/lib/pastel/read-custom-app.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAsB,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAsB,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAiB,MAAM,YAAY,CAAC;AAoB3C,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,aAAa,CAAC,SAAiB;IAC3D,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1C,IAAI,SAAgC,CAAC;IAErC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,SAAS;QACX,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;QACxC,MAAM,CAAC,GAAG,CAAC,MAAM,MAAM,kCAAC,OAAO,CAAC,IAAI,EAAC,CAAe,CAAC;QAErD,SAAS,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC,YAAY,EAAE,aAAa,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC;QAC7F,MAAM;IACR,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-command.d.ts","sourceRoot":"","sources":["../../../src/lib/pastel/render-command.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,IAAI,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAK7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAK1D;;;;GAIG;AACH,wBAA8B,aAAa,CACzC,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,cAAc,EACtB,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,EAAE,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"render-command.d.ts","sourceRoot":"","sources":["../../../src/lib/pastel/render-command.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,IAAI,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAK7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAK1D;;;;GAIG;AACH,wBAA8B,aAAa,CACzC,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,cAAc,EACtB,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,EAAE,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,iBA+C3G"}
|
|
@@ -36,14 +36,15 @@ export default async function renderCommand(commanderCommand, module, { commands
|
|
|
36
36
|
rejectInput(commanderCommand, result.error);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
const
|
|
40
|
-
|
|
39
|
+
const customApp = await readCustomApp(commandsDirectory);
|
|
40
|
+
await customApp?.beforeRender?.(Component, parsedOptions);
|
|
41
|
+
render(React.createElement(customApp?.App ?? App, {
|
|
41
42
|
commandProps: {
|
|
42
43
|
args: arguments_,
|
|
43
44
|
options: parsedOptions,
|
|
44
45
|
},
|
|
45
46
|
Component,
|
|
46
|
-
}));
|
|
47
|
+
}), customApp?.renderOptions?.(Component, parsedOptions));
|
|
47
48
|
}
|
|
48
49
|
/**
|
|
49
50
|
* Options or arguments the command's schema rejects are a usage error, reported through commander like its own
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-command.js","sourceRoot":"","sources":["../../../src/lib/pastel/render-command.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoC,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIpD,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,aAAa,MAAM,sBAAsB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,aAAa,CACzC,gBAAkC,EAClC,MAAsB,EACtB,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAsE;IAE1G,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC;IAEjC,4DAA4D;IAC5D,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,GAAG,gBAAgB,CAAC,IAAI,EAAE,kEAAkE,CAAC,CAAC;IAChH,CAAC;IAED,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S,EAAE,YAAY,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAE1D,MAAM,CACJ,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,GAAG,IAAI,GAAG,EAAE;QACzC,YAAY,EAAE;YACZ,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,aAAa;SACvB;QACD,SAAS;KACV,CAAC,EACF,SAAS,EAAE,aAAa,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,CACrD,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,gBAAkC,EAAE,KAAyC;IAChG,MAAM,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC,KAAK,EAAE,EAAE,kBAAkB,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,CAAC;IACpG,gBAAgB,CAAC,KAAK,CAAC,UAAU,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const NPM_DIST_TAGS_URL = "https://registry.npmjs.org/-/package/@detergent-software%2fatk/dist-tags";
|
|
3
3
|
/** How long the cached dist-tags stand before the check asks npm again; not the registry's `cacheTtlMinutes`. */
|
|
4
4
|
export declare const UPDATE_CHECK_INTERVAL_MS: number;
|
|
5
|
-
/** The
|
|
5
|
+
/** The background refresh of a missing or stale cache makes one attempt and gives up after this long, so it barely delays exit. */
|
|
6
6
|
export declare const BACKGROUND_REFRESH_TIMEOUT_MS = 1500;
|
|
7
7
|
/** `atk doctor`'s npm read, made on every run, is one attempt that gives up after this long, as its `/health` probe does. */
|
|
8
8
|
export declare const VERSION_STATUS_TIMEOUT_MS = 5000;
|
|
@@ -36,14 +36,18 @@ export interface VersionStatus {
|
|
|
36
36
|
}
|
|
37
37
|
type BannerListener = () => void;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
|
|
39
|
+
* The newer version of @detergent-software/atk the cached npm dist-tags name, or null. It reads the cache of any age
|
|
40
|
+
* and never asks npm before it answers, so a run decides its update banner or notice at once. A missing cache, or one
|
|
41
|
+
* older than {@link UPDATE_CHECK_INTERVAL_MS}, starts one background fetch (no retries,
|
|
42
|
+
* {@link BACKGROUND_REFRESH_TIMEOUT_MS}) that only rewrites the cache, for the next run. Null, reading nothing, when
|
|
43
|
+
* {@link updateCheckSwitch} names a switch. Never throws.
|
|
44
|
+
*/
|
|
45
|
+
export declare function cachedUpdateInfo(): Promise<null | UpdateInfo>;
|
|
46
|
+
/**
|
|
47
|
+
* The TTY update banner for this run: what {@link loadUpdateBanner} found, or null once {@link hideUpdateBanner} ran.
|
|
48
|
+
* A stable snapshot for `useSyncExternalStore`.
|
|
45
49
|
*/
|
|
46
|
-
export declare function
|
|
50
|
+
export declare function getUpdateBanner(): null | UpdateInfo;
|
|
47
51
|
/**
|
|
48
52
|
* This CLI's version and its channel's version on npm, whether or not that is newer. npm is asked
|
|
49
53
|
* every time, never the cache first, since a cache under a day old can miss a version tagged a moment
|
|
@@ -55,21 +59,23 @@ export declare function getUpdateInfo(): Promise<null | UpdateInfo>;
|
|
|
55
59
|
*/
|
|
56
60
|
export declare function getVersionStatus(): Promise<VersionStatus>;
|
|
57
61
|
/**
|
|
58
|
-
* Hide the TTY update banner for the rest of the run.
|
|
59
|
-
*
|
|
62
|
+
* Hide the TTY update banner for the rest of the run. The banner names a version newer than the one this process
|
|
63
|
+
* loaded, so `atk upgrade` (before its first frame) and `atk doctor --fix` (after its upgrade) hide it: it would
|
|
60
64
|
* tell the user to run the command that just ran (ATK-877).
|
|
61
65
|
*/
|
|
62
66
|
export declare function hideUpdateBanner(): void;
|
|
63
67
|
/** Whether {@link hideUpdateBanner} ran in this process (a stable snapshot for `useSyncExternalStore`). */
|
|
64
68
|
export declare function isUpdateBannerHidden(): boolean;
|
|
65
69
|
/**
|
|
66
|
-
* The update
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*
|
|
70
|
+
* The TTY update banner for this run, from {@link cachedUpdateInfo}. The App shell awaits it before its first frame,
|
|
71
|
+
* so the banner is in that frame and never arrives later: a print-once output already taller than the terminal would
|
|
72
|
+
* be written again, its top a second time (ATK-966). Never throws.
|
|
73
|
+
*/
|
|
74
|
+
export declare function loadUpdateBanner(read?: () => Promise<null | UpdateInfo>): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* The update check for JSON mode, which shows no banner. `cli.tsx` runs it before the command so the payload can
|
|
77
|
+
* carry the result: when {@link cachedUpdateInfo} names a newer version it records an `update-available` notice.
|
|
78
|
+
* Never throws.
|
|
73
79
|
*/
|
|
74
80
|
export declare function noteCachedUpdate(): Promise<void>;
|
|
75
81
|
/**
|
|
@@ -79,9 +85,9 @@ export declare function noteCachedUpdate(): Promise<void>;
|
|
|
79
85
|
* npm couldn't be read, or offline. For `atk upgrade`; doesn't throw.
|
|
80
86
|
*/
|
|
81
87
|
export declare function readDistTagsFresh(): Promise<DistTags | null>;
|
|
82
|
-
/**
|
|
88
|
+
/** Forget the run's banner and show it again once loaded. Intended for tests. */
|
|
83
89
|
export declare function resetUpdateBanner(): void;
|
|
84
|
-
/** Subscribe to {@link hideUpdateBanner}; returns the unsubscribe function. */
|
|
90
|
+
/** Subscribe to {@link loadUpdateBanner} and {@link hideUpdateBanner}; returns the unsubscribe function. */
|
|
85
91
|
export declare function subscribeUpdateBanner(listener: BannerListener): () => void;
|
|
86
92
|
/**
|
|
87
93
|
* The switch that turns the update check off, or null when it runs. An
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-check.d.ts","sourceRoot":"","sources":["../../src/lib/update-check.ts"],"names":[],"mappings":"AAWA,qFAAqF;AACrF,eAAO,MAAM,iBAAiB,6EAA6E,CAA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eAAe,IAAI,IAAI,GAAG,UAAU,CAEnD;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC,CA4B/D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAQvC;AAED,2GAA2G;AAC3G,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,GAAE,MAAM,OAAO,CAAC,IAAI,GAAG,UAAU,CAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAK/G;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAStD;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAWlE;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,IAAI,IAAI,CASxC;AAED,4GAA4G;AAC5G,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,IAAI,CAK1E;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,EAClC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,IAAI,GAAG,iBAAiB,CAK1B"}
|
|
@@ -12,21 +12,21 @@ export const NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/@detergen
|
|
|
12
12
|
const NPM_CACHE_FILE = 'npm-version.json';
|
|
13
13
|
/** How long the cached dist-tags stand before the check asks npm again; not the registry's `cacheTtlMinutes`. */
|
|
14
14
|
export const UPDATE_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
15
|
-
/** The
|
|
15
|
+
/** The background refresh of a missing or stale cache makes one attempt and gives up after this long, so it barely delays exit. */
|
|
16
16
|
export const BACKGROUND_REFRESH_TIMEOUT_MS = 1_500;
|
|
17
17
|
/** `atk doctor`'s npm read, made on every run, is one attempt that gives up after this long, as its `/health` probe does. */
|
|
18
18
|
export const VERSION_STATUS_TIMEOUT_MS = 5_000;
|
|
19
|
+
let bannerInfo = null;
|
|
19
20
|
let bannerHidden = false;
|
|
20
21
|
const bannerListeners = new Set();
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* network call.
|
|
23
|
+
* The newer version of @detergent-software/atk the cached npm dist-tags name, or null. It reads the cache of any age
|
|
24
|
+
* and never asks npm before it answers, so a run decides its update banner or notice at once. A missing cache, or one
|
|
25
|
+
* older than {@link UPDATE_CHECK_INTERVAL_MS}, starts one background fetch (no retries,
|
|
26
|
+
* {@link BACKGROUND_REFRESH_TIMEOUT_MS}) that only rewrites the cache, for the next run. Null, reading nothing, when
|
|
27
|
+
* {@link updateCheckSwitch} names a switch. Never throws.
|
|
28
28
|
*/
|
|
29
|
-
export async function
|
|
29
|
+
export async function cachedUpdateInfo() {
|
|
30
30
|
try {
|
|
31
31
|
const config = await loadConfig();
|
|
32
32
|
if (updateCheckSwitch(config)) {
|
|
@@ -36,32 +36,33 @@ export async function getUpdateInfo() {
|
|
|
36
36
|
const cacheDir = getCacheDir(config);
|
|
37
37
|
const cachePath = join(cacheDir, NPM_CACHE_FILE);
|
|
38
38
|
const cached = await readNpmCache(cachePath);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
await writeNpmCache(cachePath, cacheDir, tags);
|
|
39
|
+
if (!cached || cached.ageMs > UPDATE_CHECK_INTERVAL_MS) {
|
|
40
|
+
void fetchDistTags(BACKGROUND_REFRESH_TIMEOUT_MS).then(async (tags) => {
|
|
41
|
+
if (tags) {
|
|
42
|
+
await writeNpmCache(cachePath, cacheDir, tags);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
46
45
|
}
|
|
47
|
-
const latestVersion = tags[channel];
|
|
46
|
+
const latestVersion = cached?.tags[channel];
|
|
48
47
|
if (!latestVersion || !semverValid(CLI_VERSION) || !semverValid(latestVersion)) {
|
|
49
48
|
return null;
|
|
50
49
|
}
|
|
51
50
|
if (!semverGt(latestVersion, CLI_VERSION)) {
|
|
52
51
|
return null;
|
|
53
52
|
}
|
|
54
|
-
return {
|
|
55
|
-
channel,
|
|
56
|
-
currentVersion: CLI_VERSION,
|
|
57
|
-
latestVersion,
|
|
58
|
-
upgradeCommand: UPGRADE_COMMAND,
|
|
59
|
-
};
|
|
53
|
+
return { channel, currentVersion: CLI_VERSION, latestVersion, upgradeCommand: UPGRADE_COMMAND };
|
|
60
54
|
}
|
|
61
55
|
catch {
|
|
62
56
|
return null;
|
|
63
57
|
}
|
|
64
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* The TTY update banner for this run: what {@link loadUpdateBanner} found, or null once {@link hideUpdateBanner} ran.
|
|
61
|
+
* A stable snapshot for `useSyncExternalStore`.
|
|
62
|
+
*/
|
|
63
|
+
export function getUpdateBanner() {
|
|
64
|
+
return bannerHidden ? null : bannerInfo;
|
|
65
|
+
}
|
|
65
66
|
/**
|
|
66
67
|
* This CLI's version and its channel's version on npm, whether or not that is newer. npm is asked
|
|
67
68
|
* every time, never the cache first, since a cache under a day old can miss a version tagged a moment
|
|
@@ -100,8 +101,8 @@ export async function getVersionStatus() {
|
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
103
|
/**
|
|
103
|
-
* Hide the TTY update banner for the rest of the run.
|
|
104
|
-
*
|
|
104
|
+
* Hide the TTY update banner for the rest of the run. The banner names a version newer than the one this process
|
|
105
|
+
* loaded, so `atk upgrade` (before its first frame) and `atk doctor --fix` (after its upgrade) hide it: it would
|
|
105
106
|
* tell the user to run the command that just ran (ATK-877).
|
|
106
107
|
*/
|
|
107
108
|
export function hideUpdateBanner() {
|
|
@@ -118,42 +119,29 @@ export function isUpdateBannerHidden() {
|
|
|
118
119
|
return bannerHidden;
|
|
119
120
|
}
|
|
120
121
|
/**
|
|
121
|
-
* The update
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* notice, with no network call on the way. A missing or stale cache starts one
|
|
125
|
-
* background fetch (no retries, {@link BACKGROUND_REFRESH_TIMEOUT_MS}) that
|
|
126
|
-
* only rewrites the cache, for the next run. Does nothing when
|
|
127
|
-
* {@link updateCheckSwitch} names a switch. Never throws.
|
|
122
|
+
* The TTY update banner for this run, from {@link cachedUpdateInfo}. The App shell awaits it before its first frame,
|
|
123
|
+
* so the banner is in that frame and never arrives later: a print-once output already taller than the terminal would
|
|
124
|
+
* be written again, its top a second time (ATK-966). Never throws.
|
|
128
125
|
*/
|
|
129
|
-
export async function
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
const channel = isPreRelease() ? 'dev' : 'latest';
|
|
136
|
-
const cacheDir = getCacheDir(config);
|
|
137
|
-
const cachePath = join(cacheDir, NPM_CACHE_FILE);
|
|
138
|
-
const cached = await readNpmCache(cachePath);
|
|
139
|
-
const version = cached?.tags[channel];
|
|
140
|
-
if (version && semverValid(CLI_VERSION) && semverValid(version) && semverGt(version, CLI_VERSION)) {
|
|
141
|
-
addNotice({
|
|
142
|
-
command: UPGRADE_COMMAND,
|
|
143
|
-
kind: 'update-available',
|
|
144
|
-
text: `ATK ${version} is available (this is ${CLI_VERSION}). Run \`${UPGRADE_COMMAND}\` to update.`,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
if (!cached || cached.ageMs > UPDATE_CHECK_INTERVAL_MS) {
|
|
148
|
-
void fetchDistTags(BACKGROUND_REFRESH_TIMEOUT_MS).then(async (tags) => {
|
|
149
|
-
if (tags) {
|
|
150
|
-
await writeNpmCache(cachePath, cacheDir, tags);
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
126
|
+
export async function loadUpdateBanner(read = cachedUpdateInfo) {
|
|
127
|
+
bannerInfo = await read().catch(() => null);
|
|
128
|
+
for (const listener of bannerListeners) {
|
|
129
|
+
listener();
|
|
154
130
|
}
|
|
155
|
-
|
|
156
|
-
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The update check for JSON mode, which shows no banner. `cli.tsx` runs it before the command so the payload can
|
|
134
|
+
* carry the result: when {@link cachedUpdateInfo} names a newer version it records an `update-available` notice.
|
|
135
|
+
* Never throws.
|
|
136
|
+
*/
|
|
137
|
+
export async function noteCachedUpdate() {
|
|
138
|
+
const info = await cachedUpdateInfo();
|
|
139
|
+
if (info) {
|
|
140
|
+
addNotice({
|
|
141
|
+
command: info.upgradeCommand,
|
|
142
|
+
kind: 'update-available',
|
|
143
|
+
text: `ATK ${info.latestVersion} is available (this is ${info.currentVersion}). Run \`${info.upgradeCommand}\` to update.`,
|
|
144
|
+
});
|
|
157
145
|
}
|
|
158
146
|
}
|
|
159
147
|
/**
|
|
@@ -175,17 +163,18 @@ export async function readDistTagsFresh() {
|
|
|
175
163
|
}
|
|
176
164
|
return tags;
|
|
177
165
|
}
|
|
178
|
-
/**
|
|
166
|
+
/** Forget the run's banner and show it again once loaded. Intended for tests. */
|
|
179
167
|
export function resetUpdateBanner() {
|
|
180
|
-
if (!bannerHidden) {
|
|
168
|
+
if (!bannerHidden && !bannerInfo) {
|
|
181
169
|
return;
|
|
182
170
|
}
|
|
183
171
|
bannerHidden = false;
|
|
172
|
+
bannerInfo = null;
|
|
184
173
|
for (const listener of bannerListeners) {
|
|
185
174
|
listener();
|
|
186
175
|
}
|
|
187
176
|
}
|
|
188
|
-
/** Subscribe to {@link hideUpdateBanner}; returns the unsubscribe function. */
|
|
177
|
+
/** Subscribe to {@link loadUpdateBanner} and {@link hideUpdateBanner}; returns the unsubscribe function. */
|
|
189
178
|
export function subscribeUpdateBanner(listener) {
|
|
190
179
|
bannerListeners.add(listener);
|
|
191
180
|
return () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-check.js","sourceRoot":"","sources":["../../src/lib/update-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3G,qFAAqF;AACrF,MAAM,CAAC,MAAM,iBAAiB,GAAG,0EAA0E,CAAC;AAC5G,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAE1C,iHAAiH;AACjH,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE5D,
|
|
1
|
+
{"version":3,"file":"update-check.js","sourceRoot":"","sources":["../../src/lib/update-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAA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AAG,MAAM,IAAI,CAAC,SAAS,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;QAC1E,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,wFAAwF;AACxF,KAAK,UAAU,aAAa,CAAC,SAAiB,EAAE,QAAgB,EAAE,IAAc;IAC9E,IAAI,CAAC;QACH,MAAM,IAAI,GAAiB,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;QAE9D,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC1B,MAAM,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC;QACD,MAAM,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAAC,MAAM,CAAC;QACP,uDAAuD;IACzD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@detergent-software/atk",
|
|
3
|
-
"version": "9.6.1-dev.
|
|
3
|
+
"version": "9.6.1-dev.15",
|
|
4
4
|
"description": "Agentic Tool Kit — CLI for managing AI coding tool assets.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"tsx": "^4.23.15",
|
|
63
63
|
"typescript": "~6.0.3",
|
|
64
64
|
"vitest": "^5.0.5",
|
|
65
|
-
"@atk/
|
|
66
|
-
"@atk/
|
|
65
|
+
"@atk/eslint-config": "0.0.0",
|
|
66
|
+
"@atk/tsconfig": "0.0.0"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"build": "pnpm manifest && tsc",
|