You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scaffold a production-minded Electrobun desktop app with Bun, Reactor Preact, TypeScript, Vite, Biome, typed Electrobun RPC, and a small set of optional integrations that can be enabled at create time or added later.
8
+
Scaffold a production-minded Electrobun desktop app with Bun, React, Preact, Svelte, or SvelteKit, TypeScript, Vite, Biome, typed Electrobun RPC, optional native utilities, and optional installer packaging helpers that can be enabled at create time or added later.
9
9
10
10
The generator is intentionally explicit: every selected stack option is written to `ces.json`, the generated project README explains what was scaffolded, and the `add` command can use that manifest to enable missing features without asking you to remember the original command.
Some options add commands. For example, `--addons turborepo` adds `bun run check`, and `--orm drizzle` adds Drizzle scripts.
179
+
Some options add commands. For example, `--addons turborepo` adds `bun run check`, `--orm drizzle` adds Drizzle scripts, and `--packaging installers` adds `bun run package:release` plus platform-specific packaging commands.
Copy file name to clipboardExpand all lines: docs/guides/generated-project.md
+23-3Lines changed: 23 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,8 @@ my-app/
15
15
vite.config.ts
16
16
biome.json
17
17
tsconfig.json
18
+
scripts/
19
+
package-electrobun.ts
18
20
tests/
19
21
manifest.test.ts
20
22
desktop-smoke.test.ts
@@ -49,7 +51,7 @@ my-app/
49
51
app.css
50
52
```
51
53
52
-
That layout matches the default stack with the optional desktop smoke test shown for reference. The default stack is TanStack Router, Electrobun RPC, app menu, local navigation rules, Tailwind CSS, and Bun tests. Options can add files such as `src/bun/db/client.ts`, `src/bun/settings/store.ts`, `tests/desktop-smoke.test.ts`, `components.json`, and `turbo.json`, or omit default files when you choose alternatives like `--router none`, `--app-menu none`, or `--testing none`.
54
+
That layout matches the default stack with optional desktop smoke and installer packaging files shown for reference. The default stack is TanStack Router, Electrobun RPC, app menu, local navigation rules, Tailwind CSS, and Bun tests. Options can add files such as `src/bun/db/client.ts`, `src/bun/settings/store.ts`, `tests/desktop-smoke.test.ts`, `scripts/package-electrobun.ts`, `components.json`, and `turbo.json`, or omit default files when you choose alternatives like `--router none`, `--app-menu none`, `--packaging none`, or `--testing none`.
53
55
54
56
## Runtime Model
55
57
@@ -110,13 +112,15 @@ Add RPC contract types in `src/shared/rpc/schema.ts`, handler implementation in
110
112
111
113
With `--frontend react`, all router choices are available.
112
114
113
-
With `--frontend preact`, use `--router none`; the generated Preact renderer mounts `Home` directly.
115
+
With `--frontend preact` or `--frontend svelte`, use `--router none`; the generated renderer mounts `Home` directly.
116
+
117
+
With `--frontend sveltekit`, use `--router none`; the generated SvelteKit app uses SvelteKit file routing under `src/views/main/routes`.
114
118
115
119
With `--router tanstack-router`, edit files under `src/views/main/routes`. The generated route tree is produced by the TanStack Router Vite plugin.
116
120
117
121
With `--router react-router`, edit routes in `src/views/main/app.tsx`.
118
122
119
-
With `--router none`, the app renders `Home` directly from `src/views/main/app.tsx`.
123
+
With `--router none`, React and Preact apps render `Home` directly from `src/views/main/app.tsx`; Svelte apps render `Home` from `src/views/main/App.svelte`.
120
124
121
125
### RPC
122
126
@@ -158,6 +162,21 @@ With `--native-utils desktop-kit`, both native utility examples are enabled.
158
162
159
163
With `--testing desktop-smoke`, `tests/desktop-smoke.test.ts` mocks `electrobun/bun`, imports the generated window code, creates the main window, and verifies launch options without opening a real OS window.
160
164
165
+
### Installer Packaging
166
+
167
+
With `--packaging installers`, `scripts/package-electrobun.ts` wraps Electrobun's release artifacts with extra distribution formats. It copies Electrobun artifacts, reuses Electrobun's generated DMG on macOS, builds AppImage and deb packages on Linux, and builds an NSIS wrapper around Electrobun's Windows setup executable on Windows.
168
+
169
+
The generated packaging commands are:
170
+
171
+
```bash
172
+
bun run package:release
173
+
bun run package:linux
174
+
bun run package:mac
175
+
bun run package:windows
176
+
```
177
+
178
+
These commands expect non-dev Electrobun artifacts. Use `package:release` for a stable build, or run `bun run build` with a canary/stable build channel before a platform-specific packaging command. Linux AppImage packaging requires `appimagetool`, Linux deb packaging requires `dpkg-deb`, and Windows packaging requires `makensis`.
179
+
161
180
## Manifest
162
181
163
182
`ces.json` is part of the project contract. Keep it in source control.
@@ -182,6 +201,7 @@ Before distributing an app generated by this stack:
182
201
- Choose build targets intentionally.
183
202
- Run `bun run typecheck`, `bun run lint`, and `bun test` when present.
184
203
- Run `bun run build` on the platform you are packaging for.
204
+
- If `--packaging installers` is enabled, run the package command on the matching OS runner and inspect `dist/installers`.
185
205
- Review local persistence paths and database behavior for your release model.
Adds `scripts/package-electrobun.ts`. The base package, TypeScript, and README templates add packaging commands and references when `--packaging installers` is selected.
136
+
117
137
### `testing/bun`
118
138
119
139
Adds `tests/manifest.test.ts`. The base package and TypeScript templates add the script and include path when testing is enabled.
@@ -137,6 +157,9 @@ Template data is built in `src/scaffold.ts`. Important booleans include:
137
157
-`hasTanstackQuery`
138
158
-`hasPreactFrontend`
139
159
-`hasReactFrontend`
160
+
-`hasSvelteFrontend`
161
+
-`hasSvelteKitFrontend`
162
+
-`hasSvelteFamilyFrontend`
140
163
-`hasTailwind`
141
164
-`hasShadcn`
142
165
-`hasDatabase`
@@ -147,6 +170,7 @@ Template data is built in `src/scaffold.ts`. Important booleans include:
Copy file name to clipboardExpand all lines: docs/llm.txt
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
create-electrobun-stack LLM guide
2
2
3
3
Purpose:
4
-
Scaffold an Electrobun desktop app with Bun, Reactor Preact, TypeScript, Vite, Biome, typed Electrobun RPC, and optional integrations. The generated project includes ces.json so future tooling can understand and expand the stack.
4
+
Scaffold an Electrobun desktop app with Bun, React, Preact, Svelte, or SvelteKit, TypeScript, Vite, Biome, typed Electrobun RPC, and optional integrations. The generated project includes ces.json so future tooling can understand and expand the stack.
5
5
6
6
Primary commands:
7
7
@@ -42,6 +42,7 @@ Default stack:
42
42
--db-setup none
43
43
--settings none
44
44
--package-manager bun
45
+
--packaging none
45
46
--testing bun
46
47
--addons none
47
48
--examples rpc
@@ -50,7 +51,7 @@ Default stack:
50
51
51
52
Generated app:
52
53
- Bun native process in src/bun.
53
-
- Reactor Preact renderer in src/views/main.
54
+
- React, Preact, Svelte, or SvelteKit renderer in src/views/main.
54
55
- Shared types in src/shared.
55
56
- Typed RPC contract in src/shared/rpc/schema.ts when --api electrobun-rpc is selected.
56
57
- ces.json manifest at project root.
@@ -72,6 +73,8 @@ Option behavior:
72
73
- --router react-router adds React Router with HashRouter.
73
74
- --router none renders Home directly.
74
75
- --frontend preact adds a Preact renderer with @preact/preset-vite. It currently requires --router none, --query none, and --ui none.
76
+
- --frontend svelte adds a direct Svelte renderer with @sveltejs/vite-plugin-svelte. It currently requires --router none, --query none, and --ui none.
77
+
- --frontend sveltekit adds a static SvelteKit renderer with @sveltejs/adapter-static and SvelteKit file routing. It currently requires --router none, --query none, and --ui none.
75
78
- --query tanstack-query adds @tanstack/react-query and QueryClientProvider.
76
79
- --styling tailwindcss adds Tailwind CSS v4 and @tailwindcss/vite.
77
80
- --styling css omits Tailwind dependencies.
@@ -94,6 +97,7 @@ Option behavior:
94
97
- --settings json adds data/settings.json persistence and requires Electrobun RPC.
95
98
- --settings database stores settings in SQLite and requires Electrobun RPC plus SQLite.
96
99
- --package-manager bun|npm|pnpm|yarn controls install/run command text and package manager metadata.
100
+
- --packaging installers adds scripts/package-electrobun.ts plus package:release, package:linux, package:mac, and package:windows scripts for AppImage, deb, DMG collection, and NSIS wrapping around Electrobun artifacts.
97
101
- --testing bun adds bun test and tests/manifest.test.ts.
98
102
- --testing desktop-smoke adds bun test, tests/manifest.test.ts, and tests/desktop-smoke.test.ts with mocked Electrobun launch verification.
99
103
- --testing none omits tests.
@@ -107,7 +111,7 @@ Invalid combinations:
107
111
- Native utility examples require Electrobun RPC.
108
112
- RPC examples require Electrobun RPC.
109
113
- shadcn requires Tailwind CSS.
110
-
- Preact requires --router none, --query none, and --ui none.
-`--frontend preact`currently requires`--router none`, `--query none`, and `--ui none`.
125
+
-`--ui shadcn` requires `--styling tailwindcss` and `--frontend react`.
126
+
-`--frontend preact`, `--frontend svelte`, and `--frontend sveltekit`currently require`--router none`, `--query none`, and `--ui none`.
126
127
127
128
The `add` command can infer some prerequisites. For example, `add --orm drizzle` enables SQLite if it was missing, and `add --ui shadcn` enables Tailwind CSS if the app was created with plain CSS.
0 commit comments