xi-create 1.0.9 → 1.0.11
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 +1 -1
- package/bin/xi-create.js +6 -1
- package/package.json +3 -3
- package/templates/template-react-ts/_pnpm-workspace.yaml +9 -0
- package/templates/template-react-ts/dist/assets/index-BwBIHDbq.js +19 -0
- package/templates/template-react-ts/dist/assets/{index-C2iIRiIH.css → index-CfpU6CQS.css} +2 -2
- package/templates/template-react-ts/dist/index.html +2 -2
- package/templates/template-react-ts/dist/sw.js +1 -1
- package/templates/template-react-ts/dist/version.txt +3 -3
- package/templates/template-react-ts/dist-zip/vite-react-typescript-starter-production.zip +0 -0
- package/templates/template-react-ts/package.json +10 -10
- package/templates/template-react-ts/tsconfig.app.json +0 -2
- package/templates/template-react-ts/tsconfig.json +0 -1
- package/templates/template-react-ts/dist/assets/index-BQLt-RbE.js +0 -19
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ node ./bin/xi-create.js my-app --template react-ts
|
|
|
101
101
|
1. 在 `templates` 目录下添加新的模板文件夹,命名格式为 `template-xxx`,如:
|
|
102
102
|
- `template-react-ts`
|
|
103
103
|
- `template-vue`
|
|
104
|
-
2. 每个模板文件夹下建议包含自己的 `package.json`、`_gitignore`
|
|
104
|
+
2. 每个模板文件夹下建议包含自己的 `package.json`、`_gitignore`、`_pnpm-workspace.yaml` 等(创建项目时会自动去掉前缀 `_`,分别变为 `.gitignore`、`pnpm-workspace.yaml`)。
|
|
105
105
|
3. 工具会自动识别并展示所有模板。
|
|
106
106
|
|
|
107
107
|
---
|
package/bin/xi-create.js
CHANGED
|
@@ -52,6 +52,11 @@ async function copyTemplate(templatePath, targetPath, projectName) {
|
|
|
52
52
|
await fs.move(gitignorePath, path.join(targetPath, '.gitignore'));
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
const pnpmWorkspacePath = path.join(targetPath, '_pnpm-workspace.yaml');
|
|
56
|
+
if (await fs.pathExists(pnpmWorkspacePath)) {
|
|
57
|
+
await fs.move(pnpmWorkspacePath, path.join(targetPath, 'pnpm-workspace.yaml'));
|
|
58
|
+
}
|
|
59
|
+
|
|
55
60
|
const nodeModulesPath = path.join(targetPath, 'node_modules');
|
|
56
61
|
if (await fs.pathExists(nodeModulesPath)) {
|
|
57
62
|
await fs.remove(nodeModulesPath);
|
|
@@ -106,7 +111,7 @@ async function runCreate({ projectName, template } = {}) {
|
|
|
106
111
|
const questions = [];
|
|
107
112
|
if (!finalTemplate) {
|
|
108
113
|
questions.push({
|
|
109
|
-
type: '
|
|
114
|
+
type: 'select',
|
|
110
115
|
name: 'template',
|
|
111
116
|
message: '请选择项目模板:',
|
|
112
117
|
choices: templates.map((t) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xi-create",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "一个用于创建项目的命令行工具",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./bin/xi-create.js",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"chalk": "^5.6.2",
|
|
36
36
|
"commander": "^14.0.3",
|
|
37
37
|
"fs-extra": "^11.3.5",
|
|
38
|
-
"inquirer": "^
|
|
38
|
+
"inquirer": "^14.0.0",
|
|
39
39
|
"ora": "^9.4.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@types/node": "^
|
|
42
|
+
"@types/node": "^25.9.1"
|
|
43
43
|
}
|
|
44
44
|
}
|