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 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: 'list',
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.9",
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": "^13.4.3",
38
+ "inquirer": "^14.0.0",
39
39
  "ora": "^9.4.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@types/node": "^24.12.4"
42
+ "@types/node": "^25.9.1"
43
43
  }
44
44
  }
@@ -0,0 +1,9 @@
1
+ packages:
2
+ - "."
3
+
4
+ # 允许这些依赖在安装时执行 postinstall 等脚本(pnpm v10.26+ / v11 的 allowBuilds)。
5
+ # CI 中无法使用交互式 `pnpm approve-builds`,因此将许可写入仓库。
6
+ allowBuilds:
7
+ core-js: true
8
+ es5-ext: true
9
+ sharp: true