@sixb/cli 0.1.17 → 0.1.18
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/README.md +7 -3
- package/dist/commands/access-token-utils.d.ts +6 -0
- package/dist/commands/access-token-utils.d.ts.map +1 -1
- package/dist/commands/api.d.ts.map +1 -1
- package/dist/commands/app.d.ts.map +1 -1
- package/dist/commands/atlas.d.ts.map +1 -1
- package/dist/commands/dev-runner.d.ts.map +1 -1
- package/dist/commands/orchestrator.d.ts.map +1 -1
- package/dist/commands/rules.d.ts.map +1 -1
- package/dist/commands/scheduler.d.ts.map +1 -1
- package/dist/commands/service-account.d.ts.map +1 -1
- package/dist/commands/token.d.ts.map +1 -1
- package/dist/commands/worker-group.d.ts.map +1 -1
- package/dist/commands/worker.d.ts.map +1 -1
- package/dist/lib/dev-watch.d.ts +2 -0
- package/dist/lib/dev-watch.d.ts.map +1 -1
- package/dist/lib/profiles.d.ts +2 -1
- package/dist/lib/profiles.d.ts.map +1 -1
- package/dist/lib/public-origin.d.ts +0 -7
- package/dist/lib/public-origin.d.ts.map +1 -1
- package/dist/lib/role-lifecycle.d.ts +3 -0
- package/dist/lib/role-lifecycle.d.ts.map +1 -0
- package/dist/lib/role-view.d.ts +22 -0
- package/dist/lib/role-view.d.ts.map +1 -0
- package/dist/lib/runtime.d.ts +34 -19
- package/dist/lib/runtime.d.ts.map +1 -1
- package/dist/ui/index.d.ts +18 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/package.json +16 -16
- package/src/commands/access-token-utils.ts +13 -0
- package/src/commands/api.tsx +2 -1
- package/src/commands/app.tsx +29 -29
- package/src/commands/atlas.tsx +23 -27
- package/src/commands/dev-runner.tsx +22 -18
- package/src/commands/orchestrator.tsx +1 -2
- package/src/commands/rules.tsx +1 -2
- package/src/commands/scheduler.tsx +1 -2
- package/src/commands/service-account.tsx +4 -1
- package/src/commands/token.tsx +4 -1
- package/src/commands/worker-group.tsx +2 -7
- package/src/commands/worker.tsx +2 -7
- package/src/index.tsx +8 -11
- package/src/lib/dev-watch.ts +6 -2
- package/src/lib/profiles.ts +3 -2
- package/src/lib/public-origin.ts +0 -13
- package/src/lib/role-lifecycle.ts +34 -0
- package/src/lib/role-view.ts +50 -0
- package/src/lib/runtime.ts +48 -50
- package/src/ui/index.tsx +46 -0
package/src/ui/index.tsx
CHANGED
|
@@ -44,6 +44,52 @@ export async function renderCliError(
|
|
|
44
44
|
)
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
// The entrypoint and the browser roles render through these rather than JSX of their own: a module
|
|
48
|
+
// with JSX loads React as soon as it is evaluated, and `atlas` and `app` load neither React nor
|
|
49
|
+
// Ink outside a terminal.
|
|
50
|
+
|
|
51
|
+
export async function renderVersion(version: string): Promise<void> {
|
|
52
|
+
await renderStatic(<VersionView version={version} />)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Root or command help, after the usage error that led to it when there is one. */
|
|
56
|
+
export async function renderHelp(help: CliHelp, usageError?: string): Promise<void> {
|
|
57
|
+
await renderStatic(
|
|
58
|
+
help.path.length === 0 ? (
|
|
59
|
+
<HelpView errorMessage={usageError} />
|
|
60
|
+
) : (
|
|
61
|
+
<CommandHelpView help={help} errorMessage={usageError} />
|
|
62
|
+
)
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface RoleStartupPanel {
|
|
67
|
+
started(view: {
|
|
68
|
+
readonly title: string
|
|
69
|
+
readonly name: string
|
|
70
|
+
readonly serviceName: string
|
|
71
|
+
readonly items: KeyValueItem[]
|
|
72
|
+
}): void
|
|
73
|
+
unmount(): void
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** A long-running role's loading panel, replaced by its started view. */
|
|
77
|
+
export function renderRoleStartup(loading: {
|
|
78
|
+
readonly title: string
|
|
79
|
+
readonly subtitle: string
|
|
80
|
+
readonly status: string
|
|
81
|
+
}): RoleStartupPanel {
|
|
82
|
+
const app = renderPersistent(<LoadingView {...loading} />)
|
|
83
|
+
return {
|
|
84
|
+
started(view) {
|
|
85
|
+
app.rerender(<RoleView {...view} />)
|
|
86
|
+
},
|
|
87
|
+
unmount() {
|
|
88
|
+
app.unmount()
|
|
89
|
+
},
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
47
93
|
function SectionTitle({ children }: { children: React.ReactNode }) {
|
|
48
94
|
return (
|
|
49
95
|
<Text color="cyan" bold>
|