create-tauri-ui 1.0.5 → 1.0.7
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 +93 -102
- package/assets/debug-panel/debug-panel.tsx.tmpl +647 -59
- package/dist/index.mjs +80 -65
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,141 +1,146 @@
|
|
|
1
1
|
# create-tauri-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
CLI to scaffold Tauri desktop apps with `shadcn/ui`. Drives the upstream `shadcn` and `create-tauri-app` CLIs — no local template tree to maintain.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Quick Start
|
|
8
|
-
|
|
9
|
-
Primary commands:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm create tauri-ui@latest my-app
|
|
13
|
-
```
|
|
5
|
+
## Install & run
|
|
14
6
|
|
|
15
7
|
```bash
|
|
8
|
+
# bun
|
|
16
9
|
bun create tauri-ui my-app
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Equivalent direct binary commands:
|
|
10
|
+
bunx create-tauri-ui@latest my-app
|
|
20
11
|
|
|
21
|
-
|
|
12
|
+
# npm
|
|
13
|
+
npm create tauri-ui@latest my-app
|
|
22
14
|
npx create-tauri-ui@latest my-app
|
|
23
15
|
```
|
|
24
16
|
|
|
17
|
+
## After generation
|
|
18
|
+
|
|
25
19
|
```bash
|
|
26
|
-
|
|
20
|
+
cd my-app
|
|
21
|
+
bun install
|
|
22
|
+
bun run tauri dev
|
|
27
23
|
```
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- `vite`
|
|
32
|
-
- `next`
|
|
33
|
-
- `start`
|
|
34
|
-
- `react-router`
|
|
35
|
-
- `astro`
|
|
36
|
-
|
|
37
|
-
## Batteries Included
|
|
25
|
+
To regenerate the Tauri icon set from the included source image:
|
|
38
26
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- a frontend scaffold generated by the upstream `shadcn` CLI
|
|
43
|
-
- template adapters for `vite`, `next`, `start`, `react-router`, and `astro`
|
|
44
|
-
- Tauri config patches for desktop dev/build output
|
|
45
|
-
- centered desktop window defaults with a `1400x918` main window
|
|
46
|
-
- startup flash prevention by hiding the main window until the first page load finishes
|
|
47
|
-
- external link guarding so internal links stay in-app and external links open in the system browser
|
|
48
|
-
- a dev-only debug panel with Tauri runtime info, tracked invokes, runtime events, and log stream wiring
|
|
49
|
-
- desktop scroll-container defaults that disable overscroll and rubber-band scrolling
|
|
50
|
-
- desktop selection defaults with global `select-none`, an intrinsic selectable allowlist, and a `.ui-selectable` utility
|
|
51
|
-
- a branded `app-icon.png` source asset
|
|
27
|
+
```bash
|
|
28
|
+
bunx tauri icon app-icon.png
|
|
29
|
+
```
|
|
52
30
|
|
|
53
|
-
|
|
31
|
+
> Bun is required in generated projects.
|
|
54
32
|
|
|
55
|
-
|
|
56
|
-
- a small Rust invoke example
|
|
57
|
-
- a GitHub release workflow
|
|
33
|
+
## CLI reference
|
|
58
34
|
|
|
59
|
-
|
|
35
|
+
```
|
|
36
|
+
Usage: create-tauri-ui [target-dir] [options]
|
|
60
37
|
|
|
61
|
-
|
|
38
|
+
Options:
|
|
39
|
+
-t, --template <name> vite | next | start | react-router | astro
|
|
40
|
+
--identifier <value> Tauri app identifier (e.g. com.example.myapp)
|
|
41
|
+
--preset <value> shadcn preset (default: b0)
|
|
42
|
+
--size-optimize optimize release binaries for size
|
|
43
|
+
--no-size-optimize skip size optimization
|
|
44
|
+
--starter include the starter dashboard
|
|
45
|
+
--no-starter skip the starter dashboard
|
|
46
|
+
--invoke-example include the Rust invoke example
|
|
47
|
+
--no-invoke-example skip the Rust invoke example
|
|
48
|
+
--workflow include the GitHub release workflow
|
|
49
|
+
--no-workflow skip the GitHub release workflow
|
|
50
|
+
-f, --force overwrite an existing target directory
|
|
51
|
+
-y, --yes accept all defaults
|
|
52
|
+
-v, --version display version
|
|
53
|
+
-h, --help display help
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Examples
|
|
57
|
+
|
|
58
|
+
**Vite app with all defaults:**
|
|
62
59
|
|
|
63
60
|
```bash
|
|
64
61
|
npm create tauri-ui@latest my-app -- --template vite --yes
|
|
65
62
|
```
|
|
66
63
|
|
|
67
|
-
|
|
64
|
+
**Next.js app, no dashboard, no workflow:**
|
|
68
65
|
|
|
69
66
|
```bash
|
|
70
67
|
npm create tauri-ui@latest my-app -- --template next --yes --no-starter --no-workflow
|
|
71
68
|
```
|
|
72
69
|
|
|
73
|
-
|
|
70
|
+
**Astro app with a custom bundle identifier:**
|
|
74
71
|
|
|
75
72
|
```bash
|
|
76
73
|
bun create tauri-ui my-app --template astro --identifier com.example.astroapp --yes
|
|
77
74
|
```
|
|
78
75
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
```text
|
|
82
|
-
Usage: create-tauri-ui [target-dir] [options]
|
|
76
|
+
**Vite app with size-optimized release binary:**
|
|
83
77
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
--identifier <value> set the Tauri app identifier
|
|
87
|
-
--preset <value> set the shadcn preset (default: b0)
|
|
88
|
-
--starter include the starter dashboard
|
|
89
|
-
--no-starter skip the starter dashboard
|
|
90
|
-
--invoke-example include the Rust invoke example
|
|
91
|
-
--no-invoke-example skip the Rust invoke example
|
|
92
|
-
--workflow include the GitHub release workflow
|
|
93
|
-
--no-workflow skip the GitHub release workflow
|
|
94
|
-
-f, --force overwrite an existing target directory
|
|
95
|
-
-y, --yes accept defaults
|
|
96
|
-
-h, --help display help
|
|
78
|
+
```bash
|
|
79
|
+
bun create tauri-ui my-app --template vite --size-optimize --yes
|
|
97
80
|
```
|
|
98
81
|
|
|
99
|
-
##
|
|
82
|
+
## Batteries included
|
|
100
83
|
|
|
101
|
-
|
|
84
|
+
Every generated project gets:
|
|
102
85
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
86
|
+
- `src-tauri` native layer (from `create-tauri-app`)
|
|
87
|
+
- shadcn frontend scaffold (from the upstream `shadcn` CLI)
|
|
88
|
+
- framework adapters for `vite`, `next`, `start`, `react-router`, `astro`
|
|
89
|
+
- Tauri config patches for desktop dev and build output
|
|
90
|
+
- centered `1400×918` main window
|
|
91
|
+
- startup flash prevention (window hidden until first paint)
|
|
92
|
+
- external link guard — internal links stay in-app, external links open in the system browser
|
|
93
|
+
- overscroll / rubber-band scroll disabled
|
|
94
|
+
- desktop selection defaults — global `select-none`, intrinsic selectable allowlist, `.ui-selectable` utility class
|
|
95
|
+
- dev-only debug panel with runtime info, tracked invokes, runtime events, and log stream
|
|
96
|
+
- `app-icon.png` source asset
|
|
109
97
|
|
|
110
|
-
|
|
98
|
+
**Optional** (prompted during scaffolding, or passed as flags):
|
|
111
99
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
100
|
+
| Battery | Flag | Notes |
|
|
101
|
+
| ----------------------- | ------------------------------------------ | ------------------------------------------- |
|
|
102
|
+
| Starter dashboard | `--starter` / `--no-starter` | based on `dashboard-01` |
|
|
103
|
+
| Rust invoke example | `--invoke-example` / `--no-invoke-example` | |
|
|
104
|
+
| Size optimization | `--size-optimize` / `--no-size-optimize` | ~65% smaller release binary (9 MB → 3.1 MB) |
|
|
105
|
+
| GitHub release workflow | `--workflow` / `--no-workflow` | |
|
|
106
|
+
|
|
107
|
+
## Template status
|
|
108
|
+
|
|
109
|
+
| Template | Status |
|
|
110
|
+
| ------------------ | ----------------------------------------------- |
|
|
111
|
+
| `vite` | smoke-tested end to end |
|
|
112
|
+
| `next` | stable |
|
|
113
|
+
| `react-router` | stable |
|
|
114
|
+
| `astro` | stable |
|
|
115
|
+
| `start` (TanStack) | experimental — validate carefully after changes |
|
|
116
|
+
|
|
117
|
+
Scaffolding into `.` (current directory) is not supported yet.
|
|
115
118
|
|
|
116
|
-
## How
|
|
119
|
+
## How it works
|
|
117
120
|
|
|
118
|
-
```
|
|
119
|
-
prompts
|
|
121
|
+
```
|
|
122
|
+
prompts → shadcn init → create-tauri-app (temp dir) → merge src-tauri → apply framework patches → add batteries
|
|
120
123
|
```
|
|
121
124
|
|
|
122
|
-
|
|
125
|
+
Local asset surface is intentionally small:
|
|
123
126
|
|
|
124
|
-
|
|
125
|
-
|
|
127
|
+
```
|
|
128
|
+
assets/app-icon.png
|
|
129
|
+
assets/release.yml.tmpl
|
|
130
|
+
```
|
|
126
131
|
|
|
127
|
-
|
|
132
|
+
No full frontend templates are shipped. The upstream CLIs do the heavy lifting; this package handles the merge, patching, and battery injection.
|
|
128
133
|
|
|
129
134
|
## Development
|
|
130
135
|
|
|
131
|
-
Run
|
|
136
|
+
Run from the monorepo root:
|
|
132
137
|
|
|
133
138
|
```bash
|
|
134
139
|
bun run --cwd packages/create-tauri-ui check-types
|
|
135
140
|
bun run --cwd packages/create-tauri-ui build
|
|
136
141
|
```
|
|
137
142
|
|
|
138
|
-
Run the local
|
|
143
|
+
Run the local build directly:
|
|
139
144
|
|
|
140
145
|
```bash
|
|
141
146
|
bun run --cwd packages/create-tauri-ui start -- --help
|
|
@@ -143,46 +148,32 @@ bun run --cwd packages/create-tauri-ui start -- --help
|
|
|
143
148
|
|
|
144
149
|
## Testing
|
|
145
150
|
|
|
146
|
-
|
|
151
|
+
**Type check + build:**
|
|
147
152
|
|
|
148
153
|
```bash
|
|
149
154
|
bun run --cwd packages/create-tauri-ui check-types
|
|
150
155
|
bun run --cwd packages/create-tauri-ui build
|
|
151
156
|
```
|
|
152
157
|
|
|
153
|
-
|
|
158
|
+
**Single template smoke test:**
|
|
154
159
|
|
|
155
160
|
```bash
|
|
156
161
|
rm -rf /tmp/ctui-vite
|
|
157
162
|
node packages/create-tauri-ui/index.js /tmp/ctui-vite --template vite --yes --no-workflow
|
|
158
|
-
cd /tmp/ctui-vite
|
|
159
|
-
bun install
|
|
160
|
-
bun run build
|
|
163
|
+
cd /tmp/ctui-vite && bun install && bun run build
|
|
161
164
|
```
|
|
162
165
|
|
|
163
|
-
|
|
166
|
+
**All templates:**
|
|
164
167
|
|
|
165
168
|
```bash
|
|
166
169
|
for template in vite next start react-router astro; do
|
|
167
170
|
dir="/tmp/create-tauri-ui-$template"
|
|
168
171
|
rm -rf "$dir"
|
|
169
172
|
node packages/create-tauri-ui/index.js "$dir" --template "$template" --yes --no-workflow
|
|
170
|
-
(
|
|
171
|
-
cd "$dir" &&
|
|
172
|
-
bun install &&
|
|
173
|
-
bun run build
|
|
174
|
-
) || exit 1
|
|
173
|
+
(cd "$dir" && bun install && bun run build) || exit 1
|
|
175
174
|
done
|
|
176
175
|
```
|
|
177
176
|
|
|
178
|
-
## Current Notes
|
|
179
|
-
|
|
180
|
-
- Bun is required in generated projects.
|
|
181
|
-
- Scaffolding into `.` is not supported yet.
|
|
182
|
-
- Vite has already been smoke-tested end to end.
|
|
183
|
-
- The other adapters are implemented, but they still need broader end-to-end verification coverage.
|
|
184
|
-
- `TanStack Start` is the highest-risk adapter and should be validated carefully after changes.
|
|
185
|
-
|
|
186
177
|
## License
|
|
187
178
|
|
|
188
179
|
MIT
|