create-golden 1.4.8 → 1.4.10

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.
Files changed (2) hide show
  1. package/index.js +3 -11
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -10,7 +10,7 @@ const os = require('os');
10
10
  const GITHUB_REPO = 'kuidream/golden-base-specs';
11
11
  const GITHUB_BRANCH = 'main';
12
12
  const GITHUB_API_URL = `https://api.github.com/repos/${GITHUB_REPO}/zipball/${GITHUB_BRANCH}`;
13
- const EXCLUDE_DIRS = ['node_modules', 'dist', '.ray', '.DS_Store'];
13
+ const EXCLUDE_DIRS = ['node_modules', 'dist', '.ray', '.DS_Store', 'VI spec'];
14
14
  const TOKEN_FILE = path.join(os.homedir(), '.create-golden-token');
15
15
 
16
16
  async function downloadFile(url, dest, token) {
@@ -53,15 +53,7 @@ async function downloadFile(url, dest, token) {
53
53
 
54
54
  function shouldExclude(filePath) {
55
55
  const parts = filePath.split(path.sep);
56
- // 排除标准排除目录
57
- if (EXCLUDE_DIRS.some(dir => parts.includes(dir))) {
58
- return true;
59
- }
60
- // 排除 VI spec 目录(注意路径中可能有空格)
61
- if (filePath.includes('VI spec') || filePath.includes('VI spec/') || filePath.includes('VI spec\\')) {
62
- return true;
63
- }
64
- return false;
56
+ return EXCLUDE_DIRS.some(dir => parts.includes(dir));
65
57
  }
66
58
 
67
59
  async function extractZip(zipPath, extractTo) {
@@ -149,7 +141,7 @@ function saveToken(token) {
149
141
 
150
142
  function updateGitignore(projectRoot) {
151
143
  const gitignorePath = path.join(projectRoot, '.gitignore');
152
- const ignoreRules = ['.cursorrules', '代码规范.md', 'AGENTS.md', '组件和功能速查地图.md', 'src/pages/demo' ];
144
+ const ignoreRules = ['.cursorrules', '代码规范.md', '项目架构说明.md', 'AGENTS.md', '组件和功能速查地图.md', 'src/pages/demo' ];
153
145
 
154
146
  try {
155
147
  let gitignoreContent = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-golden",
3
- "version": "1.4.8",
3
+ "version": "1.4.10",
4
4
  "description": "Create a new golden-template project from the latest GitHub repository (requires GITHUB_TOKEN)",
5
5
  "main": "index.js",
6
6
  "bin": {