create-vite-taro 0.1.2 → 0.1.3

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
@@ -6,23 +6,23 @@ Create a Vite 8 + React 19 + Taro app for WeChat Mini Program and H5 targets.
6
6
 
7
7
  ```sh
8
8
  # Create a new app from the default template
9
- pnpm create vite-taro my-app
9
+ npm create vite-taro@latest my-app
10
10
 
11
11
  # Enter the project and install dependencies
12
12
  cd my-app
13
- pnpm install
13
+ npm install
14
14
 
15
15
  # WeChat Mini Program: rebuild dist/wx in watch mode
16
- pnpm dev:wx
16
+ npm run dev:wx
17
17
 
18
18
  # H5: start the Vite dev server
19
- pnpm dev:h5
19
+ npm run dev:h5
20
20
 
21
21
  # Then open the standard Vite dev URL in your browser
22
22
  # http://localhost:5173
23
23
  ```
24
24
 
25
- You can keep `pnpm dev:wx` and `pnpm dev:h5` running at the same time in separate terminals.
25
+ You can keep `npm run dev:wx` and `npm run dev:h5` running at the same time in separate terminals.
26
26
 
27
27
  Note: Because of WeChat DevTools and Mini Program runtime limitations, hot reload/fast rebuilds for the WeChat target may not always apply cleanly. For day-to-day iteration, prefer the H5 Vite dev server for fast feedback, and periodically verify the Mini Program result in WeChat DevTools.
28
28
 
@@ -31,25 +31,25 @@ Set `VITE_PLUGIN_TARO_WECHAT_APP_ID` in the generated `.env.local` to your WeCha
31
31
  ## Other package managers
32
32
 
33
33
  ```sh
34
- npm create vite-taro@latest my-app
34
+ pnpm create vite-taro my-app
35
35
  yarn create vite-taro my-app
36
36
  bun create vite-taro my-app
37
37
  ```
38
38
 
39
39
  ## Scripts
40
40
 
41
- | Script | Description |
41
+ | Command | Description |
42
42
  | --- | --- |
43
- | `pnpm dev:wx` | Build the WeChat Mini Program in watch mode. |
44
- | `pnpm dev:h5` | Start the H5 dev server with Vite 8 hot reload. |
45
- | `pnpm build:wx` | Build the WeChat Mini Program output into `dist/wx`. |
46
- | `pnpm build:h5` | Build the H5 output into `dist/h5`. |
47
- | `pnpm preview:h5` | Preview the built H5 output. |
48
- | `pnpm typecheck` | Typecheck with `tsgo`. |
43
+ | `npm run dev:wx` | Build the WeChat Mini Program in watch mode. |
44
+ | `npm run dev:h5` | Start the H5 dev server with Vite 8 hot reload. |
45
+ | `npm run build:wx` | Build the WeChat Mini Program output into `dist/wx`. |
46
+ | `npm run build:h5` | Build the H5 output into `dist/h5`. |
47
+ | `npm run preview:h5` | Preview the built H5 output. |
48
+ | `npm run typecheck` | Typecheck with `tsgo`. |
49
49
 
50
50
  ## Troubleshooting
51
51
 
52
52
  | Problem | Check |
53
53
  | --- | --- |
54
- | `pnpm install` says dependency build scripts were ignored | Run `pnpm approve-builds`, approve the requested dependency build scripts, then rerun `pnpm install` if needed. |
54
+ | `pnpm install` says dependency build scripts were ignored | Run `pnpm approve-builds` and approve the requested dependency build scripts. |
55
55
 
package/index.js CHANGED
@@ -15,8 +15,8 @@ const renamedFiles = {
15
15
  _gitignore: '.gitignore'
16
16
  }
17
17
  const helpText = `Usage:
18
- pnpm create vite-taro [project-name]
19
18
  npm create vite-taro@latest [project-name]
19
+ pnpm create vite-taro [project-name]
20
20
  yarn create vite-taro [project-name]
21
21
  bun create vite-taro [project-name]
22
22
 
@@ -50,8 +50,8 @@ console.log(`\nCreated ${projectName} in ${projectPath}\n`)
50
50
  console.log('Next steps:')
51
51
  if (cdCommand) console.log(` ${cdCommand}`)
52
52
  console.log(` ${packageManager} install`)
53
- console.log(` ${packageManager} dev:wx`)
54
- console.log(` ${packageManager} dev:h5`)
53
+ console.log(` ${getScriptCommand(packageManager, 'dev:wx')}`)
54
+ console.log(` ${getScriptCommand(packageManager, 'dev:h5')}`)
55
55
 
56
56
  function parseArgs(args) {
57
57
  const options = {
@@ -178,7 +178,12 @@ function getPackageManager() {
178
178
  if (userAgent.startsWith('yarn')) return 'yarn'
179
179
  if (userAgent.startsWith('bun')) return 'bun'
180
180
  if (userAgent.startsWith('npm')) return 'npm'
181
- return 'pnpm'
181
+ return 'npm'
182
+ }
183
+
184
+ function getScriptCommand(packageManager, scriptName) {
185
+ if (packageManager === 'npm' || packageManager === 'bun') return `${packageManager} run ${scriptName}`
186
+ return `${packageManager} ${scriptName}`
182
187
  }
183
188
 
184
189
  function getDisplayProjectPath(projectPath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vite-taro",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Create Vite 8 + React 19 + Taro apps for H5 and WeChat Mini Program targets.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,19 +8,19 @@ Docs and source: <https://github.com/sep2/vite-plugin-taro>
8
8
 
9
9
  ```sh
10
10
  # Install dependencies after scaffolding
11
- pnpm install
11
+ npm install
12
12
 
13
13
  # WeChat Mini Program: rebuild dist/wx in watch mode
14
- pnpm dev:wx
14
+ npm run dev:wx
15
15
 
16
16
  # H5: start the Vite dev server
17
- pnpm dev:h5
17
+ npm run dev:h5
18
18
 
19
19
  # Then open the standard Vite dev URL in your browser
20
20
  # http://localhost:5173
21
21
  ```
22
22
 
23
- You can keep `pnpm dev:wx` and `pnpm dev:h5` running at the same time in separate terminals.
23
+ You can keep `npm run dev:wx` and `npm run dev:h5` running at the same time in separate terminals.
24
24
 
25
25
  Note: Because of WeChat DevTools and Mini Program runtime limitations, hot reload/fast rebuilds for the WeChat target may not always apply cleanly. For day-to-day iteration, prefer the H5 Vite dev server for fast feedback, and periodically verify the Mini Program result in WeChat DevTools.
26
26
 
@@ -29,10 +29,16 @@ Set `VITE_PLUGIN_TARO_WECHAT_APP_ID` in `.env.local` to your WeChat App ID, then
29
29
  ## Scripts
30
30
 
31
31
  ```sh
32
- pnpm dev:wx # Build the WeChat Mini Program in watch mode
33
- pnpm dev:h5 # Start the H5 dev server
34
- pnpm build:wx # Build dist/wx
35
- pnpm build:h5 # Build dist/h5
36
- pnpm preview:h5 # Preview dist/h5
37
- pnpm typecheck # Typecheck with tsgo
32
+ npm run dev:wx # Build the WeChat Mini Program in watch mode
33
+ npm run dev:h5 # Start the H5 dev server
34
+ npm run build:wx # Build dist/wx
35
+ npm run build:h5 # Build dist/h5
36
+ npm run preview:h5 # Preview dist/h5
37
+ npm run typecheck # Typecheck with tsgo
38
38
  ```
39
+
40
+ ## Troubleshooting
41
+
42
+ | Problem | Check |
43
+ | --- | --- |
44
+ | `pnpm install` says dependency build scripts were ignored | Run `pnpm approve-builds` and approve the requested dependency build scripts. |
@@ -21,6 +21,6 @@
21
21
  "@types/react-dom": "^19.2.3",
22
22
  "@typescript/native-preview": "latest",
23
23
  "vite": "^8.0.16",
24
- "vite-plugin-taro": "^0.1.2"
24
+ "vite-plugin-taro": "^0.1.3"
25
25
  }
26
26
  }