@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.
Files changed (49) hide show
  1. package/README.md +7 -3
  2. package/dist/commands/access-token-utils.d.ts +6 -0
  3. package/dist/commands/access-token-utils.d.ts.map +1 -1
  4. package/dist/commands/api.d.ts.map +1 -1
  5. package/dist/commands/app.d.ts.map +1 -1
  6. package/dist/commands/atlas.d.ts.map +1 -1
  7. package/dist/commands/dev-runner.d.ts.map +1 -1
  8. package/dist/commands/orchestrator.d.ts.map +1 -1
  9. package/dist/commands/rules.d.ts.map +1 -1
  10. package/dist/commands/scheduler.d.ts.map +1 -1
  11. package/dist/commands/service-account.d.ts.map +1 -1
  12. package/dist/commands/token.d.ts.map +1 -1
  13. package/dist/commands/worker-group.d.ts.map +1 -1
  14. package/dist/commands/worker.d.ts.map +1 -1
  15. package/dist/lib/dev-watch.d.ts +2 -0
  16. package/dist/lib/dev-watch.d.ts.map +1 -1
  17. package/dist/lib/profiles.d.ts +2 -1
  18. package/dist/lib/profiles.d.ts.map +1 -1
  19. package/dist/lib/public-origin.d.ts +0 -7
  20. package/dist/lib/public-origin.d.ts.map +1 -1
  21. package/dist/lib/role-lifecycle.d.ts +3 -0
  22. package/dist/lib/role-lifecycle.d.ts.map +1 -0
  23. package/dist/lib/role-view.d.ts +22 -0
  24. package/dist/lib/role-view.d.ts.map +1 -0
  25. package/dist/lib/runtime.d.ts +34 -19
  26. package/dist/lib/runtime.d.ts.map +1 -1
  27. package/dist/ui/index.d.ts +18 -0
  28. package/dist/ui/index.d.ts.map +1 -1
  29. package/package.json +16 -16
  30. package/src/commands/access-token-utils.ts +13 -0
  31. package/src/commands/api.tsx +2 -1
  32. package/src/commands/app.tsx +29 -29
  33. package/src/commands/atlas.tsx +23 -27
  34. package/src/commands/dev-runner.tsx +22 -18
  35. package/src/commands/orchestrator.tsx +1 -2
  36. package/src/commands/rules.tsx +1 -2
  37. package/src/commands/scheduler.tsx +1 -2
  38. package/src/commands/service-account.tsx +4 -1
  39. package/src/commands/token.tsx +4 -1
  40. package/src/commands/worker-group.tsx +2 -7
  41. package/src/commands/worker.tsx +2 -7
  42. package/src/index.tsx +8 -11
  43. package/src/lib/dev-watch.ts +6 -2
  44. package/src/lib/profiles.ts +3 -2
  45. package/src/lib/public-origin.ts +0 -13
  46. package/src/lib/role-lifecycle.ts +34 -0
  47. package/src/lib/role-view.ts +50 -0
  48. package/src/lib/runtime.ts +48 -50
  49. 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>