zixulu 1.76.3 → 1.76.4
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.
package/dist/index.js
CHANGED
|
@@ -1389,16 +1389,34 @@ async function addFolderPathAlias() {
|
|
|
1389
1389
|
})));
|
|
1390
1390
|
return getCommitMessage("feature", `add path alias: ${result.join(", ")}`);
|
|
1391
1391
|
}
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
.
|
|
1400
|
-
|
|
1401
|
-
|
|
1392
|
+
async function addRuleToPrettierIgnore(...rules) {
|
|
1393
|
+
const dir = await readdir(".");
|
|
1394
|
+
const message = getCommitMessage("feature", `添加 .prettierignore 规则 ${rules.join(", ")}`);
|
|
1395
|
+
if (!dir.includes(".prettierignore")) {
|
|
1396
|
+
await writeFile(".prettierignore", rules.join("\n"), "utf-8");
|
|
1397
|
+
return message;
|
|
1398
|
+
}
|
|
1399
|
+
const prettierIgnore = await readFile(".prettierignore", "utf-8");
|
|
1400
|
+
const rules2 = prettierIgnore.split("\n").map((v)=>v.trim());
|
|
1401
|
+
for (const rule of rules)if (!rules2.includes(rule)) rules2.push(rule);
|
|
1402
|
+
await writeFile(".prettierignore", rules2.join("\n"), "utf-8");
|
|
1403
|
+
return message;
|
|
1404
|
+
}
|
|
1405
|
+
const prettierIgnoreRules = [
|
|
1406
|
+
"node_modules",
|
|
1407
|
+
"public",
|
|
1408
|
+
"dist",
|
|
1409
|
+
"build",
|
|
1410
|
+
"generated",
|
|
1411
|
+
".next",
|
|
1412
|
+
".vscode",
|
|
1413
|
+
".generated",
|
|
1414
|
+
"**/components/ui/**",
|
|
1415
|
+
"**/components/ai/**",
|
|
1416
|
+
".agent",
|
|
1417
|
+
".cursor",
|
|
1418
|
+
"AGENTS.md"
|
|
1419
|
+
];
|
|
1402
1420
|
const prettierConfig = `// @ts-check
|
|
1403
1421
|
|
|
1404
1422
|
/**
|
|
@@ -1421,7 +1439,7 @@ export default config
|
|
|
1421
1439
|
async function addPrettier() {
|
|
1422
1440
|
consola_0.start("开始添加 prettier 配置");
|
|
1423
1441
|
await writeFile("prettier.config.mjs", prettierConfig, "utf-8");
|
|
1424
|
-
await
|
|
1442
|
+
await addRuleToPrettierIgnore(...prettierIgnoreRules);
|
|
1425
1443
|
const config2 = {
|
|
1426
1444
|
package: [
|
|
1427
1445
|
"prettier",
|