@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.
Files changed (130) hide show
  1. package/README.md +21 -4
  2. package/dist/commands/api.d.ts.map +1 -1
  3. package/dist/commands/app.d.ts.map +1 -1
  4. package/dist/commands/build.d.ts.map +1 -1
  5. package/dist/commands/check.d.ts.map +1 -1
  6. package/dist/commands/db-migrate.d.ts.map +1 -1
  7. package/dist/commands/deploy.d.ts.map +1 -1
  8. package/dist/commands/desktop.d.ts +15 -0
  9. package/dist/commands/desktop.d.ts.map +1 -0
  10. package/dist/commands/dev-runner.d.ts +4 -0
  11. package/dist/commands/dev-runner.d.ts.map +1 -1
  12. package/dist/commands/dev.d.ts.map +1 -1
  13. package/dist/commands/init.d.ts.map +1 -1
  14. package/dist/commands/lake-check.d.ts.map +1 -1
  15. package/dist/commands/lake-cleanup.d.ts +2 -0
  16. package/dist/commands/lake-cleanup.d.ts.map +1 -1
  17. package/dist/commands/login.d.ts.map +1 -1
  18. package/dist/commands/logout.d.ts.map +1 -1
  19. package/dist/commands/orchestrator.d.ts.map +1 -1
  20. package/dist/commands/profile.d.ts.map +1 -1
  21. package/dist/commands/rules.d.ts.map +1 -1
  22. package/dist/commands/scheduler.d.ts.map +1 -1
  23. package/dist/commands/service-account.d.ts.map +1 -1
  24. package/dist/commands/status.d.ts.map +1 -1
  25. package/dist/commands/token.d.ts.map +1 -1
  26. package/dist/commands/typegen.d.ts.map +1 -1
  27. package/dist/commands/worker-group.d.ts +2 -0
  28. package/dist/commands/worker-group.d.ts.map +1 -1
  29. package/dist/commands/worker.d.ts +2 -0
  30. package/dist/commands/worker.d.ts.map +1 -1
  31. package/dist/lib/command-line.d.ts +22 -2
  32. package/dist/lib/command-line.d.ts.map +1 -1
  33. package/dist/lib/deploy-release.d.ts +3 -1
  34. package/dist/lib/deploy-release.d.ts.map +1 -1
  35. package/dist/lib/desktop.d.ts +26 -0
  36. package/dist/lib/desktop.d.ts.map +1 -0
  37. package/dist/lib/dev-messages.d.ts +43 -0
  38. package/dist/lib/dev-messages.d.ts.map +1 -0
  39. package/dist/lib/dev-supervisor.d.ts +27 -0
  40. package/dist/lib/dev-supervisor.d.ts.map +1 -1
  41. package/dist/lib/open-url.d.ts +3 -0
  42. package/dist/lib/open-url.d.ts.map +1 -0
  43. package/dist/lib/role-lifecycle.d.ts.map +1 -1
  44. package/dist/lib/runtime.d.ts +10 -0
  45. package/dist/lib/runtime.d.ts.map +1 -1
  46. package/dist/lib/worker-concurrency.d.ts +11 -0
  47. package/dist/lib/worker-concurrency.d.ts.map +1 -1
  48. package/dist/lib/worker-registry.d.ts +2 -0
  49. package/dist/lib/worker-registry.d.ts.map +1 -1
  50. package/dist/ui/deploy-screens.d.ts +48 -0
  51. package/dist/ui/deploy-screens.d.ts.map +1 -0
  52. package/dist/ui/index.d.ts +28 -233
  53. package/dist/ui/index.d.ts.map +1 -1
  54. package/dist/ui/layout.d.ts +65 -0
  55. package/dist/ui/layout.d.ts.map +1 -0
  56. package/dist/ui/live/ansi.d.ts +8 -0
  57. package/dist/ui/live/ansi.d.ts.map +1 -0
  58. package/dist/ui/live/can-run-live.d.ts +6 -0
  59. package/dist/ui/live/can-run-live.d.ts.map +1 -0
  60. package/dist/ui/live/components.d.ts +17 -0
  61. package/dist/ui/live/components.d.ts.map +1 -0
  62. package/dist/ui/live/deploy.d.ts +22 -0
  63. package/dist/ui/live/deploy.d.ts.map +1 -0
  64. package/dist/ui/live/dev.d.ts +47 -0
  65. package/dist/ui/live/dev.d.ts.map +1 -0
  66. package/dist/ui/live/prompt.d.ts +30 -0
  67. package/dist/ui/live/prompt.d.ts.map +1 -0
  68. package/dist/ui/live/session.d.ts +27 -0
  69. package/dist/ui/live/session.d.ts.map +1 -0
  70. package/dist/ui/screens.d.ts +136 -0
  71. package/dist/ui/screens.d.ts.map +1 -0
  72. package/dist/ui/theme.d.ts +58 -0
  73. package/dist/ui/theme.d.ts.map +1 -0
  74. package/package.json +21 -19
  75. package/src/commands/{api.tsx → api.ts} +18 -27
  76. package/src/commands/{app.tsx → app.ts} +14 -18
  77. package/src/commands/build.ts +70 -0
  78. package/src/commands/{check.tsx → check.ts} +74 -19
  79. package/src/commands/db-migrate.ts +32 -0
  80. package/src/commands/{deploy.tsx → deploy.ts} +109 -102
  81. package/src/commands/desktop.ts +71 -0
  82. package/src/commands/{dev-runner.tsx → dev-runner.ts} +67 -33
  83. package/src/commands/{init.tsx → init.ts} +19 -8
  84. package/src/commands/lake-check.ts +36 -0
  85. package/src/commands/{lake-cleanup.tsx → lake-cleanup.ts} +24 -8
  86. package/src/commands/{login.tsx → login.ts} +36 -30
  87. package/src/commands/{logout.tsx → logout.ts} +5 -5
  88. package/src/commands/{orchestrator.tsx → orchestrator.ts} +15 -28
  89. package/src/commands/{profile.tsx → profile.ts} +38 -19
  90. package/src/commands/{rules.tsx → rules.ts} +15 -24
  91. package/src/commands/{scheduler.tsx → scheduler.ts} +14 -27
  92. package/src/commands/{service-account.tsx → service-account.ts} +37 -39
  93. package/src/commands/{status.tsx → status.ts} +8 -8
  94. package/src/commands/{token.tsx → token.ts} +19 -20
  95. package/src/commands/typegen.ts +18 -0
  96. package/src/commands/{worker-group.tsx → worker-group.ts} +40 -29
  97. package/src/commands/{worker.tsx → worker.ts} +30 -22
  98. package/src/index.tsx +22 -1
  99. package/src/lib/command-line.ts +108 -57
  100. package/src/lib/deploy-release.ts +17 -1
  101. package/src/lib/desktop.ts +52 -0
  102. package/src/lib/dev-messages.ts +44 -0
  103. package/src/lib/dev-supervisor.ts +132 -12
  104. package/src/lib/open-url.ts +15 -0
  105. package/src/lib/role-lifecycle.ts +2 -3
  106. package/src/lib/runtime.ts +21 -0
  107. package/src/lib/worker-concurrency.ts +31 -0
  108. package/src/lib/worker-registry.ts +4 -0
  109. package/src/ui/README.md +54 -0
  110. package/src/ui/deploy-screens.ts +360 -0
  111. package/src/ui/index.ts +158 -0
  112. package/src/ui/layout.ts +245 -0
  113. package/src/ui/live/ansi.ts +103 -0
  114. package/src/ui/live/can-run-live.ts +9 -0
  115. package/src/ui/live/components.tsx +81 -0
  116. package/src/ui/live/deploy.tsx +170 -0
  117. package/src/ui/live/dev.tsx +522 -0
  118. package/src/ui/live/prompt.tsx +205 -0
  119. package/src/ui/live/session.ts +103 -0
  120. package/src/ui/screens.ts +490 -0
  121. package/src/ui/theme.ts +122 -0
  122. package/dist/lib/role-view.d.ts +0 -21
  123. package/dist/lib/role-view.d.ts.map +0 -1
  124. package/src/commands/build.tsx +0 -65
  125. package/src/commands/db-migrate.tsx +0 -30
  126. package/src/commands/lake-check.tsx +0 -20
  127. package/src/commands/typegen.tsx +0 -18
  128. package/src/lib/role-view.ts +0 -49
  129. package/src/ui/index.tsx +0 -1363
  130. /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
- }
@@ -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
- }
@@ -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
- }