Commit 785650a2 by Lin

feat: 脚本工具包格式处理

1 parent dc8573f3
File mode changed
/* /*
commitlint-config/index.mjs commitlint-config/index.mjs
目的:配置 commitlint(cz-git)以强制仓库的 commit message 规范。 目的:配置 commitlint(cz-git)以强制仓库的 commit message 规范。
关键点: 关键点:
- 使用 conventional commits 作为基础以支持自动化 changelog/release - 使用 conventional commits 作为基础以支持自动化 changelog/release
- 通过插件和脚本动态生成 scope 白名单(基于 monorepo packages) - 通过插件和脚本动态生成 scope 白名单(基于 monorepo packages)
- 为交互式提交提示提供别名/默认值以降低误提交成本 - 为交互式提交提示提供别名/默认值以降低误提交成本
注意:该文件通过读取 git 状态来尝试预填充 scope(提高体验)。 注意:该文件通过读取 git 状态来尝试预填充 scope(提高体验)。
*/ */
......
...@@ -16,13 +16,13 @@ import { join } from "node:path"; ...@@ -16,13 +16,13 @@ import { join } from "node:path";
const rootDir = process.cwd(); const rootDir = process.cwd();
const rootDistDir = join(rootDir, "dist"); const rootDistDir = join(rootDir, "dist");
const PACKAGE_SEARCH_PATHS = [ const PACKAGE_SEARCH_PATHS = [
["apps", "web", "venus-agentic"], [ "apps", "web", "venus-agentic" ],
["apps", "web"], [ "apps", "web" ],
["apps", "frontend-micro"], [ "apps", "frontend-micro" ],
["apps", "frontend", "vue"], [ "apps", "frontend", "vue" ],
["apps"], [ "apps" ],
["packages"], [ "packages" ],
["docs"], [ "docs" ],
]; ];
// ==================== 构建配置开关 ==================== // ==================== 构建配置开关 ====================
...@@ -83,7 +83,7 @@ function cleanRootDist() { ...@@ -83,7 +83,7 @@ function cleanRootDist() {
*/ */
async function findPackagePath(packageName) { async function findPackagePath(packageName) {
const cleanName = packageName.replace("@venus/", ""); const cleanName = packageName.replace("@venus/", "");
const nameVariants = new Set([`@venus/${cleanName}`, cleanName, packageName]); const nameVariants = new Set([ `@venus/${cleanName}`, cleanName, packageName ]);
for (const pathSegments of PACKAGE_SEARCH_PATHS) { for (const pathSegments of PACKAGE_SEARCH_PATHS) {
const packagePath = join(rootDir, ...pathSegments, cleanName); const packagePath = join(rootDir, ...pathSegments, cleanName);
...@@ -121,7 +121,7 @@ async function shouldInstallDeps(packageName) { ...@@ -121,7 +121,7 @@ async function shouldInstallDeps(packageName) {
if (!existsSync(packageJsonPath) || !existsSync(pnpmLockPath)) return true; if (!existsSync(packageJsonPath) || !existsSync(pnpmLockPath)) return true;
try { try {
const [packageJsonTime, lockTime, nodeModulesTime] = [ const [ packageJsonTime, lockTime, nodeModulesTime ] = [
statSync(packageJsonPath).mtime, statSync(packageJsonPath).mtime,
statSync(pnpmLockPath).mtime, statSync(pnpmLockPath).mtime,
statSync(nodeModulesPath).mtime, statSync(nodeModulesPath).mtime,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!