@sixb/cli 0.1.20 → 0.1.22
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 +21 -4
- package/dist/commands/api.d.ts.map +1 -1
- package/dist/commands/app.d.ts.map +1 -1
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/db-migrate.d.ts.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/desktop.d.ts +15 -0
- package/dist/commands/desktop.d.ts.map +1 -0
- package/dist/commands/dev-runner.d.ts +4 -0
- package/dist/commands/dev-runner.d.ts.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/lake-check.d.ts.map +1 -1
- package/dist/commands/lake-cleanup.d.ts +2 -0
- package/dist/commands/lake-cleanup.d.ts.map +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/logout.d.ts.map +1 -1
- package/dist/commands/orchestrator.d.ts.map +1 -1
- package/dist/commands/profile.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/status.d.ts.map +1 -1
- package/dist/commands/token.d.ts.map +1 -1
- package/dist/commands/typegen.d.ts.map +1 -1
- package/dist/commands/worker-group.d.ts +2 -0
- package/dist/commands/worker-group.d.ts.map +1 -1
- package/dist/commands/worker.d.ts +2 -0
- package/dist/commands/worker.d.ts.map +1 -1
- package/dist/lib/command-line.d.ts +22 -2
- package/dist/lib/command-line.d.ts.map +1 -1
- package/dist/lib/deploy-release.d.ts +3 -1
- package/dist/lib/deploy-release.d.ts.map +1 -1
- package/dist/lib/desktop.d.ts +26 -0
- package/dist/lib/desktop.d.ts.map +1 -0
- package/dist/lib/dev-messages.d.ts +43 -0
- package/dist/lib/dev-messages.d.ts.map +1 -0
- package/dist/lib/dev-supervisor.d.ts +27 -0
- package/dist/lib/dev-supervisor.d.ts.map +1 -1
- package/dist/lib/open-url.d.ts +3 -0
- package/dist/lib/open-url.d.ts.map +1 -0
- package/dist/lib/role-lifecycle.d.ts.map +1 -1
- package/dist/lib/runtime.d.ts +10 -0
- package/dist/lib/runtime.d.ts.map +1 -1
- package/dist/lib/worker-concurrency.d.ts +11 -0
- package/dist/lib/worker-concurrency.d.ts.map +1 -1
- package/dist/lib/worker-registry.d.ts +2 -0
- package/dist/lib/worker-registry.d.ts.map +1 -1
- package/dist/ui/deploy-screens.d.ts +48 -0
- package/dist/ui/deploy-screens.d.ts.map +1 -0
- package/dist/ui/index.d.ts +28 -233
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/layout.d.ts +65 -0
- package/dist/ui/layout.d.ts.map +1 -0
- package/dist/ui/live/ansi.d.ts +8 -0
- package/dist/ui/live/ansi.d.ts.map +1 -0
- package/dist/ui/live/can-run-live.d.ts +6 -0
- package/dist/ui/live/can-run-live.d.ts.map +1 -0
- package/dist/ui/live/components.d.ts +17 -0
- package/dist/ui/live/components.d.ts.map +1 -0
- package/dist/ui/live/deploy.d.ts +22 -0
- package/dist/ui/live/deploy.d.ts.map +1 -0
- package/dist/ui/live/dev.d.ts +47 -0
- package/dist/ui/live/dev.d.ts.map +1 -0
- package/dist/ui/live/prompt.d.ts +30 -0
- package/dist/ui/live/prompt.d.ts.map +1 -0
- package/dist/ui/live/session.d.ts +27 -0
- package/dist/ui/live/session.d.ts.map +1 -0
- package/dist/ui/screens.d.ts +136 -0
- package/dist/ui/screens.d.ts.map +1 -0
- package/dist/ui/theme.d.ts +58 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/package.json +21 -19
- package/src/commands/{api.tsx → api.ts} +18 -27
- package/src/commands/{app.tsx → app.ts} +14 -18
- package/src/commands/build.ts +70 -0
- package/src/commands/{check.tsx → check.ts} +74 -19
- package/src/commands/db-migrate.ts +32 -0
- package/src/commands/{deploy.tsx → deploy.ts} +109 -102
- package/src/commands/desktop.ts +71 -0
- package/src/commands/{dev-runner.tsx → dev-runner.ts} +67 -33
- package/src/commands/{init.tsx → init.ts} +19 -8
- package/src/commands/lake-check.ts +36 -0
- package/src/commands/{lake-cleanup.tsx → lake-cleanup.ts} +24 -8
- package/src/commands/{login.tsx → login.ts} +36 -30
- package/src/commands/{logout.tsx → logout.ts} +5 -5
- package/src/commands/{orchestrator.tsx → orchestrator.ts} +15 -28
- package/src/commands/{profile.tsx → profile.ts} +38 -19
- package/src/commands/{rules.tsx → rules.ts} +15 -24
- package/src/commands/{scheduler.tsx → scheduler.ts} +14 -27
- package/src/commands/{service-account.tsx → service-account.ts} +37 -39
- package/src/commands/{status.tsx → status.ts} +8 -8
- package/src/commands/{token.tsx → token.ts} +19 -20
- package/src/commands/typegen.ts +18 -0
- package/src/commands/{worker-group.tsx → worker-group.ts} +40 -29
- package/src/commands/{worker.tsx → worker.ts} +30 -22
- package/src/index.tsx +22 -1
- package/src/lib/command-line.ts +108 -57
- package/src/lib/deploy-release.ts +17 -1
- package/src/lib/desktop.ts +52 -0
- package/src/lib/dev-messages.ts +44 -0
- package/src/lib/dev-supervisor.ts +132 -12
- package/src/lib/open-url.ts +15 -0
- package/src/lib/role-lifecycle.ts +2 -3
- package/src/lib/runtime.ts +21 -0
- package/src/lib/worker-concurrency.ts +31 -0
- package/src/lib/worker-registry.ts +4 -0
- package/src/ui/README.md +54 -0
- package/src/ui/deploy-screens.ts +360 -0
- package/src/ui/index.ts +158 -0
- package/src/ui/layout.ts +245 -0
- package/src/ui/live/ansi.ts +103 -0
- package/src/ui/live/can-run-live.ts +9 -0
- package/src/ui/live/components.tsx +81 -0
- package/src/ui/live/deploy.tsx +170 -0
- package/src/ui/live/dev.tsx +522 -0
- package/src/ui/live/prompt.tsx +205 -0
- package/src/ui/live/session.ts +103 -0
- package/src/ui/screens.ts +490 -0
- package/src/ui/theme.ts +122 -0
- package/dist/lib/role-view.d.ts +0 -21
- package/dist/lib/role-view.d.ts.map +0 -1
- package/src/commands/build.tsx +0 -65
- package/src/commands/db-migrate.tsx +0 -30
- package/src/commands/lake-check.tsx +0 -20
- package/src/commands/typegen.tsx +0 -18
- package/src/lib/role-view.ts +0 -49
- package/src/ui/index.tsx +0 -1363
- /package/src/commands/{dev.tsx → dev.ts} +0 -0
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { migrateStorage } from "@sixb/core"
|
|
2
|
-
import { loadSixbFromEntry } from "../lib/loadSixb"
|
|
3
|
-
import { resolveRuntimeEntry } from "../lib/production"
|
|
4
|
-
import { stopSixbProviders } from "../lib/runtime"
|
|
5
|
-
import { DbMigrateView, renderStatic } from "../ui"
|
|
6
|
-
|
|
7
|
-
export interface DbMigrateOptions {
|
|
8
|
-
entry?: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export async function runDbMigrate(options: DbMigrateOptions = {}) {
|
|
12
|
-
const entry = await resolveRuntimeEntry({ entry: options.entry })
|
|
13
|
-
const sixb = await loadSixbFromEntry(entry)
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
const result = await migrateStorage(sixb.storage, {
|
|
17
|
-
projectId: sixb.id,
|
|
18
|
-
ontology: sixb.definitions.ontology,
|
|
19
|
-
})
|
|
20
|
-
await renderStatic(
|
|
21
|
-
<DbMigrateView
|
|
22
|
-
projectId={sixb.id}
|
|
23
|
-
status={result.status}
|
|
24
|
-
applied={result.reports.flatMap((report) => report.applied)}
|
|
25
|
-
/>
|
|
26
|
-
)
|
|
27
|
-
} finally {
|
|
28
|
-
await stopSixbProviders(sixb)
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { loadSixbFromEntry } from "../lib/loadSixb"
|
|
2
|
-
import { resolveRuntimeEntry } from "../lib/production"
|
|
3
|
-
import { checkRuntimeLakeDefinitions, stopSixbProviders } from "../lib/runtime"
|
|
4
|
-
import { LakeCheckView, renderStatic } from "../ui"
|
|
5
|
-
|
|
6
|
-
export interface LakeCheckOptions {
|
|
7
|
-
entry?: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export async function runLakeCheck(options: LakeCheckOptions = {}) {
|
|
11
|
-
const entry = await resolveRuntimeEntry({ entry: options.entry })
|
|
12
|
-
const sixb = await loadSixbFromEntry(entry)
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
await checkRuntimeLakeDefinitions(sixb)
|
|
16
|
-
await renderStatic(<LakeCheckView projectId={sixb.id} status="ok" />)
|
|
17
|
-
} finally {
|
|
18
|
-
await stopSixbProviders(sixb)
|
|
19
|
-
}
|
|
20
|
-
}
|
package/src/commands/typegen.tsx
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { generateProjectTypes } from "../lib/typegen"
|
|
2
|
-
import { renderStatic, TypegenView } from "../ui"
|
|
3
|
-
|
|
4
|
-
export interface TypegenOptions {
|
|
5
|
-
entry?: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export async function runTypegen(options: TypegenOptions = {}) {
|
|
9
|
-
const result = await generateProjectTypes(options)
|
|
10
|
-
await renderStatic(
|
|
11
|
-
<TypegenView
|
|
12
|
-
path={result.path}
|
|
13
|
-
objectTypes={result.entries.length}
|
|
14
|
-
skipped={result.skipped}
|
|
15
|
-
written={result.written}
|
|
16
|
-
/>
|
|
17
|
-
)
|
|
18
|
-
}
|
package/src/lib/role-view.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { RoleStartupPanel } from "../ui"
|
|
2
|
-
import { errorMessage, errorRemediation } from "./errors"
|
|
3
|
-
|
|
4
|
-
export interface RoleView {
|
|
5
|
-
startup(loading: {
|
|
6
|
-
readonly title: string
|
|
7
|
-
readonly subtitle: string
|
|
8
|
-
readonly status: string
|
|
9
|
-
}): RoleStartupPanel
|
|
10
|
-
error(error: unknown): Promise<void>
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* How a long-running role reports itself: the Ink panels in a terminal, plain lines in a log.
|
|
15
|
-
*
|
|
16
|
-
* Ink's layout engine keeps about 45 MB for the life of the process once it is imported. `app`
|
|
17
|
-
* runs under a supervisor and serves static files, so outside a terminal it never loads it.
|
|
18
|
-
*
|
|
19
|
-
* Call this before the role sets NODE_ENV. Bun compiles JSX for the mode the process started in,
|
|
20
|
-
* and React loaded after the change cannot run it: the panels then render nothing, or throw. Ink
|
|
21
|
-
* stays out of logs for a second reason: its error panel could come out empty there.
|
|
22
|
-
*/
|
|
23
|
-
export async function loadRoleView(): Promise<RoleView> {
|
|
24
|
-
if (process.stdout.isTTY) {
|
|
25
|
-
const { renderCliError, renderRoleStartup } = await import("../ui")
|
|
26
|
-
return { startup: renderRoleStartup, error: renderCliError }
|
|
27
|
-
}
|
|
28
|
-
return { startup: printRoleStartup, error: printRoleError }
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function printRoleStartup(loading: {
|
|
32
|
-
readonly title: string
|
|
33
|
-
readonly subtitle: string
|
|
34
|
-
}): RoleStartupPanel {
|
|
35
|
-
console.log(`${loading.title} (${loading.subtitle})`)
|
|
36
|
-
return {
|
|
37
|
-
started(view) {
|
|
38
|
-
const items = view.items.map((item) => `${item.label} ${item.value}`).join(", ")
|
|
39
|
-
console.log(`${view.title}: ${view.name}, ${view.serviceName} ${items}`)
|
|
40
|
-
},
|
|
41
|
-
unmount() {},
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
async function printRoleError(error: unknown): Promise<void> {
|
|
46
|
-
console.error(errorMessage(error))
|
|
47
|
-
const remediation = errorRemediation(error)
|
|
48
|
-
if (remediation) console.error(remediation)
|
|
49
|
-
}
|