@sixb/cli 0.1.8 → 0.1.9
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 +12 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/lib/build-runtime.d.ts +3 -0
- package/dist/lib/build-runtime.d.ts.map +1 -0
- package/package.json +17 -17
- package/src/commands/build.tsx +2 -10
- package/src/index.tsx +1 -1
- package/src/lib/build-runtime.ts +41 -0
package/README.md
CHANGED
|
@@ -207,6 +207,18 @@ cd my-project && bun install && sixb dev
|
|
|
207
207
|
sixb init .
|
|
208
208
|
```
|
|
209
209
|
|
|
210
|
+
## Production builds
|
|
211
|
+
|
|
212
|
+
`sixb build` bundles the config and all convention-discovered backend modules together. Configured
|
|
213
|
+
tools and discovered definitions share the same module instances. Production discovery uses this
|
|
214
|
+
built inventory, so the original `ontology/`, `connectors/`, and other discovery directories are
|
|
215
|
+
not required at startup. Rebuild to include added or changed definitions.
|
|
216
|
+
|
|
217
|
+
The runtime entry remains `.sixb/dist/sixb.config.js` (or the configured `--outdir`). Installed
|
|
218
|
+
package dependencies and any files your application reads at runtime must still be deployed.
|
|
219
|
+
Both top-level host exports and config factories are supported. Run production commands from the
|
|
220
|
+
deployed project root; an explicit `createSixb({ projectRoot })` must resolve to that same root.
|
|
221
|
+
|
|
210
222
|
## Profiles and remote commands
|
|
211
223
|
|
|
212
224
|
Login validates `/api/project`, saves the profile in `~/.config/sixb/config.json`, and selects it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,wBAAsB,QAAQ,CAAC,OAAO,GAAE,YAAiB,iBAoExD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-runtime.d.ts","sourceRoot":"","sources":["../../src/lib/build-runtime.ts"],"names":[],"mappings":"AAIA,6FAA6F;AAC7F,wBAAsB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAmC1F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixb/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Command-line interface for Sixb projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sixb",
|
|
@@ -29,21 +29,21 @@
|
|
|
29
29
|
"prepack": "bun run build"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@sixb/action-worker": "0.1.
|
|
33
|
-
"@sixb/agent-worker": "0.1.
|
|
34
|
-
"@sixb/app": "^0.1.
|
|
35
|
-
"@sixb/atlas": "^0.1.
|
|
36
|
-
"@sixb/client": "^0.1.
|
|
37
|
-
"@sixb/core": "0.1.
|
|
38
|
-
"@sixb/cli-core": "^0.1.
|
|
39
|
-
"@sixb/orchestrator": "0.1.
|
|
40
|
-
"@sixb/pipeline-worker": "0.1.
|
|
41
|
-
"@sixb/projection-worker": "0.1.
|
|
42
|
-
"@sixb/rules-worker": "0.1.
|
|
43
|
-
"@sixb/server": "0.1.
|
|
44
|
-
"@sixb/sync-worker": "0.1.
|
|
45
|
-
"@sixb/workflow-worker": "0.1.
|
|
46
|
-
"create-sixb": "^0.1.
|
|
32
|
+
"@sixb/action-worker": "0.1.9",
|
|
33
|
+
"@sixb/agent-worker": "0.1.9",
|
|
34
|
+
"@sixb/app": "^0.1.7",
|
|
35
|
+
"@sixb/atlas": "^0.1.8",
|
|
36
|
+
"@sixb/client": "^0.1.9",
|
|
37
|
+
"@sixb/core": "0.1.9",
|
|
38
|
+
"@sixb/cli-core": "^0.1.5",
|
|
39
|
+
"@sixb/orchestrator": "0.1.9",
|
|
40
|
+
"@sixb/pipeline-worker": "0.1.9",
|
|
41
|
+
"@sixb/projection-worker": "0.1.9",
|
|
42
|
+
"@sixb/rules-worker": "0.1.9",
|
|
43
|
+
"@sixb/server": "0.1.9",
|
|
44
|
+
"@sixb/sync-worker": "0.1.9",
|
|
45
|
+
"@sixb/workflow-worker": "0.1.9",
|
|
46
|
+
"create-sixb": "^0.1.3",
|
|
47
47
|
"ink": "^6.0.0",
|
|
48
48
|
"react": "^19.0.0",
|
|
49
49
|
"react-devtools-core": "^4.19.1"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"license": "MIT",
|
|
57
57
|
"engines": {
|
|
58
|
-
"bun": ">=1.
|
|
58
|
+
"bun": ">=1.4.2"
|
|
59
59
|
},
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public"
|
package/src/commands/build.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import { mkdir } from "node:fs/promises"
|
|
|
2
2
|
import { dirname, join, resolve } from "node:path"
|
|
3
3
|
import { createCustomApp } from "@sixb/app"
|
|
4
4
|
import { buildAtlasAssets } from "@sixb/atlas"
|
|
5
|
+
import { buildRuntime } from "../lib/build-runtime"
|
|
5
6
|
import { generateProjectTypes } from "../lib/typegen"
|
|
6
7
|
import { BuildView, ErrorView, renderStatic } from "../ui"
|
|
7
8
|
|
|
@@ -18,16 +19,7 @@ export async function runBuild(options: BuildOptions = {}) {
|
|
|
18
19
|
await generateProjectTypes({ entry })
|
|
19
20
|
await mkdir(outdir, { recursive: true })
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
const result = await Bun.build({
|
|
23
|
-
entrypoints: [entry],
|
|
24
|
-
outdir,
|
|
25
|
-
target: "bun",
|
|
26
|
-
sourcemap: "external",
|
|
27
|
-
minify: false,
|
|
28
|
-
packages: "external",
|
|
29
|
-
external: ["@sixb/*"],
|
|
30
|
-
})
|
|
22
|
+
const result = await buildRuntime(entry, outdir)
|
|
31
23
|
|
|
32
24
|
if (!result.success) {
|
|
33
25
|
const details = result.logs.map(String)
|
package/src/index.tsx
CHANGED
|
@@ -21,7 +21,7 @@ const args = process.argv.slice(2)
|
|
|
21
21
|
* `bun install` only warns about `engines`, so without this check an older Bun fails later on
|
|
22
22
|
* whichever API it happens to be missing, far from the cause.
|
|
23
23
|
*/
|
|
24
|
-
const MINIMUM_BUN_VERSION = "1.
|
|
24
|
+
const MINIMUM_BUN_VERSION = "1.4.2"
|
|
25
25
|
|
|
26
26
|
assertSupportedBunVersion()
|
|
27
27
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises"
|
|
2
|
+
import { basename, dirname, join, resolve } from "node:path"
|
|
3
|
+
import { listProjectModules } from "@sixb/core/internal/bootstrap"
|
|
4
|
+
|
|
5
|
+
/** Bundle a project, including modules reachable only through convention-based discovery. */
|
|
6
|
+
export async function buildRuntime(entry: string, outdir: string): Promise<Bun.BuildOutput> {
|
|
7
|
+
const projectRoot = dirname(entry)
|
|
8
|
+
const modules = await listProjectModules(projectRoot)
|
|
9
|
+
const generatedEntry = join(projectRoot, ".sixb", "build", "backend", basename(entry))
|
|
10
|
+
const imports = modules.map(
|
|
11
|
+
(module) =>
|
|
12
|
+
`{ path: ${JSON.stringify(module.path)}, kind: ${JSON.stringify(module.kind)}, ` +
|
|
13
|
+
`load: () => import(${JSON.stringify(resolve(projectRoot, module.path))}) }`
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
await mkdir(dirname(generatedEntry), { recursive: true })
|
|
17
|
+
await writeFile(
|
|
18
|
+
generatedEntry,
|
|
19
|
+
`import { withProjectModules } from "@sixb/core/internal/bootstrap"
|
|
20
|
+
|
|
21
|
+
const projectRoot = process.cwd()
|
|
22
|
+
const modules = [${imports.join(",\n")}]
|
|
23
|
+
const config = await withProjectModules(projectRoot, modules, () => import(${JSON.stringify(entry)}))
|
|
24
|
+
const candidate = config.sixb ?? config.default
|
|
25
|
+
export const sixb = typeof candidate === "function"
|
|
26
|
+
? () => withProjectModules(projectRoot, modules, candidate)
|
|
27
|
+
: candidate
|
|
28
|
+
export default sixb
|
|
29
|
+
`
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
return Bun.build({
|
|
33
|
+
entrypoints: [generatedEntry],
|
|
34
|
+
outdir,
|
|
35
|
+
target: "bun",
|
|
36
|
+
sourcemap: "external",
|
|
37
|
+
minify: false,
|
|
38
|
+
packages: "external",
|
|
39
|
+
external: ["@sixb/*"],
|
|
40
|
+
})
|
|
41
|
+
}
|