@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.
- package/README.md +23 -26
- package/dist/commands/api.d.ts +0 -1
- 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/dev-runner.d.ts +12 -1
- package/dist/commands/dev-runner.d.ts.map +1 -1
- package/dist/commands/worker-group.d.ts +1 -0
- package/dist/commands/worker-group.d.ts.map +1 -1
- package/dist/commands/worker.d.ts +1 -0
- package/dist/commands/worker.d.ts.map +1 -1
- package/dist/lib/browser-topology.d.ts +9 -33
- package/dist/lib/browser-topology.d.ts.map +1 -1
- package/dist/lib/command-line.d.ts +8 -8
- package/dist/lib/command-line.d.ts.map +1 -1
- package/dist/lib/deploy-release.d.ts.map +1 -1
- package/dist/lib/dev-supervisor.d.ts.map +1 -1
- package/dist/lib/dev-watch.d.ts +1 -1
- package/dist/lib/dev-watch.d.ts.map +1 -1
- package/dist/lib/production-roles.d.ts +5 -10
- package/dist/lib/production-roles.d.ts.map +1 -1
- package/dist/lib/production.d.ts +1 -2
- package/dist/lib/production.d.ts.map +1 -1
- package/dist/lib/role-view.d.ts +2 -3
- package/dist/lib/role-view.d.ts.map +1 -1
- package/dist/lib/runtime.d.ts +1 -0
- package/dist/lib/runtime.d.ts.map +1 -1
- package/dist/lib/worker-concurrency.d.ts +5 -0
- package/dist/lib/worker-concurrency.d.ts.map +1 -1
- package/dist/lib/worker-registry.d.ts +1 -0
- package/dist/lib/worker-registry.d.ts.map +1 -1
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/index.d.ts.map +1 -1
- package/package.json +14 -15
- package/src/commands/api.tsx +1 -5
- package/src/commands/app.tsx +5 -7
- package/src/commands/build.tsx +14 -31
- package/src/commands/dev-runner.tsx +43 -47
- package/src/commands/worker-group.tsx +4 -1
- package/src/commands/worker.tsx +4 -1
- package/src/index.tsx +3 -14
- package/src/lib/browser-topology.ts +28 -135
- package/src/lib/command-line.ts +26 -18
- package/src/lib/deploy-release.ts +0 -3
- package/src/lib/dev-supervisor.ts +7 -6
- package/src/lib/dev-watch.ts +8 -8
- package/src/lib/production-roles.ts +5 -7
- package/src/lib/production.ts +3 -8
- package/src/lib/profiles.ts +1 -1
- package/src/lib/role-lifecycle.ts +2 -2
- package/src/lib/role-view.ts +2 -3
- package/src/lib/runtime.ts +2 -0
- package/src/lib/worker-concurrency.ts +11 -0
- package/src/lib/worker-registry.ts +5 -1
- package/src/ui/index.tsx +7 -15
- package/dist/commands/atlas.d.ts +0 -9
- package/dist/commands/atlas.d.ts.map +0 -1
- 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
|
|
48
|
-
// with JSX loads React as soon as it is evaluated, and `
|
|
49
|
-
//
|
|
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
|
-
|
|
494
|
-
appUrl
|
|
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 />
|
package/dist/commands/atlas.d.ts
DELETED
|
@@ -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"}
|
package/src/commands/atlas.tsx
DELETED
|
@@ -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
|
-
}
|