@brickkit/cli 0.8.1 → 0.9.0
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 +13 -3
- package/dashboard-dist/{CollapsiblePanel-DM8J3g8m.js → CollapsiblePanel-a54TwMKb.js} +1 -1
- package/dashboard-dist/{PopoverPopup-B6eMOlOC.js → PopoverPopup-BLzjTqsi.js} +1 -1
- package/dashboard-dist/{api-reference-wTdT1AVt.js → api-reference-r893F8zi.js} +2 -2
- package/dashboard-dist/app.css +1 -1
- package/dashboard-dist/app.js +13 -13
- package/dashboard-dist/core-BWAwhSFf.js +1 -0
- package/dashboard-dist/{docs-DflzpIIh.js → docs-CkMy3Y5i.js} +1 -1
- package/dashboard-dist/{preload-helper-CVJ-D494.js → preload-helper-CjQDFR0M.js} +1 -1
- package/dist/app-entry2.js +8 -1
- package/dist/app-entry2.js.map +1 -1
- package/dist/bin.js +6 -2
- package/dist/bin.js.map +1 -1
- package/dist/build.js +18 -5
- package/dist/build.js.map +1 -1
- package/dist/dev-telemetry-store.js +148 -5
- package/dist/dev-telemetry-store.js.map +1 -1
- package/dist/dev-telemetry.js.map +1 -1
- package/dist/dev-worker.js +19 -2
- package/dist/dev-worker.js.map +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/runner.js +69 -3
- package/dist/runner.js.map +1 -1
- package/dist/workflows.d.ts +61 -0
- package/dist/workflows.d.ts.map +1 -0
- package/dist/workflows.js +1 -0
- package/dist/workflows2.js +298 -0
- package/dist/workflows2.js.map +1 -0
- package/inspector-dist/LICENSE.md +201 -0
- package/inspector-dist/NOTICE +20 -0
- package/inspector-dist/client/assets/api.rpc-l0sNRNKZ.js +1 -0
- package/inspector-dist/client/assets/api.stream._streamId-l0sNRNKZ.js +1 -0
- package/inspector-dist/client/assets/app-CY7CQBRo.css +1 -0
- package/inspector-dist/client/assets/entry.client-BJ6G3n5t.js +11697 -0
- package/inspector-dist/client/assets/highlighted-body-B3W2YXNL-C-3wZnxf.js +19 -0
- package/inspector-dist/client/assets/home-CSKAS4P2.js +4979 -0
- package/inspector-dist/client/assets/index-DECCyMR0.js +4482 -0
- package/inspector-dist/client/assets/index-Dot7CgrA.js +9837 -0
- package/inspector-dist/client/assets/index-HqNj_XIX.js +200 -0
- package/inspector-dist/client/assets/manifest-4baa7c6f.js +1 -0
- package/inspector-dist/client/assets/mermaid-3ZIDBTTL-DC0K8uTy.js +58626 -0
- package/inspector-dist/client/assets/mermaid-3ZIDBTTL-F88p7PFX.css +1 -0
- package/inspector-dist/client/assets/root-Bmn5n3jF.js +305 -0
- package/inspector-dist/client/assets/root-CfCr265_.css +1 -0
- package/inspector-dist/client/assets/run-detail-CWoGxu_0.css +1 -0
- package/inspector-dist/client/assets/run-detail-Cc7tSGNq.js +6237 -0
- package/inspector-dist/client/assets/world-config-context-BAD1QCrR.js +26 -0
- package/inspector-dist/client/assets/zstd-B5R2yJjB.wasm +0 -0
- package/inspector-dist/client/assets/zstd-browser-decoder-BQoRpP7L.js +28 -0
- package/inspector-dist/server/assets/app-C-ZVJtic.js +174880 -0
- package/inspector-dist/server/assets/highlighted-body-B3W2YXNL-C8sq8F_D.js +71 -0
- package/inspector-dist/server/assets/index-BfLBLRRi.js +204 -0
- package/inspector-dist/server/assets/index-BzrGWk7J.js +1164 -0
- package/inspector-dist/server/assets/index-CWJr34WJ.js +1296 -0
- package/inspector-dist/server/assets/index-CYlmUaKx.js +191 -0
- package/inspector-dist/server/assets/mermaid-3ZIDBTTL-Dv5rjfMN.js +58 -0
- package/inspector-dist/server/assets/token-DnLp3wBO.js +95 -0
- package/inspector-dist/server/assets/token-util-Bpfp-B0w.js +33 -0
- package/inspector-dist/server/assets/wrapper-D5LIcZ_u.js +67 -0
- package/inspector-dist/server/assets/zstd-browser-decoder-BM8GpVB8.js +77 -0
- package/inspector-dist/server/index.js +58 -0
- package/package.json +12 -4
- package/dashboard-dist/core-CHWYtApw.js +0 -1
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import { r as DEFAULT_DASHBOARD_PORT } from "./dev-telemetry-store.js";
|
|
3
|
-
import {
|
|
3
|
+
import { a as parsePort, i as startWorker, n as startDevServer, r as startProdServer } from "./runner.js";
|
|
4
4
|
import { t as loadBrickApp } from "./app-entry2.js";
|
|
5
5
|
import { t as buildApplication } from "./build.js";
|
|
6
6
|
import { t as writeClientContract } from "./client-contract-file2.js";
|
|
@@ -8,7 +8,7 @@ import { generateOpenApiSpec, getGlobalRegistry } from "@brickkit/core";
|
|
|
8
8
|
import { Command, InvalidArgumentError } from "commander";
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/bin.ts
|
|
11
|
-
const CLI_VERSION = "0.
|
|
11
|
+
const CLI_VERSION = "0.9.0";
|
|
12
12
|
const PORT_HELP = "Port to listen on (CLI --port overrides PORT env, default 4000)";
|
|
13
13
|
const PORT_RESOLUTION_HELP = `
|
|
14
14
|
Port Resolution (dev/start commands):
|
|
@@ -49,6 +49,7 @@ function createProgram() {
|
|
|
49
49
|
Usage:
|
|
50
50
|
brick dev [entry] [--port <number>] [--dashboard-port <number>] [--history-days <number>] [--no-dashboard] Start development server with live reload and dashboard
|
|
51
51
|
brick start [entry] [--port <number>] Start production server
|
|
52
|
+
brick worker <entry> Deliver events without serving HTTP
|
|
52
53
|
brick build <app.ts> [--outdir <dir>] [--port <number>] [--no-aot] Compile a default-exported BrickApp into a Bun server
|
|
53
54
|
brick gen openapi <entry> [--output <file>] Generate OpenAPI 3.1 JSON specification
|
|
54
55
|
brick gen client <entry> [--output <file>] Generate a typed browser client contract
|
|
@@ -76,6 +77,9 @@ ${PORT_RESOLUTION_HELP}`);
|
|
|
76
77
|
port
|
|
77
78
|
});
|
|
78
79
|
});
|
|
80
|
+
program.command("worker").description("Deliver the app's events without serving HTTP").argument("<entry>", "Application entry file (must default-export a BrickApp)").action(async (entry) => {
|
|
81
|
+
await startWorker({ entry });
|
|
82
|
+
});
|
|
79
83
|
program.command("build").description("Compile a default-exported BrickApp into a Bun server").argument("<entry>", "Application entry file (must default-export a BrickApp)").option("--outdir <dir>", "Output directory", (v) => parseFileOption(v, "Usage: brick build <app.ts> [--outdir <directory>]")).option("--port <number>", "Default listening port", parsePortOption).option("--no-aot", "Disable ahead-of-time compilation").option("--prefix <path>", "DEPRECATED: configure prefix in brick() app instead").option("--no-request-logging", "DEPRECATED: configure requestLogging in brick() app instead").action(async (entry, opts) => {
|
|
80
84
|
if (opts.prefix !== void 0 || opts.requestLogging === false) throw new Error("Brick: configure prefix and requestLogging in your default-exported brick() app instead of build flags.");
|
|
81
85
|
const result = await buildApplication({
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","names":["cliPkg.version"],"sources":["../package.json","../src/bin.ts"],"sourcesContent":["","#!/usr/bin/env bun\nimport { Command, InvalidArgumentError } from \"commander\";\nimport { startDevServer, startProdServer } from \"./runner\";\nimport { DEFAULT_DASHBOARD_PORT } from \"./dev-dashboard\";\nimport { DEFAULT_HISTORY_DAYS } from \"./dev-history\";\nimport { buildApplication } from \"./build\";\nimport { writeClientContract } from \"./client-contract-file\";\nimport { generateOpenApiSpec, getGlobalRegistry } from \"@brickkit/core\";\nimport { parsePort } from \"./port-utils\";\nimport { loadBrickApp } from \"./app-entry\";\nimport cliPkg from \"../package.json\";\n\n// Single source of truth for the CLI version (inlined at build time).\nconst CLI_VERSION: string = cliPkg.version;\n\nconst PORT_HELP =\n \"Port to listen on (CLI --port overrides PORT env, default 4000)\";\n\nconst PORT_RESOLUTION_HELP = `\nPort Resolution (dev/start commands):\n - CLI --port flag takes precedence\n - Falls back to PORT environment variable\n - Defaults to 4000 if neither is set\n - Valid range: 1-65535\n\nExamples:\n brick dev app.ts # port 4000 (default)\n brick dev app.ts --port 5000 # port 5000 (explicit)\n PORT=3000 brick dev app.ts # port 3000 (from env)\n brick dev app.ts --port 6000 # port 6000 (CLI overrides PORT=3000)\n`;\n\nfunction parsePortOption(value: string): number {\n try {\n return parsePort(value, undefined);\n } catch (err) {\n throw new InvalidArgumentError((err as Error).message);\n }\n}\n\nfunction parseHistoryDays(value: string): number {\n const days = Number(value);\n if (!/^\\d+$/.test(value.trim()) || !Number.isSafeInteger(days)) {\n throw new InvalidArgumentError(\n `--history-days must be a whole number of days, or 0 for none (got '${value}')`,\n );\n }\n return days;\n}\n\nfunction parseFileOption(value: string, usage: string): string {\n if (value.startsWith(\"-\")) {\n throw new InvalidArgumentError(`${usage} (got flag-like value '${value}')`);\n }\n return value;\n}\n\nfunction resolveDevPort(cliPort: number | undefined): number {\n if (cliPort !== undefined) return cliPort;\n return parsePort(undefined, process.env.PORT);\n}\n\nexport function createProgram(): Command {\n const program = new Command();\n program\n .name(\"brick\")\n .description(\"🧱 Brick-TS CLI\")\n .version(CLI_VERSION)\n .showHelpAfterError()\n .addHelpText(\n \"after\",\n `\nUsage:\n brick dev [entry] [--port <number>] [--dashboard-port <number>] [--history-days <number>] [--no-dashboard] Start development server with live reload and dashboard\n brick start [entry] [--port <number>] Start production server\n brick build <app.ts> [--outdir <dir>] [--port <number>] [--no-aot] Compile a default-exported BrickApp into a Bun server\n brick gen openapi <entry> [--output <file>] Generate OpenAPI 3.1 JSON specification\n brick gen client <entry> [--output <file>] Generate a typed browser client contract\n brick info <entry> Export architecture JSON schema\n${PORT_RESOLUTION_HELP}`,\n );\n\n program\n .command(\"dev\")\n .description(\"Start development server with live reload\")\n .option(\n \"--client <file>\",\n \"Generate and watch a browser contract before startup\",\n )\n .option(\n \"--frontend <command>\",\n \"Start frontend after contract generation; requires --client\",\n )\n .option(\n \"--dashboard-port <number>\",\n `Port for the local dashboard (default ${DEFAULT_DASHBOARD_PORT})`,\n parsePortOption,\n )\n .option(\n \"--history-days <number>\",\n `Days of requests the dashboard keeps on disk, 0 for none (default ${DEFAULT_HISTORY_DAYS})`,\n parseHistoryDays,\n )\n .option(\"--no-dashboard\", \"Do not start the local dashboard\")\n .argument(\"[entry]\", \"Application entry file\")\n .option(\"--port <number>\", PORT_HELP, parsePortOption)\n .addHelpText(\"after\", PORT_RESOLUTION_HELP)\n .action(\n async (\n entry: string | undefined,\n opts: {\n port?: number;\n client?: string;\n frontend?: string;\n dashboardPort?: number;\n historyDays?: number;\n dashboard?: boolean;\n },\n ) => {\n const port = resolveDevPort(opts.port);\n if (opts.dashboard === false && opts.dashboardPort !== undefined) {\n throw new Error(\n \"Brick: --dashboard-port cannot be combined with --no-dashboard.\",\n );\n }\n if (opts.dashboard === false && opts.historyDays !== undefined) {\n throw new Error(\n \"Brick: --history-days cannot be combined with --no-dashboard.\",\n );\n }\n await startDevServer({\n entry,\n port,\n clientOutput: opts.client,\n frontend: opts.frontend,\n // The dashboard reads the app's requests, so it needs an entry.\n dashboard:\n entry && opts.dashboard !== false\n ? {\n port: opts.dashboardPort ?? DEFAULT_DASHBOARD_PORT,\n historyDays: opts.historyDays,\n }\n : false,\n });\n },\n );\n\n program\n .command(\"start\")\n .description(\"Start production server\")\n .argument(\"[entry]\", \"Application entry file\")\n .option(\"--port <number>\", PORT_HELP, parsePortOption)\n .addHelpText(\"after\", PORT_RESOLUTION_HELP)\n .action(async (entry: string | undefined, opts: { port?: number }) => {\n const port = resolveDevPort(opts.port);\n await startProdServer({ entry, port });\n });\n\n program\n .command(\"build\")\n .description(\"Compile a default-exported BrickApp into a Bun server\")\n .argument(\n \"<entry>\",\n \"Application entry file (must default-export a BrickApp)\",\n )\n .option(\"--outdir <dir>\", \"Output directory\", (v: string) =>\n parseFileOption(v, \"Usage: brick build <app.ts> [--outdir <directory>]\"),\n )\n .option(\"--port <number>\", \"Default listening port\", parsePortOption)\n .option(\"--no-aot\", \"Disable ahead-of-time compilation\")\n .option(\n \"--prefix <path>\",\n \"DEPRECATED: configure prefix in brick() app instead\",\n )\n .option(\n \"--no-request-logging\",\n \"DEPRECATED: configure requestLogging in brick() app instead\",\n )\n .action(\n async (\n entry: string,\n opts: {\n outdir?: string;\n port?: number;\n aot?: boolean;\n prefix?: string;\n requestLogging?: boolean;\n },\n ) => {\n if (opts.prefix !== undefined || opts.requestLogging === false) {\n throw new Error(\n \"Brick: configure prefix and requestLogging in your default-exported brick() app instead of build flags.\",\n );\n }\n const result = await buildApplication({\n entry,\n outdir: opts.outdir,\n port: opts.port,\n aot: opts.aot,\n });\n for (const warning of result.ir.diagnostics)\n console.warn(`[Brick compiler] ${warning}`);\n console.log(\n `Compiled ${result.ir.services.length} services / ${result.ir.routes.length} routes`,\n );\n console.log(`IR: ${result.outdir}/brick-ir.json`);\n console.log(`Run: bun ${result.entry}`);\n },\n );\n\n const gen = program\n .command(\"gen\")\n .description(\"Generate artifacts from a BrickApp entry\")\n .argument(\"[subcommand]\", \"Generator to run (openapi, client)\")\n .action((subcommand: string | undefined) => {\n console.error(\n `Unknown generator: ${subcommand ?? \"(none)\"}. Available: openapi, client`,\n );\n process.exit(1);\n });\n\n gen\n .command(\"openapi\")\n .description(\"Generate OpenAPI 3.1 JSON specification\")\n .argument(\"<entry>\", \"Application entry file\")\n .option(\n \"--output <file>\",\n \"Write specification to file instead of stdout\",\n (v: string) =>\n parseFileOption(\n v,\n \"Usage: brick gen openapi <entry> [--output <file>]\",\n ),\n )\n .action(async (entry: string, opts: { output?: string }) => {\n const app = await loadBrickApp(entry);\n const spec = generateOpenApiSpec({\n services: [...app.definition.services],\n prefix: app.definition.prefix,\n });\n const jsonOutput = JSON.stringify(spec, null, 2);\n if (opts.output) {\n await Bun.write(opts.output, jsonOutput);\n console.log(`✅ OpenAPI 3.1 specification written to ${opts.output}`);\n } else {\n console.log(jsonOutput);\n }\n });\n\n gen\n .command(\"client\")\n .description(\"Generate a typed browser client contract\")\n .argument(\"<entry>\", \"Application entry file\")\n .option(\n \"--output <file>\",\n \"Write contract to file (default _brick/contract.ts)\",\n (v: string) =>\n parseFileOption(v, \"Usage: brick gen client <entry> [--output <file>]\"),\n )\n .action(async (entry: string, opts: { output?: string }) => {\n const output = await writeClientContract(entry, opts.output);\n console.log(`Client contract written to ${output}`);\n });\n\n program\n .command(\"info\")\n .alias(\"services\")\n .description(\"Export architecture JSON schema\")\n .argument(\"<entry>\", \"Application entry file\")\n .action(async (entry: string) => {\n const app = await loadBrickApp(entry);\n const architecture = getGlobalRegistry().exportArchitecture(\n app.definition,\n );\n console.log(JSON.stringify(architecture, null, 2));\n });\n\n return program;\n}\n\nasync function main() {\n const program = createProgram();\n // Preserve legacy behavior: bare `brick` starts the dev server.\n const userArgs = process.argv.slice(2);\n if (userArgs.length === 0) {\n const port = parsePort(undefined, process.env.PORT);\n await startDevServer({ port });\n return;\n }\n await program.parseAsync(process.argv);\n}\n\nmain().catch((err) => {\n // Commander already prints validation errors (missing arg, unknown option,\n // invalid port) and exits. Only print Fatal error for action failures.\n if (err?.exitCode !== undefined) {\n process.exit(err.exitCode);\n }\n if (err?.code?.startsWith?.(\"commander.\")) {\n process.exit(1);\n }\n console.error(\"Fatal error:\", err);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;ACaA,MAAM,cAAsBA;AAE5B,MAAM,YACJ;AAEF,MAAM,uBAAuB;;;;;;;;;;;;;AAc7B,SAAS,gBAAgB,OAAuB;CAC9C,IAAI;EACF,OAAO,UAAU,OAAO,KAAA,CAAS;CACnC,SAAS,KAAK;EACZ,MAAM,IAAI,qBAAsB,IAAc,OAAO;CACvD;AACF;AAEA,SAAS,iBAAiB,OAAuB;CAC/C,MAAM,OAAO,OAAO,KAAK;CACzB,IAAI,CAAC,QAAQ,KAAK,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,cAAc,IAAI,GAC3D,MAAM,IAAI,qBACR,sEAAsE,MAAM,GAC9E;CAEF,OAAO;AACT;AAEA,SAAS,gBAAgB,OAAe,OAAuB;CAC7D,IAAI,MAAM,WAAW,GAAG,GACtB,MAAM,IAAI,qBAAqB,GAAG,MAAM,yBAAyB,MAAM,GAAG;CAE5E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GpB,IAAI,KAAK,aAAa,KAAA,GACpB,QAAQ,KAAK,IAAI,QAAQ;CAE3B,IAAI,KAAK,MAAM,aAAa,YAAY,GACtC,QAAQ,KAAK,CAAC;CAEhB,QAAQ,MAAM,gBAAgB,GAAG;CACjC,QAAQ,KAAK,CAAC;AAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"bin.js","names":["cliPkg.version"],"sources":["../package.json","../src/bin.ts"],"sourcesContent":["","#!/usr/bin/env bun\nimport { Command, InvalidArgumentError } from \"commander\";\nimport { startDevServer, startProdServer, startWorker } from \"./runner\";\nimport { DEFAULT_DASHBOARD_PORT } from \"./dev-dashboard\";\nimport { DEFAULT_HISTORY_DAYS } from \"./dev-history\";\nimport { buildApplication } from \"./build\";\nimport { writeClientContract } from \"./client-contract-file\";\nimport { generateOpenApiSpec, getGlobalRegistry } from \"@brickkit/core\";\nimport { parsePort } from \"./port-utils\";\nimport { loadBrickApp } from \"./app-entry\";\nimport cliPkg from \"../package.json\";\n\n// Single source of truth for the CLI version (inlined at build time).\nconst CLI_VERSION: string = cliPkg.version;\n\nconst PORT_HELP =\n \"Port to listen on (CLI --port overrides PORT env, default 4000)\";\n\nconst PORT_RESOLUTION_HELP = `\nPort Resolution (dev/start commands):\n - CLI --port flag takes precedence\n - Falls back to PORT environment variable\n - Defaults to 4000 if neither is set\n - Valid range: 1-65535\n\nExamples:\n brick dev app.ts # port 4000 (default)\n brick dev app.ts --port 5000 # port 5000 (explicit)\n PORT=3000 brick dev app.ts # port 3000 (from env)\n brick dev app.ts --port 6000 # port 6000 (CLI overrides PORT=3000)\n`;\n\nfunction parsePortOption(value: string): number {\n try {\n return parsePort(value, undefined);\n } catch (err) {\n throw new InvalidArgumentError((err as Error).message);\n }\n}\n\nfunction parseHistoryDays(value: string): number {\n const days = Number(value);\n if (!/^\\d+$/.test(value.trim()) || !Number.isSafeInteger(days)) {\n throw new InvalidArgumentError(\n `--history-days must be a whole number of days, or 0 for none (got '${value}')`,\n );\n }\n return days;\n}\n\nfunction parseFileOption(value: string, usage: string): string {\n if (value.startsWith(\"-\")) {\n throw new InvalidArgumentError(`${usage} (got flag-like value '${value}')`);\n }\n return value;\n}\n\nfunction resolveDevPort(cliPort: number | undefined): number {\n if (cliPort !== undefined) return cliPort;\n return parsePort(undefined, process.env.PORT);\n}\n\nexport function createProgram(): Command {\n const program = new Command();\n program\n .name(\"brick\")\n .description(\"🧱 Brick-TS CLI\")\n .version(CLI_VERSION)\n .showHelpAfterError()\n .addHelpText(\n \"after\",\n `\nUsage:\n brick dev [entry] [--port <number>] [--dashboard-port <number>] [--history-days <number>] [--no-dashboard] Start development server with live reload and dashboard\n brick start [entry] [--port <number>] Start production server\n brick worker <entry> Deliver events without serving HTTP\n brick build <app.ts> [--outdir <dir>] [--port <number>] [--no-aot] Compile a default-exported BrickApp into a Bun server\n brick gen openapi <entry> [--output <file>] Generate OpenAPI 3.1 JSON specification\n brick gen client <entry> [--output <file>] Generate a typed browser client contract\n brick info <entry> Export architecture JSON schema\n${PORT_RESOLUTION_HELP}`,\n );\n\n program\n .command(\"dev\")\n .description(\"Start development server with live reload\")\n .option(\n \"--client <file>\",\n \"Generate and watch a browser contract before startup\",\n )\n .option(\n \"--frontend <command>\",\n \"Start frontend after contract generation; requires --client\",\n )\n .option(\n \"--dashboard-port <number>\",\n `Port for the local dashboard (default ${DEFAULT_DASHBOARD_PORT})`,\n parsePortOption,\n )\n .option(\n \"--history-days <number>\",\n `Days of requests the dashboard keeps on disk, 0 for none (default ${DEFAULT_HISTORY_DAYS})`,\n parseHistoryDays,\n )\n .option(\"--no-dashboard\", \"Do not start the local dashboard\")\n .argument(\"[entry]\", \"Application entry file\")\n .option(\"--port <number>\", PORT_HELP, parsePortOption)\n .addHelpText(\"after\", PORT_RESOLUTION_HELP)\n .action(\n async (\n entry: string | undefined,\n opts: {\n port?: number;\n client?: string;\n frontend?: string;\n dashboardPort?: number;\n historyDays?: number;\n dashboard?: boolean;\n },\n ) => {\n const port = resolveDevPort(opts.port);\n if (opts.dashboard === false && opts.dashboardPort !== undefined) {\n throw new Error(\n \"Brick: --dashboard-port cannot be combined with --no-dashboard.\",\n );\n }\n if (opts.dashboard === false && opts.historyDays !== undefined) {\n throw new Error(\n \"Brick: --history-days cannot be combined with --no-dashboard.\",\n );\n }\n await startDevServer({\n entry,\n port,\n clientOutput: opts.client,\n frontend: opts.frontend,\n // The dashboard reads the app's requests, so it needs an entry.\n dashboard:\n entry && opts.dashboard !== false\n ? {\n port: opts.dashboardPort ?? DEFAULT_DASHBOARD_PORT,\n historyDays: opts.historyDays,\n }\n : false,\n });\n },\n );\n\n program\n .command(\"start\")\n .description(\"Start production server\")\n .argument(\"[entry]\", \"Application entry file\")\n .option(\"--port <number>\", PORT_HELP, parsePortOption)\n .addHelpText(\"after\", PORT_RESOLUTION_HELP)\n .action(async (entry: string | undefined, opts: { port?: number }) => {\n const port = resolveDevPort(opts.port);\n await startProdServer({ entry, port });\n });\n\n program\n .command(\"worker\")\n .description(\"Deliver the app's events without serving HTTP\")\n .argument(\n \"<entry>\",\n \"Application entry file (must default-export a BrickApp)\",\n )\n .action(async (entry: string) => {\n await startWorker({ entry });\n });\n\n program\n .command(\"build\")\n .description(\"Compile a default-exported BrickApp into a Bun server\")\n .argument(\n \"<entry>\",\n \"Application entry file (must default-export a BrickApp)\",\n )\n .option(\"--outdir <dir>\", \"Output directory\", (v: string) =>\n parseFileOption(v, \"Usage: brick build <app.ts> [--outdir <directory>]\"),\n )\n .option(\"--port <number>\", \"Default listening port\", parsePortOption)\n .option(\"--no-aot\", \"Disable ahead-of-time compilation\")\n .option(\n \"--prefix <path>\",\n \"DEPRECATED: configure prefix in brick() app instead\",\n )\n .option(\n \"--no-request-logging\",\n \"DEPRECATED: configure requestLogging in brick() app instead\",\n )\n .action(\n async (\n entry: string,\n opts: {\n outdir?: string;\n port?: number;\n aot?: boolean;\n prefix?: string;\n requestLogging?: boolean;\n },\n ) => {\n if (opts.prefix !== undefined || opts.requestLogging === false) {\n throw new Error(\n \"Brick: configure prefix and requestLogging in your default-exported brick() app instead of build flags.\",\n );\n }\n const result = await buildApplication({\n entry,\n outdir: opts.outdir,\n port: opts.port,\n aot: opts.aot,\n });\n for (const warning of result.ir.diagnostics)\n console.warn(`[Brick compiler] ${warning}`);\n console.log(\n `Compiled ${result.ir.services.length} services / ${result.ir.routes.length} routes`,\n );\n console.log(`IR: ${result.outdir}/brick-ir.json`);\n console.log(`Run: bun ${result.entry}`);\n },\n );\n\n const gen = program\n .command(\"gen\")\n .description(\"Generate artifacts from a BrickApp entry\")\n .argument(\"[subcommand]\", \"Generator to run (openapi, client)\")\n .action((subcommand: string | undefined) => {\n console.error(\n `Unknown generator: ${subcommand ?? \"(none)\"}. Available: openapi, client`,\n );\n process.exit(1);\n });\n\n gen\n .command(\"openapi\")\n .description(\"Generate OpenAPI 3.1 JSON specification\")\n .argument(\"<entry>\", \"Application entry file\")\n .option(\n \"--output <file>\",\n \"Write specification to file instead of stdout\",\n (v: string) =>\n parseFileOption(\n v,\n \"Usage: brick gen openapi <entry> [--output <file>]\",\n ),\n )\n .action(async (entry: string, opts: { output?: string }) => {\n const app = await loadBrickApp(entry);\n const spec = generateOpenApiSpec({\n services: [...app.definition.services],\n prefix: app.definition.prefix,\n });\n const jsonOutput = JSON.stringify(spec, null, 2);\n if (opts.output) {\n await Bun.write(opts.output, jsonOutput);\n console.log(`✅ OpenAPI 3.1 specification written to ${opts.output}`);\n } else {\n console.log(jsonOutput);\n }\n });\n\n gen\n .command(\"client\")\n .description(\"Generate a typed browser client contract\")\n .argument(\"<entry>\", \"Application entry file\")\n .option(\n \"--output <file>\",\n \"Write contract to file (default _brick/contract.ts)\",\n (v: string) =>\n parseFileOption(v, \"Usage: brick gen client <entry> [--output <file>]\"),\n )\n .action(async (entry: string, opts: { output?: string }) => {\n const output = await writeClientContract(entry, opts.output);\n console.log(`Client contract written to ${output}`);\n });\n\n program\n .command(\"info\")\n .alias(\"services\")\n .description(\"Export architecture JSON schema\")\n .argument(\"<entry>\", \"Application entry file\")\n .action(async (entry: string) => {\n const app = await loadBrickApp(entry);\n const architecture = getGlobalRegistry().exportArchitecture(\n app.definition,\n );\n console.log(JSON.stringify(architecture, null, 2));\n });\n\n return program;\n}\n\nasync function main() {\n const program = createProgram();\n // Preserve legacy behavior: bare `brick` starts the dev server.\n const userArgs = process.argv.slice(2);\n if (userArgs.length === 0) {\n const port = parsePort(undefined, process.env.PORT);\n await startDevServer({ port });\n return;\n }\n await program.parseAsync(process.argv);\n}\n\nmain().catch((err) => {\n // Commander already prints validation errors (missing arg, unknown option,\n // invalid port) and exits. Only print Fatal error for action failures.\n if (err?.exitCode !== undefined) {\n process.exit(err.exitCode);\n }\n if (err?.code?.startsWith?.(\"commander.\")) {\n process.exit(1);\n }\n console.error(\"Fatal error:\", err);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;ACaA,MAAM,cAAsBA;AAE5B,MAAM,YACJ;AAEF,MAAM,uBAAuB;;;;;;;;;;;;;AAc7B,SAAS,gBAAgB,OAAuB;CAC9C,IAAI;EACF,OAAO,UAAU,OAAO,KAAA,CAAS;CACnC,SAAS,KAAK;EACZ,MAAM,IAAI,qBAAsB,IAAc,OAAO;CACvD;AACF;AAEA,SAAS,iBAAiB,OAAuB;CAC/C,MAAM,OAAO,OAAO,KAAK;CACzB,IAAI,CAAC,QAAQ,KAAK,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,cAAc,IAAI,GAC3D,MAAM,IAAI,qBACR,sEAAsE,MAAM,GAC9E;CAEF,OAAO;AACT;AAEA,SAAS,gBAAgB,OAAe,OAAuB;CAC7D,IAAI,MAAM,WAAW,GAAG,GACtB,MAAM,IAAI,qBAAqB,GAAG,MAAM,yBAAyB,MAAM,GAAG;CAE5E,OAAO;AACT;AAEA,SAAS,eAAe,SAAqC;CAC3D,IAAI,YAAY,KAAA,GAAW,OAAO;CAClC,OAAO,UAAU,KAAA,GAAW,QAAQ,IAAI,IAAI;AAC9C;AAEA,SAA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AAC,OAAO,QAAQ;CAGpB,IAAI,KAAK,aAAa,KAAA,GACpB,QAAQ,KAAK,IAAI,QAAQ;CAE3B,IAAI,KAAK,MAAM,aAAa,YAAY,GACtC,QAAQ,KAAK,CAAC;CAEhB,QAAQ,MAAM,gBAAgB,GAAG;CACjC,QAAQ,KAAK,CAAC;AAChB,CAAC"}
|
package/dist/build.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { i as workflowTransformPlugin, t as buildAppWorkflows } from "./workflows2.js";
|
|
1
2
|
import { i as emitCompiledApplication, n as compileBrickApplication } from "./compiler2.js";
|
|
2
3
|
import { t as loadBrickApp } from "./app-entry2.js";
|
|
3
4
|
import { mkdir, mkdtemp, rename, rm } from "node:fs/promises";
|
|
@@ -13,6 +14,7 @@ async function buildApplication(options) {
|
|
|
13
14
|
const port = options.port ?? 4e3;
|
|
14
15
|
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error("Brick compiler: port must be an integer between 1 and 65535");
|
|
15
16
|
const app = await loadBrickApp(entry);
|
|
17
|
+
await buildAppWorkflows(app);
|
|
16
18
|
const services = [...app.definition.services];
|
|
17
19
|
const compilation = compileBrickApplication({
|
|
18
20
|
services,
|
|
@@ -29,13 +31,24 @@ if (import.meta.main) {
|
|
|
29
31
|
const port = Number(process.env.PORT ?? ${port});
|
|
30
32
|
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error("Invalid PORT: must be between 1 and 65535");
|
|
31
33
|
app.listen(port);
|
|
34
|
+
app.events?.start();
|
|
32
35
|
console.log("Brick compiled server listening on http://localhost:" + app.server.port);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
let stopping = false;
|
|
37
|
+
const stop = async (signal: string) => {
|
|
38
|
+
// A second signal exits at once, for a delivery that never finishes.
|
|
39
|
+
if (stopping) process.exit(signal === "SIGINT" ? 130 : 143);
|
|
40
|
+
stopping = true;
|
|
41
|
+
await app.events?.stop();
|
|
42
|
+
await app.stop();
|
|
43
|
+
process.exit(0);
|
|
44
|
+
};
|
|
45
|
+
// on, not once: the workflow runtime bundles signal-exit, which re-raises a signal when no listener is left.
|
|
46
|
+
process.on("SIGINT", stop);
|
|
47
|
+
process.on("SIGTERM", stop);
|
|
36
48
|
}
|
|
37
49
|
`;
|
|
38
50
|
await Bun.write(join(staging, "entry.ts"), source);
|
|
51
|
+
const workflows = app.events?.workflows ? await workflowTransformPlugin(app.events.workflows.root) : void 0;
|
|
39
52
|
const result = await Bun.build({
|
|
40
53
|
entrypoints: [join(staging, "entry.ts")],
|
|
41
54
|
target: "bun",
|
|
@@ -43,10 +56,10 @@ if (import.meta.main) {
|
|
|
43
56
|
outdir: staging,
|
|
44
57
|
naming: "server.js",
|
|
45
58
|
sourcemap: "external",
|
|
46
|
-
plugins: options.aot === false ? [] : [aot(join(staging, "entry.ts"), {
|
|
59
|
+
plugins: [...options.aot === false ? [] : [aot(join(staging, "entry.ts"), {
|
|
47
60
|
target: "bun",
|
|
48
61
|
strip: true
|
|
49
|
-
})]
|
|
62
|
+
})], ...workflows ? [workflows] : []]
|
|
50
63
|
});
|
|
51
64
|
if (!result.success) throw new AggregateError(result.logs, "Brick compiler: bundling failed");
|
|
52
65
|
await Bun.write(join(staging, "brick-ir.json"), JSON.stringify(compilation.ir, null, 2) + "\n");
|
package/dist/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","names":[],"sources":["../src/build.ts"],"sourcesContent":["import { mkdtemp, mkdir, rename, rm } from \"node:fs/promises\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { compileBrickApplication, emitCompiledApplication } from \"./compiler\";\nimport { aot } from \"elysia/plugin/aot/bun\";\nimport { loadBrickApp } from \"./app-entry\";\n\nexport interface BuildApplicationOptions {\n /** A module whose default export is a BrickApp, without starting a server. */\n entry: string;\n outdir?: string;\n port?: number;\n /** Precompile Elysia's HTTP handlers at build time (default true). */\n aot?: boolean;\n}\n\n/** Bundle an exported BrickApp with generated handlers and its original configuration. */\nexport async function buildApplication(options: BuildApplicationOptions) {\n const entry = resolve(options.entry);\n if (!(await Bun.file(entry).exists()))\n throw new Error(`Brick compiler: entry not found: ${entry}`);\n const outdir = resolve(options.outdir ?? \"dist/brick\");\n if (\n entry === join(outdir, \"server.js\") ||\n entry === join(outdir, \"routes.js\")\n )\n throw new Error(\n \"Brick compiler: output would overwrite the application entry\",\n );\n const port = options.port ?? 4000;\n if (!Number.isInteger(port) || port < 1 || port > 65535)\n throw new Error(\n \"Brick compiler: port must be an integer between 1 and 65535\",\n );\n const app = await loadBrickApp(entry);\n const services = [...app.definition.services];\n const compilation = compileBrickApplication({\n services,\n prefix: app.definition.prefix,\n });\n await mkdir(dirname(outdir), { recursive: true });\n const staging = await mkdtemp(join(dirname(outdir), \".brick-build-\"));\n try {\n await Bun.write(\n join(staging, \"routes.js\"),\n emitCompiledApplication(compilation.ir),\n );\n const source = `import { loadCompiledBrickApp } from \"@brickkit/core\";\nimport { ir, bind } from \"./routes.js\";\nexport const app = await loadCompiledBrickApp(() => import(${JSON.stringify(entry)}), ir, bind);\nif (import.meta.main) {\n const port = Number(process.env.PORT ?? ${port});\n if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error(\"Invalid PORT: must be between 1 and 65535\");\n app.listen(port);\n console.log(\"Brick compiled server listening on http://localhost:\" + app.server.port);\n const stop = async () => { await app.stop()
|
|
1
|
+
{"version":3,"file":"build.js","names":[],"sources":["../src/build.ts"],"sourcesContent":["import { mkdtemp, mkdir, rename, rm } from \"node:fs/promises\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { compileBrickApplication, emitCompiledApplication } from \"./compiler\";\nimport { aot } from \"elysia/plugin/aot/bun\";\nimport { loadBrickApp } from \"./app-entry\";\nimport { buildAppWorkflows, workflowTransformPlugin } from \"./workflows\";\n\nexport interface BuildApplicationOptions {\n /** A module whose default export is a BrickApp, without starting a server. */\n entry: string;\n outdir?: string;\n port?: number;\n /** Precompile Elysia's HTTP handlers at build time (default true). */\n aot?: boolean;\n}\n\n/** Bundle an exported BrickApp with generated handlers and its original configuration. */\nexport async function buildApplication(options: BuildApplicationOptions) {\n const entry = resolve(options.entry);\n if (!(await Bun.file(entry).exists()))\n throw new Error(`Brick compiler: entry not found: ${entry}`);\n const outdir = resolve(options.outdir ?? \"dist/brick\");\n if (\n entry === join(outdir, \"server.js\") ||\n entry === join(outdir, \"routes.js\")\n )\n throw new Error(\n \"Brick compiler: output would overwrite the application entry\",\n );\n const port = options.port ?? 4000;\n if (!Number.isInteger(port) || port < 1 || port > 65535)\n throw new Error(\n \"Brick compiler: port must be an integer between 1 and 65535\",\n );\n const app = await loadBrickApp(entry);\n // The bundle stays in the project, where the server finds it from the working\n // directory, as `brick start` does.\n await buildAppWorkflows(app);\n const services = [...app.definition.services];\n const compilation = compileBrickApplication({\n services,\n prefix: app.definition.prefix,\n });\n await mkdir(dirname(outdir), { recursive: true });\n const staging = await mkdtemp(join(dirname(outdir), \".brick-build-\"));\n try {\n await Bun.write(\n join(staging, \"routes.js\"),\n emitCompiledApplication(compilation.ir),\n );\n const source = `import { loadCompiledBrickApp } from \"@brickkit/core\";\nimport { ir, bind } from \"./routes.js\";\nexport const app = await loadCompiledBrickApp(() => import(${JSON.stringify(entry)}), ir, bind);\nif (import.meta.main) {\n const port = Number(process.env.PORT ?? ${port});\n if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error(\"Invalid PORT: must be between 1 and 65535\");\n app.listen(port);\n app.events?.start();\n console.log(\"Brick compiled server listening on http://localhost:\" + app.server.port);\n let stopping = false;\n const stop = async (signal: string) => {\n // A second signal exits at once, for a delivery that never finishes.\n if (stopping) process.exit(signal === \"SIGINT\" ? 130 : 143);\n stopping = true;\n await app.events?.stop();\n await app.stop();\n process.exit(0);\n };\n // on, not once: the workflow runtime bundles signal-exit, which re-raises a signal when no listener is left.\n process.on(\"SIGINT\", stop);\n process.on(\"SIGTERM\", stop);\n}\n`;\n await Bun.write(join(staging, \"entry.ts\"), source);\n const workflows = app.events?.workflows\n ? await workflowTransformPlugin(app.events.workflows.root)\n : undefined;\n const result = await Bun.build({\n entrypoints: [join(staging, \"entry.ts\")],\n target: \"bun\",\n format: \"esm\",\n outdir: staging,\n naming: \"server.js\",\n sourcemap: \"external\",\n // AOT first: the workflow plugin loads every project file it sees, so after\n // it the AOT plugin would never get to transform the entry.\n plugins: [\n ...(options.aot === false\n ? []\n : [aot(join(staging, \"entry.ts\"), { target: \"bun\", strip: true })]),\n ...(workflows ? [workflows] : []),\n ],\n });\n if (!result.success)\n throw new AggregateError(result.logs, \"Brick compiler: bundling failed\");\n await Bun.write(\n join(staging, \"brick-ir.json\"),\n JSON.stringify(compilation.ir, null, 2) + \"\\n\",\n );\n await mkdir(outdir, { recursive: true });\n for (const name of [\n \"routes.js\",\n \"brick-ir.json\",\n \"server.js.map\",\n \"server.js\",\n ])\n await rename(join(staging, name), join(outdir, name));\n return { outdir, entry: join(outdir, \"server.js\"), ir: compilation.ir };\n } finally {\n await rm(staging, { recursive: true, force: true });\n }\n}\n"],"mappings":";;;;;;;;AAiBA,eAAsB,iBAAiB,SAAkC;CACvE,MAAM,QAAQ,QAAQ,QAAQ,KAAK;CACnC,IAAI,CAAE,MAAM,IAAI,KAAK,KAAK,CAAC,CAAC,OAAO,GACjC,MAAM,IAAI,MAAM,oCAAoC,OAAO;CAC7D,MAAM,SAAS,QAAQ,QAAQ,UAAU,YAAY;CACrD,IACE,UAAU,KAAK,QAAQ,WAAW,KAClC,UAAU,KAAK,QAAQ,WAAW,GAElC,MAAM,IAAI,MACR,8DACF;CACF,MAAM,OAAO,QAAQ,QAAQ;CAC7B,IAAI,CAAC,OAAO,UAAU,IAAI,KAAK,OAAO,KAAK,OAAO,OAChD,MAAM,IAAI,MACR,6DACF;CACF,MAAM,MAAM,MAAM,aAAa,KAAK;CAGpC,MAAM,kBAAkB,GAAG;CAC3B,MAAM,WAAW,CAAC,GAAG,IAAI,WAAW,QAAQ;CAC5C,MAAM,cAAc,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;CACxE,UAAU;EACR,MAAM,GAAG,SAAS;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;CACpD;AACF"}
|
|
@@ -1,9 +1,74 @@
|
|
|
1
|
-
import { fileURLToPath } from "node:url";
|
|
2
|
-
import { existsSync, mkdirSync, watch, writeFileSync } from "node:fs";
|
|
1
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
2
|
+
import { existsSync, mkdirSync, statSync, watch, writeFileSync } from "node:fs";
|
|
3
3
|
import { readFile, readdir, stat } from "node:fs/promises";
|
|
4
4
|
import { createServer } from "node:http";
|
|
5
5
|
import { basename, dirname, extname, join, posix, relative, resolve, sep } from "node:path";
|
|
6
|
-
import {
|
|
6
|
+
import { Readable } from "node:stream";
|
|
7
|
+
import { pipeline } from "node:stream/promises";
|
|
8
|
+
import { createHash, randomBytes, timingSafeEqual } from "node:crypto";
|
|
9
|
+
//#region src/dev-inspector.ts
|
|
10
|
+
/** Where the dashboard serves the inspector. */
|
|
11
|
+
const INSPECTOR_PATH = "/workflows";
|
|
12
|
+
/** The header that proves a request comes from the dashboard. */
|
|
13
|
+
const INSPECTOR_TOKEN_HEADER = "x-brick-inspector";
|
|
14
|
+
/** The built inspector, next to `src/` in the repo and next to `dist/` when published. */
|
|
15
|
+
const INSPECTOR_DIRECTORY = fileURLToPath(new URL("../inspector-dist/", import.meta.url));
|
|
16
|
+
/** Whether a path is a regular file; any failure to find out (not a directory, name too long) says no. */
|
|
17
|
+
function isFile(path) {
|
|
18
|
+
try {
|
|
19
|
+
return statSync(path).isFile();
|
|
20
|
+
} catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A file of the inspector's browser build. Its names carry a hash of their
|
|
26
|
+
* content, so a browser may keep them for good. Anything else under `assets/`
|
|
27
|
+
* is a plain 404: the page would answer with HTML. `undefined` for requests
|
|
28
|
+
* outside `assets/`, which are the page's to answer.
|
|
29
|
+
*/
|
|
30
|
+
function browserAsset(request, client) {
|
|
31
|
+
if (request.method !== "GET" && request.method !== "HEAD") return void 0;
|
|
32
|
+
const { pathname } = new URL(request.url);
|
|
33
|
+
if (!pathname.startsWith(`/workflows/assets/`)) return void 0;
|
|
34
|
+
const file = resolve(client, pathname.slice(11));
|
|
35
|
+
if (!file.startsWith(client + sep) || !isFile(file)) return new Response("Not found", { status: 404 });
|
|
36
|
+
return new Response(Bun.file(file), { headers: { "cache-control": "public, max-age=31536000, immutable" } });
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Serve the Workflow inspector (the Workflow SDK's observability UI, built into
|
|
40
|
+
* this package) for the app's world, on a loopback port of its own. The
|
|
41
|
+
* dashboard proxies it at `/workflows`; it is the only caller that knows the
|
|
42
|
+
* token. The UI can cancel runs and resume hooks, so nothing else may reach it,
|
|
43
|
+
* and it exists only under `brick dev`.
|
|
44
|
+
*
|
|
45
|
+
* @param app - The loaded app, running in this process.
|
|
46
|
+
* @param directory - The inspector's build; this package's own by default.
|
|
47
|
+
* @returns The inspector, or `undefined` when the app runs no workflows.
|
|
48
|
+
* @throws When the inspector's build is missing.
|
|
49
|
+
*/
|
|
50
|
+
async function startInspector(app, directory = INSPECTOR_DIRECTORY) {
|
|
51
|
+
const target = app.events?.workflows;
|
|
52
|
+
if (!target) return void 0;
|
|
53
|
+
const entry = join(directory, "server", "index.js");
|
|
54
|
+
if (!existsSync(entry)) throw new Error("The workflow inspector is not built. Build it with: bun run --filter @brickkit/cli build");
|
|
55
|
+
const { createFetchHandler } = await import(pathToFileURL(entry).href);
|
|
56
|
+
const page = createFetchHandler(INSPECTOR_PATH, { world: target.world });
|
|
57
|
+
const client = join(directory, "client");
|
|
58
|
+
const token = randomBytes(16).toString("hex");
|
|
59
|
+
const server = Bun.serve({
|
|
60
|
+
hostname: "127.0.0.1",
|
|
61
|
+
port: 0,
|
|
62
|
+
idleTimeout: 0,
|
|
63
|
+
fetch: (request) => request.headers.get("x-brick-inspector") === token ? browserAsset(request, client) ?? page(request) : new Response("Forbidden", { status: 403 })
|
|
64
|
+
});
|
|
65
|
+
return {
|
|
66
|
+
port: server.port,
|
|
67
|
+
token,
|
|
68
|
+
stop: () => void server.stop(true)
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
7
72
|
//#region src/dev-history-csv.ts
|
|
8
73
|
const CSV_COLUMNS = [
|
|
9
74
|
"time",
|
|
@@ -727,6 +792,12 @@ function startDevDashboard(options) {
|
|
|
727
792
|
proxy(request, response, url);
|
|
728
793
|
return;
|
|
729
794
|
}
|
|
795
|
+
if (pathname === "/workflows" || pathname.startsWith(`/workflows/`)) {
|
|
796
|
+
response.setHeader("content-security-policy", "frame-ancestors 'self'");
|
|
797
|
+
response.setHeader("x-frame-options", "SAMEORIGIN");
|
|
798
|
+
inspector(request, response, url);
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
730
801
|
if (request.method === "POST" && pathname === "/api/ingest") {
|
|
731
802
|
ingest(request, response);
|
|
732
803
|
return;
|
|
@@ -833,6 +904,61 @@ function startDevDashboard(options) {
|
|
|
833
904
|
* `?cookie=` is the cookie parameters the reader typed into Try it, and the
|
|
834
905
|
* only cookie the app is sent (the dashboard's own are never forwarded).
|
|
835
906
|
*/
|
|
907
|
+
/**
|
|
908
|
+
* Pass a request to the workflow inspector, which the app serves on a port of
|
|
909
|
+
* its own, and stream its answer back (it follows a run's output as it
|
|
910
|
+
* grows). Anyone who can open the dashboard may look, but a change must come
|
|
911
|
+
* from the dashboard's own page: the inspector can cancel runs and resume
|
|
912
|
+
* hooks, and a page on another site could otherwise post to it.
|
|
913
|
+
*/
|
|
914
|
+
async function inspector(request, response, url) {
|
|
915
|
+
const target = options.store.inspectorTarget();
|
|
916
|
+
if (!target) {
|
|
917
|
+
send(response, 503, "The workflow inspector is not running. The app may be restarting, or it may run no workflows.", { "content-type": "text/plain; charset=utf-8" });
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
const bodyless = request.method === "GET" || request.method === "HEAD";
|
|
921
|
+
const site = request.headers["sec-fetch-site"];
|
|
922
|
+
const origin = request.headers.origin;
|
|
923
|
+
if (!bodyless && (site !== void 0 && site !== "same-origin" || origin !== void 0 && origin !== `http://${request.headers.host}`)) {
|
|
924
|
+
send(response, 403, "Forbidden");
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
const headers = new Headers();
|
|
928
|
+
for (const [name, value] of Object.entries(request.headers)) {
|
|
929
|
+
if (value === void 0 || NOT_FORWARDED.has(name)) continue;
|
|
930
|
+
if (name.startsWith("sec-")) continue;
|
|
931
|
+
headers.set(name, Array.isArray(value) ? value.join(", ") : value);
|
|
932
|
+
}
|
|
933
|
+
headers.set(INSPECTOR_TOKEN_HEADER, target.token);
|
|
934
|
+
const abort = new AbortController();
|
|
935
|
+
response.on("close", () => abort.abort());
|
|
936
|
+
try {
|
|
937
|
+
const upstream = await fetch(`http://127.0.0.1:${target.port}${url.pathname}${url.search}`, {
|
|
938
|
+
method: request.method,
|
|
939
|
+
headers,
|
|
940
|
+
redirect: "manual",
|
|
941
|
+
signal: abort.signal,
|
|
942
|
+
...bodyless ? {} : {
|
|
943
|
+
body: Readable.toWeb(request),
|
|
944
|
+
duplex: "half"
|
|
945
|
+
}
|
|
946
|
+
});
|
|
947
|
+
const returned = {};
|
|
948
|
+
upstream.headers.forEach((value, name) => {
|
|
949
|
+
if (!NOT_RETURNED.has(name)) returned[name] = value;
|
|
950
|
+
});
|
|
951
|
+
response.writeHead(upstream.status, returned);
|
|
952
|
+
if (!upstream.body || request.method === "HEAD") {
|
|
953
|
+
response.end();
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
await pipeline(Readable.fromWeb(upstream.body), response);
|
|
957
|
+
} catch {
|
|
958
|
+
if (response.headersSent) response.destroy();
|
|
959
|
+
else send(response, 502, "Could not reach the workflow inspector.");
|
|
960
|
+
}
|
|
961
|
+
}
|
|
836
962
|
async function proxy(request, response, url) {
|
|
837
963
|
const site = request.headers["sec-fetch-site"];
|
|
838
964
|
const origin = request.headers.origin;
|
|
@@ -1590,6 +1716,7 @@ var DevTelemetryStore = class {
|
|
|
1590
1716
|
#architecture = null;
|
|
1591
1717
|
#api = null;
|
|
1592
1718
|
#docs = null;
|
|
1719
|
+
#inspector;
|
|
1593
1720
|
#apiDocuments = [];
|
|
1594
1721
|
#sequence = 0;
|
|
1595
1722
|
#generation = 0;
|
|
@@ -1701,6 +1828,21 @@ var DevTelemetryStore = class {
|
|
|
1701
1828
|
docs
|
|
1702
1829
|
});
|
|
1703
1830
|
}
|
|
1831
|
+
/**
|
|
1832
|
+
* Set where the app serves its workflow inspector, or `undefined` when it
|
|
1833
|
+
* stops. The address stays here: the snapshot says only whether there is one.
|
|
1834
|
+
*/
|
|
1835
|
+
setInspector(target) {
|
|
1836
|
+
this.#inspector = target;
|
|
1837
|
+
this.#emit({
|
|
1838
|
+
type: "inspector",
|
|
1839
|
+
inspector: Boolean(target)
|
|
1840
|
+
});
|
|
1841
|
+
}
|
|
1842
|
+
/** Where the dashboard proxies the workflow inspector, when the app serves one. */
|
|
1843
|
+
inspectorTarget() {
|
|
1844
|
+
return this.#inspector;
|
|
1845
|
+
}
|
|
1704
1846
|
/** What the APIs view knows about the documents, without the documents. */
|
|
1705
1847
|
apiSnapshot() {
|
|
1706
1848
|
return this.#api;
|
|
@@ -1716,7 +1858,8 @@ var DevTelemetryStore = class {
|
|
|
1716
1858
|
reloads: [...this.#reloads],
|
|
1717
1859
|
architecture: this.#architecture,
|
|
1718
1860
|
api: this.#api,
|
|
1719
|
-
docs: this.#docs
|
|
1861
|
+
docs: this.#docs,
|
|
1862
|
+
inspector: Boolean(this.#inspector)
|
|
1720
1863
|
};
|
|
1721
1864
|
}
|
|
1722
1865
|
subscribe(listener) {
|
|
@@ -1892,6 +2035,6 @@ function numberAttribute(attributes, key) {
|
|
|
1892
2035
|
return typeof value === "number" ? value : void 0;
|
|
1893
2036
|
}
|
|
1894
2037
|
//#endregion
|
|
1895
|
-
export { isLoopbackHost as a, startDevDashboard as i, DocsHost as n, openHistory as o, DEFAULT_DASHBOARD_PORT as r, DevTelemetryStore as t };
|
|
2038
|
+
export { isLoopbackHost as a, startDevDashboard as i, DocsHost as n, openHistory as o, DEFAULT_DASHBOARD_PORT as r, startInspector as s, DevTelemetryStore as t };
|
|
1896
2039
|
|
|
1897
2040
|
//# sourceMappingURL=dev-telemetry-store.js.map
|