@zenbujs/core 0.0.4 → 0.0.8
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/dist/{advice-config-BLXjqjGN.mjs → advice-config-DXSIo0sg.mjs} +49 -38
- package/dist/advice.d.mts +8 -8
- package/dist/advice.mjs +2 -2
- package/dist/base-window-BxBZ2md_.mjs +143 -0
- package/dist/build-config-Dzg2frpk.d.mts +215 -0
- package/dist/build-config-pWdmLnrk.mjs +53 -0
- package/dist/{build-electron-C3Beey84.mjs → build-electron-Dsbb1EMl.mjs} +308 -120
- package/dist/{build-source-BvC4bPqH.mjs → build-source-d1J3shV8.mjs} +62 -27
- package/dist/chunk-DsiFFCwN.mjs +16 -0
- package/dist/cli/bin.mjs +7 -7
- package/dist/cli/build.d.mts +2 -2
- package/dist/cli/build.mjs +2 -3
- package/dist/cli/resolve-config.mjs +3 -2
- package/dist/{cli-F0B4dvSg.mjs → cli-kL6mPgBE.mjs} +4 -4
- package/dist/{config-BlRXeUXx.mjs → config-BK78JDRI.mjs} +1 -1
- package/dist/config.d.mts +3 -2
- package/dist/config.mjs +3 -3
- package/dist/{db-Cd5ETuPG.mjs → db-Bc292RYo.mjs} +2 -2
- package/dist/db.d.mts +1 -1
- package/dist/db.mjs +2 -2
- package/dist/dev-B2emj0HZ.mjs +301 -0
- package/dist/env-bootstrap.d.mts +1 -1
- package/dist/env-bootstrap.mjs +52 -1
- package/dist/events.d.mts +19 -0
- package/dist/events.mjs +1 -0
- package/dist/host-version-BIrF8tX7.mjs +65 -0
- package/dist/index-w5QyDjuf.d.mts +780 -0
- package/dist/index.d.mts +5 -6
- package/dist/index.mjs +5 -5
- package/dist/installing-preload.cjs +60 -0
- package/dist/launcher.mjs +2615 -122
- package/dist/{link-BJmsKgPa.mjs → link-glX89NV5.mjs} +215 -89
- package/dist/{load-config-BG2tPIfF.mjs → load-config-C4Oe2qZO.mjs} +22 -3
- package/dist/loaders/zenbu.d.mts +1 -0
- package/dist/loaders/zenbu.mjs +108 -86
- package/dist/{monorepo-DCruz9Jx.mjs → monorepo-Dct-kkbQ.mjs} +3 -0
- package/dist/node-loader.mjs +1 -1
- package/dist/{publish-source-34Hn9zb0.mjs → publish-source-Dq2c0iOw.mjs} +2 -2
- package/dist/react.d.mts +56 -7
- package/dist/react.mjs +118 -7
- package/dist/registry-CMp8FYgS.d.mts +47 -0
- package/dist/registry-generated.d.mts +26 -0
- package/dist/registry-generated.mjs +1 -0
- package/dist/registry.d.mts +2 -2
- package/dist/{reloader-DJoCB0bC.mjs → reloader-B22UiNA2.mjs} +7 -7
- package/dist/{renderer-host-ztaSIOGx.mjs → renderer-host-DD16MXhI.mjs} +178 -57
- package/dist/{rpc-CsgWnlZx.mjs → rpc-C4_NQmpT.mjs} +11 -8
- package/dist/rpc.d.mts +1 -1
- package/dist/rpc.mjs +1 -1
- package/dist/runtime-BQWntcOb.d.mts +218 -0
- package/dist/runtime.d.mts +2 -2
- package/dist/runtime.mjs +578 -2
- package/dist/{schema-DvT61x2_.d.mts → schema-CjrMVk36.d.mts} +3 -3
- package/dist/schema.d.mts +1 -1
- package/dist/schema.mjs +27 -1
- package/dist/{server-DB3Eki_G.mjs → server-CZLMF8Dj.mjs} +6 -6
- package/dist/services/default.d.mts +3 -3
- package/dist/services/default.mjs +14 -13
- package/dist/services/index.d.mts +2 -276
- package/dist/services/index.mjs +8 -7
- package/dist/setup-gate.d.mts +1 -1
- package/dist/setup-gate.mjs +341 -1
- package/dist/{transform-DJH3vN4b.mjs → transform-BzrwkEdf.mjs} +23 -917
- package/dist/{transport-BMSzG2-F.mjs → transport-F2hv_OEm.mjs} +1 -1
- package/dist/updater-DCkz9M1c.mjs +1008 -0
- package/dist/{vite-plugins-t4MlFcz3.mjs → vite-plugins-tt6KAtyE.mjs} +27 -26
- package/dist/vite.d.mts +3 -3
- package/dist/vite.mjs +1 -1
- package/dist/{window-DUvMTons.mjs → window-YFKvAM0l.mjs} +36 -19
- package/dist/{write-9dRFczGJ.mjs → write-DgIRjo23.mjs} +1 -1
- package/package.json +18 -5
- package/dist/advice-config-D6K_a7e9.mjs +0 -2
- package/dist/base-window-D8CpxMU3.mjs +0 -94
- package/dist/base-window-OXg2KSyP.mjs +0 -2
- package/dist/build-config-BwnnfrN-.mjs +0 -23
- package/dist/chunk-Dm34NbLt.mjs +0 -6
- package/dist/config-Ch1FreWU.mjs +0 -2
- package/dist/db-Bz_CDIWg.mjs +0 -2
- package/dist/dev-DLutFPyo.mjs +0 -85
- package/dist/env-bootstrap-rj7I-59x.mjs +0 -53
- package/dist/http-B36qtsm0.mjs +0 -2
- package/dist/load-config-CQG4297M.mjs +0 -2
- package/dist/registry-CioEYLI5.d.mts +0 -61
- package/dist/reloader-FeHKV2jd.mjs +0 -2
- package/dist/renderer-host-BQpS0ZM2.mjs +0 -2
- package/dist/rpc-D_s7-WZe.mjs +0 -2
- package/dist/runtime-C95iyVn6.mjs +0 -461
- package/dist/runtime-CsiDppGF.d.mts +0 -149
- package/dist/schema-dGK6qkfR.mjs +0 -28
- package/dist/server-CgzQOPSW.mjs +0 -2
- package/dist/setup-gate-D8XfYY52.mjs +0 -140
- package/dist/transforms-DVoy8dCu.mjs +0 -47
- package/dist/transforms-EVd5Fgyk.d.mts +0 -136
- package/dist/view-registry-2zePxTEg.mjs +0 -2
- package/dist/window-S3TlTXlK.mjs +0 -2
- /package/dist/{env-bootstrap-uCKbw2q8.d.mts → env-bootstrap-rTs8KR3-.d.mts} +0 -0
- /package/dist/{index-CE0iPntP.d.mts → index-C-ALz_SH.d.mts} +0 -0
- /package/dist/{index-CKKoxA9V.d.mts → index-ClXLQ1fw.d.mts} +0 -0
- /package/dist/{index-UK58xuoR.d.mts → index-DeDxePAa.d.mts} +0 -0
- /package/dist/{log-CyKv8hQg.mjs → log-6rzaCV0I.mjs} +0 -0
- /package/dist/{mirror-sync-EiWvdzTJ.mjs → mirror-sync-pYU6f3-c.mjs} +0 -0
- /package/dist/{node-CvZnTx53.mjs → node-BhfLKYCi.mjs} +0 -0
- /package/dist/{schema-CIg4GzHQ.mjs → schema-Ca7SxXgS.mjs} +0 -0
- /package/dist/{setup-gate-D62nX5lk.d.mts → setup-gate-BQq0QgZH.d.mts} +0 -0
- /package/dist/{src-pELM4_iH.mjs → src-Cven45mq.mjs} +0 -0
- /package/dist/{trace-DCB7qFzT.mjs → trace-BaVg0rnY.mjs} +0 -0
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { t as bootstrapEnv } from "./env-bootstrap-rj7I-59x.mjs";
|
|
2
|
-
import { createRequire, register } from "node:module";
|
|
3
|
-
import fs from "node:fs";
|
|
4
|
-
import os from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
import { pathToFileURL } from "node:url";
|
|
7
|
-
import { register as register$1 } from "tsx/esm/api";
|
|
8
|
-
//#region src/setup-gate.ts
|
|
9
|
-
function registerLoader(specifier, opts) {
|
|
10
|
-
return register(specifier, void 0, opts);
|
|
11
|
-
}
|
|
12
|
-
const verbose = process.env.ZENBU_VERBOSE === "1";
|
|
13
|
-
function projectArg() {
|
|
14
|
-
const arg = process.argv.find((item) => item.startsWith("--project="));
|
|
15
|
-
return arg ? path.resolve(arg.slice(10)) : null;
|
|
16
|
-
}
|
|
17
|
-
function appDirName(name) {
|
|
18
|
-
return name.replace(/^@/, "").replace(/[\\/]/g, "__");
|
|
19
|
-
}
|
|
20
|
-
function readPackageJson(packageDir) {
|
|
21
|
-
const pkgPath = path.join(packageDir, "package.json");
|
|
22
|
-
return JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
23
|
-
}
|
|
24
|
-
function findProjectRoot(projectDir) {
|
|
25
|
-
let dir = path.resolve(projectDir);
|
|
26
|
-
while (dir !== path.dirname(dir)) {
|
|
27
|
-
if (fs.existsSync(path.join(dir, "package.json"))) return dir;
|
|
28
|
-
dir = path.dirname(dir);
|
|
29
|
-
}
|
|
30
|
-
return path.resolve(projectDir);
|
|
31
|
-
}
|
|
32
|
-
function resolveConfigPath(projectRoot) {
|
|
33
|
-
const candidates = [
|
|
34
|
-
"zenbu.config.ts",
|
|
35
|
-
"zenbu.config.mts",
|
|
36
|
-
"zenbu.config.js",
|
|
37
|
-
"zenbu.config.mjs"
|
|
38
|
-
];
|
|
39
|
-
for (const name of candidates) {
|
|
40
|
-
const candidate = path.join(projectRoot, name);
|
|
41
|
-
if (fs.existsSync(candidate)) return candidate;
|
|
42
|
-
}
|
|
43
|
-
throw new Error(`No zenbu config found at ${projectRoot}. Expected one of: ${candidates.join(", ")}`);
|
|
44
|
-
}
|
|
45
|
-
function findTsconfig(projectRoot) {
|
|
46
|
-
const candidate = path.join(projectRoot, "tsconfig.json");
|
|
47
|
-
return fs.existsSync(candidate) ? candidate : false;
|
|
48
|
-
}
|
|
49
|
-
function loadElectronApp() {
|
|
50
|
-
const electron = createRequire(import.meta.url)("electron");
|
|
51
|
-
if (!electron.app) throw new Error("Electron app API is unavailable; setup-gate must run inside Electron");
|
|
52
|
-
return electron.app;
|
|
53
|
-
}
|
|
54
|
-
async function closeRegisteredWatchers() {
|
|
55
|
-
await (await import("@zenbujs/hmr/pause")).closeAllWatchers?.();
|
|
56
|
-
}
|
|
57
|
-
async function registerLoaders(tsconfig, projectRoot) {
|
|
58
|
-
register$1({ tsconfig });
|
|
59
|
-
const { loadConfig } = await import("./load-config-CQG4297M.mjs");
|
|
60
|
-
const { resolved, pluginSourceFiles } = await loadConfig(projectRoot);
|
|
61
|
-
const loaderData = {
|
|
62
|
-
payload: {
|
|
63
|
-
plugins: resolved.plugins.map((p) => ({
|
|
64
|
-
name: p.name,
|
|
65
|
-
dir: p.dir,
|
|
66
|
-
services: p.services,
|
|
67
|
-
schemaPath: p.schemaPath,
|
|
68
|
-
migrationsPath: p.migrationsPath,
|
|
69
|
-
preloadPath: p.preloadPath,
|
|
70
|
-
eventsPath: p.eventsPath,
|
|
71
|
-
icons: p.icons
|
|
72
|
-
})),
|
|
73
|
-
appEntrypoint: resolved.uiEntrypointPath
|
|
74
|
-
},
|
|
75
|
-
pluginSourceFiles
|
|
76
|
-
};
|
|
77
|
-
globalThis.__zenbu_main_resolved_config__ = loaderData;
|
|
78
|
-
registerLoader(import.meta.resolve("@zenbujs/core/loaders/zenbu"), { data: loaderData });
|
|
79
|
-
process.env.ZENBU_ADVICE_ROOT = projectRoot;
|
|
80
|
-
await import("./node-CvZnTx53.mjs");
|
|
81
|
-
const dynohot = await import(pathToFileURL(createRequire(import.meta.url).resolve("@zenbujs/hmr/register")).href);
|
|
82
|
-
if (typeof dynohot.register === "function") dynohot.register({ ignore: /[/\\](?:node_modules|dist)[/\\]/ });
|
|
83
|
-
}
|
|
84
|
-
async function setupGate() {
|
|
85
|
-
const app = loadElectronApp();
|
|
86
|
-
await app.whenReady();
|
|
87
|
-
bootstrapEnv();
|
|
88
|
-
const bundledAppPath = app.getAppPath();
|
|
89
|
-
const appName = readPackageJson(bundledAppPath).name ?? path.basename(bundledAppPath);
|
|
90
|
-
const resolvedProjectDir = projectArg() ?? path.join(process.env.ZENBU_APPS_DIR ?? path.join(os.homedir(), ".zenbu", "apps"), appDirName(appName));
|
|
91
|
-
if (!fs.existsSync(resolvedProjectDir)) throw new Error(`setup-gate: project directory ${resolvedProjectDir} does not exist. In a shipped .app, the launcher provisions this dir before invoking setup-gate. In dev, point at an existing project with --project=.`);
|
|
92
|
-
const projectRoot = findProjectRoot(resolvedProjectDir);
|
|
93
|
-
const configPath = resolveConfigPath(projectRoot);
|
|
94
|
-
const tsconfig = findTsconfig(projectRoot);
|
|
95
|
-
process.chdir(projectRoot);
|
|
96
|
-
process.env.ZENBU_CONFIG_PATH = configPath;
|
|
97
|
-
if (!process.argv.some((arg) => arg.startsWith("--project="))) process.argv.push(`--project=${resolvedProjectDir}`);
|
|
98
|
-
if (verbose) {
|
|
99
|
-
console.log("[setup-gate] project:", resolvedProjectDir);
|
|
100
|
-
console.log("[setup-gate] config:", configPath);
|
|
101
|
-
}
|
|
102
|
-
await registerLoaders(tsconfig, projectRoot);
|
|
103
|
-
const { defaultServices } = await import("./services/default.mjs");
|
|
104
|
-
await defaultServices();
|
|
105
|
-
let shuttingDown = false;
|
|
106
|
-
const shutdown = async (exitCode = 0) => {
|
|
107
|
-
if (shuttingDown) return;
|
|
108
|
-
shuttingDown = true;
|
|
109
|
-
try {
|
|
110
|
-
await globalThis.__zenbu_service_runtime__?.shutdown();
|
|
111
|
-
} catch (err) {
|
|
112
|
-
console.error("[setup-gate] shutdown failed:", err);
|
|
113
|
-
}
|
|
114
|
-
try {
|
|
115
|
-
await closeRegisteredWatchers();
|
|
116
|
-
} catch (err) {
|
|
117
|
-
console.error("[setup-gate] closeAllWatchers failed:", err);
|
|
118
|
-
}
|
|
119
|
-
app.exit(exitCode);
|
|
120
|
-
};
|
|
121
|
-
app.on("before-quit", (event) => {
|
|
122
|
-
if (shuttingDown) return;
|
|
123
|
-
event.preventDefault();
|
|
124
|
-
shutdown(0);
|
|
125
|
-
});
|
|
126
|
-
process.on("SIGINT", () => void shutdown(0));
|
|
127
|
-
process.on("SIGTERM", () => void shutdown(0));
|
|
128
|
-
const mod = await import(`zenbu:plugins?config=${encodeURIComponent(configPath)}`, { with: { hot: "import" } });
|
|
129
|
-
if (typeof mod.default === "function") {
|
|
130
|
-
const controller = mod.default();
|
|
131
|
-
if (controller && typeof controller.main === "function") await controller.main();
|
|
132
|
-
}
|
|
133
|
-
await globalThis.__zenbu_service_runtime__?.whenIdle();
|
|
134
|
-
}
|
|
135
|
-
setupGate().catch((error) => {
|
|
136
|
-
console.error(error);
|
|
137
|
-
process.exit(1);
|
|
138
|
-
});
|
|
139
|
-
//#endregion
|
|
140
|
-
export { setupGate as t };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
//#region src/cli/lib/transforms.ts
|
|
2
|
-
const STRIP_START = /^\s*\/\/\s*@zenbu:strip-if\s+(!?)([A-Za-z_][A-Za-z0-9_]*)\s*$/;
|
|
3
|
-
const STRIP_END = /^\s*\/\/\s*@zenbu:end\s*$/;
|
|
4
|
-
/**
|
|
5
|
-
* Marker-based feature-flag stripping. Removes lines between
|
|
6
|
-
* // @zenbu:strip-if FLAG (strip when FLAG is truthy)
|
|
7
|
-
* // @zenbu:strip-if !FLAG (strip when FLAG is falsy)
|
|
8
|
-
* ...
|
|
9
|
-
* // @zenbu:end
|
|
10
|
-
*
|
|
11
|
-
* Pure string/line ops — no AST, no compiler dep.
|
|
12
|
-
*/
|
|
13
|
-
function stripIfDisabled(flags) {
|
|
14
|
-
return (file) => {
|
|
15
|
-
const lines = file.code.split("\n");
|
|
16
|
-
const out = [];
|
|
17
|
-
let stripDepth = 0;
|
|
18
|
-
for (const line of lines) {
|
|
19
|
-
const startMatch = STRIP_START.exec(line);
|
|
20
|
-
if (startMatch) {
|
|
21
|
-
const negated = startMatch[1] === "!";
|
|
22
|
-
const flagValue = flags[startMatch[2]] ?? false;
|
|
23
|
-
if ((negated ? !flagValue : flagValue) || stripDepth > 0) stripDepth += 1;
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
if (STRIP_END.test(line)) {
|
|
27
|
-
if (stripDepth > 0) stripDepth -= 1;
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
if (stripDepth === 0) out.push(line);
|
|
31
|
-
}
|
|
32
|
-
return { code: out.join("\n") };
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Drop files whose path matches the given pattern (relative path from the
|
|
37
|
-
* source root, posix slashes). Also covered by `ignore` globs in the config;
|
|
38
|
-
* use this when a regex is more convenient than a glob.
|
|
39
|
-
*/
|
|
40
|
-
function dropFiles(pattern) {
|
|
41
|
-
const test = typeof pattern === "function" ? pattern : (p) => pattern.test(p);
|
|
42
|
-
return (file) => {
|
|
43
|
-
if (test(file.path)) return { drop: true };
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
export { stripIfDisabled as n, dropFiles as t };
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
//#region src/cli/lib/build-config.d.ts
|
|
2
|
-
interface TransformInput {
|
|
3
|
-
path: string;
|
|
4
|
-
code: string;
|
|
5
|
-
}
|
|
6
|
-
interface TransformOutput {
|
|
7
|
-
code?: string;
|
|
8
|
-
drop?: boolean;
|
|
9
|
-
}
|
|
10
|
-
type Transform = (file: TransformInput) => TransformOutput | null | undefined | void;
|
|
11
|
-
interface MirrorConfig {
|
|
12
|
-
target: string;
|
|
13
|
-
branch?: string;
|
|
14
|
-
}
|
|
15
|
-
interface BundleConfig {
|
|
16
|
-
extraResources?: string[];
|
|
17
|
-
}
|
|
18
|
-
interface BuildConfig {
|
|
19
|
-
source?: string;
|
|
20
|
-
out?: string;
|
|
21
|
-
include: string[];
|
|
22
|
-
ignore?: string[];
|
|
23
|
-
transforms?: Transform[];
|
|
24
|
-
mirror?: MirrorConfig;
|
|
25
|
-
bundle?: BundleConfig;
|
|
26
|
-
}
|
|
27
|
-
declare function defineBuildConfig(config: BuildConfig): BuildConfig;
|
|
28
|
-
type ResolvedBuildConfig = Required<Omit<BuildConfig, "mirror" | "bundle">> & {
|
|
29
|
-
mirror?: MirrorConfig;
|
|
30
|
-
bundle?: BundleConfig;
|
|
31
|
-
};
|
|
32
|
-
declare function resolveBuildConfig(config: BuildConfig): ResolvedBuildConfig;
|
|
33
|
-
/**
|
|
34
|
-
* A Zenbu plugin's main-process surface. Plugins are pure main-process: they
|
|
35
|
-
* register services + side-effect modules (schema, preload, events). UI is
|
|
36
|
-
* handled exclusively at the outer config level via `uiEntrypoint` — there
|
|
37
|
-
* is exactly one HTML entrypoint per app.
|
|
38
|
-
*
|
|
39
|
-
* `services` is an array of glob patterns (relative to the plugin file's
|
|
40
|
-
* directory). `schema` / `preload` / `events` are optional file paths.
|
|
41
|
-
*/
|
|
42
|
-
interface Plugin {
|
|
43
|
-
name: string;
|
|
44
|
-
services: string[];
|
|
45
|
-
schema?: string;
|
|
46
|
-
migrations?: string;
|
|
47
|
-
preload?: string;
|
|
48
|
-
events?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Plugin-author-defined SVG icons keyed by view scope. Read by
|
|
51
|
-
* `view-registry` to decorate registered views. Optional.
|
|
52
|
-
*/
|
|
53
|
-
icons?: Record<string, string>;
|
|
54
|
-
}
|
|
55
|
-
declare function definePlugin(plugin: Plugin): Plugin;
|
|
56
|
-
/**
|
|
57
|
-
* A plugin manifest after path resolution. Every relative path has been made
|
|
58
|
-
* absolute against `dir` (the directory the manifest came from). Glob-form
|
|
59
|
-
* service entries stay as patterns (still anchored to `dir`).
|
|
60
|
-
*
|
|
61
|
-
* The runtime stores these in `runtime.getPlugins()`; consumers like
|
|
62
|
-
* `services/db.ts`, `services/advice-config.ts`, `vite-plugins.ts` read from
|
|
63
|
-
* there instead of walking the filesystem looking for `zenbu.plugin.json`.
|
|
64
|
-
*/
|
|
65
|
-
interface ResolvedPlugin {
|
|
66
|
-
name: string;
|
|
67
|
-
/** Absolute directory the plugin was loaded from. */
|
|
68
|
-
dir: string;
|
|
69
|
-
/** Glob patterns for service files. Anchored to `dir`. */
|
|
70
|
-
services: string[];
|
|
71
|
-
/** Absolute path to `schema.ts` (or undefined). */
|
|
72
|
-
schemaPath?: string;
|
|
73
|
-
/** Absolute path to migrations dir/file (or undefined). */
|
|
74
|
-
migrationsPath?: string;
|
|
75
|
-
/** Absolute path to `preload.ts` (or undefined). */
|
|
76
|
-
preloadPath?: string;
|
|
77
|
-
/** Absolute path to `events.ts` (or undefined). */
|
|
78
|
-
eventsPath?: string;
|
|
79
|
-
/** Plugin-author-defined SVG icons. */
|
|
80
|
-
icons?: Record<string, string>;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* The whole-app `zenbu.config.ts` shape. Authored by user code; imported
|
|
84
|
-
* (and re-imported on every change) by the loader and CLI.
|
|
85
|
-
*
|
|
86
|
-
* - `db`: directory the kyju database lives in (relative to the config file).
|
|
87
|
-
* - `uiEntrypoint`: path to the boot-window's HTML file. Exactly one — there
|
|
88
|
-
* is no per-plugin UI (today's per-plugin `uiEntrypoint` was effectively a
|
|
89
|
-
* bug that the new shape disallows at the type level).
|
|
90
|
-
* - `plugins`: flat list. Each entry is either an inline `definePlugin({...})`
|
|
91
|
-
* or a path to a `zenbu.plugin.ts` whose default export is a plugin. The
|
|
92
|
-
* "host plugin" is just `plugins[0]` by convention; nothing structurally
|
|
93
|
-
* distinguishes it.
|
|
94
|
-
* - `build`: shipped as `defineBuildConfig({...})`. Drives `zen build:source`
|
|
95
|
-
* and `zen build:electron`.
|
|
96
|
-
*/
|
|
97
|
-
interface Config {
|
|
98
|
-
db: string;
|
|
99
|
-
uiEntrypoint: string;
|
|
100
|
-
plugins: Array<Plugin | string>;
|
|
101
|
-
build?: BuildConfig;
|
|
102
|
-
}
|
|
103
|
-
declare function defineConfig(config: Config): Config;
|
|
104
|
-
interface ResolvedConfig {
|
|
105
|
-
/** Absolute path to the `zenbu.config.ts` this came from. */
|
|
106
|
-
configPath: string;
|
|
107
|
-
/** Directory containing `zenbu.config.ts`. */
|
|
108
|
-
projectDir: string;
|
|
109
|
-
/** Absolute path to the database directory. */
|
|
110
|
-
dbPath: string;
|
|
111
|
-
/** Absolute path to the boot-window HTML. */
|
|
112
|
-
uiEntrypointPath: string;
|
|
113
|
-
plugins: ResolvedPlugin[];
|
|
114
|
-
/** Resolved build config; defaults filled in even when user omits. */
|
|
115
|
-
build: ResolvedBuildConfig;
|
|
116
|
-
}
|
|
117
|
-
//#endregion
|
|
118
|
-
//#region src/cli/lib/transforms.d.ts
|
|
119
|
-
/**
|
|
120
|
-
* Marker-based feature-flag stripping. Removes lines between
|
|
121
|
-
* // @zenbu:strip-if FLAG (strip when FLAG is truthy)
|
|
122
|
-
* // @zenbu:strip-if !FLAG (strip when FLAG is falsy)
|
|
123
|
-
* ...
|
|
124
|
-
* // @zenbu:end
|
|
125
|
-
*
|
|
126
|
-
* Pure string/line ops — no AST, no compiler dep.
|
|
127
|
-
*/
|
|
128
|
-
declare function stripIfDisabled(flags: Record<string, boolean>): Transform;
|
|
129
|
-
/**
|
|
130
|
-
* Drop files whose path matches the given pattern (relative path from the
|
|
131
|
-
* source root, posix slashes). Also covered by `ignore` globs in the config;
|
|
132
|
-
* use this when a regex is more convenient than a glob.
|
|
133
|
-
*/
|
|
134
|
-
declare function dropFiles(pattern: RegExp | ((path: string) => boolean)): Transform;
|
|
135
|
-
//#endregion
|
|
136
|
-
export { resolveBuildConfig as _, Config as a, ResolvedBuildConfig as c, Transform as d, TransformInput as f, definePlugin as g, defineConfig as h, BundleConfig as i, ResolvedConfig as l, defineBuildConfig as m, stripIfDisabled as n, MirrorConfig as o, TransformOutput as p, BuildConfig as r, Plugin as s, dropFiles as t, ResolvedPlugin as u };
|
package/dist/window-S3TlTXlK.mjs
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|