@brickkit/cli 0.9.1 → 0.11.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 +1 -1
- package/dashboard-dist/CollapsiblePanel-BX79_W-b.js +2 -0
- package/dashboard-dist/CompositeRoot-xzybXjnx.js +1 -0
- package/dashboard-dist/PopoverPopup-CvlmC7EL.js +1 -0
- package/dashboard-dist/{api-reference-r893F8zi.js → api-reference-BcAYVYwJ.js} +8 -8
- package/dashboard-dist/app.css +1 -1
- package/dashboard-dist/app.js +13 -13
- package/dashboard-dist/core-BGO9JZ1r.js +1 -0
- package/dashboard-dist/docs-DHikPD2v.js +4 -0
- package/dashboard-dist/kit.js +1 -0
- package/dashboard-dist/popover-DG498XHH.js +1 -0
- package/dashboard-dist/react-dom-client.js +3 -0
- package/dashboard-dist/react-dom.js +3 -0
- package/dashboard-dist/react-jsx-runtime.js +1 -1
- package/dashboard-dist/react.js +3 -3
- package/dashboard-dist/theme.css +123 -0
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +440 -44
- package/dist/bin.js.map +1 -1
- package/dist/client-contract-file2.js +1 -1
- package/dist/client-contract2.js +34 -8
- package/dist/client-contract2.js.map +1 -1
- package/dist/config.js +252 -0
- package/dist/config.js.map +1 -0
- package/dist/dashboard-extension.d.ts +27 -0
- package/dist/dashboard-extension.d.ts.map +1 -0
- package/dist/dashboard.d.ts +3127 -0
- package/dist/dev-telemetry-store.js +1407 -952
- package/dist/dev-telemetry-store.js.map +1 -1
- package/dist/dev-worker.js +2 -2
- package/dist/index.d.ts +95 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/lint/eslint.d.ts +2 -0
- package/dist/lint/eslint.js +1 -0
- package/dist/lint/oxlint.d.ts +19 -0
- package/dist/lint/oxlint.d.ts.map +1 -0
- package/dist/lint/oxlint.js +19 -0
- package/dist/lint/oxlint.js.map +1 -0
- package/dist/plugin.d.ts +76 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +66 -0
- package/dist/plugin.js.map +1 -0
- package/dist/presets.js +1070 -0
- package/dist/presets.js.map +1 -0
- package/dist/runner.js +112 -26
- package/dist/runner.js.map +1 -1
- package/dist/vite.d.ts +6 -3
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +9 -3
- package/dist/vite.js.map +1 -1
- package/dist/workflows2.js +1 -1
- package/inspector-dist/client/assets/app-CvoGgWcV.css +1 -0
- package/inspector-dist/client/assets/{manifest-4baa7c6f.js → manifest-139c9319.js} +1 -1
- package/inspector-dist/client/assets/root-BMHd_XHz.css +1 -0
- package/inspector-dist/server/assets/{app-C-ZVJtic.js → app-DUP5RybL.js} +11 -11
- package/inspector-dist/server/assets/{highlighted-body-B3W2YXNL-C8sq8F_D.js → highlighted-body-B3W2YXNL-D2g4hL2-.js} +1 -1
- package/inspector-dist/server/assets/{index-CYlmUaKx.js → index-D71yP6AL.js} +2 -2
- package/inspector-dist/server/assets/{index-CWJr34WJ.js → index-wGSWRns3.js} +1 -1
- package/inspector-dist/server/assets/{mermaid-3ZIDBTTL-Dv5rjfMN.js → mermaid-3ZIDBTTL-DsvuKoEV.js} +1 -1
- package/inspector-dist/server/assets/{token-DnLp3wBO.js → token-ClUZZwXl.js} +1 -1
- package/inspector-dist/server/assets/{token-util-Bpfp-B0w.js → token-util-DSxMZ6nI.js} +1 -1
- package/inspector-dist/server/assets/{wrapper-D5LIcZ_u.js → wrapper-B3vstpCO.js} +2 -2
- package/inspector-dist/server/assets/{zstd-browser-decoder-BM8GpVB8.js → zstd-browser-decoder-Dn82m2BU.js} +1 -1
- package/inspector-dist/server/index.js +1 -1
- package/package.json +30 -6
- package/dashboard-dist/CollapsiblePanel-a54TwMKb.js +0 -2
- package/dashboard-dist/PopoverPopup-BLzjTqsi.js +0 -1
- package/dashboard-dist/core-BWAwhSFf.js +0 -1
- package/dashboard-dist/docs-CkMy3Y5i.js +0 -4
- package/dashboard-dist/preload-helper-CjQDFR0M.js +0 -1
- package/dist/build.js +0 -88
- package/dist/build.js.map +0 -1
- package/inspector-dist/client/assets/app-CY7CQBRo.css +0 -1
- package/inspector-dist/client/assets/root-CfCr265_.css +0 -1
- /package/inspector-dist/client/assets/{root-Bmn5n3jF.js → root-cbi6iYwg.js} +0 -0
package/dist/config.js
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { a as writeDashboardExtension, i as themeCss } from "./dev-telemetry-store.js";
|
|
2
|
+
import { t as loadBrickApp } from "./app-entry2.js";
|
|
3
|
+
import { i as workflowTransformPlugin, t as buildAppWorkflows } from "./workflows2.js";
|
|
4
|
+
import { i as emitCompiledApplication, n as compileBrickApplication } from "./compiler2.js";
|
|
5
|
+
import { pathToFileURL } from "node:url";
|
|
6
|
+
import { mkdir, mkdtemp, rename, rm } from "node:fs/promises";
|
|
7
|
+
import { dirname, join, resolve } from "node:path";
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
9
|
+
import { aot } from "elysia/plugin/aot/bun";
|
|
10
|
+
//#region src/compiler/aot.ts
|
|
11
|
+
/** Keep the pinned Elysia beta's incomplete stripping from breaking builds. */
|
|
12
|
+
function brickAot(entry, hasSockets) {
|
|
13
|
+
if (hasSockets) return aot(entry, {
|
|
14
|
+
target: "bun",
|
|
15
|
+
strip: false
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
name: "brick-elysia-aot",
|
|
19
|
+
async setup(build) {
|
|
20
|
+
await aot(entry, {
|
|
21
|
+
target: "bun",
|
|
22
|
+
strip: true
|
|
23
|
+
}).setup({
|
|
24
|
+
...build,
|
|
25
|
+
onLoad(options, callback) {
|
|
26
|
+
return build.onLoad(options, async (args) => {
|
|
27
|
+
const result = await callback(args);
|
|
28
|
+
if (!result || !("contents" in result) || typeof result.contents !== "string") return result;
|
|
29
|
+
let contents = result.contents;
|
|
30
|
+
if (/[/\\]elysia[/\\]dist[/\\]ws[/\\]route\.m?js$/.test(args.path) && contents.includes("[elysia-aot] WebSocket route builder was stripped")) {
|
|
31
|
+
for (const name of ["resolveWSOptions", "accumulateWSOptions"]) if (!contents.includes(`export function ${name}`)) contents += `\nexport function ${name}() { throw new Error("WebSocket support was stripped"); }\n`;
|
|
32
|
+
}
|
|
33
|
+
return contents === result.contents ? result : {
|
|
34
|
+
...result,
|
|
35
|
+
contents
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/build.ts
|
|
45
|
+
/** Bundle an exported BrickApp with generated handlers and its original configuration. */
|
|
46
|
+
async function buildApplication(options) {
|
|
47
|
+
const entry = resolve(options.entry);
|
|
48
|
+
if (!await Bun.file(entry).exists()) throw new Error(`Brick compiler: entry not found: ${entry}`);
|
|
49
|
+
const outdir = resolve(options.outdir ?? "dist/brick");
|
|
50
|
+
if (entry === join(outdir, "server.js") || entry === join(outdir, "routes.js")) throw new Error("Brick compiler: output would overwrite the application entry");
|
|
51
|
+
const port = options.port ?? 4e3;
|
|
52
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error("Brick compiler: port must be an integer between 1 and 65535");
|
|
53
|
+
themeCss(options.dashboard?.theme);
|
|
54
|
+
const extension = options.dashboard?.extension ? resolve(options.dashboard.extension) : void 0;
|
|
55
|
+
if (extension && !await Bun.file(extension).exists()) throw new Error(`Brick compiler: dashboard extension not found: ${extension}`);
|
|
56
|
+
const app = await loadBrickApp(entry);
|
|
57
|
+
await buildAppWorkflows(app);
|
|
58
|
+
const services = [...app.definition.services];
|
|
59
|
+
const compilation = compileBrickApplication({
|
|
60
|
+
services,
|
|
61
|
+
prefix: app.definition.prefix
|
|
62
|
+
});
|
|
63
|
+
await mkdir(dirname(outdir), { recursive: true });
|
|
64
|
+
const staging = await mkdtemp(join(dirname(outdir), ".brick-build-"));
|
|
65
|
+
try {
|
|
66
|
+
await Bun.write(join(staging, "routes.js"), emitCompiledApplication(compilation.ir));
|
|
67
|
+
const source = `import { loadCompiledBrickApp } from "@brickkit/core";
|
|
68
|
+
import { ir, bind } from "./routes.js";
|
|
69
|
+
export const app = await loadCompiledBrickApp(() => import(${JSON.stringify(entry)}), ir, bind);
|
|
70
|
+
if (import.meta.main) {
|
|
71
|
+
const port = Number(process.env.PORT ?? ${port});
|
|
72
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error("Invalid PORT: must be between 1 and 65535");
|
|
73
|
+
await app.start?.();
|
|
74
|
+
app.listen(port);
|
|
75
|
+
app.events?.start();
|
|
76
|
+
console.log("Brick compiled server listening on http://localhost:" + app.server.port);
|
|
77
|
+
let stopping = false;
|
|
78
|
+
const stop = async (signal: string) => {
|
|
79
|
+
// A second signal exits at once, for a delivery that never finishes.
|
|
80
|
+
if (stopping) process.exit(signal === "SIGINT" ? 130 : 143);
|
|
81
|
+
stopping = true;
|
|
82
|
+
await app.events?.stop();
|
|
83
|
+
await app.stop();
|
|
84
|
+
process.exit(0);
|
|
85
|
+
};
|
|
86
|
+
// on, not once: the workflow runtime bundles signal-exit, which re-raises a signal when no listener is left.
|
|
87
|
+
process.on("SIGINT", stop);
|
|
88
|
+
process.on("SIGTERM", stop);
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
await Bun.write(join(staging, "entry.ts"), source);
|
|
92
|
+
const workflows = app.events?.workflows ? await workflowTransformPlugin(app.events.workflows.root) : void 0;
|
|
93
|
+
const result = await Bun.build({
|
|
94
|
+
entrypoints: [join(staging, "entry.ts")],
|
|
95
|
+
target: "bun",
|
|
96
|
+
format: "esm",
|
|
97
|
+
outdir: staging,
|
|
98
|
+
naming: "server.js",
|
|
99
|
+
sourcemap: "external",
|
|
100
|
+
plugins: [...options.aot === false ? [] : [brickAot(join(staging, "entry.ts"), app.definition.sockets.length > 0)], ...workflows ? [workflows] : []]
|
|
101
|
+
});
|
|
102
|
+
if (!result.success) throw new AggregateError(result.logs, "Brick compiler: bundling failed");
|
|
103
|
+
await Bun.write(join(staging, "brick-ir.json"), JSON.stringify(compilation.ir, null, 2) + "\n");
|
|
104
|
+
const dashboard = await writeDashboardExtension(extension, app.definition.plugins ?? [], join(staging, "dashboard")) ? join(outdir, "dashboard") : void 0;
|
|
105
|
+
await mkdir(outdir, { recursive: true });
|
|
106
|
+
for (const name of [
|
|
107
|
+
"routes.js",
|
|
108
|
+
"brick-ir.json",
|
|
109
|
+
"server.js.map",
|
|
110
|
+
"server.js"
|
|
111
|
+
]) await rename(join(staging, name), join(outdir, name));
|
|
112
|
+
if (dashboard) {
|
|
113
|
+
await rm(dashboard, {
|
|
114
|
+
recursive: true,
|
|
115
|
+
force: true
|
|
116
|
+
});
|
|
117
|
+
await rename(join(staging, "dashboard"), dashboard);
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
outdir,
|
|
121
|
+
entry: join(outdir, "server.js"),
|
|
122
|
+
ir: compilation.ir,
|
|
123
|
+
/** The built dashboard extension's folder, when there is one. */
|
|
124
|
+
dashboard
|
|
125
|
+
};
|
|
126
|
+
} finally {
|
|
127
|
+
await rm(staging, {
|
|
128
|
+
recursive: true,
|
|
129
|
+
force: true
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/config.ts
|
|
135
|
+
/** Types the config file in the editor; the CLI validates it at load. */
|
|
136
|
+
function defineConfig(config) {
|
|
137
|
+
return config;
|
|
138
|
+
}
|
|
139
|
+
const CONFIG_FILE = "brick.config.ts";
|
|
140
|
+
/** A missing or invalid config file; the message names the file and key. */
|
|
141
|
+
var ConfigError = class extends Error {};
|
|
142
|
+
/** The nearest `brick.config.ts` in `cwd` or its parents. */
|
|
143
|
+
function findConfigFile(cwd = process.cwd()) {
|
|
144
|
+
for (let dir = resolve(cwd);; dir = dirname(dir)) {
|
|
145
|
+
const file = join(dir, CONFIG_FILE);
|
|
146
|
+
if (existsSync(file)) return file;
|
|
147
|
+
if (dirname(dir) === dir) return void 0;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Load and validate the project's config: `explicit` (`--config`) when given,
|
|
152
|
+
* else the nearest `brick.config.ts`. Returns undefined when there is none.
|
|
153
|
+
*/
|
|
154
|
+
async function loadConfig(explicit, cwd = process.cwd()) {
|
|
155
|
+
const file = explicit ? resolve(cwd, explicit) : findConfigFile(cwd);
|
|
156
|
+
if (!file) return void 0;
|
|
157
|
+
if (!existsSync(file)) throw new ConfigError(`Brick: config file not found: ${file}`);
|
|
158
|
+
const config = (await import(pathToFileURL(file).href)).default;
|
|
159
|
+
validateConfig(config, file.endsWith("brick.config.ts") ? CONFIG_FILE : file);
|
|
160
|
+
const root = dirname(file);
|
|
161
|
+
return {
|
|
162
|
+
file,
|
|
163
|
+
root,
|
|
164
|
+
config,
|
|
165
|
+
entry: resolve(root, config.entry ?? "src/app.ts"),
|
|
166
|
+
services: resolve(root, config.services ?? "src/services"),
|
|
167
|
+
generated: resolve(root, config.generated ?? "_brick")
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
const isString = (v) => typeof v === "string" && v.length > 0;
|
|
171
|
+
const isBoolean = (v) => typeof v === "boolean";
|
|
172
|
+
const isPort = (v) => Number.isInteger(v) && v >= 1 && v <= 65535;
|
|
173
|
+
const isRecordOf = (check) => (v) => isPlainObject(v) && Object.values(v).every(check);
|
|
174
|
+
const isArrayOf = (check) => (v) => Array.isArray(v) && v.every(check);
|
|
175
|
+
const PRESETS = [
|
|
176
|
+
"recommended",
|
|
177
|
+
"layout",
|
|
178
|
+
"strict",
|
|
179
|
+
"plugin"
|
|
180
|
+
];
|
|
181
|
+
const SEVERITIES = [
|
|
182
|
+
"error",
|
|
183
|
+
"warn",
|
|
184
|
+
"off"
|
|
185
|
+
];
|
|
186
|
+
const SCHEMA = {
|
|
187
|
+
entry: [isString, "must be a file path"],
|
|
188
|
+
services: [isString, "must be a folder path"],
|
|
189
|
+
generated: [isString, "must be a folder path"],
|
|
190
|
+
client: { output: [isString, "must be a file path"] },
|
|
191
|
+
openapi: { output: [isString, "must be a file path"] },
|
|
192
|
+
dev: {
|
|
193
|
+
port: [isPort, "must be a port number"],
|
|
194
|
+
frontend: [isString, "must be a command"],
|
|
195
|
+
dashboard: {
|
|
196
|
+
port: [isPort, "must be a port number"],
|
|
197
|
+
historyDays: [(v) => Number.isSafeInteger(v) && v >= 0, "must be a whole number of days, or 0 for none"]
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
build: {
|
|
201
|
+
outdir: [isString, "must be a folder path"],
|
|
202
|
+
aot: [isBoolean, "must be true or false"],
|
|
203
|
+
requestLogging: [isBoolean, "must be true or false"]
|
|
204
|
+
},
|
|
205
|
+
dashboard: {
|
|
206
|
+
extension: [isString, "must be a file path"],
|
|
207
|
+
theme: {
|
|
208
|
+
light: [isRecordOf(isString), "must map token names to values"],
|
|
209
|
+
dark: [isRecordOf(isString), "must map token names to values"],
|
|
210
|
+
radius: [isString, "must be a CSS length"],
|
|
211
|
+
fonts: {
|
|
212
|
+
sans: [isString, "must be a font-family value"],
|
|
213
|
+
mono: [isString, "must be a font-family value"]
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
lint: {
|
|
218
|
+
presets: [isArrayOf((v) => PRESETS.includes(v)), `must list presets from ${PRESETS.join(", ")}`],
|
|
219
|
+
rules: [isRecordOf((v) => SEVERITIES.includes(v)), "must map rule names to \"error\", \"warn\" or \"off\""],
|
|
220
|
+
ignore: [isArrayOf(isString), "must be a list of glob patterns"]
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
function isPlainObject(value) {
|
|
224
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
225
|
+
}
|
|
226
|
+
/** Throws on an unknown key, a bad type, or `dev.frontend` without `client.output`. */
|
|
227
|
+
function validateConfig(config, label = CONFIG_FILE) {
|
|
228
|
+
const fail = (message) => {
|
|
229
|
+
throw new ConfigError(`${label}: ${message}`);
|
|
230
|
+
};
|
|
231
|
+
if (!isPlainObject(config)) fail("must default-export defineConfig({ ... })");
|
|
232
|
+
const walk = (value, shape, path) => {
|
|
233
|
+
for (const [key, child] of Object.entries(value)) {
|
|
234
|
+
const keyPath = path + key;
|
|
235
|
+
const rule = shape[key];
|
|
236
|
+
if (!rule) fail(`unknown key ${keyPath}`);
|
|
237
|
+
if (child === void 0) continue;
|
|
238
|
+
if (keyPath === "dev.dashboard" && child === false) continue;
|
|
239
|
+
if (Array.isArray(rule)) {
|
|
240
|
+
if (!rule[0](child)) fail(`${keyPath} ${rule[1]}`);
|
|
241
|
+
} else if (!isPlainObject(child)) fail(`${keyPath} must be an object${keyPath === "dev.dashboard" ? " or false" : ""}`);
|
|
242
|
+
else walk(child, rule, `${keyPath}.`);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
walk(config, SCHEMA, "");
|
|
246
|
+
const typed = config;
|
|
247
|
+
if (typed.dev?.frontend && !typed.client?.output) fail("dev.frontend requires client.output");
|
|
248
|
+
}
|
|
249
|
+
//#endregion
|
|
250
|
+
export { buildApplication as i, defineConfig as n, loadConfig as r, ConfigError as t };
|
|
251
|
+
|
|
252
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","names":[],"sources":["../src/compiler/aot.ts","../src/build.ts","../src/config.ts"],"sourcesContent":["import { aot } from \"elysia/plugin/aot/bun\";\nimport type { BunPlugin } from \"bun\";\n\n/** Keep the pinned Elysia beta's incomplete stripping from breaking builds. */\nexport function brickAot(entry: string, hasSockets: boolean): BunPlugin {\n // WS routes still need cookie setup during reconstruction in beta.29.\n // Retain those modules while continuing to precompile HTTP handlers.\n if (hasSockets) return aot(entry, { target: \"bun\", strip: false });\n return {\n name: \"brick-elysia-aot\",\n async setup(build) {\n await aot(entry, { target: \"bun\", strip: true }).setup({\n ...build,\n onLoad(options, callback) {\n return build.onLoad(options, async (args) => {\n const result = await callback(args);\n if (\n !result ||\n !(\"contents\" in result) ||\n typeof result.contents !== \"string\"\n )\n return result;\n let contents = result.contents;\n if (\n /[/\\\\]elysia[/\\\\]dist[/\\\\]ws[/\\\\]route\\.m?js$/.test(args.path) &&\n contents.includes(\n \"[elysia-aot] WebSocket route builder was stripped\",\n )\n ) {\n for (const name of [\"resolveWSOptions\", \"accumulateWSOptions\"]) {\n if (!contents.includes(`export function ${name}`))\n contents += `\\nexport function ${name}() { throw new Error(\"WebSocket support was stripped\"); }\\n`;\n }\n }\n return contents === result.contents\n ? result\n : { ...result, contents };\n });\n },\n });\n },\n };\n}\n","import { mkdtemp, mkdir, rename, rm } from \"node:fs/promises\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { compileBrickApplication, emitCompiledApplication } from \"./compiler\";\nimport { brickAot } from \"./compiler/aot\";\nimport { loadBrickApp } from \"./app-entry\";\nimport { buildAppWorkflows, workflowTransformPlugin } from \"./workflows\";\nimport {\n themeCss,\n writeDashboardExtension,\n type DashboardExtensionOptions,\n} from \"./dashboard-extension\";\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 * The dashboard's extension, built into `<outdir>/dashboard` with those of\n * the app's plugins for the production dashboard to serve; its theme is\n * checked here too.\n */\n dashboard?: DashboardExtensionOptions;\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 themeCss(options.dashboard?.theme);\n const extension = options.dashboard?.extension\n ? resolve(options.dashboard.extension)\n : undefined;\n if (extension && !(await Bun.file(extension).exists()))\n throw new Error(\n `Brick compiler: dashboard extension not found: ${extension}`,\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 await app.start?.();\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 : [\n brickAot(\n join(staging, \"entry.ts\"),\n app.definition.sockets.length > 0,\n ),\n ]),\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 const dashboard = (await writeDashboardExtension(\n extension,\n app.definition.plugins ?? [],\n join(staging, \"dashboard\"),\n ))\n ? join(outdir, \"dashboard\")\n : undefined;\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 if (dashboard) {\n await rm(dashboard, { recursive: true, force: true });\n await rename(join(staging, \"dashboard\"), dashboard);\n }\n return {\n outdir,\n entry: join(outdir, \"server.js\"),\n ir: compilation.ir,\n /** The built dashboard extension's folder, when there is one. */\n dashboard,\n };\n } finally {\n await rm(staging, { recursive: true, force: true });\n }\n}\n","import { existsSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\n\nimport type {\n DashboardExtensionOptions,\n DashboardTheme,\n} from \"./dashboard-extension\";\n\nexport type { DashboardExtensionOptions, DashboardTheme };\n\nexport type LintSeverity = \"error\" | \"warn\" | \"off\";\nexport type LintPreset = \"recommended\" | \"layout\" | \"strict\" | \"plugin\";\n\n/**\n * Project and tooling settings read by the `brick` CLI and its lint rules.\n * Paths are relative to the folder that holds `brick.config.ts`. Runtime\n * behaviour (prefix, docs, telemetry, events, sockets) stays in `brick()`.\n */\nexport interface BrickConfig {\n /** App entry whose default export is the BrickApp (default `src/app.ts`). */\n entry?: string;\n /** Folder scanned for definition files (default `src/services`). */\n services?: string;\n /** Folder for `services.gen.ts` and the default contract (default `_brick`). */\n generated?: string;\n client?: { output?: string };\n openapi?: { output?: string };\n dev?: {\n port?: number;\n /** Frontend command, started once the client contract exists. Needs `client.output`. */\n frontend?: string;\n dashboard?: { port?: number; historyDays?: number } | false;\n };\n build?: { outdir?: string; aot?: boolean; requestLogging?: boolean };\n dashboard?: DashboardExtensionOptions;\n lint?: {\n presets?: LintPreset[];\n rules?: Record<string, LintSeverity>;\n ignore?: string[];\n };\n}\n\n/** Types the config file in the editor; the CLI validates it at load. */\nexport function defineConfig(config: BrickConfig): BrickConfig {\n return config;\n}\n\nexport const CONFIG_FILE = \"brick.config.ts\";\n\n/** A missing or invalid config file; the message names the file and key. */\nexport class ConfigError extends Error {}\n\nexport interface LoadedConfig {\n /** Absolute path of the config file. */\n file: string;\n /** Folder the config's paths are relative to. */\n root: string;\n config: BrickConfig;\n /** Absolute paths with defaults applied. */\n entry: string;\n services: string;\n generated: string;\n}\n\n/** The nearest `brick.config.ts` in `cwd` or its parents. */\nexport function findConfigFile(cwd = process.cwd()): string | undefined {\n for (let dir = resolve(cwd); ; dir = dirname(dir)) {\n const file = join(dir, CONFIG_FILE);\n if (existsSync(file)) return file;\n if (dirname(dir) === dir) return undefined;\n }\n}\n\n/**\n * Load and validate the project's config: `explicit` (`--config`) when given,\n * else the nearest `brick.config.ts`. Returns undefined when there is none.\n */\nexport async function loadConfig(\n explicit?: string,\n cwd = process.cwd(),\n): Promise<LoadedConfig | undefined> {\n const file = explicit ? resolve(cwd, explicit) : findConfigFile(cwd);\n if (!file) return undefined;\n if (!existsSync(file))\n throw new ConfigError(`Brick: config file not found: ${file}`);\n const module = await import(pathToFileURL(file).href);\n const config = module.default as BrickConfig;\n validateConfig(config, file.endsWith(CONFIG_FILE) ? CONFIG_FILE : file);\n const root = dirname(file);\n return {\n file,\n root,\n config,\n entry: resolve(root, config.entry ?? \"src/app.ts\"),\n services: resolve(root, config.services ?? \"src/services\"),\n generated: resolve(root, config.generated ?? \"_brick\"),\n };\n}\n\ntype Check = (value: unknown) => boolean;\ntype Shape = { [key: string]: [Check, string] | Shape };\n\nconst isString: Check = (v) => typeof v === \"string\" && v.length > 0;\nconst isBoolean: Check = (v) => typeof v === \"boolean\";\nconst isPort: Check = (v) =>\n Number.isInteger(v) && (v as number) >= 1 && (v as number) <= 65535;\nconst isRecordOf =\n (check: Check): Check =>\n (v) =>\n isPlainObject(v) && Object.values(v).every(check);\nconst isArrayOf =\n (check: Check): Check =>\n (v) =>\n Array.isArray(v) && v.every(check);\nconst PRESETS = [\"recommended\", \"layout\", \"strict\", \"plugin\"];\nconst SEVERITIES = [\"error\", \"warn\", \"off\"];\n\nconst SCHEMA: Shape = {\n entry: [isString, \"must be a file path\"],\n services: [isString, \"must be a folder path\"],\n generated: [isString, \"must be a folder path\"],\n client: { output: [isString, \"must be a file path\"] },\n openapi: { output: [isString, \"must be a file path\"] },\n dev: {\n port: [isPort, \"must be a port number\"],\n frontend: [isString, \"must be a command\"],\n // `false`, or the shape below, checked in validateConfig.\n dashboard: {\n port: [isPort, \"must be a port number\"],\n historyDays: [\n (v) => Number.isSafeInteger(v) && (v as number) >= 0,\n \"must be a whole number of days, or 0 for none\",\n ],\n },\n },\n build: {\n outdir: [isString, \"must be a folder path\"],\n aot: [isBoolean, \"must be true or false\"],\n requestLogging: [isBoolean, \"must be true or false\"],\n },\n dashboard: {\n extension: [isString, \"must be a file path\"],\n theme: {\n light: [isRecordOf(isString), \"must map token names to values\"],\n dark: [isRecordOf(isString), \"must map token names to values\"],\n radius: [isString, \"must be a CSS length\"],\n fonts: {\n sans: [isString, \"must be a font-family value\"],\n mono: [isString, \"must be a font-family value\"],\n },\n },\n },\n lint: {\n presets: [\n isArrayOf((v) => PRESETS.includes(v as string)),\n `must list presets from ${PRESETS.join(\", \")}`,\n ],\n rules: [\n isRecordOf((v) => SEVERITIES.includes(v as string)),\n 'must map rule names to \"error\", \"warn\" or \"off\"',\n ],\n ignore: [isArrayOf(isString), \"must be a list of glob patterns\"],\n },\n};\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/** Throws on an unknown key, a bad type, or `dev.frontend` without `client.output`. */\nexport function validateConfig(\n config: unknown,\n label = CONFIG_FILE,\n): asserts config is BrickConfig {\n const fail = (message: string): never => {\n throw new ConfigError(`${label}: ${message}`);\n };\n if (!isPlainObject(config)) fail(\"must default-export defineConfig({ ... })\");\n const walk = (value: Record<string, unknown>, shape: Shape, path: string) => {\n for (const [key, child] of Object.entries(value)) {\n const keyPath = path + key;\n const rule = shape[key];\n if (!rule) fail(`unknown key ${keyPath}`);\n if (child === undefined) continue;\n if (keyPath === \"dev.dashboard\" && child === false) continue;\n if (Array.isArray(rule)) {\n if (!rule[0](child)) fail(`${keyPath} ${rule[1]}`);\n } else if (!isPlainObject(child)) {\n fail(\n `${keyPath} must be an object${keyPath === \"dev.dashboard\" ? \" or false\" : \"\"}`,\n );\n } else walk(child, rule as Shape, `${keyPath}.`);\n }\n };\n walk(config as Record<string, unknown>, SCHEMA, \"\");\n const typed = config as BrickConfig;\n if (typed.dev?.frontend && !typed.client?.output)\n fail(\"dev.frontend requires client.output\");\n}\n"],"mappings":";;;;;;;;;;;AAIA,SAAgB,SAAS,OAAe,YAAgC;CAGtE,IAAI,YAAY,OAAO,IAAI,OAAO;EAAE,QAAQ;EAAO,OAAO;CAAM,CAAC;CACjE,OAAO;EACL,MAAM;EACN,MAAM,MAAM,OAAO;GACjB,MAAM,IAAI,OAAO;IAAE,QAAQ;IAAO,OAAO;GAAK,CAAC,CAAC,CAAC,MAAM;IACrD,GAAG;IACH,OAAO,SAAS,UAAU;KACxB,OAAO,MAAM,OAAO,SAAS,OAAO,SAAS;MAC3C,MAAM,SAAS,MAAM,SAAS,IAAI;MAClC,IACE,CAAC,UACD,EAAE,cAAc,WAChB,OAAO,OAAO,aAAa,UAE3B,OAAO;MACT,IAAI,WAAW,OAAO;MACtB,IACE,+CAA+C,KAAK,KAAK,IAAI,KAC7D,SAAS,SACP,mDACF,GAEK;YAAA,MAAM,QAAQ,CAAC,oBA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E,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;;AAGA,SAAgB,eACd,QACA,QAAQ,aACuB;CAC/B,MAAM,QAAQ,YAA2B;EACvC,MAAM,IAAI,YAAY,GAAG,MAAM,IAAI,SAAS;CAC9C;CACA,IAAI,CAAC,cAAc,MAAM,GAAG,KAAK,2CAA2C;CAC5E,MAAM,QAAQ,OAAgC,OAAc,SAAiB;EAC3E,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAAG;GAChD,MAAM,UAAU,OAAO;GACvB,MAAM,OAAO,MAAM;GACnB,IAAI,CAAC,MAAM,KAAK,eAAe,SAAS;GACxC,IAAI,UAAU,KAAA,GAAW;GACzB,IAAI,YAAY,mBAAmB,UAAU,OAAO;GACpD,IAAI,MAAM,QAAQ,IAAI,GAChB;QAAA,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,IAAI;GAAA,OAC5C,IAAI,CAAC,cAAc,KAAK,GAC7B,KACE,GAAG,QAAQ,oBAAoB,YAAY,kBAAkB,cAAc,IAC7E;QACK,KAAK,OAAO,MAAe,GAAG,QAAQ,EAAE;EACjD;CACF;CACA,KAAK,QAAmC,QAAQ,EAAE;CAClD,MAAM,QAAQ;CACd,IAAI,MAAM,KAAK,YAAY,CAAC,MAAM,QAAQ,QACxC,KAAK,qCAAqC;AAC9C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/dashboard-extension.d.ts
|
|
2
|
+
/** Token values for the dashboard's light and dark themes, its radius and fonts. */
|
|
3
|
+
interface DashboardTheme {
|
|
4
|
+
/** Colour tokens in light mode, by name: `{ primary: "oklch(0.55 0.2 260)" }`. */
|
|
5
|
+
light?: Record<string, string>;
|
|
6
|
+
/** Colour tokens in dark mode. */
|
|
7
|
+
dark?: Record<string, string>;
|
|
8
|
+
/** The base corner radius, such as `"0.5rem"`. */
|
|
9
|
+
radius?: string;
|
|
10
|
+
/** CSS font stacks. The page must be able to load the font. */
|
|
11
|
+
fonts?: {
|
|
12
|
+
sans?: string;
|
|
13
|
+
mono?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/** What `dashboard` accepts wherever the dashboard starts or is built. */
|
|
17
|
+
interface DashboardExtensionOptions {
|
|
18
|
+
/**
|
|
19
|
+
* A module whose default export is `defineDashboard({ ... })`, or the
|
|
20
|
+
* `dashboard` folder `brick build` wrote it to.
|
|
21
|
+
*/
|
|
22
|
+
extension?: string;
|
|
23
|
+
theme?: DashboardTheme;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { DashboardTheme as n, DashboardExtensionOptions as t };
|
|
27
|
+
//# sourceMappingURL=dashboard-extension.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-extension.d.ts","names":[],"sources":["../src/dashboard-extension.ts"],"mappings":";;UAeiB;;EAEf,QAAQ;;EAER,OAAO;;EAEP;;EAEA;IAAU;IAAe;;;;UAIV;;;;;EAKf;EACA,QAAQ"}
|