@zenbujs/core 0.0.3 → 0.0.4

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.
Files changed (84) hide show
  1. package/dist/{advice-config-CjgkEf2E.mjs → advice-config-BLXjqjGN.mjs} +21 -13
  2. package/dist/advice-config-D6K_a7e9.mjs +2 -0
  3. package/dist/advice.mjs +1 -1
  4. package/dist/{base-window-BUt8pwbw.mjs → base-window-D8CpxMU3.mjs} +2 -2
  5. package/dist/base-window-OXg2KSyP.mjs +2 -0
  6. package/dist/{build-config-pbv0w4oN.mjs → build-config-BwnnfrN-.mjs} +8 -2
  7. package/dist/{build-electron-BzHa_hRi.mjs → build-electron-C3Beey84.mjs} +12 -6
  8. package/dist/{build-source-CnTfQBGK.mjs → build-source-BvC4bPqH.mjs} +13 -8
  9. package/dist/cli/bin.mjs +12 -15
  10. package/dist/cli/build.d.mts +1 -52
  11. package/dist/cli/build.mjs +2 -47
  12. package/dist/cli/resolve-config.mjs +36 -0
  13. package/dist/{cli-BLbQQIVB.mjs → cli-F0B4dvSg.mjs} +3 -3
  14. package/dist/config-Ch1FreWU.mjs +2 -0
  15. package/dist/config.d.mts +2 -0
  16. package/dist/config.mjs +3 -0
  17. package/dist/db-Bz_CDIWg.mjs +2 -0
  18. package/dist/{db-BXadETOb.mjs → db-Cd5ETuPG.mjs} +47 -41
  19. package/dist/db.d.mts +1 -1
  20. package/dist/env-bootstrap.d.mts +1 -1
  21. package/dist/http-B36qtsm0.mjs +2 -0
  22. package/dist/index-CKKoxA9V.d.mts +1 -0
  23. package/dist/index.d.mts +5 -5
  24. package/dist/index.mjs +2 -2
  25. package/dist/{link-VOoGs-pY.mjs → link-BJmsKgPa.mjs} +87 -120
  26. package/dist/load-config-BG2tPIfF.mjs +126 -0
  27. package/dist/load-config-CQG4297M.mjs +2 -0
  28. package/dist/loaders/zenbu.d.mts +16 -0
  29. package/dist/loaders/zenbu.mjs +151 -62
  30. package/dist/{monorepo-CQeQBIpa.mjs → monorepo-DCruz9Jx.mjs} +2 -2
  31. package/dist/{publish-source-BJdpDAFH.mjs → publish-source-34Hn9zb0.mjs} +12 -6
  32. package/dist/react.d.mts +3 -3
  33. package/dist/{registry-Dh_e7HU1.d.mts → registry-CioEYLI5.d.mts} +1 -1
  34. package/dist/registry.d.mts +1 -1
  35. package/dist/{reloader-lLAJ3lqg.mjs → reloader-DJoCB0bC.mjs} +2 -2
  36. package/dist/reloader-FeHKV2jd.mjs +2 -0
  37. package/dist/renderer-host-BQpS0ZM2.mjs +2 -0
  38. package/dist/{renderer-host-Bg8QdeeH.mjs → renderer-host-ztaSIOGx.mjs} +71 -205
  39. package/dist/{rpc-BwwQK6hD.mjs → rpc-CsgWnlZx.mjs} +2 -2
  40. package/dist/rpc-D_s7-WZe.mjs +2 -0
  41. package/dist/rpc.d.mts +1 -1
  42. package/dist/{runtime-DUFKDIe4.mjs → runtime-C95iyVn6.mjs} +53 -1
  43. package/dist/{runtime-CjqDr8Yf.d.mts → runtime-CsiDppGF.d.mts} +41 -1
  44. package/dist/runtime.d.mts +2 -2
  45. package/dist/runtime.mjs +2 -2
  46. package/dist/{schema-DMoSkwUx.d.mts → schema-DvT61x2_.d.mts} +1 -1
  47. package/dist/schema.d.mts +1 -1
  48. package/dist/server-CgzQOPSW.mjs +2 -0
  49. package/dist/{server-BXwZEQ-n.mjs → server-DB3Eki_G.mjs} +1 -1
  50. package/dist/services/default.mjs +10 -10
  51. package/dist/services/index.d.mts +3 -3
  52. package/dist/services/index.mjs +6 -6
  53. package/dist/{setup-gate-BcoqWu8S.mjs → setup-gate-D8XfYY52.mjs} +35 -5
  54. package/dist/setup-gate.d.mts +1 -1
  55. package/dist/setup-gate.mjs +1 -1
  56. package/dist/transforms-DVoy8dCu.mjs +47 -0
  57. package/dist/transforms-EVd5Fgyk.d.mts +136 -0
  58. package/dist/view-registry-2zePxTEg.mjs +2 -0
  59. package/dist/{vite-plugins-Bh3SCOw-.mjs → vite-plugins-t4MlFcz3.mjs} +4 -18
  60. package/dist/vite.mjs +1 -1
  61. package/dist/{window-CmmpCVX6.mjs → window-DUvMTons.mjs} +3 -3
  62. package/dist/window-S3TlTXlK.mjs +2 -0
  63. package/package.json +9 -8
  64. package/dist/advice-config-Cy133IQP.mjs +0 -2
  65. package/dist/base-window-DEIAk618.mjs +0 -2
  66. package/dist/config-LK73dJmO.mjs +0 -2
  67. package/dist/db-ByKPbnP6.mjs +0 -2
  68. package/dist/http-IBcLzbYu.mjs +0 -2
  69. package/dist/load-build-config-DozuRhAN.mjs +0 -40
  70. package/dist/reloader-BCkLjDhS.mjs +0 -2
  71. package/dist/renderer-host-DpvBPTHJ.mjs +0 -2
  72. package/dist/rpc-CqitnyR4.mjs +0 -2
  73. package/dist/server-DjrZUbbu.mjs +0 -2
  74. package/dist/view-registry-BualWgAf.mjs +0 -2
  75. package/dist/window-CM2a9Kyc.mjs +0 -2
  76. package/dist/{index-FtE8MXJ_.d.mts → cli/resolve-config.d.mts} +0 -0
  77. package/dist/{config-CdVrW85P.mjs → config-BlRXeUXx.mjs} +0 -0
  78. package/dist/{dev-BU_llQh1.mjs → dev-DLutFPyo.mjs} +0 -0
  79. package/dist/{env-bootstrap-BtVME-CU.d.mts → env-bootstrap-uCKbw2q8.d.mts} +0 -0
  80. package/dist/{index-Bhlbyrn7.d.mts → index-CE0iPntP.d.mts} +0 -0
  81. package/dist/{index-CPZ5d6Hl.d.mts → index-UK58xuoR.d.mts} +0 -0
  82. package/dist/{mirror-sync-BN59kMCG.mjs → mirror-sync-EiWvdzTJ.mjs} +1 -1
  83. /package/dist/{node-D4M19_mV.mjs → node-CvZnTx53.mjs} +0 -0
  84. /package/dist/{setup-gate-BqOzm7zp.d.mts → setup-gate-D62nX5lk.d.mts} +0 -0
@@ -6,6 +6,9 @@ import path from "node:path";
6
6
  import { pathToFileURL } from "node:url";
7
7
  import { register as register$1 } from "tsx/esm/api";
8
8
  //#region src/setup-gate.ts
9
+ function registerLoader(specifier, opts) {
10
+ return register(specifier, void 0, opts);
11
+ }
9
12
  const verbose = process.env.ZENBU_VERBOSE === "1";
10
13
  function projectArg() {
11
14
  const arg = process.argv.find((item) => item.startsWith("--project="));
@@ -27,9 +30,17 @@ function findProjectRoot(projectDir) {
27
30
  return path.resolve(projectDir);
28
31
  }
29
32
  function resolveConfigPath(projectRoot) {
30
- const configPath = path.join(projectRoot, "config.json");
31
- if (!fs.existsSync(configPath)) throw new Error(`config.json not found at ${configPath}`);
32
- return configPath;
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(", ")}`);
33
44
  }
34
45
  function findTsconfig(projectRoot) {
35
46
  const candidate = path.join(projectRoot, "tsconfig.json");
@@ -44,10 +55,29 @@ async function closeRegisteredWatchers() {
44
55
  await (await import("@zenbujs/hmr/pause")).closeAllWatchers?.();
45
56
  }
46
57
  async function registerLoaders(tsconfig, projectRoot) {
47
- register(import.meta.resolve("@zenbujs/core/loaders/zenbu"));
48
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 });
49
79
  process.env.ZENBU_ADVICE_ROOT = projectRoot;
50
- await import("./node-D4M19_mV.mjs");
80
+ await import("./node-CvZnTx53.mjs");
51
81
  const dynohot = await import(pathToFileURL(createRequire(import.meta.url).resolve("@zenbujs/hmr/register")).href);
52
82
  if (typeof dynohot.register === "function") dynohot.register({ ignore: /[/\\](?:node_modules|dist)[/\\]/ });
53
83
  }
@@ -1,2 +1,2 @@
1
- import { t as setupGate } from "./setup-gate-BqOzm7zp.mjs";
1
+ import { t as setupGate } from "./setup-gate-D62nX5lk.mjs";
2
2
  export { setupGate };
@@ -1,2 +1,2 @@
1
- import { t as setupGate } from "./setup-gate-BcoqWu8S.mjs";
1
+ import { t as setupGate } from "./setup-gate-D8XfYY52.mjs";
2
2
  export { setupGate };
@@ -0,0 +1,47 @@
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 };
@@ -0,0 +1,136 @@
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 };
@@ -0,0 +1,2 @@
1
+ import "./renderer-host-ztaSIOGx.mjs";
2
+ export {};
@@ -1,8 +1,8 @@
1
+ import { a as getPlugins } from "./runtime-C95iyVn6.mjs";
1
2
  import { n as require_lib, t as zenbuAdviceTransform$1 } from "./transform-DJH3vN4b.mjs";
2
- import { a as getContentScripts, i as getAllScopes, r as getAllContentScriptPaths, t as getAdvice } from "./advice-config-CjgkEf2E.mjs";
3
+ import { a as getContentScripts, i as getAllScopes, r as getAllContentScriptPaths, t as getAdvice } from "./advice-config-BLXjqjGN.mjs";
3
4
  import path from "node:path";
4
5
  import { fileURLToPath } from "node:url";
5
- import fsp from "node:fs/promises";
6
6
  //#region ../advice/src/vite.ts
7
7
  var import_lib = require_lib();
8
8
  const defaultInclude = /\.[jt]sx?$/;
@@ -117,22 +117,8 @@ function zenbuFrameworkResolve() {
117
117
  * proactively calls `server.restart()` on add/change/unlink of any
118
118
  * `tsconfig.local.json`.
119
119
  */
120
- async configureServer(server) {
121
- const configPath = process.env.ZENBU_CONFIG_PATH;
122
- if (!configPath) return;
123
- const configDir = path.dirname(configPath);
124
- let tsconfigPaths = [];
125
- try {
126
- const raw = await fsp.readFile(configPath, "utf8");
127
- const config = JSON.parse(raw);
128
- if (Array.isArray(config.plugins)) for (const entry of config.plugins) {
129
- if (typeof entry !== "string") continue;
130
- const manifestAbs = path.isAbsolute(entry) ? entry : path.resolve(configDir, entry);
131
- tsconfigPaths.push(path.join(path.dirname(manifestAbs), "tsconfig.local.json"));
132
- }
133
- } catch {
134
- return;
135
- }
120
+ configureServer(server) {
121
+ const tsconfigPaths = getPlugins().map((p) => path.join(p.dir, "tsconfig.local.json"));
136
122
  if (tsconfigPaths.length === 0) return;
137
123
  server.watcher.add(tsconfigPaths);
138
124
  let restarting = false;
package/dist/vite.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as zenbuVitePlugins, i as zenbuFrameworkResolve, n as resolveAdviceRuntime, r as zenbuAdviceTransform, t as advicePreludePlugin } from "./vite-plugins-Bh3SCOw-.mjs";
1
+ import { a as zenbuVitePlugins, i as zenbuFrameworkResolve, n as resolveAdviceRuntime, r as zenbuAdviceTransform, t as advicePreludePlugin } from "./vite-plugins-t4MlFcz3.mjs";
2
2
  export { advicePreludePlugin, resolveAdviceRuntime, zenbuAdviceTransform, zenbuFrameworkResolve, zenbuVitePlugins };
@@ -1,7 +1,7 @@
1
- import { a as serviceWithDeps, i as runtime } from "./runtime-DUFKDIe4.mjs";
1
+ import { d as serviceWithDeps, u as runtime } from "./runtime-C95iyVn6.mjs";
2
2
  import { t as createLogger } from "./log-CyKv8hQg.mjs";
3
- import { n as ViewRegistryService, o as HttpService, t as RendererHostService } from "./renderer-host-Bg8QdeeH.mjs";
4
- import { t as BaseWindowService } from "./base-window-BUt8pwbw.mjs";
3
+ import { n as ViewRegistryService, o as HttpService, t as RendererHostService } from "./renderer-host-ztaSIOGx.mjs";
4
+ import { t as BaseWindowService } from "./base-window-D8CpxMU3.mjs";
5
5
  import { URLSearchParams } from "node:url";
6
6
  import { WebContentsView, clipboard, dialog, shell } from "electron";
7
7
  import electronContextMenu from "electron-context-menu";
@@ -0,0 +1,2 @@
1
+ import "./window-DUvMTons.mjs";
2
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenbujs/core",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -22,6 +22,10 @@
22
22
  "types": "./dist/cli/build.d.mts",
23
23
  "import": "./dist/cli/build.mjs"
24
24
  },
25
+ "./config": {
26
+ "types": "./dist/config.d.mts",
27
+ "import": "./dist/config.mjs"
28
+ },
25
29
  "./loaders/zenbu": {
26
30
  "types": "./dist/loaders/zenbu.d.mts",
27
31
  "import": "./dist/loaders/zenbu.mjs"
@@ -105,20 +109,17 @@
105
109
  "@types/react": "^19.0.0",
106
110
  "@types/ws": "^8.18.0",
107
111
  "electron": "^42.0.0",
108
- "eslint": "^9.0.0",
109
112
  "tsdown": "^0.21.10",
110
113
  "typescript": "^5.4.5",
111
- "@zenbu/kyju": "0.0.0",
112
- "@zenbu/lint": "0.0.0",
113
114
  "@zenbu/advice": "0.0.0",
115
+ "@zenbu/kyju": "0.0.0",
114
116
  "@zenbu/zenrpc": "0.0.0"
115
117
  },
116
118
  "scripts": {
117
119
  "build": "node --max-old-space-size=8192 ./node_modules/tsdown/dist/run.mjs",
118
120
  "dev": "tsdown --watch",
119
- "link:types": "node ../zen/dist/bin.mjs link --types-config ./zenbu-types.config.json --registry ./types",
120
- "db:generate": "node ../zen/dist/bin.mjs db generate --schema src/schema.ts --migrations ./migrations",
121
- "typecheck": "tsc --noEmit -p tsconfig.json",
122
- "lint": "eslint . --max-warnings=0"
121
+ "link:types": "node ./dist/cli/bin.mjs link --types-config ./zenbu-types.config.json --registry ./types",
122
+ "db:generate": "node ./dist/cli/bin.mjs db generate --schema src/schema.ts --migrations ./migrations",
123
+ "typecheck": "tsc --noEmit -p tsconfig.json"
123
124
  }
124
125
  }
@@ -1,2 +0,0 @@
1
- import "./advice-config-CjgkEf2E.mjs";
2
- export {};
@@ -1,2 +0,0 @@
1
- import "./base-window-BUt8pwbw.mjs";
2
- export {};
@@ -1,2 +0,0 @@
1
- import { n as loadConfig, t as findConfigFile } from "./config-CdVrW85P.mjs";
2
- export { findConfigFile, loadConfig };
@@ -1,2 +0,0 @@
1
- import "./renderer-host-Bg8QdeeH.mjs";
2
- export {};
@@ -1,2 +0,0 @@
1
- import "./renderer-host-Bg8QdeeH.mjs";
2
- export {};
@@ -1,40 +0,0 @@
1
- import { n as resolveBuildConfig } from "./build-config-pbv0w4oN.mjs";
2
- import { createRequire } from "node:module";
3
- import fs from "node:fs";
4
- import path from "node:path";
5
- import { pathToFileURL } from "node:url";
6
- //#region src/cli/lib/load-build-config.ts
7
- const localRequire = createRequire(import.meta.url);
8
- const CONFIG_NAMES = [
9
- "zenbu.build.ts",
10
- "zenbu.build.mts",
11
- "zenbu.build.js",
12
- "zenbu.build.mjs"
13
- ];
14
- function findBuildConfig(projectDir) {
15
- for (const name of CONFIG_NAMES) {
16
- const candidate = path.join(projectDir, name);
17
- if (fs.existsSync(candidate)) return candidate;
18
- }
19
- throw new Error(`No zenbu.build config found at ${projectDir}. Expected one of: ${CONFIG_NAMES.join(", ")}`);
20
- }
21
- let tsxRegistered = null;
22
- function ensureTsxRegistered() {
23
- if (tsxRegistered) return tsxRegistered;
24
- tsxRegistered = (async () => {
25
- try {
26
- const tsxApi = localRequire("tsx/esm/api");
27
- if (typeof tsxApi.register === "function") tsxApi.register();
28
- } catch {}
29
- })();
30
- return tsxRegistered;
31
- }
32
- async function loadBuildConfig(configPath) {
33
- await ensureTsxRegistered();
34
- const mod = await import(pathToFileURL(path.resolve(configPath)).href);
35
- const config = mod.default ?? mod;
36
- if (!config || !Array.isArray(config.include)) throw new Error(`${path.basename(configPath)} must export a config object (via defineBuildConfig) with an 'include' array.`);
37
- return resolveBuildConfig(config);
38
- }
39
- //#endregion
40
- export { loadBuildConfig as n, findBuildConfig as t };
@@ -1,2 +0,0 @@
1
- import "./reloader-lLAJ3lqg.mjs";
2
- export {};
@@ -1,2 +0,0 @@
1
- import "./renderer-host-Bg8QdeeH.mjs";
2
- export {};
@@ -1,2 +0,0 @@
1
- import "./rpc-BwwQK6hD.mjs";
2
- export {};
@@ -1,2 +0,0 @@
1
- import "./server-BXwZEQ-n.mjs";
2
- export {};
@@ -1,2 +0,0 @@
1
- import "./renderer-host-Bg8QdeeH.mjs";
2
- export {};
@@ -1,2 +0,0 @@
1
- import "./window-CmmpCVX6.mjs";
2
- export {};
File without changes
@@ -1,9 +1,9 @@
1
1
  import "node:fs";
2
2
  import os from "node:os";
3
3
  import path from "node:path";
4
+ import { execFile } from "node:child_process";
4
5
  import crypto from "node:crypto";
5
6
  import fsp from "node:fs/promises";
6
- import { execFile } from "node:child_process";
7
7
  import { promisify } from "node:util";
8
8
  //#region src/cli/lib/mirror-sync.ts
9
9
  const execFile$1 = promisify(execFile);
File without changes