@supatype/cli 0.1.1 → 0.1.2
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +114 -90
- package/.turbo/turbo-typecheck.log +2 -2
- package/dist/binary-cache.d.ts +2 -0
- package/dist/binary-cache.d.ts.map +1 -1
- package/dist/binary-cache.js +36 -0
- package/dist/binary-cache.js.map +1 -1
- package/dist/binary-download-lock.d.ts +12 -0
- package/dist/binary-download-lock.d.ts.map +1 -0
- package/dist/binary-download-lock.js +106 -0
- package/dist/binary-download-lock.js.map +1 -0
- package/dist/cli-package-version.d.ts +3 -0
- package/dist/cli-package-version.d.ts.map +1 -0
- package/dist/cli-package-version.js +15 -0
- package/dist/cli-package-version.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +5 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/add.js +25 -19
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/admin.d.ts.map +1 -1
- package/dist/commands/admin.js +22 -6
- package/dist/commands/admin.js.map +1 -1
- package/dist/commands/cache.d.ts +1 -1
- package/dist/commands/cache.d.ts.map +1 -1
- package/dist/commands/cache.js +98 -5
- package/dist/commands/cache.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +26 -22
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/init.d.ts +3 -4
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +238 -168
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/link-helpers.d.ts.map +1 -1
- package/dist/commands/link-helpers.js +26 -25
- package/dist/commands/link-helpers.js.map +1 -1
- package/dist/compose-local-server-image.d.ts +13 -0
- package/dist/compose-local-server-image.d.ts.map +1 -0
- package/dist/compose-local-server-image.js +57 -0
- package/dist/compose-local-server-image.js.map +1 -0
- package/dist/compose-rename.d.ts.map +1 -1
- package/dist/compose-rename.js +5 -8
- package/dist/compose-rename.js.map +1 -1
- package/dist/dev-compose.d.ts.map +1 -1
- package/dist/dev-compose.js +111 -54
- package/dist/dev-compose.js.map +1 -1
- package/dist/dev-log-bus.d.ts +5 -0
- package/dist/dev-log-bus.d.ts.map +1 -1
- package/dist/dev-log-bus.js +14 -0
- package/dist/dev-log-bus.js.map +1 -1
- package/dist/dev-log-filter.d.ts +4 -0
- package/dist/dev-log-filter.d.ts.map +1 -1
- package/dist/dev-log-filter.js +52 -0
- package/dist/dev-log-filter.js.map +1 -1
- package/dist/dev-ports.d.ts.map +1 -1
- package/dist/dev-ports.js +19 -12
- package/dist/dev-ports.js.map +1 -1
- package/dist/dev-ready-panel.d.ts +19 -0
- package/dist/dev-ready-panel.d.ts.map +1 -0
- package/dist/dev-ready-panel.js +49 -0
- package/dist/dev-ready-panel.js.map +1 -0
- package/dist/dev-session-lock.d.ts.map +1 -1
- package/dist/dev-session-lock.js +5 -8
- package/dist/dev-session-lock.js.map +1 -1
- package/dist/dev-session.d.ts +18 -5
- package/dist/dev-session.d.ts.map +1 -1
- package/dist/dev-session.js +91 -18
- package/dist/dev-session.js.map +1 -1
- package/dist/dev-shutdown.d.ts +2 -0
- package/dist/dev-shutdown.d.ts.map +1 -1
- package/dist/dev-shutdown.js +29 -15
- package/dist/dev-shutdown.js.map +1 -1
- package/dist/dev-task-colors.d.ts +3 -1
- package/dist/dev-task-colors.d.ts.map +1 -1
- package/dist/dev-task-colors.js +23 -3
- package/dist/dev-task-colors.js.map +1 -1
- package/dist/docker-runtime.js +1 -1
- package/dist/docker-runtime.js.map +1 -1
- package/dist/engine-push-output.d.ts +1 -0
- package/dist/engine-push-output.d.ts.map +1 -1
- package/dist/engine-push-output.js +4 -1
- package/dist/engine-push-output.js.map +1 -1
- package/dist/ensure-binary.d.ts.map +1 -1
- package/dist/ensure-binary.js +14 -2
- package/dist/ensure-binary.js.map +1 -1
- package/dist/ensure-component-binaries.d.ts +17 -0
- package/dist/ensure-component-binaries.d.ts.map +1 -0
- package/dist/ensure-component-binaries.js +45 -0
- package/dist/ensure-component-binaries.js.map +1 -0
- package/dist/ensure-dev-api-config.d.ts +3 -0
- package/dist/ensure-dev-api-config.d.ts.map +1 -0
- package/dist/ensure-dev-api-config.js +17 -0
- package/dist/ensure-dev-api-config.js.map +1 -0
- package/dist/init-dependency-versions.d.ts +13 -0
- package/dist/init-dependency-versions.d.ts.map +1 -0
- package/dist/init-dependency-versions.js +53 -0
- package/dist/init-dependency-versions.js.map +1 -0
- package/dist/init-package-json.d.ts +21 -0
- package/dist/init-package-json.d.ts.map +1 -0
- package/dist/init-package-json.js +46 -0
- package/dist/init-package-json.js.map +1 -0
- package/dist/postgres-ctl.d.ts.map +1 -1
- package/dist/postgres-ctl.js +2 -1
- package/dist/postgres-ctl.js.map +1 -1
- package/dist/required-host-components.d.ts +11 -0
- package/dist/required-host-components.d.ts.map +1 -0
- package/dist/required-host-components.js +25 -0
- package/dist/required-host-components.js.map +1 -0
- package/dist/resolve-api-url.d.ts +6 -0
- package/dist/resolve-api-url.d.ts.map +1 -0
- package/dist/resolve-api-url.js +39 -0
- package/dist/resolve-api-url.js.map +1 -0
- package/dist/rest-cache-admin.d.ts +33 -0
- package/dist/rest-cache-admin.d.ts.map +1 -0
- package/dist/rest-cache-admin.js +96 -0
- package/dist/rest-cache-admin.js.map +1 -0
- package/dist/scripts/postinstall.d.ts +4 -6
- package/dist/scripts/postinstall.d.ts.map +1 -1
- package/dist/scripts/postinstall.js +8 -41
- package/dist/scripts/postinstall.js.map +1 -1
- package/dist/self-host-compose.d.ts.map +1 -1
- package/dist/self-host-compose.js +23 -13
- package/dist/self-host-compose.js.map +1 -1
- package/dist/studio-dev-server.d.ts +4 -2
- package/dist/studio-dev-server.d.ts.map +1 -1
- package/dist/studio-dev-server.js +3 -2
- package/dist/studio-dev-server.js.map +1 -1
- package/dist/ui/brand.d.ts +2 -5
- package/dist/ui/brand.d.ts.map +1 -1
- package/dist/ui/brand.js +2 -7
- package/dist/ui/brand.js.map +1 -1
- package/dist/ui/clack-api.d.ts +44 -0
- package/dist/ui/clack-api.d.ts.map +1 -0
- package/dist/ui/clack-api.js +76 -0
- package/dist/ui/clack-api.js.map +1 -0
- package/dist/ui/clack.d.ts +14 -0
- package/dist/ui/clack.d.ts.map +1 -0
- package/dist/ui/clack.js +147 -0
- package/dist/ui/clack.js.map +1 -0
- package/dist/ui/components/FlowSpinner.d.ts +5 -0
- package/dist/ui/components/FlowSpinner.d.ts.map +1 -0
- package/dist/ui/components/FlowSpinner.js +8 -0
- package/dist/ui/components/FlowSpinner.js.map +1 -0
- package/dist/ui/components/LogoWordmark.d.ts +9 -0
- package/dist/ui/components/LogoWordmark.d.ts.map +1 -0
- package/dist/ui/components/LogoWordmark.js +17 -0
- package/dist/ui/components/LogoWordmark.js.map +1 -0
- package/dist/ui/components/PromptPanel.d.ts +5 -0
- package/dist/ui/components/PromptPanel.d.ts.map +1 -0
- package/dist/ui/components/PromptPanel.js +7 -0
- package/dist/ui/components/PromptPanel.js.map +1 -0
- package/dist/ui/components/SelectField.d.ts +11 -0
- package/dist/ui/components/SelectField.d.ts.map +1 -0
- package/dist/ui/components/SelectField.js +19 -0
- package/dist/ui/components/SelectField.js.map +1 -0
- package/dist/ui/confirm.d.ts +2 -1
- package/dist/ui/confirm.d.ts.map +1 -1
- package/dist/ui/confirm.js +4 -4
- package/dist/ui/confirm.js.map +1 -1
- package/dist/ui/dev/DevDashboard.d.ts +8 -0
- package/dist/ui/dev/DevDashboard.d.ts.map +1 -0
- package/dist/ui/dev/DevDashboard.js +151 -0
- package/dist/ui/dev/DevDashboard.js.map +1 -0
- package/dist/ui/dev/DevReadyPanelView.d.ts +7 -0
- package/dist/ui/dev/DevReadyPanelView.d.ts.map +1 -0
- package/dist/ui/dev/DevReadyPanelView.js +29 -0
- package/dist/ui/dev/DevReadyPanelView.js.map +1 -0
- package/dist/ui/fatal.d.ts.map +1 -1
- package/dist/ui/fatal.js +5 -11
- package/dist/ui/fatal.js.map +1 -1
- package/dist/ui/flows/FlowApp.d.ts +8 -0
- package/dist/ui/flows/FlowApp.d.ts.map +1 -0
- package/dist/ui/flows/FlowApp.js +42 -0
- package/dist/ui/flows/FlowApp.js.map +1 -0
- package/dist/ui/flows/prompt-fields.d.ts +48 -0
- package/dist/ui/flows/prompt-fields.d.ts.map +1 -0
- package/dist/ui/flows/prompt-fields.js +88 -0
- package/dist/ui/flows/prompt-fields.js.map +1 -0
- package/dist/ui/flows/types.d.ts +41 -0
- package/dist/ui/flows/types.d.ts.map +1 -0
- package/dist/ui/flows/types.js +2 -0
- package/dist/ui/flows/types.js.map +1 -0
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui/messages.d.ts +1 -0
- package/dist/ui/messages.d.ts.map +1 -1
- package/dist/ui/messages.js +48 -8
- package/dist/ui/messages.js.map +1 -1
- package/dist/ui/progress.d.ts +5 -1
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +12 -3
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/prompts.d.ts +7 -5
- package/dist/ui/prompts.d.ts.map +1 -1
- package/dist/ui/prompts.js +15 -8
- package/dist/ui/prompts.js.map +1 -1
- package/dist/ui/runtime/cancel.d.ts +4 -0
- package/dist/ui/runtime/cancel.d.ts.map +1 -0
- package/dist/ui/runtime/cancel.js +6 -0
- package/dist/ui/runtime/cancel.js.map +1 -0
- package/dist/ui/runtime/command-chrome.d.ts +17 -0
- package/dist/ui/runtime/command-chrome.d.ts.map +1 -0
- package/dist/ui/runtime/command-chrome.js +123 -0
- package/dist/ui/runtime/command-chrome.js.map +1 -0
- package/dist/ui/runtime/dev-prompt-queue.d.ts +30 -0
- package/dist/ui/runtime/dev-prompt-queue.d.ts.map +1 -0
- package/dist/ui/runtime/dev-prompt-queue.js +57 -0
- package/dist/ui/runtime/dev-prompt-queue.js.map +1 -0
- package/dist/ui/runtime/flow-session.d.ts +4 -0
- package/dist/ui/runtime/flow-session.d.ts.map +1 -0
- package/dist/ui/runtime/flow-session.js +8 -0
- package/dist/ui/runtime/flow-session.js.map +1 -0
- package/dist/ui/runtime/run-clack-flow.d.ts +5 -0
- package/dist/ui/runtime/run-clack-flow.d.ts.map +1 -0
- package/dist/ui/runtime/run-clack-flow.js +34 -0
- package/dist/ui/runtime/run-clack-flow.js.map +1 -0
- package/dist/ui/theme.d.ts +24 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +34 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/valkey-sidecar.d.ts +17 -0
- package/dist/valkey-sidecar.d.ts.map +1 -0
- package/dist/valkey-sidecar.js +94 -0
- package/dist/valkey-sidecar.js.map +1 -0
- package/package.json +9 -3
- package/src/binary-cache.ts +61 -0
- package/src/binary-download-lock.ts +124 -0
- package/src/cli-package-version.ts +15 -0
- package/src/cli.ts +6 -2
- package/src/commands/add.ts +26 -19
- package/src/commands/admin.ts +24 -6
- package/src/commands/cache.ts +105 -5
- package/src/commands/dev.ts +26 -21
- package/src/commands/init.ts +124 -45
- package/src/commands/link-helpers.ts +30 -29
- package/src/compose-local-server-image.ts +68 -0
- package/src/compose-rename.ts +5 -8
- package/src/dev-compose.ts +136 -51
- package/src/dev-log-bus.ts +18 -0
- package/src/dev-log-filter.ts +42 -0
- package/src/dev-ports.ts +22 -11
- package/src/dev-ready-panel.ts +63 -0
- package/src/dev-session-lock.ts +5 -8
- package/src/dev-session.ts +98 -18
- package/src/dev-shutdown.ts +29 -17
- package/src/dev-task-colors.ts +22 -3
- package/src/docker-runtime.ts +1 -1
- package/src/engine-push-output.ts +5 -1
- package/src/ensure-binary.ts +21 -1
- package/src/ensure-component-binaries.ts +71 -0
- package/src/ensure-dev-api-config.ts +18 -0
- package/src/init-dependency-versions.ts +69 -0
- package/src/init-package-json.ts +63 -0
- package/src/postgres-ctl.ts +2 -1
- package/src/required-host-components.ts +37 -0
- package/src/resolve-api-url.ts +43 -0
- package/src/rest-cache-admin.ts +135 -0
- package/src/scripts/postinstall.ts +9 -46
- package/src/self-host-compose.ts +22 -12
- package/src/studio-dev-server.ts +5 -4
- package/src/ui/README.md +13 -9
- package/src/ui/brand.ts +2 -8
- package/src/ui/clack-api.ts +123 -0
- package/src/ui/clack.ts +153 -0
- package/src/ui/components/FlowSpinner.tsx +15 -0
- package/src/ui/components/LogoWordmark.tsx +36 -0
- package/src/ui/components/PromptPanel.tsx +17 -0
- package/src/ui/components/SelectField.tsx +58 -0
- package/src/ui/confirm.ts +5 -4
- package/src/ui/dev/DevDashboard.tsx +213 -0
- package/src/ui/dev/DevReadyPanelView.tsx +67 -0
- package/src/ui/fatal.ts +5 -10
- package/src/ui/flows/FlowApp.tsx +67 -0
- package/src/ui/flows/prompt-fields.tsx +192 -0
- package/src/ui/flows/types.ts +50 -0
- package/src/ui/index.ts +1 -1
- package/src/ui/messages.ts +50 -8
- package/src/ui/progress.ts +14 -3
- package/src/ui/prompts.ts +17 -9
- package/src/ui/runtime/cancel.ts +6 -0
- package/src/ui/runtime/command-chrome.ts +147 -0
- package/src/ui/runtime/dev-prompt-queue.ts +84 -0
- package/src/ui/runtime/flow-session.ts +11 -0
- package/src/ui/runtime/run-clack-flow.tsx +52 -0
- package/src/ui/theme.ts +41 -0
- package/src/valkey-sidecar.ts +126 -0
- package/tests/binary-cache-cloud-overrides.test.ts +2 -2
- package/tests/binary-download-lock.test.ts +41 -0
- package/tests/cli-help.test.ts +7 -4
- package/tests/cli-package-version.test.ts +15 -0
- package/tests/command-chrome-coverage.test.ts +149 -0
- package/tests/command-chrome-wrap.test.ts +51 -0
- package/tests/config.test.ts +8 -4
- package/tests/dev-ready-panel.test.ts +20 -0
- package/tests/dev-ui.test.ts +42 -2
- package/tests/docker-runtime.test.ts +9 -20
- package/tests/ensure-dev-api-config.test.ts +22 -0
- package/tests/init-dependency-versions.test.ts +62 -0
- package/tests/init-package-json.test.ts +18 -0
- package/tests/init.test.ts +30 -3
- package/tests/required-host-components.test.ts +51 -0
- package/tests/resolve-api-url.test.ts +23 -0
- package/tests/rest-cache-admin.test.ts +28 -0
- package/tests/runtime-contract.test.ts +12 -3
- package/tests/tsconfig.json +8 -2
- package/tests/ui-confirm.test.ts +13 -9
- package/tests/ui-messages.test.ts +4 -18
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/vitest.config.ts +3 -0
- package/dist/dev-tui.d.ts +0 -24
- package/dist/dev-tui.d.ts.map +0 -1
- package/dist/dev-tui.js +0 -188
- package/dist/dev-tui.js.map +0 -1
- package/src/dev-tui.ts +0 -232
package/dist/ui/messages.js
CHANGED
|
@@ -1,35 +1,75 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getActiveFlowApi } from "./runtime/flow-session.js";
|
|
2
2
|
import { isInteractive } from "./interactive.js";
|
|
3
|
+
import { plainError, plainInfo, plainSuccess, plainWarn } from "./theme.js";
|
|
3
4
|
export const SUPATYPE_PREFIX = "[supatype]";
|
|
5
|
+
function writePlain(message = "") {
|
|
6
|
+
console.log(message);
|
|
7
|
+
}
|
|
4
8
|
export function info(message) {
|
|
9
|
+
const api = getActiveFlowApi();
|
|
10
|
+
if (api) {
|
|
11
|
+
api.log.info(message);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
5
14
|
if (isInteractive()) {
|
|
6
|
-
|
|
15
|
+
writePlain(plainInfo(message));
|
|
7
16
|
return;
|
|
8
17
|
}
|
|
9
|
-
|
|
18
|
+
writePlain(`${SUPATYPE_PREFIX} ${message}`);
|
|
10
19
|
}
|
|
11
20
|
export function warn(message) {
|
|
21
|
+
const api = getActiveFlowApi();
|
|
22
|
+
if (api) {
|
|
23
|
+
api.log.warn(message);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
12
26
|
if (isInteractive()) {
|
|
13
|
-
|
|
27
|
+
writePlain(plainWarn(message));
|
|
14
28
|
return;
|
|
15
29
|
}
|
|
16
30
|
console.warn(`${SUPATYPE_PREFIX} ${message}`);
|
|
17
31
|
}
|
|
18
32
|
export function error(message) {
|
|
33
|
+
const api = getActiveFlowApi();
|
|
34
|
+
if (api) {
|
|
35
|
+
api.log.error(message);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
19
38
|
if (isInteractive()) {
|
|
20
|
-
|
|
39
|
+
writePlain(plainError(message));
|
|
21
40
|
return;
|
|
22
41
|
}
|
|
23
42
|
console.error(`${SUPATYPE_PREFIX} ${message}`);
|
|
24
43
|
}
|
|
25
44
|
/** Unprefixed line (tables, diff output, blank lines). */
|
|
26
45
|
export function plain(message = "") {
|
|
27
|
-
|
|
46
|
+
const api = getActiveFlowApi();
|
|
47
|
+
if (api) {
|
|
48
|
+
if (message === "") {
|
|
49
|
+
api.note("");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
api.note(message);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
writePlain(message);
|
|
28
56
|
}
|
|
29
57
|
export function step(title) {
|
|
30
|
-
|
|
58
|
+
plain(`\n${title}`);
|
|
31
59
|
}
|
|
32
60
|
export function file(action, rel) {
|
|
33
|
-
|
|
61
|
+
plain(` ${action} ${rel}`);
|
|
62
|
+
}
|
|
63
|
+
export function success(message) {
|
|
64
|
+
const api = getActiveFlowApi();
|
|
65
|
+
if (api) {
|
|
66
|
+
api.log.success(message);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (isInteractive()) {
|
|
70
|
+
writePlain(plainSuccess(message));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
plain(`${SUPATYPE_PREFIX} ${message}`);
|
|
34
74
|
}
|
|
35
75
|
//# sourceMappingURL=messages.js.map
|
package/dist/ui/messages.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/ui/messages.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/ui/messages.ts"],"names":[],"mappings":"AAAA,OAAO,E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.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Progress UI for one-shot commands — Ink spinner inside command chrome.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Show progress with the branded Ink spinner when command chrome is active
|
|
6
|
+
* (or mount chrome for a standalone spinner).
|
|
3
7
|
*/
|
|
4
8
|
export declare function withSpinner<T>(message: string, task: () => Promise<T>, doneMessage?: string): Promise<T>;
|
|
5
9
|
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/ui/progress.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/ui/progress.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH;;;GAGG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACtB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,CAAC,CAAC,CAqBZ"}
|
package/dist/ui/progress.js
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Progress UI for one-shot commands — Ink spinner inside command chrome.
|
|
3
|
+
*/
|
|
4
|
+
import { getActiveFlowApi } from "./runtime/flow-session.js";
|
|
2
5
|
import { isInteractive } from "./interactive.js";
|
|
3
6
|
import { info } from "./messages.js";
|
|
7
|
+
import { runCommandChrome } from "./runtime/command-chrome.js";
|
|
4
8
|
/**
|
|
5
|
-
*
|
|
9
|
+
* Show progress with the branded Ink spinner when command chrome is active
|
|
10
|
+
* (or mount chrome for a standalone spinner).
|
|
6
11
|
*/
|
|
7
12
|
export async function withSpinner(message, task, doneMessage) {
|
|
8
13
|
if (!isInteractive()) {
|
|
9
14
|
info(`${message}...`);
|
|
10
15
|
return task();
|
|
11
16
|
}
|
|
12
|
-
const
|
|
17
|
+
const api = getActiveFlowApi();
|
|
18
|
+
if (!api) {
|
|
19
|
+
return runCommandChrome(() => withSpinner(message, task, doneMessage));
|
|
20
|
+
}
|
|
21
|
+
const spinner = api.spinner();
|
|
13
22
|
spinner.start(message);
|
|
14
23
|
try {
|
|
15
24
|
const result = await task();
|
package/dist/ui/progress.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/ui/progress.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/ui/progress.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAE9D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAe,EACf,IAAsB,EACtB,WAAoB;IAEpB,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;QACrB,IAAI,CAAC,GAAG,OAAO,KAAK,CAAC,CAAA;QACrB,OAAO,IAAI,EAAE,CAAA;IACf,CAAC;IAED,MAAM,GAAG,GAAG,gBAAgB,EAAE,CAAA;IAC9B,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,gBAAgB,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAA;IACxE,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAA;IAC7B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACtB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAA;QAC3B,OAAO,CAAC,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,CAAA;QACpC,OAAO,MAAM,CAAA;IACf,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACtB,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC"}
|
package/dist/ui/prompts.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CLACK_CANCEL } from "./clack.js";
|
|
2
2
|
/** Print the coloured Supatype ASCII wordmark at the top of an interactive command. */
|
|
3
3
|
export declare function printLogo(): void;
|
|
4
4
|
/**
|
|
5
|
-
* Unwrap a
|
|
5
|
+
* Unwrap a prompt result, exiting cleanly when the user cancels (Ctrl-C).
|
|
6
6
|
*/
|
|
7
|
-
export declare function ensureNotCancelled<T>(value: T |
|
|
8
|
-
/** Single-line text input
|
|
7
|
+
export declare function ensureNotCancelled<T>(value: T | typeof CLACK_CANCEL, cancelMessage?: string): T;
|
|
8
|
+
/** Single-line text input (TTY only). */
|
|
9
9
|
export declare function promptText(message: string, opts?: {
|
|
10
10
|
defaultValue?: string;
|
|
11
11
|
placeholder?: string;
|
|
12
12
|
}): Promise<string>;
|
|
13
|
-
|
|
13
|
+
/** Masked password input (TTY only). */
|
|
14
|
+
export declare function promptPassword(message: string): Promise<string>;
|
|
15
|
+
export { p, clack, isCancel, CLACK_CANCEL, runClackFlow } from "./clack.js";
|
|
14
16
|
//# sourceMappingURL=prompts.d.ts.map
|
package/dist/ui/prompts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/ui/prompts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/ui/prompts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAe,MAAM,YAAY,CAAA;AAEtD,uFAAuF;AACvF,wBAAgB,SAAS,IAAI,IAAI,CAIhC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,YAAY,EAAE,aAAa,SAAe,GAAG,CAAC,CAKrG;AAED,yCAAyC;AACzC,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACrD,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED,wCAAwC;AACxC,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAMrE;AAED,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/ui/prompts.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { SUPATYPE_ASCII_LOGO_WORDMARK, colorLogoLines } from "../dev-logo.js";
|
|
3
|
-
import { plain } from "./messages.js";
|
|
1
|
+
import { colorLogoLines, SUPATYPE_ASCII_LOGO_WORDMARK } from "../dev-logo.js";
|
|
4
2
|
import { isInteractive } from "./interactive.js";
|
|
3
|
+
import { plain } from "./messages.js";
|
|
4
|
+
import { isCancel, p } from "./clack.js";
|
|
5
5
|
/** Print the coloured Supatype ASCII wordmark at the top of an interactive command. */
|
|
6
6
|
export function printLogo() {
|
|
7
7
|
plain();
|
|
@@ -9,16 +9,15 @@ export function printLogo() {
|
|
|
9
9
|
plain();
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* Unwrap a
|
|
12
|
+
* Unwrap a prompt result, exiting cleanly when the user cancels (Ctrl-C).
|
|
13
13
|
*/
|
|
14
14
|
export function ensureNotCancelled(value, cancelMessage = "Cancelled.") {
|
|
15
|
-
if (
|
|
15
|
+
if (isCancel(value)) {
|
|
16
16
|
p.cancel(cancelMessage);
|
|
17
|
-
process.exit(0);
|
|
18
17
|
}
|
|
19
18
|
return value;
|
|
20
19
|
}
|
|
21
|
-
/** Single-line text input
|
|
20
|
+
/** Single-line text input (TTY only). */
|
|
22
21
|
export async function promptText(message, opts) {
|
|
23
22
|
if (!isInteractive()) {
|
|
24
23
|
throw new Error(`Cannot prompt for "${message}" in non-interactive mode.`);
|
|
@@ -30,5 +29,13 @@ export async function promptText(message, opts) {
|
|
|
30
29
|
});
|
|
31
30
|
return ensureNotCancelled(value).trim();
|
|
32
31
|
}
|
|
33
|
-
|
|
32
|
+
/** Masked password input (TTY only). */
|
|
33
|
+
export async function promptPassword(message) {
|
|
34
|
+
if (!isInteractive()) {
|
|
35
|
+
throw new Error(`Cannot prompt for "${message}" in non-interactive mode.`);
|
|
36
|
+
}
|
|
37
|
+
const value = await p.password({ message });
|
|
38
|
+
return ensureNotCancelled(value).trim();
|
|
39
|
+
}
|
|
40
|
+
export { p, clack, isCancel, CLACK_CANCEL, runClackFlow } from "./clack.js";
|
|
34
41
|
//# sourceMappingURL=prompts.js.map
|
package/dist/ui/prompts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/ui/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/ui/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAgB,QAAQ,EAAE,CAAC,EAAE,MAAM,YAAY,CAAA;AAEtD,uFAAuF;AACvF,MAAM,UAAU,SAAS;IACvB,KAAK,EAAE,CAAA;IACP,KAAK,C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C,CAAA;IAC3C,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAA;AACzC,CAAC;AAED,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../../src/ui/runtime/cancel.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,eAAO,MAAM,YAAY,eAA4B,CAAA;AAErD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,YAAY,CAErE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../../src/ui/runtime/cancel.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAA;AAErD,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,KAAK,KAAK,YAAY,CAAA;AAC/B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Branded Ink chrome for one-shot CLI commands (push, diff, adopt, …).
|
|
3
|
+
* Reuses the flow shell: figlet logo, coloured log pane, ink-spinner, prompts.
|
|
4
|
+
*/
|
|
5
|
+
import type { Command } from "commander";
|
|
6
|
+
/**
|
|
7
|
+
* Run a command body inside the branded Ink shell (logo + logs + spinner).
|
|
8
|
+
* Falls back to plain stdout when not interactive.
|
|
9
|
+
*/
|
|
10
|
+
export declare function runCommandChrome<T>(fn: () => Promise<T>): Promise<T>;
|
|
11
|
+
/** True while `runCommandChrome` / `runClackFlow` is active. */
|
|
12
|
+
export declare function isCommandChromeActive(): boolean;
|
|
13
|
+
/** Whether a registered command path should skip automatic command chrome. */
|
|
14
|
+
export declare function shouldExcludeCommandChrome(commandPath: string): boolean;
|
|
15
|
+
/** Wrap every leaf command action with branded Ink chrome (see exclusions above). */
|
|
16
|
+
export declare function wrapProgramActionsWithChrome(program: Command): void;
|
|
17
|
+
//# sourceMappingURL=command-chrome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-chrome.d.ts","sourceRoot":"","sources":["../../../src/ui/runtime/command-chrome.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA8DxC;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAa1E;AAED,gEAAgE;AAChE,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C;AAqBD,8EAA8E;AAC9E,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAKvE;AAqBD,qFAAqF;AACrF,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAQnE"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Branded Ink chrome for one-shot CLI commands (push, diff, adopt, …).
|
|
3
|
+
* Reuses the flow shell: figlet logo, coloured log pane, ink-spinner, prompts.
|
|
4
|
+
*/
|
|
5
|
+
import { getActiveFlowApi } from "./flow-session.js";
|
|
6
|
+
import { runClackFlow } from "../clack.js";
|
|
7
|
+
import { isInteractive } from "../interactive.js";
|
|
8
|
+
import { filterCommandLogLine, formatConsoleArgs, stripAnsi, } from "../../dev-log-filter.js";
|
|
9
|
+
function patchConsoleForCommand(api) {
|
|
10
|
+
const original = {
|
|
11
|
+
log: console.log,
|
|
12
|
+
warn: console.warn,
|
|
13
|
+
error: console.error,
|
|
14
|
+
};
|
|
15
|
+
const emitLine = (raw, stream) => {
|
|
16
|
+
if (!filterCommandLogLine(raw))
|
|
17
|
+
return;
|
|
18
|
+
const t = stripAnsi(raw).trim();
|
|
19
|
+
if (!t)
|
|
20
|
+
return;
|
|
21
|
+
const stripped = t.replace(/^\[supatype\]\s*/, "");
|
|
22
|
+
if (stream === "error" || stripped.startsWith("✗")) {
|
|
23
|
+
api.log.error(stripped.replace(/^✗\s*/, ""));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (stream === "warn" || stripped.startsWith("⚠")) {
|
|
27
|
+
api.log.warn(stripped.replace(/^⚠\s*/, ""));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (stripped.startsWith("✓")) {
|
|
31
|
+
api.log.success(stripped.replace(/^✓\s*/, ""));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (/\[supatype\]/.test(raw)) {
|
|
35
|
+
api.log.info(stripped);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
api.note(t);
|
|
39
|
+
};
|
|
40
|
+
const wrap = (stream) => (...args) => {
|
|
41
|
+
for (const part of formatConsoleArgs(args).split(/\r?\n/)) {
|
|
42
|
+
emitLine(part, stream);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
console.log = wrap("log");
|
|
46
|
+
console.warn = wrap("warn");
|
|
47
|
+
console.error = wrap("error");
|
|
48
|
+
return () => {
|
|
49
|
+
console.log = original.log;
|
|
50
|
+
console.warn = original.warn;
|
|
51
|
+
console.error = original.error;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Run a command body inside the branded Ink shell (logo + logs + spinner).
|
|
56
|
+
* Falls back to plain stdout when not interactive.
|
|
57
|
+
*/
|
|
58
|
+
export async function runCommandChrome(fn) {
|
|
59
|
+
if (!isInteractive() || isCommandChromeActive()) {
|
|
60
|
+
return fn();
|
|
61
|
+
}
|
|
62
|
+
return runClackFlow(async (api) => {
|
|
63
|
+
const restore = patchConsoleForCommand(api);
|
|
64
|
+
try {
|
|
65
|
+
return await fn();
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
restore();
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/** True while `runCommandChrome` / `runClackFlow` is active. */
|
|
73
|
+
export function isCommandChromeActive() {
|
|
74
|
+
return getActiveFlowApi() !== null;
|
|
75
|
+
}
|
|
76
|
+
/** Commands that mount their own Ink UI — do not wrap with command chrome. */
|
|
77
|
+
const WIZARD_COMMAND_PATHS = new Set(["dev", "init", "link"]);
|
|
78
|
+
/** Prefixes for subcommands that call `runClackFlow` internally. */
|
|
79
|
+
const WIZARD_COMMAND_PREFIXES = ["add "];
|
|
80
|
+
/** Long-running or stdio-inherit commands where chrome would fight subprocess output. */
|
|
81
|
+
const STREAMING_COMMAND_PATHS = new Set([
|
|
82
|
+
"logs",
|
|
83
|
+
"pg psql",
|
|
84
|
+
"functions serve",
|
|
85
|
+
"self-host compose logs",
|
|
86
|
+
]);
|
|
87
|
+
/** Whether a registered command path should skip automatic command chrome. */
|
|
88
|
+
export function shouldExcludeCommandChrome(commandPath) {
|
|
89
|
+
if (WIZARD_COMMAND_PATHS.has(commandPath))
|
|
90
|
+
return true;
|
|
91
|
+
if (WIZARD_COMMAND_PREFIXES.some((prefix) => commandPath.startsWith(prefix)))
|
|
92
|
+
return true;
|
|
93
|
+
if (STREAMING_COMMAND_PATHS.has(commandPath))
|
|
94
|
+
return true;
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
function commandPath(cmd, root) {
|
|
98
|
+
const segments = [];
|
|
99
|
+
let current = cmd;
|
|
100
|
+
while (current && current !== root) {
|
|
101
|
+
segments.unshift(current.name());
|
|
102
|
+
current = current.parent ?? null;
|
|
103
|
+
}
|
|
104
|
+
return segments.join(" ");
|
|
105
|
+
}
|
|
106
|
+
function wrapCommandAction(cmd, root) {
|
|
107
|
+
const path = commandPath(cmd, root);
|
|
108
|
+
const handler = cmd._actionHandler;
|
|
109
|
+
if (!handler || shouldExcludeCommandChrome(path))
|
|
110
|
+
return;
|
|
111
|
+
cmd._actionHandler = (args) => runCommandChrome(() => Promise.resolve(handler(args)));
|
|
112
|
+
}
|
|
113
|
+
/** Wrap every leaf command action with branded Ink chrome (see exclusions above). */
|
|
114
|
+
export function wrapProgramActionsWithChrome(program) {
|
|
115
|
+
const walk = (cmd) => {
|
|
116
|
+
wrapCommandAction(cmd, program);
|
|
117
|
+
for (const sub of cmd.commands) {
|
|
118
|
+
walk(sub);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
walk(program);
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=command-chrome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-chrome.js","sourceRoot":"","sources":["../../../src/ui/runtime/command-chrome.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,SAAS,GACV,MAAM,yBAAyB,CAAA;AAEhC,SAAS,sBAAsB,CAAC,GAAa;IAC3C,MAAM,QAAQ,GAAG;QACf,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAA;IAED,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,MAAgC,EAAQ,EAAE;QACvE,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC;YAAE,OAAM;QACtC,MAAM,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAA;QAC/B,IAAI,CAAC,CAAC;YAAE,OAAM;QACd,MAAM,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAA;QAElD,IAA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GAAwB,CAAC,CAAA;QAChC,CAAC;IACH,CAAC,CAAA;IACD,IAAI,CAAC,OAA4B,CAAC,CAAA;AACpC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Imperative prompt queue for the dev dashboard overlay.
|
|
3
|
+
*/
|
|
4
|
+
import { CLACK_CANCEL } from "./cancel.js";
|
|
5
|
+
export type DevPromptKind = "confirm" | "text" | "password" | "select";
|
|
6
|
+
export interface DevSelectOption<T extends string = string> {
|
|
7
|
+
value: T;
|
|
8
|
+
label: string;
|
|
9
|
+
hint?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface DevPromptRequest<T = unknown> {
|
|
12
|
+
id: number;
|
|
13
|
+
kind: DevPromptKind;
|
|
14
|
+
message: string;
|
|
15
|
+
initialValue?: string | boolean;
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
mask?: boolean;
|
|
19
|
+
options?: DevSelectOption[];
|
|
20
|
+
validate?: (value: string) => string | undefined;
|
|
21
|
+
resolve: (value: T | typeof CLACK_CANCEL) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare function subscribeDevPrompts(listener: () => void): () => void;
|
|
24
|
+
export declare function getActiveDevPrompt(): DevPromptRequest | null;
|
|
25
|
+
export declare function enqueueDevPrompt<T>(spec: Omit<DevPromptRequest<T>, "id" | "resolve">): Promise<T | typeof CLACK_CANCEL>;
|
|
26
|
+
export declare function resolveDevPrompt(value: unknown): void;
|
|
27
|
+
export declare function clearDevPromptQueue(): void;
|
|
28
|
+
/** @internal Tests */
|
|
29
|
+
export declare function resetDevPromptQueueForTests(): void;
|
|
30
|
+
//# sourceMappingURL=dev-prompt-queue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-prompt-queue.d.ts","sourceRoot":"","sources":["../../../src/ui/runtime/dev-prompt-queue.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YA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,CAGlD"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Imperative prompt queue for the dev dashboard overlay.
|
|
3
|
+
*/
|
|
4
|
+
import { CLACK_CANCEL } from "./cancel.js";
|
|
5
|
+
let nextId = 0;
|
|
6
|
+
let active = null;
|
|
7
|
+
const waiters = [];
|
|
8
|
+
const listeners = new Set();
|
|
9
|
+
function notify() {
|
|
10
|
+
for (const listener of listeners)
|
|
11
|
+
listener();
|
|
12
|
+
}
|
|
13
|
+
export function subscribeDevPrompts(listener) {
|
|
14
|
+
listeners.add(listener);
|
|
15
|
+
return () => listeners.delete(listener);
|
|
16
|
+
}
|
|
17
|
+
export function getActiveDevPrompt() {
|
|
18
|
+
return active;
|
|
19
|
+
}
|
|
20
|
+
export function enqueueDevPrompt(spec) {
|
|
21
|
+
return new Promise((resolve) => {
|
|
22
|
+
const request = {
|
|
23
|
+
...spec,
|
|
24
|
+
id: nextId++,
|
|
25
|
+
resolve: resolve,
|
|
26
|
+
};
|
|
27
|
+
waiters.push(request);
|
|
28
|
+
if (!active) {
|
|
29
|
+
active = waiters.shift() ?? null;
|
|
30
|
+
}
|
|
31
|
+
notify();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
export function resolveDevPrompt(value) {
|
|
35
|
+
if (!active)
|
|
36
|
+
return;
|
|
37
|
+
const current = active;
|
|
38
|
+
active = waiters.shift() ?? null;
|
|
39
|
+
current.resolve(value);
|
|
40
|
+
notify();
|
|
41
|
+
}
|
|
42
|
+
export function clearDevPromptQueue() {
|
|
43
|
+
while (active) {
|
|
44
|
+
active.resolve(CLACK_CANCEL);
|
|
45
|
+
active = waiters.shift() ?? null;
|
|
46
|
+
}
|
|
47
|
+
for (const pending of waiters.splice(0)) {
|
|
48
|
+
pending.resolve(CLACK_CANCEL);
|
|
49
|
+
}
|
|
50
|
+
notify();
|
|
51
|
+
}
|
|
52
|
+
/** @internal Tests */
|
|
53
|
+
export function resetDevPromptQueueForTests() {
|
|
54
|
+
clearDevPromptQueue();
|
|
55
|
+
nextId = 0;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=dev-prompt-queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-prompt-queue.js","sourceRoot":"","sources":["../../../src/ui/runtime/dev-prompt-queue.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAuB1C,IAAI,MAAM,GAAG,CAAC,CAAA;AACd,IAAI,MAAM,GAA4B,IAAI,CAAA;AAC1C,MAAM,OAAO,GAAuB,EAAE,CAAA;AACtC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAc,CAAA;AAEvC,SAAS,MAAM;IACb,KAAK,MAAM,QAAQ,IAAI,SAAS;QAAE,QAAQ,EAAE,CAAA;AAC9C,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,QAAoB;IACtD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IACvB,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACzC,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,MAAM,CAAA;AACf,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAI,IAAiD;IACnF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,OAAO,GAAwB;YACnC,GAAG,IAAI;YACP,EAAE,EAAE,MAAM,EAAE;YACZ,OAAO,EAAE,OAAsC;SAChD,CAAA;QACD,OAAO,CAAC,IAAI,CAAC,OAA2B,CAAC,CAAA;QACzC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,IAAI,IAAI,CAAA;QAClC,CAAC;QACD,MAAM,EAAE,CAAA;IACV,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,CAAC,MAAM;QAAE,OAAM;IACnB,MAAM,OAAO,GAAG,MAAM,CAAA;IACtB,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,IAAI,IAAI,CAAA;IAChC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IACtB,MAAM,EAAE,CAAA;AACV,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,MAAM,EAAE,CAAC;QACd,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;QAC5B,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,IAAI,IAAI,CAAA;IAClC,CAAC;IACD,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QACxC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;IAC/B,CAAC;IACD,MAAM,EAAE,CAAA;AACV,CAAC;AAED,sBAAsB;AACtB,MAAM,UAAU,2BAA2B;IACzC,mBAAmB,EAAE,CAAA;IACrB,MAAM,GAAG,CAAC,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-session.d.ts","sourceRoot":"","sources":["../../../src/ui/runtime/flow-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAI/C,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,CAE3D;AAED,wBAAgB,gBAAgB,IAAI,QAAQ,GAAG,IAAI,CAElD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-session.js","sourceRoot":"","sources":["../../../src/ui/runtime/flow-session.ts"],"names":[],"mappings":"AAEA,IAAI,aAAa,GAAoB,IAAI,CAAA;AAEzC,MAAM,UAAU,gBAAgB,CAAC,GAAoB;IACnD,aAAa,GAAG,GAAG,CAAA;AACrB,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,aAAa,CAAA;AACtB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ClackApi } from "../clack-api.js";
|
|
2
|
+
/** Mount a single Ink flow session (init wizard, standalone confirm, etc.). */
|
|
3
|
+
export declare function runClackFlow<T>(run: (api: ClackApi) => Promise<T>): Promise<T>;
|
|
4
|
+
export { CLACK_CANCEL } from "./cancel.js";
|
|
5
|
+
//# sourceMappingURL=run-clack-flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-clack-flow.d.ts","sourceRoot":"","sources":["../../../src/ui/runtime/run-clack-flow.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAyB/D,+EAA+E;AAC/E,wBAAsB,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAoBpF;AAED,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import { render } from "ink";
|
|
4
|
+
import { isInteractive } from "../interactive.js";
|
|
5
|
+
import { createClackApi } from "../clack-api.js";
|
|
6
|
+
import { FlowApp } from "../flows/FlowApp.js";
|
|
7
|
+
function RunClackFlowRoot({ run, onComplete, onError }) {
|
|
8
|
+
const started = useRef(false);
|
|
9
|
+
return (_jsx(FlowApp, { bind: (controller) => {
|
|
10
|
+
if (started.current)
|
|
11
|
+
return;
|
|
12
|
+
started.current = true;
|
|
13
|
+
void run(createClackApi(controller))
|
|
14
|
+
.then(onComplete)
|
|
15
|
+
.catch(onError);
|
|
16
|
+
} }));
|
|
17
|
+
}
|
|
18
|
+
/** Mount a single Ink flow session (init wizard, standalone confirm, etc.). */
|
|
19
|
+
export async function runClackFlow(run) {
|
|
20
|
+
if (!isInteractive()) {
|
|
21
|
+
throw new Error("Interactive Ink flow requires a TTY.");
|
|
22
|
+
}
|
|
23
|
+
return new Promise((resolve, reject) => {
|
|
24
|
+
const instance = render(_jsx(RunClackFlowRoot, { run: run, onComplete: (value) => {
|
|
25
|
+
instance.unmount();
|
|
26
|
+
resolve(value);
|
|
27
|
+
}, onError: (err) => {
|
|
28
|
+
instance.unmount();
|
|
29
|
+
reject(err);
|
|
30
|
+
} }));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export { CLACK_CANCEL } from "./cancel.js";
|
|
34
|
+
//# sourceMappingURL=run-clack-flow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-clack-flow.js","sourceRoot":"","sources":["../../../src/ui/runtime/run-clack-flow.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAiB,MAAM,iBAAiB,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAQ7C,SAAS,gBAAgB,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAyB;IAC3E,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IAE7B,OAAO,CACL,KAAC,OAAO,IACN,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE;YACnB,IAAI,OAAO,CAAC,OAAO;gBAAE,OAAM;YAC3B,OAAO,CAAC,OAAO,GAAG,IAAI,CAAA;YACtB,KAAK,GAAG,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;iBACjC,IAAI,CAAC,UAAU,CAAC;iBAChB,KAAK,CAAC,OAAO,CAAC,CAAA;QACnB,CAAC,GACD,CACH,CAAA;AACH,CAAC;AAED,+EAA+E;AAC/E,MAAM,CAAC,KAAK,UAAU,YAAY,CAAI,GAAkC;IACtE,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;IACzD,CAAC;IAED,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACxC,MAAM,QAAQ,GAAG,MAAM,CACrB,KAAC,gBAAgB,IACf,GAAG,EAAE,GAA0C,EAC/C,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;gBACpB,QAAQ,CAAC,OAAO,EAAE,CAAA;gBAClB,OAAO,CAAC,KAAU,CAAC,CAAA;YACrB,CAAC,EACD,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;gBACf,QAAQ,CAAC,OAAO,EAAE,CAAA;gBAClB,MAAM,CAAC,GAAG,CAAC,CAAA;YACb,CAAC,GACD,CACH,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supatype terminal design tokens — shared by Ink components and plain CI output.
|
|
3
|
+
*/
|
|
4
|
+
export declare const RESET = "\u001B[0m";
|
|
5
|
+
export declare const DIM = "\u001B[2m";
|
|
6
|
+
export declare const BOLD = "\u001B[1m";
|
|
7
|
+
export declare const theme: {
|
|
8
|
+
readonly brand: "magenta";
|
|
9
|
+
readonly brandHex: "#c084fc";
|
|
10
|
+
readonly info: "cyan";
|
|
11
|
+
readonly warn: "yellow";
|
|
12
|
+
readonly error: "red";
|
|
13
|
+
readonly success: "green";
|
|
14
|
+
readonly dim: "gray";
|
|
15
|
+
readonly muted: "gray";
|
|
16
|
+
};
|
|
17
|
+
/** Legacy ANSI exports used by dev-logo / dev-task-colors. */
|
|
18
|
+
export declare const BRAND_COLOR = "\u001B[35m";
|
|
19
|
+
export declare function brandStyle(text: string): string;
|
|
20
|
+
export declare function plainInfo(message: string): string;
|
|
21
|
+
export declare function plainWarn(message: string): string;
|
|
22
|
+
export declare function plainError(message: string): string;
|
|
23
|
+
export declare function plainSuccess(message: string): string;
|
|
24
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/ui/theme.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,KAAK,cAAY,CAAA;AAC9B,eAAO,MAAM,GAAG,cAAY,CAAA;AAC5B,eAAO,MAAM,IAAI,cAAY,CAAA;AAE7B,eAAO,MAAM,KAAK;;;;;;;;;CASR,CAAA;AAEV,8DAA8D;AAC9D,eAAO,MAAM,WAAW,eAAa,CAAA;AAErC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|