create-tengits-app 1.1.2 → 1.1.4

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/bin/cli.js CHANGED
@@ -191,7 +191,6 @@ const createProject = async () => {
191
191
  const excludeList = [
192
192
  'node_modules',
193
193
  '.git',
194
- 'bin',
195
194
  'pnpm-lock.yaml',
196
195
  '.DS_Store',
197
196
  'yarn.lock',
@@ -200,7 +199,8 @@ const createProject = async () => {
200
199
 
201
200
  // 需要保留的文件(即使在其他排除列表中)
202
201
  const keepFiles = [
203
- 'bin/setup-ttos.js'
202
+ 'bin/setup-ttos.js',
203
+ '.gitignore'
204
204
  ];
205
205
 
206
206
  // 复制模板文件
@@ -208,20 +208,22 @@ const createProject = async () => {
208
208
 
209
209
  const copyRecursive = (src, dest) => {
210
210
  const stats = fs.statSync(src);
211
-
211
+
212
212
  if (stats.isDirectory()) {
213
213
  const dirName = path.basename(src);
214
- if (excludeList.includes(dirName)) {
215
- return;
216
- }
217
-
214
+
218
215
  fs.ensureDirSync(dest);
219
216
  const files = fs.readdirSync(src);
220
-
217
+
221
218
  files.forEach(file => {
222
219
  const relativePath = path.relative(templateDir, path.join(src, file));
223
220
  const shouldKeep = keepFiles.some(keepFile => relativePath === keepFile);
224
-
221
+
222
+ // 对于bin目录,只复制setup-ttos.js文件
223
+ if (dirName === 'bin' && file === 'cli.js') {
224
+ return; // 跳过cli.js文件
225
+ }
226
+
225
227
  if (!excludeList.includes(file) || shouldKeep) {
226
228
  copyRecursive(path.join(src, file), path.join(dest, file));
227
229
  }
@@ -236,9 +238,10 @@ const createProject = async () => {
236
238
  templateFiles.forEach(file => {
237
239
  if (file !== 'packages') {
238
240
  const relativePath = path.relative(templateDir, path.join(templateDir, file));
239
- const shouldKeep = keepFiles.some(keepFile => relativePath.startsWith(keepFile.split('/')[0]));
240
-
241
- if (!excludeList.includes(file) || shouldKeep) {
241
+ const shouldKeep = keepFiles.some(keepFile => relativePath === keepFile);
242
+
243
+ // 对于bin目录和.gitignore文件,总是复制
244
+ if (file === 'bin' || file === '.gitignore' || !excludeList.includes(file) || shouldKeep) {
242
245
  const srcPath = path.join(templateDir, file);
243
246
  const destPath = path.join(targetDir, file);
244
247
  copyRecursive(srcPath, destPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tengits-app",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "🚀 快速创建基于 React + Rsbuild + TypeScript + Tailwind CSS + Antd 的现代前端项目脚手架",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -4,7 +4,7 @@
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
7
- "dev": "vite serve",
7
+ "start": "vite serve",
8
8
  "build": "rimraf dist && vite build --outDir dist && serve -s dist",
9
9
  "ssr": "rimraf dist && vite-pages ssr && serve dist"
10
10
  },