@pubinfo/commitlint 2.0.11 → 2.0.12
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
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { commitPreset, configureGitHooksPath, createCzConfig, createGitMessage, isCommitlintEnabled, isInsideGitRepo, lintAndReturn, lintMessage, loadCommitConfig, runCzConfig, runGitMessage, runNpx, runPrompt, runSimpleGitHooks } from "./lint.message-
|
|
1
|
+
import { commitPreset, configureGitHooksPath, createCzConfig, createGitMessage, isCommitlintEnabled, isInsideGitRepo, lintAndReturn, lintMessage, loadCommitConfig, runCzConfig, runGitMessage, runNpx, runPrompt, runSimpleGitHooks } from "./lint.message-DjB1N5aR.js";
|
|
2
2
|
|
|
3
3
|
export { commitPreset, configureGitHooksPath, createCzConfig, createGitMessage, isCommitlintEnabled, isInsideGitRepo, lintAndReturn, lintMessage, loadCommitConfig, runCzConfig, runGitMessage, runNpx, runPrompt, runSimpleGitHooks };
|
|
@@ -268,11 +268,10 @@ function resolveCommitlintEnabled(value) {
|
|
|
268
268
|
async function isCommitlintEnabled() {
|
|
269
269
|
if (typeof cachedState === "boolean") return cachedState;
|
|
270
270
|
try {
|
|
271
|
-
const
|
|
271
|
+
const resolved = resolveCommitlintEnabled((await loadConfig({
|
|
272
272
|
sources: [{ files: "pubinfo.config" }],
|
|
273
273
|
merge: false
|
|
274
|
-
});
|
|
275
|
-
const resolved = resolveCommitlintEnabled(result?.config?.commitlint);
|
|
274
|
+
}))?.config?.commitlint);
|
|
276
275
|
cachedState = typeof resolved === "boolean" ? resolved : true;
|
|
277
276
|
} catch {
|
|
278
277
|
cachedState = true;
|
|
@@ -685,9 +684,9 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
685
684
|
previousSymbol = "___graceful-fs.previous";
|
|
686
685
|
}
|
|
687
686
|
function noop() {}
|
|
688
|
-
function publishQueue(context, queue
|
|
687
|
+
function publishQueue(context, queue) {
|
|
689
688
|
Object.defineProperty(context, gracefulQueue, { get: function() {
|
|
690
|
-
return queue
|
|
689
|
+
return queue;
|
|
691
690
|
} });
|
|
692
691
|
}
|
|
693
692
|
var debug = noop;
|
|
@@ -698,8 +697,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
698
697
|
console.error(m);
|
|
699
698
|
};
|
|
700
699
|
if (!fs$21[gracefulQueue]) {
|
|
701
|
-
|
|
702
|
-
publishQueue(fs$21, queue);
|
|
700
|
+
publishQueue(fs$21, global[gracefulQueue] || []);
|
|
703
701
|
fs$21.close = (function(fs$close) {
|
|
704
702
|
function close(fd, cb) {
|
|
705
703
|
return fs$close.call(fs$21, fd, function(err) {
|
|
@@ -1014,8 +1012,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
1014
1012
|
} else {
|
|
1015
1013
|
var sinceAttempt = Date.now() - lastTime;
|
|
1016
1014
|
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
1017
|
-
|
|
1018
|
-
if (sinceAttempt >= desiredDelay) {
|
|
1015
|
+
if (sinceAttempt >= Math.min(sinceStart * 1.2, 100)) {
|
|
1019
1016
|
debug("RETRY", fn.name, args);
|
|
1020
1017
|
fn.apply(null, args.concat([startTime]));
|
|
1021
1018
|
} else fs$21[gracefulQueue].push(elem);
|
|
@@ -1883,9 +1880,7 @@ var require_symlink = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/fs-
|
|
|
1883
1880
|
stats = fs$7.lstatSync(dstpath);
|
|
1884
1881
|
} catch {}
|
|
1885
1882
|
if (stats && stats.isSymbolicLink()) {
|
|
1886
|
-
|
|
1887
|
-
const dstStat = fs$7.statSync(dstpath);
|
|
1888
|
-
if (areIdentical(srcStat, dstStat)) return;
|
|
1883
|
+
if (areIdentical(fs$7.statSync(srcpath), fs$7.statSync(dstpath))) return;
|
|
1889
1884
|
}
|
|
1890
1885
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
1891
1886
|
srcpath = relative.toDst;
|
|
@@ -2046,8 +2041,7 @@ var require_output_json = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
|
|
|
2046
2041
|
const { stringify: stringify$1 } = require_utils();
|
|
2047
2042
|
const { outputFile } = require_output_file();
|
|
2048
2043
|
async function outputJson(file, data, options = {}) {
|
|
2049
|
-
|
|
2050
|
-
await outputFile(file, str, options);
|
|
2044
|
+
await outputFile(file, stringify$1(data, options), options);
|
|
2051
2045
|
}
|
|
2052
2046
|
module.exports = outputJson;
|
|
2053
2047
|
}) });
|
|
@@ -2058,8 +2052,7 @@ var require_output_json_sync = /* @__PURE__ */ __commonJS({ "../../node_modules/
|
|
|
2058
2052
|
const { stringify } = require_utils();
|
|
2059
2053
|
const { outputFileSync } = require_output_file();
|
|
2060
2054
|
function outputJsonSync(file, data, options) {
|
|
2061
|
-
|
|
2062
|
-
outputFileSync(file, str, options);
|
|
2055
|
+
outputFileSync(file, stringify(data, options), options);
|
|
2063
2056
|
}
|
|
2064
2057
|
module.exports = outputJsonSync;
|
|
2065
2058
|
}) });
|
|
@@ -2259,9 +2252,7 @@ var import_lib$1 = /* @__PURE__ */ __toESM(require_lib(), 1);
|
|
|
2259
2252
|
function createGitMessage(rootPath = process$1.cwd()) {
|
|
2260
2253
|
const target = resolve(rootPath, ".gitmessage");
|
|
2261
2254
|
if (import_lib$1.default.existsSync(target)) import_lib$1.default.unlinkSync(target);
|
|
2262
|
-
const
|
|
2263
|
-
const scopes = (commitPreset.prompt?.scopes || []).join(", ");
|
|
2264
|
-
const tpl = `# Commit Message 模板 (首行: <type>(<scope>): <subject>)\n# 可用类型: ${types}\n# 可用范围: ${scopes}\n# 示例: feat(core): add http client abstraction\n# 空行后可写入 body, 使用 | 换行 (交互模式会自动处理)\n`;
|
|
2255
|
+
const tpl = `# Commit Message 模板 (首行: <type>(<scope>): <subject>)\n# 可用类型: ${(commitPreset.prompt?.types || []).map((t) => t.value).join(", ")}\n# 可用范围: ${(commitPreset.prompt?.scopes || []).join(", ")}\n# 示例: feat(core): add http client abstraction\n# 空行后可写入 body, 使用 | 换行 (交互模式会自动处理)\n`;
|
|
2265
2256
|
import_lib$1.default.writeFileSync(target, tpl, "utf8");
|
|
2266
2257
|
return true;
|
|
2267
2258
|
}
|
package/dist/run.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { configureGitHooksPath, createCzConfig, createGitMessage, isCommitlintEnabled, isInsideGitRepo, lintMessage, runCzConfig, runGitMessage, runNpx, runPrompt, runSimpleGitHooks } from "./lint.message-
|
|
1
|
+
import { configureGitHooksPath, createCzConfig, createGitMessage, isCommitlintEnabled, isInsideGitRepo, lintMessage, runCzConfig, runGitMessage, runNpx, runPrompt, runSimpleGitHooks } from "./lint.message-DjB1N5aR.js";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { defineCommand, runMain as runMain$1 } from "citty";
|
|
@@ -6,7 +6,7 @@ import { defineCommand, runMain as runMain$1 } from "citty";
|
|
|
6
6
|
//#region package.json
|
|
7
7
|
var name = "@pubinfo/commitlint";
|
|
8
8
|
var type = "module";
|
|
9
|
-
var version = "2.0.
|
|
9
|
+
var version = "2.0.12";
|
|
10
10
|
var description = "commitlint config for Pubinfo projects";
|
|
11
11
|
var exports = { ".": "./dist/index.js" };
|
|
12
12
|
var main$1 = "./dist/index.js";
|