create-vite-taro 0.7.0 → 0.7.1-beta.2
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/index.js +11 -2
- package/package.json +1 -1
- package/templates/default/package.json +1 -2
package/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import path from 'node:path'
|
|
|
5
5
|
import process from 'node:process'
|
|
6
6
|
import readline from 'node:readline/promises'
|
|
7
7
|
import { fileURLToPath } from 'node:url'
|
|
8
|
+
import generatorPackage from './package.json' with { type: 'json' }
|
|
8
9
|
|
|
9
10
|
const packageRoot = path.dirname(fileURLToPath(import.meta.url))
|
|
10
11
|
const defaultProjectName = 'vite-taro-app'
|
|
@@ -130,8 +131,16 @@ function copyTemplate(sourceDirectory, targetDirectory, projectName, projectTitl
|
|
|
130
131
|
|
|
131
132
|
function transformTemplateFile(fileName, source, projectName, projectTitle, wechatAppId) {
|
|
132
133
|
if (fileName === 'package.json') {
|
|
133
|
-
const
|
|
134
|
-
|
|
134
|
+
const template = JSON.parse(source)
|
|
135
|
+
// The fixed Changesets group releases the generator and plugin at the same version.
|
|
136
|
+
const packageJson = {
|
|
137
|
+
...template,
|
|
138
|
+
name: projectName,
|
|
139
|
+
devDependencies: {
|
|
140
|
+
...template.devDependencies,
|
|
141
|
+
'vite-plugin-taro': `^${generatorPackage.version}`
|
|
142
|
+
}
|
|
143
|
+
}
|
|
135
144
|
return `${JSON.stringify(packageJson, null, 4)}\n`
|
|
136
145
|
}
|
|
137
146
|
|
package/package.json
CHANGED