create-zenbu-app 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/README.md +50 -3
- package/dist/index.mjs +439 -36
- package/package.json +9 -6
- package/templates/plugin/_gitignore +3 -0
- package/templates/plugin/package.json +24 -0
- package/templates/plugin/src/main/services/{{projectName}}.ts.tmpl +9 -0
- package/templates/plugin/tsconfig.json +14 -0
- package/templates/plugin/zenbu.plugin.ts.tmpl +6 -0
- package/{template → templates/tailwind}/_gitignore +3 -0
- package/templates/tailwind/package.json +47 -0
- package/templates/tailwind/src/main/schema.ts.tmpl +13 -0
- package/templates/tailwind/src/main/services/init.ts.tmpl +11 -0
- package/templates/tailwind/src/main/services/repo.ts.tmpl +11 -0
- package/templates/tailwind/src/renderer/App.tsx.tmpl +100 -0
- package/{template → templates/tailwind}/src/renderer/app.css +3 -0
- package/templates/tailwind/src/renderer/installing.html +118 -0
- package/{template → templates/tailwind}/src/renderer/main.tsx.tmpl +3 -3
- package/templates/tailwind/vite.config.ts.tmpl +17 -0
- package/{template → templates/tailwind}/zenbu.config.ts.tmpl +12 -8
- package/templates/vanilla/_gitignore +8 -0
- package/templates/vanilla/electron-builder.json +12 -0
- package/{template → templates/vanilla}/package.json +1 -1
- package/templates/vanilla/src/main/schema.ts.tmpl +13 -0
- package/templates/vanilla/src/main/services/init.ts.tmpl +11 -0
- package/templates/vanilla/src/main/services/repo.ts.tmpl +11 -0
- package/templates/vanilla/src/renderer/App.tsx.tmpl +83 -0
- package/templates/vanilla/src/renderer/app.css +143 -0
- package/templates/vanilla/src/renderer/index.html +12 -0
- package/templates/vanilla/src/renderer/installing.html +118 -0
- package/templates/vanilla/src/renderer/main.tsx.tmpl +10 -0
- package/templates/vanilla/src/renderer/splash.html +22 -0
- package/templates/vanilla/tsconfig.json.tmpl +18 -0
- package/templates/vanilla/zenbu.config.ts.tmpl +56 -0
- package/LICENSE +0 -11
- package/template/src/main/services/app.ts.tmpl +0 -14
- package/template/src/renderer/App.tsx.tmpl +0 -43
- /package/{template → templates/tailwind}/electron-builder.json +0 -0
- /package/{template → templates/tailwind}/src/renderer/index.html +0 -0
- /package/{template → templates/tailwind}/src/renderer/splash.html +0 -0
- /package/{template → templates/tailwind}/tsconfig.json.tmpl +0 -0
- /package/{template → templates/vanilla}/vite.config.ts.tmpl +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
body {
|
|
6
|
+
margin: 0;
|
|
7
|
+
background: #111;
|
|
8
|
+
color: #e5e5e5;
|
|
9
|
+
font-family:
|
|
10
|
+
ui-sans-serif,
|
|
11
|
+
system-ui,
|
|
12
|
+
-apple-system,
|
|
13
|
+
"Segoe UI",
|
|
14
|
+
Roboto,
|
|
15
|
+
sans-serif;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.app {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
min-height: 100vh;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.titlebar {
|
|
25
|
+
height: 40px;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: flex-end;
|
|
29
|
+
padding: 0 12px 0 72px;
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.home {
|
|
34
|
+
flex: 1;
|
|
35
|
+
padding: 0 32px 32px;
|
|
36
|
+
color: #e5e5e5;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.home h1 {
|
|
40
|
+
font-size: 24px;
|
|
41
|
+
font-weight: 700;
|
|
42
|
+
margin: 0 0 8px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.home .lede {
|
|
46
|
+
color: #888;
|
|
47
|
+
margin: 0 0 24px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.home code {
|
|
51
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.add-form {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
gap: 12px;
|
|
58
|
+
background: #18181b;
|
|
59
|
+
border-radius: 12px;
|
|
60
|
+
padding: 16px;
|
|
61
|
+
max-width: 28rem;
|
|
62
|
+
margin-bottom: 24px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.add-form input {
|
|
66
|
+
padding: 8px 12px;
|
|
67
|
+
border-radius: 4px;
|
|
68
|
+
background: #222;
|
|
69
|
+
border: 1px solid #333;
|
|
70
|
+
color: inherit;
|
|
71
|
+
outline: none;
|
|
72
|
+
font: inherit;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.add-form input:focus {
|
|
76
|
+
border-color: #6366f1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.add-form button {
|
|
80
|
+
background: #4f46e5;
|
|
81
|
+
color: white;
|
|
82
|
+
font-weight: 600;
|
|
83
|
+
padding: 8px 16px;
|
|
84
|
+
border-radius: 4px;
|
|
85
|
+
border: 0;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
transition: background 120ms ease;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.add-form button:hover {
|
|
91
|
+
background: #4338ca;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.issues {
|
|
95
|
+
max-width: 28rem;
|
|
96
|
+
margin-bottom: 24px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.issues-empty {
|
|
100
|
+
color: #888;
|
|
101
|
+
font-style: italic;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.issue {
|
|
105
|
+
margin-bottom: 8px;
|
|
106
|
+
padding: 12px;
|
|
107
|
+
border-radius: 8px;
|
|
108
|
+
background: #222;
|
|
109
|
+
border: 1px solid #2a2a2a;
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
justify-content: space-between;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.issue-time {
|
|
116
|
+
font-size: 12px;
|
|
117
|
+
color: #666;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.rpc-button {
|
|
121
|
+
background: #27272a;
|
|
122
|
+
color: inherit;
|
|
123
|
+
border: 0;
|
|
124
|
+
padding: 8px 16px;
|
|
125
|
+
border-radius: 4px;
|
|
126
|
+
font-size: 14px;
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
transition: background 120ms ease;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.rpc-button:hover {
|
|
132
|
+
background: #3f3f46;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.rpc-result {
|
|
136
|
+
margin-top: 8px;
|
|
137
|
+
padding: 8px;
|
|
138
|
+
border-radius: 4px;
|
|
139
|
+
background: #232328;
|
|
140
|
+
color: #b0b0b0;
|
|
141
|
+
width: fit-content;
|
|
142
|
+
font-size: 12px;
|
|
143
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Zenbu App</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="root"></div>
|
|
10
|
+
<script type="module" src="./main.tsx"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="zenbu-bg" content="#111">
|
|
6
|
+
<title>Installing</title>
|
|
7
|
+
<style>
|
|
8
|
+
html, body {
|
|
9
|
+
height: 100%;
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
background: #111;
|
|
13
|
+
color: #ddd;
|
|
14
|
+
font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
|
|
15
|
+
-webkit-app-region: drag;
|
|
16
|
+
user-select: none;
|
|
17
|
+
}
|
|
18
|
+
body {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
gap: 18px;
|
|
24
|
+
padding: 32px;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
}
|
|
27
|
+
.label {
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
color: #f0f0f0;
|
|
30
|
+
letter-spacing: 0.2px;
|
|
31
|
+
min-height: 1.4em;
|
|
32
|
+
text-align: center;
|
|
33
|
+
}
|
|
34
|
+
.bar {
|
|
35
|
+
width: min(360px, 70%);
|
|
36
|
+
height: 4px;
|
|
37
|
+
background: #2a2a2a;
|
|
38
|
+
border-radius: 2px;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
position: relative;
|
|
41
|
+
}
|
|
42
|
+
.bar-fill {
|
|
43
|
+
position: absolute;
|
|
44
|
+
inset: 0 auto 0 0;
|
|
45
|
+
width: 0%;
|
|
46
|
+
background: #f0f0f0;
|
|
47
|
+
transition: width 180ms ease-out;
|
|
48
|
+
}
|
|
49
|
+
.bar.indeterminate .bar-fill {
|
|
50
|
+
width: 30%;
|
|
51
|
+
animation: slide 1.2s ease-in-out infinite;
|
|
52
|
+
}
|
|
53
|
+
@keyframes slide {
|
|
54
|
+
0% { transform: translateX(-100%); }
|
|
55
|
+
100% { transform: translateX(366%); }
|
|
56
|
+
}
|
|
57
|
+
.message {
|
|
58
|
+
font-size: 11px;
|
|
59
|
+
color: #888;
|
|
60
|
+
font-family: "SF Mono", Menlo, Consolas, monospace;
|
|
61
|
+
max-width: min(420px, 90%);
|
|
62
|
+
text-align: center;
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
text-overflow: ellipsis;
|
|
65
|
+
white-space: nowrap;
|
|
66
|
+
min-height: 1.4em;
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
69
|
+
</head>
|
|
70
|
+
<body>
|
|
71
|
+
<div class="label" id="label">Starting…</div>
|
|
72
|
+
<div class="bar indeterminate" id="bar"><div class="bar-fill" id="fill"></div></div>
|
|
73
|
+
<div class="message" id="message"></div>
|
|
74
|
+
<script>
|
|
75
|
+
// The framework's built-in preload exposes `window.zenbuInstall` with
|
|
76
|
+
// `.on(event, cb)` returning an unsubscribe function. Events:
|
|
77
|
+
// step: { id: "clone" | "fetch" | "install" | "handoff", label }
|
|
78
|
+
// message: { text }
|
|
79
|
+
// progress: { phase?, loaded?, total?, ratio? }
|
|
80
|
+
// done: { id }
|
|
81
|
+
// error: { id?, message }
|
|
82
|
+
const api = window.zenbuInstall;
|
|
83
|
+
const labelEl = document.getElementById("label");
|
|
84
|
+
const messageEl = document.getElementById("message");
|
|
85
|
+
const barEl = document.getElementById("bar");
|
|
86
|
+
const fillEl = document.getElementById("fill");
|
|
87
|
+
if (api) {
|
|
88
|
+
api.on("step", (p) => {
|
|
89
|
+
if (p && p.label) labelEl.textContent = p.label;
|
|
90
|
+
barEl.classList.add("indeterminate");
|
|
91
|
+
fillEl.style.width = "";
|
|
92
|
+
});
|
|
93
|
+
api.on("message", (p) => {
|
|
94
|
+
if (p && p.text) messageEl.textContent = p.text;
|
|
95
|
+
});
|
|
96
|
+
api.on("progress", (p) => {
|
|
97
|
+
const ratio = p && typeof p.ratio === "number" ? p.ratio : null;
|
|
98
|
+
if (ratio != null && ratio >= 0) {
|
|
99
|
+
barEl.classList.remove("indeterminate");
|
|
100
|
+
fillEl.style.width = Math.max(2, Math.min(100, ratio * 100)) + "%";
|
|
101
|
+
} else {
|
|
102
|
+
barEl.classList.add("indeterminate");
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
api.on("done", () => {
|
|
106
|
+
messageEl.textContent = "";
|
|
107
|
+
});
|
|
108
|
+
api.on("error", (p) => {
|
|
109
|
+
labelEl.textContent = "Failed";
|
|
110
|
+
if (p && p.message) messageEl.textContent = p.message;
|
|
111
|
+
barEl.classList.remove("indeterminate");
|
|
112
|
+
fillEl.style.width = "100%";
|
|
113
|
+
fillEl.style.background = "#d04444";
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
</script>
|
|
117
|
+
</body>
|
|
118
|
+
</html>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="zenbu-bg" content="#111">
|
|
6
|
+
<style>
|
|
7
|
+
html, body {
|
|
8
|
+
height: 100%;
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
background: #111;
|
|
12
|
+
}
|
|
13
|
+
@media (prefers-color-scheme: dark) {
|
|
14
|
+
html, body {
|
|
15
|
+
background: #111;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"jsx": "react-jsx",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"outDir": "dist",
|
|
11
|
+
"rootDir": ".",
|
|
12
|
+
"paths": {
|
|
13
|
+
"@/*": ["./src/renderer/*"],
|
|
14
|
+
"#registry/*": ["./types/*"]
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"include": ["src", "types"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineConfig,
|
|
3
|
+
definePlugin,
|
|
4
|
+
defineBuildConfig,
|
|
5
|
+
} from "@zenbujs/core/config"
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
// Where the kyju database lives (relative to this file).
|
|
9
|
+
db: "./.zenbu/db",
|
|
10
|
+
|
|
11
|
+
// Boot-window HTML. The single ui entrypoint for the whole app.
|
|
12
|
+
uiEntrypoint: "./src/renderer",
|
|
13
|
+
|
|
14
|
+
// Plugins are pure main-process: services + optional schema/preload/events.
|
|
15
|
+
// The "host plugin" is just the first entry by convention.
|
|
16
|
+
plugins: [
|
|
17
|
+
definePlugin({
|
|
18
|
+
name: "app",
|
|
19
|
+
services: ["./src/main/services/*.ts"],
|
|
20
|
+
schema: "./src/main/schema.ts",
|
|
21
|
+
}),
|
|
22
|
+
],
|
|
23
|
+
|
|
24
|
+
// Build pipeline for `zen build:source` (mirror staging) and
|
|
25
|
+
// `zen build:electron` (signed .app via electron-builder). Set
|
|
26
|
+
// `mirror.target` to "<owner>/<repo>" before shipping.
|
|
27
|
+
build: defineBuildConfig({
|
|
28
|
+
// {{packageManager}}
|
|
29
|
+
// The .app's "host version" comes from `package.json#version` —
|
|
30
|
+
// read at build time and baked into <bundle>/host.json. Bump
|
|
31
|
+
// `package.json#version` every time you ship a new .app build.
|
|
32
|
+
// Each commit's `package.json#zenbu.host` semver range is checked
|
|
33
|
+
// against that value at launch (and from `UpdaterService.update()`);
|
|
34
|
+
// incompatible commits are skipped, so older .apps stay pinned to
|
|
35
|
+
// source they can actually run.
|
|
36
|
+
source: ".",
|
|
37
|
+
out: ".zenbu/build/source",
|
|
38
|
+
include: [
|
|
39
|
+
"src/**/*",
|
|
40
|
+
".gitignore",
|
|
41
|
+
"package.json",
|
|
42
|
+
"pnpm-lock.yaml",
|
|
43
|
+
"tsconfig.json",
|
|
44
|
+
"zenbu.config.ts",
|
|
45
|
+
"vite.config.ts",
|
|
46
|
+
],
|
|
47
|
+
ignore: [
|
|
48
|
+
"src/**/*.test.ts",
|
|
49
|
+
"src/**/*.test.tsx",
|
|
50
|
+
"src/**/*.spec.ts",
|
|
51
|
+
"src/**/*.spec.tsx",
|
|
52
|
+
"src/dev-only/**",
|
|
53
|
+
],
|
|
54
|
+
// mirror: { target: "{{owner}}/{{repo}}", branch: "main" },
|
|
55
|
+
}),
|
|
56
|
+
})
|
package/LICENSE
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
All Rights Reserved
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Zenbu Labs Inc.
|
|
4
|
-
|
|
5
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
6
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
7
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
8
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
9
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
10
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
11
|
-
THE SOFTWARE.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { runtime, serviceWithDeps } from "@zenbujs/core/runtime"
|
|
2
|
-
import { WindowService } from "@zenbujs/core/services"
|
|
3
|
-
|
|
4
|
-
export class AppService extends serviceWithDeps({
|
|
5
|
-
window: WindowService,
|
|
6
|
-
}) {
|
|
7
|
-
static key = "app"
|
|
8
|
-
|
|
9
|
-
async evaluate() {
|
|
10
|
-
await this.ctx.window.openView({ scope: "app" })
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
runtime.register(AppService, import.meta)
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
function Titlebar() {
|
|
2
|
-
return (
|
|
3
|
-
<div
|
|
4
|
-
style={{
|
|
5
|
-
height: 40,
|
|
6
|
-
display: "flex",
|
|
7
|
-
alignItems: "center",
|
|
8
|
-
justifyContent: "flex-end",
|
|
9
|
-
padding: "0 12px 0 72px",
|
|
10
|
-
// @ts-expect-error webkit property
|
|
11
|
-
WebkitAppRegion: "drag",
|
|
12
|
-
flexShrink: 0,
|
|
13
|
-
}}
|
|
14
|
-
/>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function Home() {
|
|
19
|
-
return (
|
|
20
|
-
<main
|
|
21
|
-
style={{
|
|
22
|
-
flex: 1,
|
|
23
|
-
padding: "0 32px 32px",
|
|
24
|
-
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
25
|
-
color: "var(--foreground, #e5e5e5)",
|
|
26
|
-
}}
|
|
27
|
-
>
|
|
28
|
-
<h1>Welcome to Zenbu</h1>
|
|
29
|
-
<p style={{ color: "var(--muted-foreground, #999)", marginTop: 8 }}>
|
|
30
|
-
Edit <code>src/renderer/App.tsx</code> to get started.
|
|
31
|
-
</p>
|
|
32
|
-
</main>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function App() {
|
|
37
|
-
return (
|
|
38
|
-
<div style={{ display: "flex", flexDirection: "column", minHeight: "100vh" }}>
|
|
39
|
-
<Titlebar />
|
|
40
|
-
<Home />
|
|
41
|
-
</div>
|
|
42
|
-
)
|
|
43
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|