规范:统一自有源码中文注释和中文提交约定

This commit is contained in:
cieanyau committed 2026-11-07 04:49:51 +08:00
1 parent bdb9b00b6e
commit 83b7484558
17 files changed
+39 -36

No files matched your search

+1 -1
View File
@@ -38,7 +38,7 @@ function existsModule(file) {
}
function checkImport(source, owner) {
// # 开头的虚拟模块由 Nuxt 生成,本地文件与 npm 包则分别核对实际路径及依赖声明。
if (source.startsWith("#")) return; // Nuxt-generated public/virtual modules.
if (source.startsWith("#")) return; // Nuxt 生成的公共/虚拟模块。
if (source.startsWith("~/")) {
if (!existsModule(path.join(root, "app", source.slice(2))))
failures.push(`${owner}: missing ${source}`);
+8 -8
View File
@@ -1,4 +1,4 @@
/** One-time source reconstruction. Input is explicit; generated app has no runtime link to it. */
/** 一次性源码重建;输入显式指定,生成的应用运行时不依赖该输入。 */
/**
* 一次性重建留档,不参与日常开发、构建或发布。
* 输入必须是可信的自有 Nuxt 发布目录:脚本会 import 其中的元数据,因此不是安全的第三方解包器。
@@ -243,7 +243,7 @@ for (const [source, mod] of own) {
label: path.basename(source, ".vue"),
});
}
// Official libraries replace bundled copies. Resolve tiny re-export wrappers first.
// 使用官方库替换内嵌副本,先解析仅重导出的轻量包装模块。
for (const [source, mod] of Object.entries(pc.modules)) {
if (!source.includes("/node_modules/") || mod.resourceType !== "script")
continue;
@@ -262,7 +262,7 @@ for (const [source, mod] of Object.entries(pc.modules)) {
label: npm.split("/").at(-1),
});
}
// The existing chart component is recovered separately; ECharts stays a library dependency.
// 现有图表组件单独恢复;ECharts 仍作为库依赖。
const chartOwner = [...owners.entries()].find(
([, v]) => v.source === "components/ChartBox.vue",
);
@@ -341,7 +341,7 @@ async function add(file, code, parser) {
});
patchFiles.push({ file, code: formatted });
}
// Save route metadata without compiled preload machinery; Nuxt owns the new module graph.
// 保存路由元数据,不保留编译后的预加载机制;新模块依赖图由 Nuxt 管理。
const entry = asts.get("CNMaXYQo.js");
let routes;
traverse(entry, {
@@ -398,7 +398,7 @@ while (pending.length) {
}
if (file === "BLvPXbVl.js") {
// 针对此发布包剥离内嵌的 Pinia/密码库实现,保留业务逻辑并接回正式 npm 依赖。
// Business logic only; Pinia, file downloads and cryptography are npm dependencies.
// 仅恢复业务逻辑;Pinia、文件下载和密码学功能通过 npm 依赖提供。
let keep = false;
const body = [];
for (const n of ast.program.body) {
@@ -441,7 +441,7 @@ while (pending.length) {
},
});
}
// Discard old dependency indexes: Vite reconstructs preload URLs from new imports.
// 丢弃旧依赖索引;Vite 根据新导入重建预加载地址。
traverse(ast, {
CallExpression(p) {
if (t.isIdentifier(p.node.callee, { name: "__vite__mapDeps" }))
@@ -510,7 +510,7 @@ while (pending.length) {
}
stmt.replaceWithMultiple(imports);
}
// Semantic exported API names are stable throughout the reconstructed project.
// 语义化导出接口名在整个重建工程中保持稳定。
for (const s of p.node.body)
if (t.isExportNamedDeclaration(s))
for (const spec of s.specifiers) {
@@ -619,7 +619,7 @@ for (const { file, code } of patchFiles) {
});
if (result.status !== 0) throw Error(result.stdout + result.stderr);
}
// Static binary assets retain their deployed paths; no JS bundle is copied.
// 静态二进制资源保留原部署路径,不复制任何 JS 构建包。
const cssFiles = [
// 样式保留发布版 scope 选择器,避免在模板已丢失时重新分配作用域导致外观失配。
...new Set(