chore: 补充构建缺少的开发依赖
This commit is contained in:
parent
6be244336e
commit
14d4519d03
11
package.json
11
package.json
@ -18,7 +18,9 @@
|
||||
"build:analyze": "turbo build:analyze",
|
||||
"build:docker": "./scripts/deploy/build-local-docker-image.sh",
|
||||
"build:docs": "pnpm run build --filter=@vben/docs",
|
||||
"build:ele": "pnpm run build --filter=@vben/web-ele",
|
||||
"build:renderer": "pnpm run build --filter=@sy/y-code-renderer",
|
||||
"build:platform": "pnpm run build --filter=@sy/y-code-platform",
|
||||
"build:designer": "pnpm run build --filter=@sy/y-code-designer",
|
||||
"build:play": "pnpm run build --filter=@vben/playground",
|
||||
"changeset": "pnpm exec changeset",
|
||||
"check": "pnpm run check:circular && pnpm run check:dep && pnpm run check:type && pnpm check:cspell",
|
||||
@ -27,10 +29,11 @@
|
||||
"check:dep": "vsh check-dep",
|
||||
"check:type": "turbo run typecheck",
|
||||
"clean": "node ./scripts/clean.mjs",
|
||||
"clean:dist": "node ./scripts/clean-dist.mjs",
|
||||
"commit": "czg",
|
||||
"dev": "turbo-run dev",
|
||||
"dev:docs": "pnpm -F @vben/docs run dev",
|
||||
"dev:ele": "pnpm -F @vben/web-ele run dev",
|
||||
"dev:renderer": "pnpm -F @sy/y-code-renderer run dev",
|
||||
"dev:play": "pnpm -F @vben/playground run dev",
|
||||
"format": "vsh lint --format",
|
||||
"lint": "vsh lint",
|
||||
@ -39,12 +42,12 @@
|
||||
"prepare": "is-ci || husky",
|
||||
"preview": "turbo-run preview",
|
||||
"publint": "vsh publint",
|
||||
"reinstall": "pnpm clean --del-lock && pnpm install",
|
||||
"reinstall": "pnpm clean --del-lock && pnpm install && pnpm store prune",
|
||||
"test:unit": "vitest run --dom",
|
||||
"test:e2e": "turbo run test:e2e",
|
||||
"update:deps": "npx taze -r -w",
|
||||
"version": "pnpm exec changeset version && pnpm install --no-frozen-lockfile",
|
||||
"reset": "pnpm run clean && pnpm install"
|
||||
"reset": "pnpm clean && pnpm install"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@changesets/changelog-github": "catalog:",
|
||||
|
@ -37,5 +37,8 @@
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vben/vite-config": "workspace:*"
|
||||
}
|
||||
}
|
||||
|
555
pnpm-lock.yaml
generated
555
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
58
scripts/clean-dist.mjs
Normal file
58
scripts/clean-dist.mjs
Normal file
@ -0,0 +1,58 @@
|
||||
import { promises as fs } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
|
||||
const rootDir = process.cwd();
|
||||
|
||||
/**
|
||||
* 递归查找并删除目标目录
|
||||
* @param {string} currentDir - 当前遍历的目录路径
|
||||
*/
|
||||
async function cleanTargetsRecursively(currentDir, targets) {
|
||||
// 忽略 node_modules 目录
|
||||
if (currentDir.includes('node_modules')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const items = await fs.readdir(currentDir);
|
||||
|
||||
for (const item of items) {
|
||||
try {
|
||||
const itemPath = join(currentDir, item);
|
||||
// 忽略 node_modules 目录
|
||||
if (item === 'node_modules') {
|
||||
continue;
|
||||
}
|
||||
if (targets.includes(item)) {
|
||||
// 匹配到目标目录或文件时直接删除
|
||||
await fs.rm(itemPath, { force: true, recursive: true });
|
||||
console.log(`Deleted: ${itemPath}`);
|
||||
}
|
||||
const stat = await fs.lstat(itemPath);
|
||||
if (stat.isDirectory()) {
|
||||
await cleanTargetsRecursively(itemPath, targets);
|
||||
}
|
||||
} catch {
|
||||
// console.error(
|
||||
// `Error handling item ${item} in ${currentDir}: ${error.message}`,
|
||||
// );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
(async function startCleanup() {
|
||||
// 要删除的目录及文件名称
|
||||
const targets = ['dist', '.turbo'];
|
||||
|
||||
const cleanupTargets = [...targets];
|
||||
|
||||
console.log(
|
||||
`Starting cleanup of targets: ${cleanupTargets.join(', ')} from root: ${rootDir}`,
|
||||
);
|
||||
|
||||
try {
|
||||
await cleanTargetsRecursively(rootDir, cleanupTargets);
|
||||
console.log('Cleanup process completed.');
|
||||
} catch (error) {
|
||||
console.error(`Unexpected error during cleanup: ${error.message}`);
|
||||
}
|
||||
})();
|
11
turbo.json
11
turbo.json
@ -15,12 +15,17 @@
|
||||
],
|
||||
"globalEnv": ["NODE_ENV"],
|
||||
"tasks": {
|
||||
"reset": {
|
||||
"reinstall": {
|
||||
"cache": false
|
||||
},
|
||||
"build": {
|
||||
"dependsOn": ["reset", "^build"],
|
||||
"outputs": ["dist/**", "dist.zip", ".vitepress/dist.zip", ".vitepress/dist/**"]
|
||||
"dependsOn": ["reinstall", "^build"],
|
||||
"outputs": [
|
||||
"dist/**",
|
||||
"dist.zip",
|
||||
".vitepress/dist.zip",
|
||||
".vitepress/dist/**"
|
||||
]
|
||||
},
|
||||
"preview": {
|
||||
"dependsOn": ["^build"],
|
||||
|
Loading…
x
Reference in New Issue
Block a user