Commit d1c7f6ef by venus

fix: create 补齐 githooks/docs/README 复制,保证派生项目门禁随基座分发

1 parent 069f2699
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* - 根配置(package.json 包名换成 <name>;pnpm-workspace/turbo/tsconfig 原样) * - 根配置(package.json 包名换成 <name>;pnpm-workspace/turbo/tsconfig 原样)
* - apps/example:一个最小占位子应用(派生应用可删可改) * - apps/example:一个最小占位子应用(派生应用可删可改)
* - packages/common:一个业务公共模块示例(派生应用可改可扩) * - packages/common:一个业务公共模块示例(派生应用可改可扩)
* - README / .gitignore * - githooks/、docs/、README.md:提交门禁与文档(随基座分发)
* 不含:node_modules、dist、.git、备份、生成物。 * 不含:node_modules、dist、.git、备份、生成物。
*/ */
import fs from 'node:fs'; import fs from 'node:fs';
...@@ -140,11 +140,17 @@ export function createProject(name, parentDir) { ...@@ -140,11 +140,17 @@ export function createProject(name, parentDir) {
// 2. 复制 CLI 工具链 // 2. 复制 CLI 工具链
copyDir(path.join(TEMPLATE_ROOT, 'cli'), path.join(target, 'cli')); copyDir(path.join(TEMPLATE_ROOT, 'cli'), path.join(target, 'cli'));
// 2b. 复制提交门禁 hook 与文档(门禁必须随基座分发,否则派生项目无法拦截内核篡改)
for (const dir of ['githooks', 'docs']) {
const s = path.join(TEMPLATE_ROOT, dir);
if (fs.existsSync(s)) copyDir(s, path.join(target, dir));
}
// 3. 复制根配置,替换包名 // 3. 复制根配置,替换包名
const rootFiles = [ const rootFiles = [
'package.json', 'pnpm-workspace.yaml', 'tsconfig.base.json', 'turbo.json', 'package.json', 'pnpm-workspace.yaml', 'tsconfig.base.json', 'turbo.json',
'eslint.config.js', '.env.example', '.editorconfig', '.prettierrc.json', 'eslint.config.js', '.env.example', '.editorconfig', '.prettierrc.json',
'.prettierignore', '.npmrc', '.gitignore', '.prettierignore', '.npmrc', '.gitignore', 'README.md',
]; ];
for (const f of rootFiles) { for (const f of rootFiles) {
const s = path.join(TEMPLATE_ROOT, f); const s = path.join(TEMPLATE_ROOT, f);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!