@sixb/cli 0.1.19 → 0.1.20

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 (58) hide show
  1. package/README.md +23 -26
  2. package/dist/commands/api.d.ts +0 -1
  3. package/dist/commands/api.d.ts.map +1 -1
  4. package/dist/commands/app.d.ts.map +1 -1
  5. package/dist/commands/build.d.ts.map +1 -1
  6. package/dist/commands/dev-runner.d.ts +12 -1
  7. package/dist/commands/dev-runner.d.ts.map +1 -1
  8. package/dist/commands/worker-group.d.ts +1 -0
  9. package/dist/commands/worker-group.d.ts.map +1 -1
  10. package/dist/commands/worker.d.ts +1 -0
  11. package/dist/commands/worker.d.ts.map +1 -1
  12. package/dist/lib/browser-topology.d.ts +9 -33
  13. package/dist/lib/browser-topology.d.ts.map +1 -1
  14. package/dist/lib/command-line.d.ts +8 -8
  15. package/dist/lib/command-line.d.ts.map +1 -1
  16. package/dist/lib/deploy-release.d.ts.map +1 -1
  17. package/dist/lib/dev-supervisor.d.ts.map +1 -1
  18. package/dist/lib/dev-watch.d.ts +1 -1
  19. package/dist/lib/dev-watch.d.ts.map +1 -1
  20. package/dist/lib/production-roles.d.ts +5 -10
  21. package/dist/lib/production-roles.d.ts.map +1 -1
  22. package/dist/lib/production.d.ts +1 -2
  23. package/dist/lib/production.d.ts.map +1 -1
  24. package/dist/lib/role-view.d.ts +2 -3
  25. package/dist/lib/role-view.d.ts.map +1 -1
  26. package/dist/lib/runtime.d.ts +1 -0
  27. package/dist/lib/runtime.d.ts.map +1 -1
  28. package/dist/lib/worker-concurrency.d.ts +5 -0
  29. package/dist/lib/worker-concurrency.d.ts.map +1 -1
  30. package/dist/lib/worker-registry.d.ts +1 -0
  31. package/dist/lib/worker-registry.d.ts.map +1 -1
  32. package/dist/ui/index.d.ts +3 -3
  33. package/dist/ui/index.d.ts.map +1 -1
  34. package/package.json +14 -15
  35. package/src/commands/api.tsx +1 -5
  36. package/src/commands/app.tsx +5 -7
  37. package/src/commands/build.tsx +14 -31
  38. package/src/commands/dev-runner.tsx +43 -47
  39. package/src/commands/worker-group.tsx +4 -1
  40. package/src/commands/worker.tsx +4 -1
  41. package/src/index.tsx +3 -14
  42. package/src/lib/browser-topology.ts +28 -135
  43. package/src/lib/command-line.ts +26 -18
  44. package/src/lib/deploy-release.ts +0 -3
  45. package/src/lib/dev-supervisor.ts +7 -6
  46. package/src/lib/dev-watch.ts +8 -8
  47. package/src/lib/production-roles.ts +5 -7
  48. package/src/lib/production.ts +3 -8
  49. package/src/lib/profiles.ts +1 -1
  50. package/src/lib/role-lifecycle.ts +2 -2
  51. package/src/lib/role-view.ts +2 -3
  52. package/src/lib/runtime.ts +2 -0
  53. package/src/lib/worker-concurrency.ts +11 -0
  54. package/src/lib/worker-registry.ts +5 -1
  55. package/src/ui/index.tsx +7 -15
  56. package/dist/commands/atlas.d.ts +0 -9
  57. package/dist/commands/atlas.d.ts.map +0 -1
  58. package/src/commands/atlas.tsx +0 -71
package/src/ui/index.tsx CHANGED
@@ -44,9 +44,9 @@ 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.
47
+ // The entrypoint and the app role render through these rather than JSX of their own: a module
48
+ // with JSX loads React as soon as it is evaluated, and `app` loads neither React nor Ink outside a
49
+ // terminal.
50
50
 
51
51
  export async function renderVersion(version: string): Promise<void> {
52
52
  await renderStatic(<VersionView version={version} />)
@@ -481,7 +481,6 @@ export function DevView({
481
481
  apiUrl,
482
482
  apiDocsUrl,
483
483
  wsUrl,
484
- uiUrl,
485
484
  appUrl,
486
485
  workers = [],
487
486
  warnings = [],
@@ -490,8 +489,8 @@ export function DevView({
490
489
  apiUrl: string
491
490
  apiDocsUrl: string
492
491
  wsUrl: string
493
- uiUrl: string | null
494
- appUrl?: string | null
492
+ /** `null` when the app could not start; a warning says why. */
493
+ appUrl: string | null
495
494
  workers?: readonly { readonly type: string; readonly concurrency: number }[]
496
495
  warnings?: readonly string[]
497
496
  }) {
@@ -500,22 +499,15 @@ export function DevView({
500
499
  { label: "API docs", value: apiDocsUrl },
501
500
  { label: "Events", value: wsUrl },
502
501
  ]
503
- if (uiUrl) {
504
- serverItems.push({ label: "Atlas UI", value: uiUrl })
505
- }
506
502
 
507
503
  return (
508
504
  <Box flexDirection="column">
509
505
  <Text bold>sixb dev</Text>
510
506
  <Text dimColor>{name}</Text>
511
507
  <Spacer />
508
+ <ServicePanel name="App" items={[{ label: "URL", value: appUrl ?? "not running" }]} />
509
+ <Spacer />
512
510
  <ServicePanel name="Server" items={serverItems} />
513
- {appUrl ? (
514
- <>
515
- <Spacer />
516
- <ServicePanel name="Custom app" items={[{ label: "URL", value: appUrl }]} />
517
- </>
518
- ) : null}
519
511
  {workers.length > 0 ? (
520
512
  <>
521
513
  <Spacer />
@@ -1,9 +0,0 @@
1
- export interface AtlasOptions {
2
- entry?: string;
3
- port?: string;
4
- host?: string;
5
- apiPublicOrigin?: string;
6
- atlasPublicOrigin?: string;
7
- }
8
- export declare function runAtlas(options?: AtlasOptions): Promise<void>;
9
- //# sourceMappingURL=atlas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"atlas.d.ts","sourceRoot":"","sources":["../../src/commands/atlas.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,wBAAsB,QAAQ,CAAC,OAAO,GAAE,YAAiB,iBAuDxD"}
@@ -1,71 +0,0 @@
1
- import { basename } from "node:path"
2
- import { type AtlasAppServer, createAtlasApp } from "@sixb/atlas"
3
- import { resolveBrowserTopology, servedUrl } from "../lib/browser-topology"
4
- import { builtAtlasOutdir, resolveProductionPaths, resolveRuntimeEntry } from "../lib/production"
5
- import { runUntilSignal, stopQuietly } from "../lib/role-lifecycle"
6
- import { loadRoleView } from "../lib/role-view"
7
-
8
- export interface AtlasOptions {
9
- entry?: string
10
- port?: string
11
- host?: string
12
- apiPublicOrigin?: string
13
- atlasPublicOrigin?: string
14
- }
15
-
16
- export async function runAtlas(options: AtlasOptions = {}) {
17
- // Before NODE_ENV changes: see loadRoleView.
18
- const view = await loadRoleView()
19
- process.env.NODE_ENV = "production"
20
-
21
- const entry = await resolveRuntimeEntry({ entry: options.entry })
22
- const { projectRoot, buildOutdir } = await resolveProductionPaths(entry)
23
- const app = view.startup({
24
- title: "Starting sixb atlas",
25
- subtitle: entry,
26
- status: "Starting Atlas",
27
- })
28
-
29
- let atlasServer: AtlasAppServer | null = null
30
-
31
- try {
32
- const topology = resolveBrowserTopology({
33
- role: "atlas",
34
- host: options.host,
35
- port: options.port,
36
- apiPublicOrigin: options.apiPublicOrigin,
37
- atlasPublicOrigin: options.atlasPublicOrigin,
38
- })
39
-
40
- const atlas = createAtlasApp({
41
- apiBaseUrl: topology.apiPublicOrigin,
42
- audience: "atlas",
43
- // No authEnabled: the page asks the API whether the project uses auth, so serving the
44
- // bundle never loads the project.
45
- })
46
- atlasServer = await atlas.start({
47
- host: topology.host,
48
- port: topology.atlasPort,
49
- development: false,
50
- outdir: builtAtlasOutdir(buildOutdir),
51
- })
52
-
53
- app.started({
54
- title: "Sixb Atlas started",
55
- name: basename(projectRoot),
56
- serviceName: "Atlas",
57
- items: [{ label: "URL", value: servedUrl(topology) }],
58
- })
59
-
60
- await runUntilSignal(async () => {
61
- app.unmount()
62
- console.log("\nShutting down atlas...")
63
- await stopQuietly(() => atlasServer?.stop() ?? Promise.resolve())
64
- })
65
- } catch (error) {
66
- app.unmount()
67
- await stopQuietly(() => atlasServer?.stop() ?? Promise.resolve())
68
- await view.error(error)
69
- process.exit(1)
70
- }
71
- }