@zenbujs/core 0.0.5 → 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-QYB2qEd_.mjs → advice-config-DXSIo0sg.mjs} +40 -39
- package/dist/advice.d.mts +8 -8
- package/dist/advice.mjs +2 -2
- package/dist/{base-window-BbFRRhKP.mjs → base-window-BxBZ2md_.mjs} +51 -7
- package/dist/{transforms-CuTODvDx.d.mts → build-config-Dzg2frpk.d.mts} +98 -28
- package/dist/build-config-pWdmLnrk.mjs +53 -0
- package/dist/{build-electron-CNJ0dLND.mjs → build-electron-Dsbb1EMl.mjs} +308 -120
- package/dist/{build-source-C2puqEVr.mjs → build-source-d1J3shV8.mjs} +62 -27
- 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 +1 -1
- package/dist/{cli-C3R1LBMY.mjs → cli-kL6mPgBE.mjs} +2 -2
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +2 -3
- package/dist/{db-xjvahRFJ.mjs → db-Bc292RYo.mjs} +2 -2
- package/dist/db.d.mts +1 -1
- package/dist/dev-B2emj0HZ.mjs +301 -0
- package/dist/env-bootstrap.d.mts +1 -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 +2 -2
- package/dist/installing-preload.cjs +60 -0
- package/dist/launcher.mjs +2615 -122
- package/dist/{link-c0_aLWQ3.mjs → link-glX89NV5.mjs} +215 -89
- package/dist/{load-config-xMf2wxH8.mjs → load-config-C4Oe2qZO.mjs} +5 -1
- package/dist/loaders/zenbu.mjs +102 -0
- package/dist/node-loader.mjs +1 -1
- package/dist/{publish-source-Dill72NS.mjs → publish-source-Dq2c0iOw.mjs} +2 -2
- package/dist/react.d.mts +55 -6
- package/dist/react.mjs +116 -5
- 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-DzEO8kJr.mjs → reloader-B22UiNA2.mjs} +2 -4
- package/dist/{renderer-host-Cau9JK0v.mjs → renderer-host-DD16MXhI.mjs} +152 -43
- package/dist/{rpc-JfGv-Wuw.mjs → rpc-C4_NQmpT.mjs} +5 -4
- package/dist/{runtime-pCeVzj--.d.mts → runtime-BQWntcOb.d.mts} +85 -48
- package/dist/runtime.d.mts +2 -2
- package/dist/runtime.mjs +139 -83
- package/dist/{schema-Dl85YjXW.d.mts → schema-CjrMVk36.d.mts} +3 -3
- package/dist/schema.d.mts +1 -1
- package/dist/schema.mjs +1 -1
- package/dist/{server-y3PPbh3l.mjs → server-CZLMF8Dj.mjs} +1 -3
- package/dist/services/default.d.mts +3 -3
- package/dist/services/default.mjs +14 -13
- package/dist/services/index.d.mts +2 -280
- package/dist/services/index.mjs +8 -7
- package/dist/setup-gate.d.mts +1 -1
- package/dist/setup-gate.mjs +117 -24
- package/dist/{transform-CmFYPmt8.mjs → transform-BzrwkEdf.mjs} +22 -916
- package/dist/updater-DCkz9M1c.mjs +1008 -0
- package/dist/{vite-plugins-Do7liKi_.mjs → vite-plugins-tt6KAtyE.mjs} +26 -25
- package/dist/vite.d.mts +3 -3
- package/dist/vite.mjs +1 -1
- package/dist/{window-o2NGUsIb.mjs → window-YFKvAM0l.mjs} +30 -16
- package/package.json +15 -2
- package/dist/build-config-C3a-o3_B.mjs +0 -23
- package/dist/dev-Dazhu66l.mjs +0 -85
- package/dist/registry-eX6e2oql.d.mts +0 -61
- package/dist/transforms-htxfTwsY.mjs +0 -47
- /package/dist/{config-DXRCDUxG.mjs → config-BK78JDRI.mjs} +0 -0
- /package/dist/{env-bootstrap-DW2hVhSO.d.mts → env-bootstrap-rTs8KR3-.d.mts} +0 -0
- /package/dist/{index-M_lSNBrq.d.mts → index-DeDxePAa.d.mts} +0 -0
- /package/dist/{mirror-sync-PDzxhf1w.mjs → mirror-sync-pYU6f3-c.mjs} +0 -0
- /package/dist/{monorepo-3avKJwzJ.mjs → monorepo-Dct-kkbQ.mjs} +0 -0
- /package/dist/{node-_8xShqxr.mjs → node-BhfLKYCi.mjs} +0 -0
- /package/dist/{setup-gate-Dcy8gGPJ.d.mts → setup-gate-BQq0QgZH.d.mts} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as bootstrapEnv } from "./env-bootstrap-
|
|
3
|
-
import { t as setupGate } from "./setup-gate-
|
|
4
|
-
import { n as SchemaRoot, o as schema, t as CoreSchema } from "./schema-
|
|
5
|
-
|
|
6
|
-
export { CleanupReason, CoreDbSections, CoreEvents, CorePreloads, CoreSchema, SchemaRoot as CoreSchemaRoot, CoreServiceRouter, Service, ServiceRuntime, bootstrapEnv, schema as coreSchema, optional, runtime, serviceWithDeps, setupGate };
|
|
1
|
+
import { h as runtime, i as Service, o as ServiceRuntime, t as CleanupReason } from "./runtime-BQWntcOb.mjs";
|
|
2
|
+
import { t as bootstrapEnv } from "./env-bootstrap-rTs8KR3-.mjs";
|
|
3
|
+
import { t as setupGate } from "./setup-gate-BQq0QgZH.mjs";
|
|
4
|
+
import { n as SchemaRoot, o as schema, t as CoreSchema } from "./schema-CjrMVk36.mjs";
|
|
5
|
+
export { CleanupReason, CoreSchema, SchemaRoot as CoreSchemaRoot, Service, ServiceRuntime, bootstrapEnv, schema as coreSchema, runtime, setupGate };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { bootstrapEnv } from "./env-bootstrap.mjs";
|
|
2
2
|
import { setupGate } from "./setup-gate.mjs";
|
|
3
|
-
import { Service, ServiceRuntime,
|
|
3
|
+
import { Service, ServiceRuntime, runtime } from "./runtime.mjs";
|
|
4
4
|
import { schema } from "./schema.mjs";
|
|
5
|
-
export { Service, ServiceRuntime, bootstrapEnv, schema as coreSchema,
|
|
5
|
+
export { Service, ServiceRuntime, bootstrapEnv, schema as coreSchema, runtime, setupGate };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
let electron = require("electron");
|
|
2
|
+
//#region src/installing-preload.ts
|
|
3
|
+
/**
|
|
4
|
+
* Built-in preload script for the production launcher's `installing.html`
|
|
5
|
+
* window. Compiled to CJS via tsdown (`dist/installing-preload.cjs`) and
|
|
6
|
+
* staged into the .app's `Resources/` by `zen build:electron`. Sandboxed
|
|
7
|
+
* preloads MUST be CommonJS — Electron disables ESM in sandboxed contexts.
|
|
8
|
+
*
|
|
9
|
+
* Exposes `window.zenbuInstall` to the page:
|
|
10
|
+
*
|
|
11
|
+
* const off = window.zenbuInstall.on("step", (p) => { ... })
|
|
12
|
+
* window.zenbuInstall.off("step", cb)
|
|
13
|
+
*
|
|
14
|
+
* Events emitted by the launcher (channel name `zenbu:install:<event>`):
|
|
15
|
+
*
|
|
16
|
+
* - "step": { id: "clone" | "fetch" | "install" | "handoff", label: string }
|
|
17
|
+
* - "message": { text: string }
|
|
18
|
+
* - "progress": { phase?: string, loaded?: number, total?: number, ratio?: number }
|
|
19
|
+
* - "done": { id: same as step }
|
|
20
|
+
* - "error": { id?: string, message: string }
|
|
21
|
+
*
|
|
22
|
+
* The exposed API is intentionally tiny — no privileged Node access, no
|
|
23
|
+
* arbitrary IPC channels. The page can only listen to the five fixed
|
|
24
|
+
* event names above.
|
|
25
|
+
*/
|
|
26
|
+
const VALID_EVENTS = new Set([
|
|
27
|
+
"step",
|
|
28
|
+
"message",
|
|
29
|
+
"progress",
|
|
30
|
+
"done",
|
|
31
|
+
"error"
|
|
32
|
+
]);
|
|
33
|
+
const wrappers = /* @__PURE__ */ new WeakMap();
|
|
34
|
+
function channelFor(event) {
|
|
35
|
+
return `zenbu:install:${event}`;
|
|
36
|
+
}
|
|
37
|
+
electron.contextBridge.exposeInMainWorld("zenbuInstall", {
|
|
38
|
+
on(event, cb) {
|
|
39
|
+
if (!VALID_EVENTS.has(event) || typeof cb !== "function") return () => {};
|
|
40
|
+
const wrapper = (_e, payload) => cb(payload);
|
|
41
|
+
wrappers.set(cb, wrapper);
|
|
42
|
+
electron.ipcRenderer.on(channelFor(event), wrapper);
|
|
43
|
+
return () => {
|
|
44
|
+
const w = wrappers.get(cb);
|
|
45
|
+
if (w) {
|
|
46
|
+
electron.ipcRenderer.off(channelFor(event), w);
|
|
47
|
+
wrappers.delete(cb);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
off(event, cb) {
|
|
52
|
+
if (!VALID_EVENTS.has(event) || typeof cb !== "function") return;
|
|
53
|
+
const wrapper = wrappers.get(cb);
|
|
54
|
+
if (wrapper) {
|
|
55
|
+
electron.ipcRenderer.off(channelFor(event), wrapper);
|
|
56
|
+
wrappers.delete(cb);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
//#endregion
|