create-tauri-ui 1.0.4 → 1.0.6

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 CHANGED
@@ -1,141 +1,142 @@
1
1
  # create-tauri-ui
2
2
 
3
- Create modern Tauri desktop apps with `shadcn/ui` in a few steps.
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
- This package scaffolds a frontend with the upstream `shadcn` CLI, generates a native shell with `create-tauri-app`, and merges the result into a Tauri-ready project. It is designed to avoid maintaining a large local template directory.
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
- ```bash
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
- bunx create-tauri-ui@latest my-app
20
+ cd my-app
21
+ bun install
22
+ bun run tauri dev
27
23
  ```
28
24
 
29
- ## Supported Templates
30
-
31
- - `vite`
32
- - `next`
33
- - `start`
34
- - `react-router`
35
- - `astro`
36
-
37
- ## Batteries Included
38
-
39
- Every generated project gets:
40
-
41
- - a Tauri `src-tauri` native layer
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
25
+ To regenerate the Tauri icon set from the included source image:
52
26
 
53
- Optional batteries:
27
+ ```bash
28
+ bunx tauri icon app-icon.png
29
+ ```
54
30
 
55
- - a starter dashboard based on `dashboard-01`
56
- - a small Rust invoke example
57
- - a GitHub release workflow
31
+ > Bun is required in generated projects.
58
32
 
59
- ## Example Commands
33
+ ## CLI reference
60
34
 
61
- Generate a Vite app with defaults:
35
+ ```
36
+ Usage: create-tauri-ui [target-dir] [options]
62
37
 
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:**
63
59
  ```bash
64
60
  npm create tauri-ui@latest my-app -- --template vite --yes
65
61
  ```
66
62
 
67
- Generate a Next.js app without the starter dashboard or workflow:
68
-
63
+ **Next.js app, no dashboard, no workflow:**
69
64
  ```bash
70
65
  npm create tauri-ui@latest my-app -- --template next --yes --no-starter --no-workflow
71
66
  ```
72
67
 
73
- Generate an Astro app with a custom identifier:
74
-
68
+ **Astro app with a custom bundle identifier:**
75
69
  ```bash
76
70
  bun create tauri-ui my-app --template astro --identifier com.example.astroapp --yes
77
71
  ```
78
72
 
79
- ## CLI Options
73
+ **Vite app with size-optimized release binary:**
74
+ ```bash
75
+ bun create tauri-ui my-app --template vite --size-optimize --yes
76
+ ```
80
77
 
81
- ```text
82
- Usage: create-tauri-ui [target-dir] [options]
78
+ ## Batteries included
83
79
 
84
- Options:
85
- -t, --template <name> vite | next | start | react-router | astro
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
97
- ```
80
+ Every generated project gets:
98
81
 
99
- ## After Generation
82
+ - `src-tauri` native layer (from `create-tauri-app`)
83
+ - shadcn frontend scaffold (from the upstream `shadcn` CLI)
84
+ - framework adapters for `vite`, `next`, `start`, `react-router`, `astro`
85
+ - Tauri config patches for desktop dev and build output
86
+ - centered `1400×918` main window
87
+ - startup flash prevention (window hidden until first paint)
88
+ - external link guard — internal links stay in-app, external links open in the system browser
89
+ - overscroll / rubber-band scroll disabled
90
+ - desktop selection defaults — global `select-none`, intrinsic selectable allowlist, `.ui-selectable` utility class
91
+ - dev-only debug panel with runtime info, tracked invokes, runtime events, and log stream
92
+ - `app-icon.png` source asset
100
93
 
101
- In the generated project:
94
+ **Optional** (prompted during scaffolding, or passed as flags):
102
95
 
103
- ```bash
104
- cd my-app
105
- bun install
106
- bun run build
107
- bun run tauri dev
108
- ```
96
+ | Battery | Flag | Notes |
97
+ |---|---|---|
98
+ | Starter dashboard | `--starter` / `--no-starter` | based on `dashboard-01` |
99
+ | Rust invoke example | `--invoke-example` / `--no-invoke-example` | |
100
+ | Size optimization | `--size-optimize` / `--no-size-optimize` | ~65% smaller release binary (9 MB → 3.1 MB) |
101
+ | GitHub release workflow | `--workflow` / `--no-workflow` | |
109
102
 
110
- To generate the Tauri icon set from the included source image:
103
+ ## Template status
111
104
 
112
- ```bash
113
- bunx tauri icon app-icon.png
114
- ```
105
+ | Template | Status |
106
+ |---|---|
107
+ | `vite` | smoke-tested end to end |
108
+ | `next` | stable |
109
+ | `react-router` | stable |
110
+ | `astro` | stable |
111
+ | `start` (TanStack) | experimental — validate carefully after changes |
112
+
113
+ Scaffolding into `.` (current directory) is not supported yet.
115
114
 
116
- ## How It Works
115
+ ## How it works
117
116
 
118
- ```text
119
- prompts -> shadcn init -> create-tauri-app (temp) -> merge src-tauri -> apply framework patches -> add batteries
117
+ ```
118
+ prompts shadcn init create-tauri-app (temp dir) merge src-tauri apply framework patches add batteries
120
119
  ```
121
120
 
122
- The package keeps only a small local asset surface:
121
+ Local asset surface is intentionally small:
123
122
 
124
- - `assets/app-icon.png`
125
- - `assets/release.yml.tmpl`
123
+ ```
124
+ assets/app-icon.png
125
+ assets/release.yml.tmpl
126
+ ```
126
127
 
127
- It does not ship full frontend templates.
128
+ No full frontend templates are shipped. The upstream CLIs do the heavy lifting; this package handles the merge, patching, and battery injection.
128
129
 
129
130
  ## Development
130
131
 
131
- Run these from the monorepo root:
132
+ Run from the monorepo root:
132
133
 
133
134
  ```bash
134
135
  bun run --cwd packages/create-tauri-ui check-types
135
136
  bun run --cwd packages/create-tauri-ui build
136
137
  ```
137
138
 
138
- Run the local CLI build:
139
+ Run the local build directly:
139
140
 
140
141
  ```bash
141
142
  bun run --cwd packages/create-tauri-ui start -- --help
@@ -143,46 +144,29 @@ bun run --cwd packages/create-tauri-ui start -- --help
143
144
 
144
145
  ## Testing
145
146
 
146
- Quick validation:
147
-
147
+ **Type check + build:**
148
148
  ```bash
149
149
  bun run --cwd packages/create-tauri-ui check-types
150
150
  bun run --cwd packages/create-tauri-ui build
151
151
  ```
152
152
 
153
- End-to-end smoke test from the monorepo root:
154
-
153
+ **Single template smoke test:**
155
154
  ```bash
156
155
  rm -rf /tmp/ctui-vite
157
156
  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
157
+ cd /tmp/ctui-vite && bun install && bun run build
161
158
  ```
162
159
 
163
- Smoke test all templates:
164
-
160
+ **All templates:**
165
161
  ```bash
166
162
  for template in vite next start react-router astro; do
167
163
  dir="/tmp/create-tauri-ui-$template"
168
164
  rm -rf "$dir"
169
165
  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
166
+ (cd "$dir" && bun install && bun run build) || exit 1
175
167
  done
176
168
  ```
177
169
 
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
170
  ## License
187
171
 
188
172
  MIT