@kcconfigs/commitlint 0.1.0-beta.0 → 0.1.0-beta.2
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/CHANGELOG.md +75 -1
- package/dist/index.cjs +1 -213
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -207
- package/dist/index.js.map +1 -1
- package/dist/lib-B8xWHCsG.js +4 -0
- package/dist/{lib-D5qzG1z4.js.map → lib-B8xWHCsG.js.map} +1 -1
- package/dist/lib-BQYBZSwc.js +4 -0
- package/dist/{lib-DPex9ONF.js.map → lib-BQYBZSwc.js.map} +1 -1
- package/dist/lib-BmsL4Q0l.cjs +4 -0
- package/dist/{lib-CzUh7oEE.cjs.map → lib-BmsL4Q0l.cjs.map} +1 -1
- package/dist/lib-CewO3LXT.cjs +4 -0
- package/dist/{lib-26NWB_Cl.cjs.map → lib-CewO3LXT.cjs.map} +1 -1
- package/package.json +9 -8
- package/dist/lib-26NWB_Cl.cjs +0 -142
- package/dist/lib-CzUh7oEE.cjs +0 -31
- package/dist/lib-D5qzG1z4.js +0 -25
- package/dist/lib-DPex9ONF.js +0 -142
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,79 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.0-beta.2](https://github.com/kc-workspace/kcws/compare/@kcconfigs/commitlint+v0.1.0-beta.1...@kcconfigs/commitlint+v0.1.0-beta.2) (2026-01-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* **kcconfigs/tsconfig:** remove default types and kctypes, user must install themselves
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **kcconfigs/tsconfig:** remove default types and kctypes, user must install themselves ([5f2989d](https://github.com/kc-workspace/kcws/commit/5f2989d1c091a3ae78f43ce5320ff232246e035f))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Performance Improvements
|
|
16
|
+
|
|
17
|
+
* **deps:** bump @pnpm/workspace.find-packages ([6ee1db9](https://github.com/kc-workspace/kcws/commit/6ee1db95072cc91366712206ddf4c54fb764ccb6))
|
|
18
|
+
* **deps:** bump @pnpm/workspace.find-packages from 1000.0.49 to 1000.0.52 ([#54](https://github.com/kc-workspace/kcws/issues/54)) ([6ee1db9](https://github.com/kc-workspace/kcws/commit/6ee1db95072cc91366712206ddf4c54fb764ccb6))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bugfixes
|
|
22
|
+
|
|
23
|
+
* **script:** pnpm type:check should use tsc --noEmit instead of tsc --build ([e92504c](https://github.com/kc-workspace/kcws/commit/e92504ca6fca6bcfa2a863303000a5ba61d2dd40))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Documentation
|
|
27
|
+
|
|
28
|
+
* add package version and changelog to documentation site ([722fab5](https://github.com/kc-workspace/kcws/commit/722fab5e2472b7d4e4fd5ba446c369f36bd1b4f1))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Dependencies
|
|
32
|
+
|
|
33
|
+
* The following workspace dependencies were updated
|
|
34
|
+
* devDependencies
|
|
35
|
+
* @kcconfigs/biome bumped to 0.2.1
|
|
36
|
+
* @kcconfigs/tsconfig bumped to 0.1.0
|
|
37
|
+
* @kcconfigs/tsdown bumped to 0.1.0-beta.3
|
|
38
|
+
* @kcconfigs/vitest bumped to 0.1.0-beta.2
|
|
39
|
+
|
|
40
|
+
## [0.1.0-beta.1](https://github.com/kc-workspace/kcws/compare/@kcconfigs/commitlint+v0.1.0-beta.0...@kcconfigs/commitlint+v0.1.0-beta.1) (2026-01-10)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### ⚠ BREAKING CHANGES
|
|
44
|
+
|
|
45
|
+
* **kcconfigs/biome:** Use @kcconfigs/biome instead of @kcconfigs/biome/default when use shared config
|
|
46
|
+
|
|
47
|
+
### Features
|
|
48
|
+
|
|
49
|
+
* **config:** use shared typedoc config instead of manually config on every packages ([fd4cdc6](https://github.com/kc-workspace/kcws/commit/fd4cdc607f0fde49e5863c77aa7e0627676d0c42))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Performance Improvements
|
|
53
|
+
|
|
54
|
+
* **config:** remove typedoc on package level, only use root level ([b24e48f](https://github.com/kc-workspace/kcws/commit/b24e48f5c03ee8e095dc795f3b7643d5adce406a))
|
|
55
|
+
* **kcconfigs/biome:** remove /default exports and add typedoc conditions ([5e1ab7d](https://github.com/kc-workspace/kcws/commit/5e1ab7d9be478fedbb29d2e68801c7689cd39882))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### Bugfixes
|
|
59
|
+
|
|
60
|
+
* **config:** update schema version from 2.3.8 to 2.3.10 across all biome configuration files ([751ee20](https://github.com/kc-workspace/kcws/commit/751ee207527ed05720ad415927e0b0f27bdf9bdf))
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### Documentation
|
|
64
|
+
|
|
65
|
+
* update changelog to fix invalid url ([7f14bb5](https://github.com/kc-workspace/kcws/commit/7f14bb520342dc1dfb546a166bf64ef8a357451e))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### Dependencies
|
|
69
|
+
|
|
70
|
+
* The following workspace dependencies were updated
|
|
71
|
+
* devDependencies
|
|
72
|
+
* @kcconfigs/biome bumped to 0.2.0
|
|
73
|
+
* @kcconfigs/tsconfig bumped to 0.1.0-beta.2
|
|
74
|
+
* @kcconfigs/tsdown bumped to 0.1.0-beta.2
|
|
75
|
+
* @kcconfigs/vitest bumped to 0.1.0-beta.1
|
|
76
|
+
|
|
3
77
|
## 0.1.0-beta.0 (2025-12-28)
|
|
4
78
|
|
|
5
79
|
|
|
@@ -22,7 +96,7 @@
|
|
|
22
96
|
* homepage contains invalid url ([0ee37d6](https://github.com/kc-workspace/kcws/commit/0ee37d641fe5b04fb019099915c8aa3ddfed3be7))
|
|
23
97
|
* **kcconfigs/commitlint:** remove unused dependencies from package.json file ([3d627ee](https://github.com/kc-workspace/kcws/commit/3d627eef7b9d48da3f080a89dc796b23da2d7140))
|
|
24
98
|
* trigger re-release please ([65447a7](https://github.com/kc-workspace/kcws/commit/65447a776ed2f8638f6f35a4d00277d407143114))
|
|
25
|
-
* update all
|
|
99
|
+
* update all `@kcconfigs` description so it trigger new deployment with new tag separator ([cf5be8c](https://github.com/kc-workspace/kcws/commit/cf5be8cc02fba8becb7e8f31fd6f3a741c0f0b95))
|
|
26
100
|
|
|
27
101
|
|
|
28
102
|
### Dependencies
|
package/dist/index.cjs
CHANGED
|
@@ -1,216 +1,4 @@
|
|
|
1
1
|
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
-
const
|
|
3
|
-
let node_fs = require("node:fs");
|
|
4
|
-
let node_path = require("node:path");
|
|
5
|
-
let node_process = require("node:process");
|
|
6
|
-
let node_fs_promises = require("node:fs/promises");
|
|
7
|
-
let _pnpm_workspace_find_packages = require("@pnpm/workspace.find-packages");
|
|
8
|
-
let yaml = require("yaml");
|
|
9
|
-
|
|
10
|
-
//#region src/apis/projects.ts
|
|
11
|
-
const findPackages = async (cwd, patterns, includeRoot) => {
|
|
12
|
-
return (await (0, _pnpm_workspace_find_packages.findWorkspacePackagesNoCheck)(cwd, { patterns: patterns ?? ["**"] })).filter((pkg) => (includeRoot ?? false) || pkg.rootDir !== cwd).map((pkg) => pkg.manifest.name ?? (0, node_path.basename)(pkg.rootDirRealPath)).map((name) => name.startsWith("@") ? name.slice(1) : name);
|
|
13
|
-
};
|
|
14
|
-
const findPnpmPackages = async (includeRoot) => {
|
|
15
|
-
const cwd = (0, node_process.cwd)();
|
|
16
|
-
const workspace = (0, yaml.parse)(await (0, node_fs_promises.readFile)((0, node_path.join)(cwd, "pnpm-workspace.yaml"), { encoding: "utf8" }));
|
|
17
|
-
return findPackages(cwd, workspace === null || workspace === void 0 ? void 0 : workspace.packages, includeRoot);
|
|
18
|
-
};
|
|
19
|
-
const findNpmPackages = async (includeRoot) => {
|
|
20
|
-
const cwd = (0, node_process.cwd)();
|
|
21
|
-
const { workspaces } = JSON.parse(await (0, node_fs_promises.readFile)((0, node_path.join)(cwd, "package.json"), { encoding: "utf8" }));
|
|
22
|
-
return findPackages(cwd, workspaces, includeRoot);
|
|
23
|
-
};
|
|
24
|
-
const findBunPackages = async (includeRoot) => {
|
|
25
|
-
return findNpmPackages(includeRoot);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/apis/scopes.ts
|
|
30
|
-
/**
|
|
31
|
-
* Automatically detects and retrieves project scopes based on the package manager in use.
|
|
32
|
-
*
|
|
33
|
-
* Determines the package manager by checking for workspace configuration files:
|
|
34
|
-
* - pnpm: Checks for pnpm-workspace.yaml
|
|
35
|
-
* - bun: Checks for bun.lock or bun.lockb
|
|
36
|
-
* - npm: Falls back to npm package detection
|
|
37
|
-
*
|
|
38
|
-
* @param includeRoot - Whether to include the root package in the results
|
|
39
|
-
* @returns Array of detected project scope names
|
|
40
|
-
*/
|
|
41
|
-
const getAutoScope = (includeRoot) => {
|
|
42
|
-
const cwd = (0, node_process.cwd)();
|
|
43
|
-
if ((0, node_fs.existsSync)((0, node_path.join)(cwd, "pnpm-workspace.yaml"))) return findPnpmPackages(includeRoot);
|
|
44
|
-
else if ((0, node_fs.existsSync)((0, node_path.join)(cwd, "bun.lock")) || (0, node_fs.existsSync)((0, node_path.join)(cwd, "bun.lockb"))) return findBunPackages(includeRoot);
|
|
45
|
-
return findNpmPackages(includeRoot);
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Retrieves a merged list of commit scopes based on automatic detection and user input.
|
|
49
|
-
*
|
|
50
|
-
* Combines user-provided scopes with automatically detected project scopes.
|
|
51
|
-
* If no scopes are provided, returns a default set of common scope categories.
|
|
52
|
-
*
|
|
53
|
-
* @param auto - Whether to automatically detect scopes from workspace packages
|
|
54
|
-
* @param scopes - Optional user-provided scopes to include
|
|
55
|
-
* @returns Merged array of all available scopes
|
|
56
|
-
*
|
|
57
|
-
*/
|
|
58
|
-
const getScopes = async (auto, scopes) => {
|
|
59
|
-
const _scopes = [];
|
|
60
|
-
if (scopes) _scopes.push(...scopes);
|
|
61
|
-
if (auto) _scopes.push(...await getAutoScope(false));
|
|
62
|
-
if (_scopes.length === 0) _scopes.push("core", "config", "script", "deps", "deps-dev");
|
|
63
|
-
return _scopes;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region src/apis/types.ts
|
|
68
|
-
const STANDARD_TYPES = {
|
|
69
|
-
feat: {
|
|
70
|
-
description: "A new feature",
|
|
71
|
-
title: "Features",
|
|
72
|
-
emoji: "✨"
|
|
73
|
-
},
|
|
74
|
-
perf: {
|
|
75
|
-
description: "A code change that improves performance",
|
|
76
|
-
title: "Performance Improvements",
|
|
77
|
-
emoji: "🚀"
|
|
78
|
-
},
|
|
79
|
-
fix: {
|
|
80
|
-
description: "A bug fix",
|
|
81
|
-
title: "Bugfixes",
|
|
82
|
-
emoji: "🐛"
|
|
83
|
-
},
|
|
84
|
-
docs: {
|
|
85
|
-
description: "Documentation only changes",
|
|
86
|
-
title: "Documentation",
|
|
87
|
-
emoji: "📚"
|
|
88
|
-
},
|
|
89
|
-
test: {
|
|
90
|
-
description: "Adding missing tests or correcting existing tests",
|
|
91
|
-
title: "Tests",
|
|
92
|
-
emoji: "🚨"
|
|
93
|
-
},
|
|
94
|
-
style: {
|
|
95
|
-
description: "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",
|
|
96
|
-
title: "Styles",
|
|
97
|
-
emoji: "💎"
|
|
98
|
-
},
|
|
99
|
-
build: {
|
|
100
|
-
description: "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)",
|
|
101
|
-
title: "Builds",
|
|
102
|
-
emoji: "🛠"
|
|
103
|
-
},
|
|
104
|
-
refactor: {
|
|
105
|
-
description: "A code change that neither fixes a bug nor adds a feature",
|
|
106
|
-
title: "Code Refactoring",
|
|
107
|
-
emoji: "📦"
|
|
108
|
-
},
|
|
109
|
-
ci: {
|
|
110
|
-
description: "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)",
|
|
111
|
-
title: "Continuous Integrations",
|
|
112
|
-
emoji: "⚙️"
|
|
113
|
-
},
|
|
114
|
-
chore: {
|
|
115
|
-
description: "Other changes that don't modify src or test files",
|
|
116
|
-
title: "Miscellaneous Chores",
|
|
117
|
-
emoji: "♻️"
|
|
118
|
-
},
|
|
119
|
-
revert: {
|
|
120
|
-
description: "Reverts a previous commit",
|
|
121
|
-
title: "Reverts",
|
|
122
|
-
emoji: "🗑"
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
/**
|
|
126
|
-
* Retrieves commit types based on the specified mode.
|
|
127
|
-
*
|
|
128
|
-
* Returns a predefined list of commit types for standard or kc modes,
|
|
129
|
-
* or a custom list if an array or object is provided.
|
|
130
|
-
*
|
|
131
|
-
* @param mode - The commit type mode: "standard", "kc", or a custom object
|
|
132
|
-
* @returns Map of type object
|
|
133
|
-
*/
|
|
134
|
-
const getTypes = (mode) => {
|
|
135
|
-
if (Array.isArray(mode)) return mode.reduce((acc, type) => {
|
|
136
|
-
acc[type] = {};
|
|
137
|
-
return acc;
|
|
138
|
-
}, {});
|
|
139
|
-
if (typeof mode !== "string") return mode;
|
|
140
|
-
switch (mode) {
|
|
141
|
-
case "standard": return STANDARD_TYPES;
|
|
142
|
-
case "minimal": return {
|
|
143
|
-
feat: STANDARD_TYPES.feat,
|
|
144
|
-
perf: STANDARD_TYPES.perf,
|
|
145
|
-
fix: STANDARD_TYPES.fix,
|
|
146
|
-
chore: STANDARD_TYPES.chore
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
//#endregion
|
|
152
|
-
//#region src/index.ts
|
|
153
|
-
/**
|
|
154
|
-
* Defines a commitlint configuration with automatic workspace scope detection and customizable commit types.
|
|
155
|
-
*
|
|
156
|
-
* @param params - Configuration options
|
|
157
|
-
* @returns A commitlint configuration object
|
|
158
|
-
*/
|
|
159
|
-
const defineConfig = async (params) => {
|
|
160
|
-
const { default: { parserPreset, prompt: { questions: { type, scope, ...questions }, ...prompt }, rules } } = await Promise.resolve().then(() => require("./lib-26NWB_Cl.cjs"));
|
|
161
|
-
const types = getTypes((params === null || params === void 0 ? void 0 : params.types) ?? "standard");
|
|
162
|
-
const scopes = await getScopes((params === null || params === void 0 ? void 0 : params.autoScopes) ?? true, params === null || params === void 0 ? void 0 : params.scopes);
|
|
163
|
-
return {
|
|
164
|
-
helpUrl: "use 'pnpm commit' to create commit instead",
|
|
165
|
-
parserPreset,
|
|
166
|
-
rules: {
|
|
167
|
-
...rules,
|
|
168
|
-
"type-enum": [
|
|
169
|
-
require_lib.RuleConfigSeverity.Error,
|
|
170
|
-
"always",
|
|
171
|
-
Object.keys(types)
|
|
172
|
-
],
|
|
173
|
-
"scope-enum": () => [
|
|
174
|
-
require_lib.RuleConfigSeverity.Error,
|
|
175
|
-
"always",
|
|
176
|
-
scopes
|
|
177
|
-
],
|
|
178
|
-
"subject-max-length": [
|
|
179
|
-
require_lib.RuleConfigSeverity.Warning,
|
|
180
|
-
"always",
|
|
181
|
-
80
|
|
182
|
-
],
|
|
183
|
-
"body-max-line-length": [
|
|
184
|
-
require_lib.RuleConfigSeverity.Warning,
|
|
185
|
-
"always",
|
|
186
|
-
300
|
|
187
|
-
]
|
|
188
|
-
},
|
|
189
|
-
prompt: {
|
|
190
|
-
...prompt,
|
|
191
|
-
questions: {
|
|
192
|
-
...questions,
|
|
193
|
-
type: {
|
|
194
|
-
...type,
|
|
195
|
-
enum: types
|
|
196
|
-
},
|
|
197
|
-
scope: {
|
|
198
|
-
...scope,
|
|
199
|
-
enum: Object.fromEntries(scopes.map((s) => [s, {}]))
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
settings: { enableMultipleScopes: false }
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
//#endregion
|
|
208
|
-
Object.defineProperty(exports, 'Severity', {
|
|
209
|
-
enumerable: true,
|
|
210
|
-
get: function () {
|
|
211
|
-
return require_lib.RuleConfigSeverity;
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
exports.defineConfig = defineConfig;
|
|
2
|
+
const e=require(`./lib-BmsL4Q0l.cjs`);let t=require(`node:fs`),n=require(`node:path`),r=require(`node:process`),i=require(`node:fs/promises`),a=require(`@pnpm/workspace.find-packages`),o=require(`yaml`);const s=async(e,t,r)=>(await(0,a.findWorkspacePackagesNoCheck)(e,{patterns:t??[`**`]})).filter(t=>(r??!1)||t.rootDir!==e).map(e=>e.manifest.name??(0,n.basename)(e.rootDirRealPath)).map(e=>e.startsWith(`@`)?e.slice(1):e),c=async e=>{let t=(0,r.cwd)(),a=(0,o.parse)(await(0,i.readFile)((0,n.join)(t,`pnpm-workspace.yaml`),{encoding:`utf8`}));return s(t,a==null?void 0:a.packages,e)},l=async e=>{let t=(0,r.cwd)(),{workspaces:a}=JSON.parse(await(0,i.readFile)((0,n.join)(t,`package.json`),{encoding:`utf8`}));return s(t,a,e)},u=async e=>l(e),d=e=>{let i=(0,r.cwd)();return(0,t.existsSync)((0,n.join)(i,`pnpm-workspace.yaml`))?c(e):(0,t.existsSync)((0,n.join)(i,`bun.lock`))||(0,t.existsSync)((0,n.join)(i,`bun.lockb`))?u(e):l(e)},f=async(e,t)=>{let n=[];return t&&n.push(...t),e&&n.push(...await d(!1)),n.length===0&&n.push(`core`,`config`,`script`,`deps`,`deps-dev`),n},p={feat:{description:`A new feature`,title:`Features`,emoji:`✨`},perf:{description:`A code change that improves performance`,title:`Performance Improvements`,emoji:`🚀`},fix:{description:`A bug fix`,title:`Bugfixes`,emoji:`🐛`},docs:{description:`Documentation only changes`,title:`Documentation`,emoji:`📚`},test:{description:`Adding missing tests or correcting existing tests`,title:`Tests`,emoji:`🚨`},style:{description:`Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)`,title:`Styles`,emoji:`💎`},build:{description:`Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)`,title:`Builds`,emoji:`🛠`},refactor:{description:`A code change that neither fixes a bug nor adds a feature`,title:`Code Refactoring`,emoji:`📦`},ci:{description:`Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)`,title:`Continuous Integrations`,emoji:`⚙️`},chore:{description:`Other changes that don't modify src or test files`,title:`Miscellaneous Chores`,emoji:`♻️`},revert:{description:`Reverts a previous commit`,title:`Reverts`,emoji:`🗑`}},m=e=>{if(Array.isArray(e))return e.reduce((e,t)=>(e[t]={},e),{});if(typeof e!=`string`)return e;switch(e){case`standard`:return p;case`minimal`:return{feat:p.feat,perf:p.perf,fix:p.fix,chore:p.chore}}},h=async t=>{let{default:{parserPreset:n,prompt:{questions:{type:r,scope:i,...a},...o},rules:s}}=await Promise.resolve().then(()=>require(`./lib-CewO3LXT.cjs`)),c=m((t==null?void 0:t.types)??`standard`),l=await f((t==null?void 0:t.autoScopes)??!0,t==null?void 0:t.scopes);return{helpUrl:`use 'pnpm commit' to create commit instead`,parserPreset:n,rules:{...s,"type-enum":[e.t.Error,`always`,Object.keys(c)],"scope-enum":()=>[e.t.Error,`always`,l],"subject-max-length":[e.t.Warning,`always`,80],"body-max-line-length":[e.t.Warning,`always`,300]},prompt:{...o,questions:{...a,type:{...r,enum:c},scope:{...i,enum:Object.fromEntries(l.map(e=>[e,{}]))}},settings:{enableMultipleScopes:!1}}}};Object.defineProperty(exports,`Severity`,{enumerable:!0,get:function(){return e.t}}),exports.defineConfig=h;
|
|
215
3
|
// Generated by @kcconfigs/tsdown
|
|
216
4
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["_scopes: string[]","Severity"],"sources":["../src/apis/projects.ts","../src/apis/scopes.ts","../src/apis/types.ts","../src/index.ts"],"sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { basename, join } from \"node:path\";\nimport { cwd as wd } from \"node:process\";\nimport { findWorkspacePackagesNoCheck } from \"@pnpm/workspace.find-packages\";\nimport { parse } from \"yaml\";\n\nconst findPackages = async (\n\tcwd: string,\n\tpatterns: WithUndefined<string[]>,\n\tincludeRoot: WithUndefined<boolean>,\n) => {\n\tconst packages = await findWorkspacePackagesNoCheck(cwd, {\n\t\tpatterns: patterns ?? [\"**\"],\n\t});\n\n\treturn packages\n\t\t.filter((pkg) => (includeRoot ?? false) || pkg.rootDir !== cwd)\n\t\t.map((pkg) => pkg.manifest.name ?? basename(pkg.rootDirRealPath))\n\t\t.map((name) => (name.startsWith(\"@\") ? name.slice(1) : name));\n};\n\nexport const findPnpmPackages = async (\n\tincludeRoot?: boolean,\n): Promise<string[]> => {\n\tconst cwd = wd();\n\n\tconst pnpmWorkspace = await readFile(join(cwd, \"pnpm-workspace.yaml\"), {\n\t\tencoding: \"utf8\",\n\t});\n\n\tconst workspace = parse(pnpmWorkspace);\n\treturn findPackages(cwd, workspace?.packages, includeRoot);\n};\n\nexport const findNpmPackages = async (\n\tincludeRoot?: boolean,\n): Promise<string[]> => {\n\tconst cwd = wd();\n\n\tconst { workspaces } = JSON.parse(\n\t\tawait readFile(join(cwd, \"package.json\"), {\n\t\t\tencoding: \"utf8\",\n\t\t}),\n\t);\n\treturn findPackages(cwd, workspaces, includeRoot);\n};\n\nexport const findBunPackages = async (\n\tincludeRoot?: boolean,\n): Promise<string[]> => {\n\treturn findNpmPackages(includeRoot);\n};\n","import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { cwd as wd } from \"node:process\";\nimport { findBunPackages, findNpmPackages, findPnpmPackages } from \"./projects\";\n\n/**\n * Automatically detects and retrieves project scopes based on the package manager in use.\n *\n * Determines the package manager by checking for workspace configuration files:\n * - pnpm: Checks for pnpm-workspace.yaml\n * - bun: Checks for bun.lock or bun.lockb\n * - npm: Falls back to npm package detection\n *\n * @param includeRoot - Whether to include the root package in the results\n * @returns Array of detected project scope names\n */\nconst getAutoScope = (includeRoot: boolean) => {\n\tconst cwd = wd();\n\n\tif (existsSync(join(cwd, \"pnpm-workspace.yaml\"))) {\n\t\treturn findPnpmPackages(includeRoot);\n\t} else if (\n\t\texistsSync(join(cwd, \"bun.lock\")) ||\n\t\texistsSync(join(cwd, \"bun.lockb\"))\n\t) {\n\t\treturn findBunPackages(includeRoot);\n\t}\n\n\treturn findNpmPackages(includeRoot);\n};\n\n/**\n * Retrieves a merged list of commit scopes based on automatic detection and user input.\n *\n * Combines user-provided scopes with automatically detected project scopes.\n * If no scopes are provided, returns a default set of common scope categories.\n *\n * @param auto - Whether to automatically detect scopes from workspace packages\n * @param scopes - Optional user-provided scopes to include\n * @returns Merged array of all available scopes\n *\n */\nexport const getScopes = async (\n\tauto: boolean,\n\tscopes?: string[],\n): Promise<string[]> => {\n\tconst _scopes: string[] = [];\n\n\tif (scopes) _scopes.push(...scopes);\n\tif (auto) _scopes.push(...(await getAutoScope(false)));\n\n\tif (_scopes.length === 0) {\n\t\t_scopes.push(\"core\", \"config\", \"script\", \"deps\", \"deps-dev\");\n\t}\n\treturn _scopes;\n};\n","export interface TypeEnum {\n\tdescription?: string;\n\ttitle?: string;\n\temoji?: string;\n}\n\nexport type TypeObject = Record<string, TypeEnum>;\n\nexport type TypeMode = \"standard\" | \"minimal\" | string[] | TypeObject;\n\nconst STANDARD_TYPES = {\n\tfeat: {\n\t\tdescription: \"A new feature\",\n\t\ttitle: \"Features\",\n\t\temoji: \"✨\",\n\t},\n\tperf: {\n\t\tdescription: \"A code change that improves performance\",\n\t\ttitle: \"Performance Improvements\",\n\t\temoji: \"🚀\",\n\t},\n\tfix: {\n\t\tdescription: \"A bug fix\",\n\t\ttitle: \"Bugfixes\",\n\t\temoji: \"🐛\",\n\t},\n\tdocs: {\n\t\tdescription: \"Documentation only changes\",\n\t\ttitle: \"Documentation\",\n\t\temoji: \"📚\",\n\t},\n\ttest: {\n\t\tdescription: \"Adding missing tests or correcting existing tests\",\n\t\ttitle: \"Tests\",\n\t\temoji: \"🚨\",\n\t},\n\tstyle: {\n\t\tdescription:\n\t\t\t\"Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)\",\n\t\ttitle: \"Styles\",\n\t\temoji: \"💎\",\n\t},\n\tbuild: {\n\t\tdescription:\n\t\t\t\"Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)\",\n\t\ttitle: \"Builds\",\n\t\temoji: \"🛠\",\n\t},\n\trefactor: {\n\t\tdescription: \"A code change that neither fixes a bug nor adds a feature\",\n\t\ttitle: \"Code Refactoring\",\n\t\temoji: \"📦\",\n\t},\n\tci: {\n\t\tdescription:\n\t\t\t\"Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)\",\n\t\ttitle: \"Continuous Integrations\",\n\t\temoji: \"⚙️\",\n\t},\n\tchore: {\n\t\tdescription: \"Other changes that don't modify src or test files\",\n\t\ttitle: \"Miscellaneous Chores\",\n\t\temoji: \"♻️\",\n\t},\n\trevert: {\n\t\tdescription: \"Reverts a previous commit\",\n\t\ttitle: \"Reverts\",\n\t\temoji: \"🗑\",\n\t},\n} satisfies TypeObject;\n\n/**\n * Retrieves commit types based on the specified mode.\n *\n * Returns a predefined list of commit types for standard or kc modes,\n * or a custom list if an array or object is provided.\n *\n * @param mode - The commit type mode: \"standard\", \"kc\", or a custom object\n * @returns Map of type object\n */\nexport const getTypes = (mode: TypeMode): TypeObject => {\n\tif (Array.isArray(mode)) {\n\t\treturn mode.reduce((acc, type) => {\n\t\t\tacc[type] = {};\n\t\t\treturn acc;\n\t\t}, {} as TypeObject);\n\t}\n\tif (typeof mode !== \"string\") {\n\t\treturn mode;\n\t}\n\n\tswitch (mode) {\n\t\tcase \"standard\":\n\t\t\treturn STANDARD_TYPES;\n\t\tcase \"minimal\":\n\t\t\treturn {\n\t\t\t\tfeat: STANDARD_TYPES.feat,\n\t\t\t\tperf: STANDARD_TYPES.perf,\n\t\t\t\tfix: STANDARD_TYPES.fix,\n\t\t\t\tchore: STANDARD_TYPES.chore,\n\t\t\t};\n\t}\n};\n","import {\n\tRuleConfigSeverity as Severity,\n\ttype UserConfig,\n} from \"@commitlint/types\";\n\nimport { getScopes } from \"./apis/scopes\";\nimport { getTypes, type TypeMode } from \"./apis/types\";\n\nexport interface DefineConfigParams {\n\t/**\n\t * Commit types configuration\n\t * - `\"standard\"`: Use standard conventional commit types\n\t * - `string[]`: Use custom types\n\t * @default \"standard\"\n\t */\n\ttypes?: TypeMode;\n\t/**\n\t * Automatically gather scopes from pnpm workspaces\n\t * @default true\n\t */\n\tautoScopes?: boolean;\n\t/**\n\t * Provide additional scopes; or override if `autoScopes` is false\n\t */\n\tscopes?: string[];\n}\n\n/**\n * Defines a commitlint configuration with automatic workspace scope detection and customizable commit types.\n *\n * @param params - Configuration options\n * @returns A commitlint configuration object\n */\nexport const defineConfig = async (\n\tparams?: DefineConfigParams,\n): Promise<UserConfig> => {\n\tconst {\n\t\tdefault: {\n\t\t\tparserPreset,\n\t\t\tprompt: {\n\t\t\t\tquestions: { type, scope, ...questions },\n\t\t\t\t...prompt\n\t\t\t},\n\t\t\trules,\n\t\t},\n\t} = await import(\"@commitlint/config-conventional\");\n\n\tconst types = getTypes(params?.types ?? \"standard\");\n\tconst scopes = await getScopes(params?.autoScopes ?? true, params?.scopes);\n\n\treturn {\n\t\thelpUrl: \"use 'pnpm commit' to create commit instead\",\n\t\tparserPreset,\n\t\trules: {\n\t\t\t...rules,\n\t\t\t\"type-enum\": [Severity.Error, \"always\", Object.keys(types)],\n\t\t\t\"scope-enum\": () => [Severity.Error, \"always\", scopes],\n\t\t\t\"subject-max-length\": [Severity.Warning, \"always\", 80],\n\t\t\t\"body-max-line-length\": [Severity.Warning, \"always\", 300],\n\t\t},\n\t\tprompt: {\n\t\t\t...prompt,\n\t\t\tquestions: {\n\t\t\t\t...questions,\n\t\t\t\ttype: {\n\t\t\t\t\t...type,\n\t\t\t\t\tenum: types,\n\t\t\t\t},\n\t\t\t\tscope: {\n\t\t\t\t\t...scope,\n\t\t\t\t\tenum: Object.fromEntries(scopes.map((s) => [s, {}])),\n\t\t\t\t},\n\t\t\t},\n\t\t\tsettings: {\n\t\t\t\tenableMultipleScopes: false,\n\t\t\t},\n\t\t},\n\t};\n};\n\nexport { Severity };\nexport type { UserConfig };\n"],"mappings":";;;;;;;;;;AAMA,MAAM,eAAe,OACpB,KACA,UACA,gBACI;AAKJ,SAJiB,sEAAmC,KAAK,EACxD,UAAU,YAAY,CAAC,KAAK,EAC5B,CAAC,EAGA,QAAQ,SAAS,eAAe,UAAU,IAAI,YAAY,IAAI,CAC9D,KAAK,QAAQ,IAAI,SAAS,gCAAiB,IAAI,gBAAgB,CAAC,CAChE,KAAK,SAAU,KAAK,WAAW,IAAI,GAAG,KAAK,MAAM,EAAE,GAAG,KAAM;;AAG/D,MAAa,mBAAmB,OAC/B,gBACuB;CACvB,MAAM,6BAAU;CAMhB,MAAM,4BAJgB,yDAAoB,KAAK,sBAAsB,EAAE,EACtE,UAAU,QACV,CAAC,CAEoC;AACtC,QAAO,aAAa,2DAAK,UAAW,UAAU,YAAY;;AAG3D,MAAa,kBAAkB,OAC9B,gBACuB;CACvB,MAAM,6BAAU;CAEhB,MAAM,EAAE,eAAe,KAAK,MAC3B,yDAAoB,KAAK,eAAe,EAAE,EACzC,UAAU,QACV,CAAC,CACF;AACD,QAAO,aAAa,KAAK,YAAY,YAAY;;AAGlD,MAAa,kBAAkB,OAC9B,gBACuB;AACvB,QAAO,gBAAgB,YAAY;;;;;;;;;;;;;;;;AClCpC,MAAM,gBAAgB,gBAAyB;CAC9C,MAAM,6BAAU;AAEhB,iDAAoB,KAAK,sBAAsB,CAAC,CAC/C,QAAO,iBAAiB,YAAY;sDAEpB,KAAK,WAAW,CAAC,gDACjB,KAAK,YAAY,CAAC,CAElC,QAAO,gBAAgB,YAAY;AAGpC,QAAO,gBAAgB,YAAY;;;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,SAAS,EACR,cACA,QAAQ,EACP,WAAW,EAAE,MAAM,OAAO,GAAG,aAC7B,GAAG,UAEJ,YAEE,2CAAM;CAEV,MAAM,QAAQ,0DAAS,OAAQ,UAAS,WAAW;CACnD,MAAM,SAAS,MAAM,2DAAU,OAAQ,eAAc,sDAAM,OAAQ,OAAO;AAE1E,QAAO;EACN,SAAS;EACT;EACA,OAAO;GACN,GAAG;GACH,aAAa;IAACC,+BAAS;IAAO;IAAU,OAAO,KAAK,MAAM;IAAC;GAC3D,oBAAoB;IAACA,+BAAS;IAAO;IAAU;IAAO;GACtD,sBAAsB;IAACA,+BAAS;IAAS;IAAU;IAAG;GACtD,wBAAwB;IAACA,+BAAS;IAAS;IAAU;IAAI;GACzD;EACD,QAAQ;GACP,GAAG;GACH,WAAW;IACV,GAAG;IACH,MAAM;KACL,GAAG;KACH,MAAM;KACN;IACD,OAAO;KACN,GAAG;KACH,MAAM,OAAO,YAAY,OAAO,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;KACpD;IACD;GACD,UAAU,EACT,sBAAsB,OACtB;GACD;EACD"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["_scopes: string[]","Severity"],"sources":["../src/apis/projects.ts","../src/apis/scopes.ts","../src/apis/types.ts","../src/index.ts"],"sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { basename, join } from \"node:path\";\nimport { cwd as wd } from \"node:process\";\nimport { findWorkspacePackagesNoCheck } from \"@pnpm/workspace.find-packages\";\nimport { parse } from \"yaml\";\n\nconst findPackages = async (\n\tcwd: string,\n\tpatterns: WithUndefined<string[]>,\n\tincludeRoot: WithUndefined<boolean>,\n) => {\n\tconst packages = await findWorkspacePackagesNoCheck(cwd, {\n\t\tpatterns: patterns ?? [\"**\"],\n\t});\n\n\treturn packages\n\t\t.filter((pkg) => (includeRoot ?? false) || pkg.rootDir !== cwd)\n\t\t.map((pkg) => pkg.manifest.name ?? basename(pkg.rootDirRealPath))\n\t\t.map((name) => (name.startsWith(\"@\") ? name.slice(1) : name));\n};\n\nexport const findPnpmPackages = async (\n\tincludeRoot?: boolean,\n): Promise<string[]> => {\n\tconst cwd = wd();\n\n\tconst pnpmWorkspace = await readFile(join(cwd, \"pnpm-workspace.yaml\"), {\n\t\tencoding: \"utf8\",\n\t});\n\n\tconst workspace = parse(pnpmWorkspace);\n\treturn findPackages(cwd, workspace?.packages, includeRoot);\n};\n\nexport const findNpmPackages = async (\n\tincludeRoot?: boolean,\n): Promise<string[]> => {\n\tconst cwd = wd();\n\n\tconst { workspaces } = JSON.parse(\n\t\tawait readFile(join(cwd, \"package.json\"), {\n\t\t\tencoding: \"utf8\",\n\t\t}),\n\t);\n\treturn findPackages(cwd, workspaces, includeRoot);\n};\n\nexport const findBunPackages = async (\n\tincludeRoot?: boolean,\n): Promise<string[]> => {\n\treturn findNpmPackages(includeRoot);\n};\n","import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { cwd as wd } from \"node:process\";\nimport { findBunPackages, findNpmPackages, findPnpmPackages } from \"./projects\";\n\n/**\n * Automatically detects and retrieves project scopes based on the package manager in use.\n *\n * Determines the package manager by checking for workspace configuration files:\n * - pnpm: Checks for pnpm-workspace.yaml\n * - bun: Checks for bun.lock or bun.lockb\n * - npm: Falls back to npm package detection\n *\n * @param includeRoot - Whether to include the root package in the results\n * @returns Array of detected project scope names\n */\nconst getAutoScope = (includeRoot: boolean) => {\n\tconst cwd = wd();\n\n\tif (existsSync(join(cwd, \"pnpm-workspace.yaml\"))) {\n\t\treturn findPnpmPackages(includeRoot);\n\t} else if (\n\t\texistsSync(join(cwd, \"bun.lock\")) ||\n\t\texistsSync(join(cwd, \"bun.lockb\"))\n\t) {\n\t\treturn findBunPackages(includeRoot);\n\t}\n\n\treturn findNpmPackages(includeRoot);\n};\n\n/**\n * Retrieves a merged list of commit scopes based on automatic detection and user input.\n *\n * Combines user-provided scopes with automatically detected project scopes.\n * If no scopes are provided, returns a default set of common scope categories.\n *\n * @param auto - Whether to automatically detect scopes from workspace packages\n * @param scopes - Optional user-provided scopes to include\n * @returns Merged array of all available scopes\n *\n */\nexport const getScopes = async (\n\tauto: boolean,\n\tscopes?: string[],\n): Promise<string[]> => {\n\tconst _scopes: string[] = [];\n\n\tif (scopes) _scopes.push(...scopes);\n\tif (auto) _scopes.push(...(await getAutoScope(false)));\n\n\tif (_scopes.length === 0) {\n\t\t_scopes.push(\"core\", \"config\", \"script\", \"deps\", \"deps-dev\");\n\t}\n\treturn _scopes;\n};\n","export interface TypeEnum {\n\tdescription?: string;\n\ttitle?: string;\n\temoji?: string;\n}\n\nexport type TypeObject = Record<string, TypeEnum>;\n\nexport type TypeMode = \"standard\" | \"minimal\" | string[] | TypeObject;\n\nconst STANDARD_TYPES = {\n\tfeat: {\n\t\tdescription: \"A new feature\",\n\t\ttitle: \"Features\",\n\t\temoji: \"✨\",\n\t},\n\tperf: {\n\t\tdescription: \"A code change that improves performance\",\n\t\ttitle: \"Performance Improvements\",\n\t\temoji: \"🚀\",\n\t},\n\tfix: {\n\t\tdescription: \"A bug fix\",\n\t\ttitle: \"Bugfixes\",\n\t\temoji: \"🐛\",\n\t},\n\tdocs: {\n\t\tdescription: \"Documentation only changes\",\n\t\ttitle: \"Documentation\",\n\t\temoji: \"📚\",\n\t},\n\ttest: {\n\t\tdescription: \"Adding missing tests or correcting existing tests\",\n\t\ttitle: \"Tests\",\n\t\temoji: \"🚨\",\n\t},\n\tstyle: {\n\t\tdescription:\n\t\t\t\"Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)\",\n\t\ttitle: \"Styles\",\n\t\temoji: \"💎\",\n\t},\n\tbuild: {\n\t\tdescription:\n\t\t\t\"Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)\",\n\t\ttitle: \"Builds\",\n\t\temoji: \"🛠\",\n\t},\n\trefactor: {\n\t\tdescription: \"A code change that neither fixes a bug nor adds a feature\",\n\t\ttitle: \"Code Refactoring\",\n\t\temoji: \"📦\",\n\t},\n\tci: {\n\t\tdescription:\n\t\t\t\"Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)\",\n\t\ttitle: \"Continuous Integrations\",\n\t\temoji: \"⚙️\",\n\t},\n\tchore: {\n\t\tdescription: \"Other changes that don't modify src or test files\",\n\t\ttitle: \"Miscellaneous Chores\",\n\t\temoji: \"♻️\",\n\t},\n\trevert: {\n\t\tdescription: \"Reverts a previous commit\",\n\t\ttitle: \"Reverts\",\n\t\temoji: \"🗑\",\n\t},\n} satisfies TypeObject;\n\n/**\n * Retrieves commit types based on the specified mode.\n *\n * Returns a predefined list of commit types for standard or kc modes,\n * or a custom list if an array or object is provided.\n *\n * @param mode - The commit type mode: \"standard\", \"kc\", or a custom object\n * @returns Map of type object\n */\nexport const getTypes = (mode: TypeMode): TypeObject => {\n\tif (Array.isArray(mode)) {\n\t\treturn mode.reduce((acc, type) => {\n\t\t\tacc[type] = {};\n\t\t\treturn acc;\n\t\t}, {} as TypeObject);\n\t}\n\tif (typeof mode !== \"string\") {\n\t\treturn mode;\n\t}\n\n\tswitch (mode) {\n\t\tcase \"standard\":\n\t\t\treturn STANDARD_TYPES;\n\t\tcase \"minimal\":\n\t\t\treturn {\n\t\t\t\tfeat: STANDARD_TYPES.feat,\n\t\t\t\tperf: STANDARD_TYPES.perf,\n\t\t\t\tfix: STANDARD_TYPES.fix,\n\t\t\t\tchore: STANDARD_TYPES.chore,\n\t\t\t};\n\t}\n};\n","import {\n\tRuleConfigSeverity as Severity,\n\ttype UserConfig,\n} from \"@commitlint/types\";\n\nimport { getScopes } from \"./apis/scopes\";\nimport { getTypes, type TypeMode } from \"./apis/types\";\n\nexport interface DefineConfigParams {\n\t/**\n\t * Commit types configuration\n\t * - `\"standard\"`: Use standard conventional commit types\n\t * - `string[]`: Use custom types\n\t * @default \"standard\"\n\t */\n\ttypes?: TypeMode;\n\t/**\n\t * Automatically gather scopes from pnpm workspaces\n\t * @default true\n\t */\n\tautoScopes?: boolean;\n\t/**\n\t * Provide additional scopes; or override if `autoScopes` is false\n\t */\n\tscopes?: string[];\n}\n\n/**\n * Defines a commitlint configuration with automatic workspace scope detection and customizable commit types.\n *\n * @param params - Configuration options\n * @returns A commitlint configuration object\n */\nexport const defineConfig = async (\n\tparams?: DefineConfigParams,\n): Promise<UserConfig> => {\n\tconst {\n\t\tdefault: {\n\t\t\tparserPreset,\n\t\t\tprompt: {\n\t\t\t\tquestions: { type, scope, ...questions },\n\t\t\t\t...prompt\n\t\t\t},\n\t\t\trules,\n\t\t},\n\t} = await import(\"@commitlint/config-conventional\");\n\n\tconst types = getTypes(params?.types ?? \"standard\");\n\tconst scopes = await getScopes(params?.autoScopes ?? true, params?.scopes);\n\n\treturn {\n\t\thelpUrl: \"use 'pnpm commit' to create commit instead\",\n\t\tparserPreset,\n\t\trules: {\n\t\t\t...rules,\n\t\t\t\"type-enum\": [Severity.Error, \"always\", Object.keys(types)],\n\t\t\t\"scope-enum\": () => [Severity.Error, \"always\", scopes],\n\t\t\t\"subject-max-length\": [Severity.Warning, \"always\", 80],\n\t\t\t\"body-max-line-length\": [Severity.Warning, \"always\", 300],\n\t\t},\n\t\tprompt: {\n\t\t\t...prompt,\n\t\t\tquestions: {\n\t\t\t\t...questions,\n\t\t\t\ttype: {\n\t\t\t\t\t...type,\n\t\t\t\t\tenum: types,\n\t\t\t\t},\n\t\t\t\tscope: {\n\t\t\t\t\t...scope,\n\t\t\t\t\tenum: Object.fromEntries(scopes.map((s) => [s, {}])),\n\t\t\t\t},\n\t\t\t},\n\t\t\tsettings: {\n\t\t\t\tenableMultipleScopes: false,\n\t\t\t},\n\t\t},\n\t};\n};\n\nexport { Severity };\nexport type { UserConfig };\n"],"mappings":";2MAMA,MAAM,EAAe,MACpB,EACA,EACA,KAEiB,MAAA,EAAA,EAAA,8BAAmC,EAAK,CACxD,SAAU,GAAY,CAAC,KAAK,CAC5B,CAAC,EAGA,OAAQ,IAAS,GAAe,KAAU,EAAI,UAAY,EAAI,CAC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AAA,EAAS,MAAO,SAAU,OAAO,KAAK,EAAM,CAAC,CAC3D,iBAAoB,CAACA,EAAAA,EAAS,MAAO,SAAU,EAAO,CACtD,qBAAsB,CAACA,EAAAA,EAAS,QAAS,SAAU,GAAG,CACtD,uBAAwB,CAACA,EAAAA,EAAS,QAAS,SAAU,IAAI,CACzD,CACD,OAAQ,CACP,GAAG,EACH,UAAW,CACV,GAAG,EACH,KAAM,CACL,GAAG,EACH,KAAM,EACN,CACD,MAAO,CACN,GAAG,EACH,KAAM,OAAO,YAAY,EAAO,IAAK,GAAM,CAAC,EAAG,EAAE,CAAC,CAAC,CAAC,CACpD,CACD,CACD,SAAU,CACT,qBAAsB,GACtB,CACD,CACD"}
|
package/dist/index.js
CHANGED
|
@@ -1,210 +1,4 @@
|
|
|
1
1
|
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
-
import { t as
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
4
|
-
import { basename, join } from "node:path";
|
|
5
|
-
import { cwd } from "node:process";
|
|
6
|
-
import { readFile } from "node:fs/promises";
|
|
7
|
-
import { findWorkspacePackagesNoCheck } from "@pnpm/workspace.find-packages";
|
|
8
|
-
import { parse } from "yaml";
|
|
9
|
-
|
|
10
|
-
//#region src/apis/projects.ts
|
|
11
|
-
const findPackages = async (cwd$1, patterns, includeRoot) => {
|
|
12
|
-
return (await findWorkspacePackagesNoCheck(cwd$1, { patterns: patterns ?? ["**"] })).filter((pkg) => (includeRoot ?? false) || pkg.rootDir !== cwd$1).map((pkg) => pkg.manifest.name ?? basename(pkg.rootDirRealPath)).map((name) => name.startsWith("@") ? name.slice(1) : name);
|
|
13
|
-
};
|
|
14
|
-
const findPnpmPackages = async (includeRoot) => {
|
|
15
|
-
const cwd$1 = cwd();
|
|
16
|
-
const workspace = parse(await readFile(join(cwd$1, "pnpm-workspace.yaml"), { encoding: "utf8" }));
|
|
17
|
-
return findPackages(cwd$1, workspace === null || workspace === void 0 ? void 0 : workspace.packages, includeRoot);
|
|
18
|
-
};
|
|
19
|
-
const findNpmPackages = async (includeRoot) => {
|
|
20
|
-
const cwd$1 = cwd();
|
|
21
|
-
const { workspaces } = JSON.parse(await readFile(join(cwd$1, "package.json"), { encoding: "utf8" }));
|
|
22
|
-
return findPackages(cwd$1, workspaces, includeRoot);
|
|
23
|
-
};
|
|
24
|
-
const findBunPackages = async (includeRoot) => {
|
|
25
|
-
return findNpmPackages(includeRoot);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/apis/scopes.ts
|
|
30
|
-
/**
|
|
31
|
-
* Automatically detects and retrieves project scopes based on the package manager in use.
|
|
32
|
-
*
|
|
33
|
-
* Determines the package manager by checking for workspace configuration files:
|
|
34
|
-
* - pnpm: Checks for pnpm-workspace.yaml
|
|
35
|
-
* - bun: Checks for bun.lock or bun.lockb
|
|
36
|
-
* - npm: Falls back to npm package detection
|
|
37
|
-
*
|
|
38
|
-
* @param includeRoot - Whether to include the root package in the results
|
|
39
|
-
* @returns Array of detected project scope names
|
|
40
|
-
*/
|
|
41
|
-
const getAutoScope = (includeRoot) => {
|
|
42
|
-
const cwd$1 = cwd();
|
|
43
|
-
if (existsSync(join(cwd$1, "pnpm-workspace.yaml"))) return findPnpmPackages(includeRoot);
|
|
44
|
-
else if (existsSync(join(cwd$1, "bun.lock")) || existsSync(join(cwd$1, "bun.lockb"))) return findBunPackages(includeRoot);
|
|
45
|
-
return findNpmPackages(includeRoot);
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Retrieves a merged list of commit scopes based on automatic detection and user input.
|
|
49
|
-
*
|
|
50
|
-
* Combines user-provided scopes with automatically detected project scopes.
|
|
51
|
-
* If no scopes are provided, returns a default set of common scope categories.
|
|
52
|
-
*
|
|
53
|
-
* @param auto - Whether to automatically detect scopes from workspace packages
|
|
54
|
-
* @param scopes - Optional user-provided scopes to include
|
|
55
|
-
* @returns Merged array of all available scopes
|
|
56
|
-
*
|
|
57
|
-
*/
|
|
58
|
-
const getScopes = async (auto, scopes) => {
|
|
59
|
-
const _scopes = [];
|
|
60
|
-
if (scopes) _scopes.push(...scopes);
|
|
61
|
-
if (auto) _scopes.push(...await getAutoScope(false));
|
|
62
|
-
if (_scopes.length === 0) _scopes.push("core", "config", "script", "deps", "deps-dev");
|
|
63
|
-
return _scopes;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region src/apis/types.ts
|
|
68
|
-
const STANDARD_TYPES = {
|
|
69
|
-
feat: {
|
|
70
|
-
description: "A new feature",
|
|
71
|
-
title: "Features",
|
|
72
|
-
emoji: "✨"
|
|
73
|
-
},
|
|
74
|
-
perf: {
|
|
75
|
-
description: "A code change that improves performance",
|
|
76
|
-
title: "Performance Improvements",
|
|
77
|
-
emoji: "🚀"
|
|
78
|
-
},
|
|
79
|
-
fix: {
|
|
80
|
-
description: "A bug fix",
|
|
81
|
-
title: "Bugfixes",
|
|
82
|
-
emoji: "🐛"
|
|
83
|
-
},
|
|
84
|
-
docs: {
|
|
85
|
-
description: "Documentation only changes",
|
|
86
|
-
title: "Documentation",
|
|
87
|
-
emoji: "📚"
|
|
88
|
-
},
|
|
89
|
-
test: {
|
|
90
|
-
description: "Adding missing tests or correcting existing tests",
|
|
91
|
-
title: "Tests",
|
|
92
|
-
emoji: "🚨"
|
|
93
|
-
},
|
|
94
|
-
style: {
|
|
95
|
-
description: "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",
|
|
96
|
-
title: "Styles",
|
|
97
|
-
emoji: "💎"
|
|
98
|
-
},
|
|
99
|
-
build: {
|
|
100
|
-
description: "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)",
|
|
101
|
-
title: "Builds",
|
|
102
|
-
emoji: "🛠"
|
|
103
|
-
},
|
|
104
|
-
refactor: {
|
|
105
|
-
description: "A code change that neither fixes a bug nor adds a feature",
|
|
106
|
-
title: "Code Refactoring",
|
|
107
|
-
emoji: "📦"
|
|
108
|
-
},
|
|
109
|
-
ci: {
|
|
110
|
-
description: "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)",
|
|
111
|
-
title: "Continuous Integrations",
|
|
112
|
-
emoji: "⚙️"
|
|
113
|
-
},
|
|
114
|
-
chore: {
|
|
115
|
-
description: "Other changes that don't modify src or test files",
|
|
116
|
-
title: "Miscellaneous Chores",
|
|
117
|
-
emoji: "♻️"
|
|
118
|
-
},
|
|
119
|
-
revert: {
|
|
120
|
-
description: "Reverts a previous commit",
|
|
121
|
-
title: "Reverts",
|
|
122
|
-
emoji: "🗑"
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
/**
|
|
126
|
-
* Retrieves commit types based on the specified mode.
|
|
127
|
-
*
|
|
128
|
-
* Returns a predefined list of commit types for standard or kc modes,
|
|
129
|
-
* or a custom list if an array or object is provided.
|
|
130
|
-
*
|
|
131
|
-
* @param mode - The commit type mode: "standard", "kc", or a custom object
|
|
132
|
-
* @returns Map of type object
|
|
133
|
-
*/
|
|
134
|
-
const getTypes = (mode) => {
|
|
135
|
-
if (Array.isArray(mode)) return mode.reduce((acc, type) => {
|
|
136
|
-
acc[type] = {};
|
|
137
|
-
return acc;
|
|
138
|
-
}, {});
|
|
139
|
-
if (typeof mode !== "string") return mode;
|
|
140
|
-
switch (mode) {
|
|
141
|
-
case "standard": return STANDARD_TYPES;
|
|
142
|
-
case "minimal": return {
|
|
143
|
-
feat: STANDARD_TYPES.feat,
|
|
144
|
-
perf: STANDARD_TYPES.perf,
|
|
145
|
-
fix: STANDARD_TYPES.fix,
|
|
146
|
-
chore: STANDARD_TYPES.chore
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
//#endregion
|
|
152
|
-
//#region src/index.ts
|
|
153
|
-
/**
|
|
154
|
-
* Defines a commitlint configuration with automatic workspace scope detection and customizable commit types.
|
|
155
|
-
*
|
|
156
|
-
* @param params - Configuration options
|
|
157
|
-
* @returns A commitlint configuration object
|
|
158
|
-
*/
|
|
159
|
-
const defineConfig = async (params) => {
|
|
160
|
-
const { default: { parserPreset, prompt: { questions: { type, scope, ...questions }, ...prompt }, rules } } = await import("./lib-DPex9ONF.js");
|
|
161
|
-
const types = getTypes((params === null || params === void 0 ? void 0 : params.types) ?? "standard");
|
|
162
|
-
const scopes = await getScopes((params === null || params === void 0 ? void 0 : params.autoScopes) ?? true, params === null || params === void 0 ? void 0 : params.scopes);
|
|
163
|
-
return {
|
|
164
|
-
helpUrl: "use 'pnpm commit' to create commit instead",
|
|
165
|
-
parserPreset,
|
|
166
|
-
rules: {
|
|
167
|
-
...rules,
|
|
168
|
-
"type-enum": [
|
|
169
|
-
RuleConfigSeverity.Error,
|
|
170
|
-
"always",
|
|
171
|
-
Object.keys(types)
|
|
172
|
-
],
|
|
173
|
-
"scope-enum": () => [
|
|
174
|
-
RuleConfigSeverity.Error,
|
|
175
|
-
"always",
|
|
176
|
-
scopes
|
|
177
|
-
],
|
|
178
|
-
"subject-max-length": [
|
|
179
|
-
RuleConfigSeverity.Warning,
|
|
180
|
-
"always",
|
|
181
|
-
80
|
|
182
|
-
],
|
|
183
|
-
"body-max-line-length": [
|
|
184
|
-
RuleConfigSeverity.Warning,
|
|
185
|
-
"always",
|
|
186
|
-
300
|
|
187
|
-
]
|
|
188
|
-
},
|
|
189
|
-
prompt: {
|
|
190
|
-
...prompt,
|
|
191
|
-
questions: {
|
|
192
|
-
...questions,
|
|
193
|
-
type: {
|
|
194
|
-
...type,
|
|
195
|
-
enum: types
|
|
196
|
-
},
|
|
197
|
-
scope: {
|
|
198
|
-
...scope,
|
|
199
|
-
enum: Object.fromEntries(scopes.map((s) => [s, {}]))
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
settings: { enableMultipleScopes: false }
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
//#endregion
|
|
208
|
-
export { RuleConfigSeverity as Severity, defineConfig };
|
|
2
|
+
import{t as e}from"./lib-B8xWHCsG.js";import{existsSync as t}from"node:fs";import{basename as n,join as r}from"node:path";import{cwd as i}from"node:process";import{readFile as a}from"node:fs/promises";import{findWorkspacePackagesNoCheck as o}from"@pnpm/workspace.find-packages";import{parse as s}from"yaml";const c=async(e,t,r)=>(await o(e,{patterns:t??[`**`]})).filter(t=>(r??!1)||t.rootDir!==e).map(e=>e.manifest.name??n(e.rootDirRealPath)).map(e=>e.startsWith(`@`)?e.slice(1):e),l=async e=>{let t=i(),n=s(await a(r(t,`pnpm-workspace.yaml`),{encoding:`utf8`}));return c(t,n==null?void 0:n.packages,e)},u=async e=>{let t=i(),{workspaces:n}=JSON.parse(await a(r(t,`package.json`),{encoding:`utf8`}));return c(t,n,e)},d=async e=>u(e),f=e=>{let n=i();return t(r(n,`pnpm-workspace.yaml`))?l(e):t(r(n,`bun.lock`))||t(r(n,`bun.lockb`))?d(e):u(e)},p=async(e,t)=>{let n=[];return t&&n.push(...t),e&&n.push(...await f(!1)),n.length===0&&n.push(`core`,`config`,`script`,`deps`,`deps-dev`),n},m={feat:{description:`A new feature`,title:`Features`,emoji:`✨`},perf:{description:`A code change that improves performance`,title:`Performance Improvements`,emoji:`🚀`},fix:{description:`A bug fix`,title:`Bugfixes`,emoji:`🐛`},docs:{description:`Documentation only changes`,title:`Documentation`,emoji:`📚`},test:{description:`Adding missing tests or correcting existing tests`,title:`Tests`,emoji:`🚨`},style:{description:`Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)`,title:`Styles`,emoji:`💎`},build:{description:`Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)`,title:`Builds`,emoji:`🛠`},refactor:{description:`A code change that neither fixes a bug nor adds a feature`,title:`Code Refactoring`,emoji:`📦`},ci:{description:`Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)`,title:`Continuous Integrations`,emoji:`⚙️`},chore:{description:`Other changes that don't modify src or test files`,title:`Miscellaneous Chores`,emoji:`♻️`},revert:{description:`Reverts a previous commit`,title:`Reverts`,emoji:`🗑`}},h=e=>{if(Array.isArray(e))return e.reduce((e,t)=>(e[t]={},e),{});if(typeof e!=`string`)return e;switch(e){case`standard`:return m;case`minimal`:return{feat:m.feat,perf:m.perf,fix:m.fix,chore:m.chore}}},g=async t=>{let{default:{parserPreset:n,prompt:{questions:{type:r,scope:i,...a},...o},rules:s}}=await import(`./lib-BQYBZSwc.js`),c=h((t==null?void 0:t.types)??`standard`),l=await p((t==null?void 0:t.autoScopes)??!0,t==null?void 0:t.scopes);return{helpUrl:`use 'pnpm commit' to create commit instead`,parserPreset:n,rules:{...s,"type-enum":[e.Error,`always`,Object.keys(c)],"scope-enum":()=>[e.Error,`always`,l],"subject-max-length":[e.Warning,`always`,80],"body-max-line-length":[e.Warning,`always`,300]},prompt:{...o,questions:{...a,type:{...r,enum:c},scope:{...i,enum:Object.fromEntries(l.map(e=>[e,{}]))}},settings:{enableMultipleScopes:!1}}}};export{e as Severity,g as defineConfig};
|
|
209
3
|
// Generated by @kcconfigs/tsdown
|
|
210
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["cwd","wd","cwd","wd","_scopes: string[]","Severity"],"sources":["../src/apis/projects.ts","../src/apis/scopes.ts","../src/apis/types.ts","../src/index.ts"],"sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { basename, join } from \"node:path\";\nimport { cwd as wd } from \"node:process\";\nimport { findWorkspacePackagesNoCheck } from \"@pnpm/workspace.find-packages\";\nimport { parse } from \"yaml\";\n\nconst findPackages = async (\n\tcwd: string,\n\tpatterns: WithUndefined<string[]>,\n\tincludeRoot: WithUndefined<boolean>,\n) => {\n\tconst packages = await findWorkspacePackagesNoCheck(cwd, {\n\t\tpatterns: patterns ?? [\"**\"],\n\t});\n\n\treturn packages\n\t\t.filter((pkg) => (includeRoot ?? false) || pkg.rootDir !== cwd)\n\t\t.map((pkg) => pkg.manifest.name ?? basename(pkg.rootDirRealPath))\n\t\t.map((name) => (name.startsWith(\"@\") ? name.slice(1) : name));\n};\n\nexport const findPnpmPackages = async (\n\tincludeRoot?: boolean,\n): Promise<string[]> => {\n\tconst cwd = wd();\n\n\tconst pnpmWorkspace = await readFile(join(cwd, \"pnpm-workspace.yaml\"), {\n\t\tencoding: \"utf8\",\n\t});\n\n\tconst workspace = parse(pnpmWorkspace);\n\treturn findPackages(cwd, workspace?.packages, includeRoot);\n};\n\nexport const findNpmPackages = async (\n\tincludeRoot?: boolean,\n): Promise<string[]> => {\n\tconst cwd = wd();\n\n\tconst { workspaces } = JSON.parse(\n\t\tawait readFile(join(cwd, \"package.json\"), {\n\t\t\tencoding: \"utf8\",\n\t\t}),\n\t);\n\treturn findPackages(cwd, workspaces, includeRoot);\n};\n\nexport const findBunPackages = async (\n\tincludeRoot?: boolean,\n): Promise<string[]> => {\n\treturn findNpmPackages(includeRoot);\n};\n","import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { cwd as wd } from \"node:process\";\nimport { findBunPackages, findNpmPackages, findPnpmPackages } from \"./projects\";\n\n/**\n * Automatically detects and retrieves project scopes based on the package manager in use.\n *\n * Determines the package manager by checking for workspace configuration files:\n * - pnpm: Checks for pnpm-workspace.yaml\n * - bun: Checks for bun.lock or bun.lockb\n * - npm: Falls back to npm package detection\n *\n * @param includeRoot - Whether to include the root package in the results\n * @returns Array of detected project scope names\n */\nconst getAutoScope = (includeRoot: boolean) => {\n\tconst cwd = wd();\n\n\tif (existsSync(join(cwd, \"pnpm-workspace.yaml\"))) {\n\t\treturn findPnpmPackages(includeRoot);\n\t} else if (\n\t\texistsSync(join(cwd, \"bun.lock\")) ||\n\t\texistsSync(join(cwd, \"bun.lockb\"))\n\t) {\n\t\treturn findBunPackages(includeRoot);\n\t}\n\n\treturn findNpmPackages(includeRoot);\n};\n\n/**\n * Retrieves a merged list of commit scopes based on automatic detection and user input.\n *\n * Combines user-provided scopes with automatically detected project scopes.\n * If no scopes are provided, returns a default set of common scope categories.\n *\n * @param auto - Whether to automatically detect scopes from workspace packages\n * @param scopes - Optional user-provided scopes to include\n * @returns Merged array of all available scopes\n *\n */\nexport const getScopes = async (\n\tauto: boolean,\n\tscopes?: string[],\n): Promise<string[]> => {\n\tconst _scopes: string[] = [];\n\n\tif (scopes) _scopes.push(...scopes);\n\tif (auto) _scopes.push(...(await getAutoScope(false)));\n\n\tif (_scopes.length === 0) {\n\t\t_scopes.push(\"core\", \"config\", \"script\", \"deps\", \"deps-dev\");\n\t}\n\treturn _scopes;\n};\n","export interface TypeEnum {\n\tdescription?: string;\n\ttitle?: string;\n\temoji?: string;\n}\n\nexport type TypeObject = Record<string, TypeEnum>;\n\nexport type TypeMode = \"standard\" | \"minimal\" | string[] | TypeObject;\n\nconst STANDARD_TYPES = {\n\tfeat: {\n\t\tdescription: \"A new feature\",\n\t\ttitle: \"Features\",\n\t\temoji: \"✨\",\n\t},\n\tperf: {\n\t\tdescription: \"A code change that improves performance\",\n\t\ttitle: \"Performance Improvements\",\n\t\temoji: \"🚀\",\n\t},\n\tfix: {\n\t\tdescription: \"A bug fix\",\n\t\ttitle: \"Bugfixes\",\n\t\temoji: \"🐛\",\n\t},\n\tdocs: {\n\t\tdescription: \"Documentation only changes\",\n\t\ttitle: \"Documentation\",\n\t\temoji: \"📚\",\n\t},\n\ttest: {\n\t\tdescription: \"Adding missing tests or correcting existing tests\",\n\t\ttitle: \"Tests\",\n\t\temoji: \"🚨\",\n\t},\n\tstyle: {\n\t\tdescription:\n\t\t\t\"Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)\",\n\t\ttitle: \"Styles\",\n\t\temoji: \"💎\",\n\t},\n\tbuild: {\n\t\tdescription:\n\t\t\t\"Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)\",\n\t\ttitle: \"Builds\",\n\t\temoji: \"🛠\",\n\t},\n\trefactor: {\n\t\tdescription: \"A code change that neither fixes a bug nor adds a feature\",\n\t\ttitle: \"Code Refactoring\",\n\t\temoji: \"📦\",\n\t},\n\tci: {\n\t\tdescription:\n\t\t\t\"Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)\",\n\t\ttitle: \"Continuous Integrations\",\n\t\temoji: \"⚙️\",\n\t},\n\tchore: {\n\t\tdescription: \"Other changes that don't modify src or test files\",\n\t\ttitle: \"Miscellaneous Chores\",\n\t\temoji: \"♻️\",\n\t},\n\trevert: {\n\t\tdescription: \"Reverts a previous commit\",\n\t\ttitle: \"Reverts\",\n\t\temoji: \"🗑\",\n\t},\n} satisfies TypeObject;\n\n/**\n * Retrieves commit types based on the specified mode.\n *\n * Returns a predefined list of commit types for standard or kc modes,\n * or a custom list if an array or object is provided.\n *\n * @param mode - The commit type mode: \"standard\", \"kc\", or a custom object\n * @returns Map of type object\n */\nexport const getTypes = (mode: TypeMode): TypeObject => {\n\tif (Array.isArray(mode)) {\n\t\treturn mode.reduce((acc, type) => {\n\t\t\tacc[type] = {};\n\t\t\treturn acc;\n\t\t}, {} as TypeObject);\n\t}\n\tif (typeof mode !== \"string\") {\n\t\treturn mode;\n\t}\n\n\tswitch (mode) {\n\t\tcase \"standard\":\n\t\t\treturn STANDARD_TYPES;\n\t\tcase \"minimal\":\n\t\t\treturn {\n\t\t\t\tfeat: STANDARD_TYPES.feat,\n\t\t\t\tperf: STANDARD_TYPES.perf,\n\t\t\t\tfix: STANDARD_TYPES.fix,\n\t\t\t\tchore: STANDARD_TYPES.chore,\n\t\t\t};\n\t}\n};\n","import {\n\tRuleConfigSeverity as Severity,\n\ttype UserConfig,\n} from \"@commitlint/types\";\n\nimport { getScopes } from \"./apis/scopes\";\nimport { getTypes, type TypeMode } from \"./apis/types\";\n\nexport interface DefineConfigParams {\n\t/**\n\t * Commit types configuration\n\t * - `\"standard\"`: Use standard conventional commit types\n\t * - `string[]`: Use custom types\n\t * @default \"standard\"\n\t */\n\ttypes?: TypeMode;\n\t/**\n\t * Automatically gather scopes from pnpm workspaces\n\t * @default true\n\t */\n\tautoScopes?: boolean;\n\t/**\n\t * Provide additional scopes; or override if `autoScopes` is false\n\t */\n\tscopes?: string[];\n}\n\n/**\n * Defines a commitlint configuration with automatic workspace scope detection and customizable commit types.\n *\n * @param params - Configuration options\n * @returns A commitlint configuration object\n */\nexport const defineConfig = async (\n\tparams?: DefineConfigParams,\n): Promise<UserConfig> => {\n\tconst {\n\t\tdefault: {\n\t\t\tparserPreset,\n\t\t\tprompt: {\n\t\t\t\tquestions: { type, scope, ...questions },\n\t\t\t\t...prompt\n\t\t\t},\n\t\t\trules,\n\t\t},\n\t} = await import(\"@commitlint/config-conventional\");\n\n\tconst types = getTypes(params?.types ?? \"standard\");\n\tconst scopes = await getScopes(params?.autoScopes ?? true, params?.scopes);\n\n\treturn {\n\t\thelpUrl: \"use 'pnpm commit' to create commit instead\",\n\t\tparserPreset,\n\t\trules: {\n\t\t\t...rules,\n\t\t\t\"type-enum\": [Severity.Error, \"always\", Object.keys(types)],\n\t\t\t\"scope-enum\": () => [Severity.Error, \"always\", scopes],\n\t\t\t\"subject-max-length\": [Severity.Warning, \"always\", 80],\n\t\t\t\"body-max-line-length\": [Severity.Warning, \"always\", 300],\n\t\t},\n\t\tprompt: {\n\t\t\t...prompt,\n\t\t\tquestions: {\n\t\t\t\t...questions,\n\t\t\t\ttype: {\n\t\t\t\t\t...type,\n\t\t\t\t\tenum: types,\n\t\t\t\t},\n\t\t\t\tscope: {\n\t\t\t\t\t...scope,\n\t\t\t\t\tenum: Object.fromEntries(scopes.map((s) => [s, {}])),\n\t\t\t\t},\n\t\t\t},\n\t\t\tsettings: {\n\t\t\t\tenableMultipleScopes: false,\n\t\t\t},\n\t\t},\n\t};\n};\n\nexport { Severity };\nexport type { UserConfig };\n"],"mappings":";;;;;;;;;;AAMA,MAAM,eAAe,OACpB,OACA,UACA,gBACI;AAKJ,SAJiB,MAAM,6BAA6BA,OAAK,EACxD,UAAU,YAA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aAAa;IAACC,mBAAS;IAAO;IAAU,OAAO,KAAK,MAAM;IAAC;GAC3D,oBAAoB;IAACA,mBAAS;IAAO;IAAU;IAAO;GACtD,sBAAsB;IAACA,mBAAS;IAAS;IAAU;IAAG;GACtD,wBAAwB;IAACA,mBAAS;IAAS;IAAU;IAAI;GACzD;EACD,QAAQ;GACP,GAAG;GACH,WAAW;IACV,GAAG;IACH,MAAM;KACL,GAAG;KACH,MAAM;KACN;IACD,OAAO;KACN,GAAG;KACH,MAAM,OAAO,YAAY,OAAO,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;KACpD;IACD;GACD,UAAU,EACT,sBAAsB,OACtB;GACD;EACD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["cwd","wd","cwd","wd","_scopes: string[]","Severity"],"sources":["../src/apis/projects.ts","../src/apis/scopes.ts","../src/apis/types.ts","../src/index.ts"],"sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { basename, join } from \"node:path\";\nimport { cwd as wd } from \"node:process\";\nimport { findWorkspacePackagesNoCheck } from \"@pnpm/workspace.find-packages\";\nimport { parse } from \"yaml\";\n\nconst findPackages = async (\n\tcwd: string,\n\tpatterns: WithUndefined<string[]>,\n\tincludeRoot: WithUndefined<boolean>,\n) => {\n\tconst packages = await findWorkspacePackagesNoCheck(cwd, {\n\t\tpatterns: patterns ?? [\"**\"],\n\t});\n\n\treturn packages\n\t\t.filter((pkg) => (includeRoot ?? false) || pkg.rootDir !== cwd)\n\t\t.map((pkg) => pkg.manifest.name ?? basename(pkg.rootDirRealPath))\n\t\t.map((name) => (name.startsWith(\"@\") ? name.slice(1) : name));\n};\n\nexport const findPnpmPackages = async (\n\tincludeRoot?: boolean,\n): Promise<string[]> => {\n\tconst cwd = wd();\n\n\tconst pnpmWorkspace = await readFile(join(cwd, \"pnpm-workspace.yaml\"), {\n\t\tencoding: \"utf8\",\n\t});\n\n\tconst workspace = parse(pnpmWorkspace);\n\treturn findPackages(cwd, workspace?.packages, includeRoot);\n};\n\nexport const findNpmPackages = async (\n\tincludeRoot?: boolean,\n): Promise<string[]> => {\n\tconst cwd = wd();\n\n\tconst { workspaces } = JSON.parse(\n\t\tawait readFile(join(cwd, \"package.json\"), {\n\t\t\tencoding: \"utf8\",\n\t\t}),\n\t);\n\treturn findPackages(cwd, workspaces, includeRoot);\n};\n\nexport const findBunPackages = async (\n\tincludeRoot?: boolean,\n): Promise<string[]> => {\n\treturn findNpmPackages(includeRoot);\n};\n","import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { cwd as wd } from \"node:process\";\nimport { findBunPackages, findNpmPackages, findPnpmPackages } from \"./projects\";\n\n/**\n * Automatically detects and retrieves project scopes based on the package manager in use.\n *\n * Determines the package manager by checking for workspace configuration files:\n * - pnpm: Checks for pnpm-workspace.yaml\n * - bun: Checks for bun.lock or bun.lockb\n * - npm: Falls back to npm package detection\n *\n * @param includeRoot - Whether to include the root package in the results\n * @returns Array of detected project scope names\n */\nconst getAutoScope = (includeRoot: boolean) => {\n\tconst cwd = wd();\n\n\tif (existsSync(join(cwd, \"pnpm-workspace.yaml\"))) {\n\t\treturn findPnpmPackages(includeRoot);\n\t} else if (\n\t\texistsSync(join(cwd, \"bun.lock\")) ||\n\t\texistsSync(join(cwd, \"bun.lockb\"))\n\t) {\n\t\treturn findBunPackages(includeRoot);\n\t}\n\n\treturn findNpmPackages(includeRoot);\n};\n\n/**\n * Retrieves a merged list of commit scopes based on automatic detection and user input.\n *\n * Combines user-provided scopes with automatically detected project scopes.\n * If no scopes are provided, returns a default set of common scope categories.\n *\n * @param auto - Whether to automatically detect scopes from workspace packages\n * @param scopes - Optional user-provided scopes to include\n * @returns Merged array of all available scopes\n *\n */\nexport const getScopes = async (\n\tauto: boolean,\n\tscopes?: string[],\n): Promise<string[]> => {\n\tconst _scopes: string[] = [];\n\n\tif (scopes) _scopes.push(...scopes);\n\tif (auto) _scopes.push(...(await getAutoScope(false)));\n\n\tif (_scopes.length === 0) {\n\t\t_scopes.push(\"core\", \"config\", \"script\", \"deps\", \"deps-dev\");\n\t}\n\treturn _scopes;\n};\n","export interface TypeEnum {\n\tdescription?: string;\n\ttitle?: string;\n\temoji?: string;\n}\n\nexport type TypeObject = Record<string, TypeEnum>;\n\nexport type TypeMode = \"standard\" | \"minimal\" | string[] | TypeObject;\n\nconst STANDARD_TYPES = {\n\tfeat: {\n\t\tdescription: \"A new feature\",\n\t\ttitle: \"Features\",\n\t\temoji: \"✨\",\n\t},\n\tperf: {\n\t\tdescription: \"A code change that improves performance\",\n\t\ttitle: \"Performance Improvements\",\n\t\temoji: \"🚀\",\n\t},\n\tfix: {\n\t\tdescription: \"A bug fix\",\n\t\ttitle: \"Bugfixes\",\n\t\temoji: \"🐛\",\n\t},\n\tdocs: {\n\t\tdescription: \"Documentation only changes\",\n\t\ttitle: \"Documentation\",\n\t\temoji: \"📚\",\n\t},\n\ttest: {\n\t\tdescription: \"Adding missing tests or correcting existing tests\",\n\t\ttitle: \"Tests\",\n\t\temoji: \"🚨\",\n\t},\n\tstyle: {\n\t\tdescription:\n\t\t\t\"Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)\",\n\t\ttitle: \"Styles\",\n\t\temoji: \"💎\",\n\t},\n\tbuild: {\n\t\tdescription:\n\t\t\t\"Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)\",\n\t\ttitle: \"Builds\",\n\t\temoji: \"🛠\",\n\t},\n\trefactor: {\n\t\tdescription: \"A code change that neither fixes a bug nor adds a feature\",\n\t\ttitle: \"Code Refactoring\",\n\t\temoji: \"📦\",\n\t},\n\tci: {\n\t\tdescription:\n\t\t\t\"Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)\",\n\t\ttitle: \"Continuous Integrations\",\n\t\temoji: \"⚙️\",\n\t},\n\tchore: {\n\t\tdescription: \"Other changes that don't modify src or test files\",\n\t\ttitle: \"Miscellaneous Chores\",\n\t\temoji: \"♻️\",\n\t},\n\trevert: {\n\t\tdescription: \"Reverts a previous commit\",\n\t\ttitle: \"Reverts\",\n\t\temoji: \"🗑\",\n\t},\n} satisfies TypeObject;\n\n/**\n * Retrieves commit types based on the specified mode.\n *\n * Returns a predefined list of commit types for standard or kc modes,\n * or a custom list if an array or object is provided.\n *\n * @param mode - The commit type mode: \"standard\", \"kc\", or a custom object\n * @returns Map of type object\n */\nexport const getTypes = (mode: TypeMode): TypeObject => {\n\tif (Array.isArray(mode)) {\n\t\treturn mode.reduce((acc, type) => {\n\t\t\tacc[type] = {};\n\t\t\treturn acc;\n\t\t}, {} as TypeObject);\n\t}\n\tif (typeof mode !== \"string\") {\n\t\treturn mode;\n\t}\n\n\tswitch (mode) {\n\t\tcase \"standard\":\n\t\t\treturn STANDARD_TYPES;\n\t\tcase \"minimal\":\n\t\t\treturn {\n\t\t\t\tfeat: STANDARD_TYPES.feat,\n\t\t\t\tperf: STANDARD_TYPES.perf,\n\t\t\t\tfix: STANDARD_TYPES.fix,\n\t\t\t\tchore: STANDARD_TYPES.chore,\n\t\t\t};\n\t}\n};\n","import {\n\tRuleConfigSeverity as Severity,\n\ttype UserConfig,\n} from \"@commitlint/types\";\n\nimport { getScopes } from \"./apis/scopes\";\nimport { getTypes, type TypeMode } from \"./apis/types\";\n\nexport interface DefineConfigParams {\n\t/**\n\t * Commit types configuration\n\t * - `\"standard\"`: Use standard conventional commit types\n\t * - `string[]`: Use custom types\n\t * @default \"standard\"\n\t */\n\ttypes?: TypeMode;\n\t/**\n\t * Automatically gather scopes from pnpm workspaces\n\t * @default true\n\t */\n\tautoScopes?: boolean;\n\t/**\n\t * Provide additional scopes; or override if `autoScopes` is false\n\t */\n\tscopes?: string[];\n}\n\n/**\n * Defines a commitlint configuration with automatic workspace scope detection and customizable commit types.\n *\n * @param params - Configuration options\n * @returns A commitlint configuration object\n */\nexport const defineConfig = async (\n\tparams?: DefineConfigParams,\n): Promise<UserConfig> => {\n\tconst {\n\t\tdefault: {\n\t\t\tparserPreset,\n\t\t\tprompt: {\n\t\t\t\tquestions: { type, scope, ...questions },\n\t\t\t\t...prompt\n\t\t\t},\n\t\t\trules,\n\t\t},\n\t} = await import(\"@commitlint/config-conventional\");\n\n\tconst types = getTypes(params?.types ?? \"standard\");\n\tconst scopes = await getScopes(params?.autoScopes ?? true, params?.scopes);\n\n\treturn {\n\t\thelpUrl: \"use 'pnpm commit' to create commit instead\",\n\t\tparserPreset,\n\t\trules: {\n\t\t\t...rules,\n\t\t\t\"type-enum\": [Severity.Error, \"always\", Object.keys(types)],\n\t\t\t\"scope-enum\": () => [Severity.Error, \"always\", scopes],\n\t\t\t\"subject-max-length\": [Severity.Warning, \"always\", 80],\n\t\t\t\"body-max-line-length\": [Severity.Warning, \"always\", 300],\n\t\t},\n\t\tprompt: {\n\t\t\t...prompt,\n\t\t\tquestions: {\n\t\t\t\t...questions,\n\t\t\t\ttype: {\n\t\t\t\t\t...type,\n\t\t\t\t\tenum: types,\n\t\t\t\t},\n\t\t\t\tscope: {\n\t\t\t\t\t...scope,\n\t\t\t\t\tenum: Object.fromEntries(scopes.map((s) => [s, {}])),\n\t\t\t\t},\n\t\t\t},\n\t\t\tsettings: {\n\t\t\t\tenableMultipleScopes: false,\n\t\t\t},\n\t\t},\n\t};\n};\n\nexport { Severity };\nexport type { UserConfig };\n"],"mappings":";mTAMA,MAAM,EAAe,MACpB,EACA,EACA,KAEiB,MAAM,EAA6BA,EAAK,CACxD,SAAU,GAAY,CAAC,KAAK,CAC5B,CAAC,EAGA,OAAQ,IAAS,GAAe,KAAU,EAAI,UAAYA,EAAI,CAC9D,IAAK,GAAQ,EAAI,SAAS,MAAQ,EAAS,EAAI,gBAAgB,CAAC,CAChE,IAAK,GAAU,EAAK,WAAW,IAAI,CAAG,EAAK,MAAM,EAAE,CAAG,EAAM,CAGlD,EAAmB,KAC/B,IACuB,CACvB,IAAMA,EAAMC,GAAI,CAMV,EAAY,EAJI,MAAM,EAAS,EAAKD,EAAK,sBAAsB,CAAE,CACtE,SA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,0 +1,4 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
var e;(function(e){e[e.Disabled=0]=`Disabled`,e[e.Warning=1]=`Warning`,e[e.Error=2]=`Error`})(e||(e={}));var t;(function(e){e[e.User=0]=`User`,e[e.Qualified=1]=`Qualified`})(t||(t={}));export{e as t};
|
|
3
|
+
// Generated by @kcconfigs/tsdown
|
|
4
|
+
//# sourceMappingURL=lib-B8xWHCsG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib-
|
|
1
|
+
{"version":3,"file":"lib-B8xWHCsG.js","names":[],"sources":["../../../../node_modules/.pnpm/@commitlint+types@20.2.0/node_modules/@commitlint/types/lib/rules.js"],"sourcesContent":["/**\n * Rules always have a severity.\n * Severity indicates what to do if the rule is found to be broken\n * 0 - Disable this rule\n * 1 - Warn for violations\n * 2 - Error for violations\n */\nexport var RuleConfigSeverity;\n(function (RuleConfigSeverity) {\n RuleConfigSeverity[RuleConfigSeverity[\"Disabled\"] = 0] = \"Disabled\";\n RuleConfigSeverity[RuleConfigSeverity[\"Warning\"] = 1] = \"Warning\";\n RuleConfigSeverity[RuleConfigSeverity[\"Error\"] = 2] = \"Error\";\n})(RuleConfigSeverity || (RuleConfigSeverity = {}));\nexport var RuleConfigQuality;\n(function (RuleConfigQuality) {\n RuleConfigQuality[RuleConfigQuality[\"User\"] = 0] = \"User\";\n RuleConfigQuality[RuleConfigQuality[\"Qualified\"] = 1] = \"Qualified\";\n})(RuleConfigQuality || (RuleConfigQuality = {}));\n//# sourceMappingURL=rules.js.map"],"x_google_ignoreList":[0],"mappings":";AAOA,IAAW,GACV,SAAU,EAAoB,CAC3B,EAAmB,EAAmB,SAAc,GAAK,WACzD,EAAmB,EAAmB,QAAa,GAAK,UACxD,EAAmB,EAAmB,MAAW,GAAK,UACvD,IAAuB,EAAqB,EAAE,EAAE,CACnD,IAAW,GACV,SAAU,EAAmB,CAC1B,EAAkB,EAAkB,KAAU,GAAK,OACnD,EAAkB,EAAkB,UAAe,GAAK,cACzD,IAAsB,EAAoB,EAAE,EAAE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
import{t as e}from"./lib-B8xWHCsG.js";var t={parserPreset:`conventional-changelog-conventionalcommits`,rules:{"body-leading-blank":[e.Warning,`always`],"body-max-line-length":[e.Error,`always`,100],"footer-leading-blank":[e.Warning,`always`],"footer-max-line-length":[e.Error,`always`,100],"header-max-length":[e.Error,`always`,100],"header-trim":[e.Error,`always`],"subject-case":[e.Error,`never`,[`sentence-case`,`start-case`,`pascal-case`,`upper-case`]],"subject-empty":[e.Error,`never`],"subject-full-stop":[e.Error,`never`,`.`],"type-case":[e.Error,`always`,`lower-case`],"type-empty":[e.Error,`never`],"type-enum":[e.Error,`always`,[`build`,`chore`,`ci`,`docs`,`feat`,`fix`,`perf`,`refactor`,`revert`,`style`,`test`]]},prompt:{questions:{type:{description:`Select the type of change that you're committing`,enum:{feat:{description:`A new feature`,title:`Features`,emoji:`✨`},fix:{description:`A bug fix`,title:`Bug Fixes`,emoji:`🐛`},docs:{description:`Documentation only changes`,title:`Documentation`,emoji:`📚`},style:{description:`Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)`,title:`Styles`,emoji:`💎`},refactor:{description:`A code change that neither fixes a bug nor adds a feature`,title:`Code Refactoring`,emoji:`📦`},perf:{description:`A code change that improves performance`,title:`Performance Improvements`,emoji:`🚀`},test:{description:`Adding missing tests or correcting existing tests`,title:`Tests`,emoji:`🚨`},build:{description:`Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)`,title:`Builds`,emoji:`🛠`},ci:{description:`Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)`,title:`Continuous Integrations`,emoji:`⚙️`},chore:{description:`Other changes that don't modify src or test files`,title:`Chores`,emoji:`♻️`},revert:{description:`Reverts a previous commit`,title:`Reverts`,emoji:`🗑`}}},scope:{description:`What is the scope of this change (e.g. component or file name)`},subject:{description:`Write a short, imperative tense description of the change`},body:{description:`Provide a longer description of the change`},isBreaking:{description:`Are there any breaking changes?`},breakingBody:{description:`A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself`},breaking:{description:`Describe the breaking changes`},isIssueAffected:{description:`Does this change affect any open issues?`},issuesBody:{description:`If issues are closed, the commit requires a body. Please enter a longer description of the commit itself`},issues:{description:`Add issue references (e.g. "fix #123", "re #123".)`}}}};export{t as default};
|
|
3
|
+
// Generated by @kcconfigs/tsdown
|
|
4
|
+
//# sourceMappingURL=lib-BQYBZSwc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib-
|
|
1
|
+
{"version":3,"file":"lib-BQYBZSwc.js","names":[],"sources":["../../../../node_modules/.pnpm/@commitlint+config-conventional@20.2.0/node_modules/@commitlint/config-conventional/lib/index.js"],"sourcesContent":["import { RuleConfigSeverity, } from \"@commitlint/types\";\nexport default {\n parserPreset: \"conventional-changelog-conventionalcommits\",\n rules: {\n \"body-leading-blank\": [RuleConfigSeverity.Warning, \"always\"],\n \"body-max-line-length\": [RuleConfigSeverity.Error, \"always\", 100],\n \"footer-leading-blank\": [RuleConfigSeverity.Warning, \"always\"],\n \"footer-max-line-length\": [\n RuleConfigSeverity.Error,\n \"always\",\n 100,\n ],\n \"header-max-length\": [RuleConfigSeverity.Error, \"always\", 100],\n \"header-trim\": [RuleConfigSeverity.Error, \"always\"],\n \"subject-case\": [\n RuleConfigSeverity.Error,\n \"never\",\n [\"sentence-case\", \"start-case\", \"pascal-case\", \"upper-case\"],\n ],\n \"subject-empty\": [RuleConfigSeverity.Error, \"never\"],\n \"subject-full-stop\": [RuleConfigSeverity.Error, \"never\", \".\"],\n \"type-case\": [RuleConfigSeverity.Error, \"always\", \"lower-case\"],\n \"type-empty\": [RuleConfigSeverity.Error, \"never\"],\n \"type-enum\": [\n RuleConfigSeverity.Error,\n \"always\",\n [\n \"build\",\n \"chore\",\n \"ci\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"perf\",\n \"refactor\",\n \"revert\",\n \"style\",\n \"test\",\n ],\n ],\n },\n prompt: {\n questions: {\n type: {\n description: \"Select the type of change that you're committing\",\n enum: {\n feat: {\n description: \"A new feature\",\n title: \"Features\",\n emoji: \"✨\",\n },\n fix: {\n description: \"A bug fix\",\n title: \"Bug Fixes\",\n emoji: \"🐛\",\n },\n docs: {\n description: \"Documentation only changes\",\n title: \"Documentation\",\n emoji: \"📚\",\n },\n style: {\n description: \"Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)\",\n title: \"Styles\",\n emoji: \"💎\",\n },\n refactor: {\n description: \"A code change that neither fixes a bug nor adds a feature\",\n title: \"Code Refactoring\",\n emoji: \"📦\",\n },\n perf: {\n description: \"A code change that improves performance\",\n title: \"Performance Improvements\",\n emoji: \"🚀\",\n },\n test: {\n description: \"Adding missing tests or correcting existing tests\",\n title: \"Tests\",\n emoji: \"🚨\",\n },\n build: {\n description: \"Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)\",\n title: \"Builds\",\n emoji: \"🛠\",\n },\n ci: {\n description: \"Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)\",\n title: \"Continuous Integrations\",\n emoji: \"⚙️\",\n },\n chore: {\n description: \"Other changes that don't modify src or test files\",\n title: \"Chores\",\n emoji: \"♻️\",\n },\n revert: {\n description: \"Reverts a previous commit\",\n title: \"Reverts\",\n emoji: \"🗑\",\n },\n },\n },\n scope: {\n description: \"What is the scope of this change (e.g. component or file name)\",\n },\n subject: {\n description: \"Write a short, imperative tense description of the change\",\n },\n body: {\n description: \"Provide a longer description of the change\",\n },\n isBreaking: {\n description: \"Are there any breaking changes?\",\n },\n breakingBody: {\n description: \"A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself\",\n },\n breaking: {\n description: \"Describe the breaking changes\",\n },\n isIssueAffected: {\n description: \"Does this change affect any open issues?\",\n },\n issuesBody: {\n description: \"If issues are closed, the commit requires a body. Please enter a longer description of the commit itself\",\n },\n issues: {\n description: 'Add issue references (e.g. \"fix #123\", \"re #123\".)',\n },\n },\n },\n};\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";sCACA,IAAA,EAAe,CACX,aAAc,6CACd,MAAO,CACH,qBAAsB,CAAC,EAAmB,QAAS,SAAS,CAC5D,uBAAwB,CAAC,EAAmB,MAAO,SAAU,IAAI,CACjE,uBAAwB,CAAC,EAAmB,QAAS,SAAS,CAC9D,yBAA0B,CACtB,EAAmB,MACnB,SACA,IACH,CACD,oBAAqB,CAAC,EAAmB,MAAO,SAAU,IAAI,CAC9D,cAAe,CAAC,EAAmB,MAAO,SAAS,CACnD,eAAgB,CACZ,EAAmB,MACnB,QACA,CAAC,gBAAiB,aAAc,cAAe,aAAa,CAC/D,CACD,gBAAiB,CAAC,EAAmB,MAAO,QAAQ,CACpD,oBAAqB,CAAC,EAAmB,MAAO,QAAS,IAAI,CAC7D,YAAa,CAAC,EAAmB,MAAO,SAAU,aAAa,CAC/D,aAAc,CAAC,EAAmB,MAAO,QAAQ,CACjD,YAAa,CACT,EAAmB,MACnB,SACA,CACI,QACA,QACA,KACA,OACA,OACA,MACA,OACA,WACA,SACA,QACA,OACH,CACJ,CACJ,CACD,OAAQ,CACJ,UAAW,CACP,KAAM,CACF,YAAa,mDACb,KAAM,CACF,KAAM,CACF,YAAa,gBACb,MAAO,WACP,MAAO,IACV,CACD,IAAK,CACD,YAAa,YACb,MAAO,YACP,MAAO,KACV,CACD,KAAM,CACF,YAAa,6BACb,MAAO,gBACP,MAAO,KACV,CACD,MAAO,CACH,YAAa,yGACb,MAAO,SACP,MAAO,KACV,CACD,SAAU,CACN,YAAa,4DACb,MAAO,mBACP,MAAO,KACV,CACD,KAAM,CACF,YAAa,0CACb,MAAO,2BACP,MAAO,KACV,CACD,KAAM,CACF,YAAa,oDACb,MAAO,QACP,MAAO,KACV,CACD,MAAO,CACH,YAAa,sGACb,MAAO,SACP,MAAO,KACV,CACD,GAAI,CACA,YAAa,8GACb,MAAO,0BACP,MAAO,KACV,CACD,MAAO,CACH,YAAa,oDACb,MAAO,SACP,MAAO,KACV,CACD,OAAQ,CACJ,YAAa,4BACb,MAAO,UACP,MAAO,KACV,CACJ,CACJ,CACD,MAAO,CACH,YAAa,iEAChB,CACD,QAAS,CACL,YAAa,4DAChB,CACD,KAAM,CACF,YAAa,6CAChB,CACD,WAAY,CACR,YAAa,kCAChB,CACD,aAAc,CACV,YAAa,mGAChB,CACD,SAAU,CACN,YAAa,gCAChB,CACD,gBAAiB,CACb,YAAa,2CAChB,CACD,WAAY,CACR,YAAa,2GAChB,CACD,OAAQ,CACJ,YAAa,qDAChB,CACJ,CACJ,CACJ"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
var e;(function(e){e[e.Disabled=0]=`Disabled`,e[e.Warning=1]=`Warning`,e[e.Error=2]=`Error`})(e||(e={}));var t;(function(e){e[e.User=0]=`User`,e[e.Qualified=1]=`Qualified`})(t||(t={})),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return e}});
|
|
3
|
+
// Generated by @kcconfigs/tsdown
|
|
4
|
+
//# sourceMappingURL=lib-BmsL4Q0l.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib-
|
|
1
|
+
{"version":3,"file":"lib-BmsL4Q0l.cjs","names":[],"sources":["../../../../node_modules/.pnpm/@commitlint+types@20.2.0/node_modules/@commitlint/types/lib/rules.js"],"sourcesContent":["/**\n * Rules always have a severity.\n * Severity indicates what to do if the rule is found to be broken\n * 0 - Disable this rule\n * 1 - Warn for violations\n * 2 - Error for violations\n */\nexport var RuleConfigSeverity;\n(function (RuleConfigSeverity) {\n RuleConfigSeverity[RuleConfigSeverity[\"Disabled\"] = 0] = \"Disabled\";\n RuleConfigSeverity[RuleConfigSeverity[\"Warning\"] = 1] = \"Warning\";\n RuleConfigSeverity[RuleConfigSeverity[\"Error\"] = 2] = \"Error\";\n})(RuleConfigSeverity || (RuleConfigSeverity = {}));\nexport var RuleConfigQuality;\n(function (RuleConfigQuality) {\n RuleConfigQuality[RuleConfigQuality[\"User\"] = 0] = \"User\";\n RuleConfigQuality[RuleConfigQuality[\"Qualified\"] = 1] = \"Qualified\";\n})(RuleConfigQuality || (RuleConfigQuality = {}));\n//# sourceMappingURL=rules.js.map"],"x_google_ignoreList":[0],"mappings":";AAOA,IAAW,GACV,SAAU,EAAoB,CAC3B,EAAmB,EAAmB,SAAc,GAAK,WACzD,EAAmB,EAAmB,QAAa,GAAK,UACxD,EAAmB,EAAmB,MAAW,GAAK,UACvD,IAAuB,EAAqB,EAAE,EAAE,CACnD,IAAW,GACV,SAAU,EAAmB,CAC1B,EAAkB,EAAkB,KAAU,GAAK,OACnD,EAAkB,EAAkB,UAAe,GAAK,cACzD,IAAsB,EAAoB,EAAE,EAAE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
const e=require(`./lib-BmsL4Q0l.cjs`);var t={parserPreset:`conventional-changelog-conventionalcommits`,rules:{"body-leading-blank":[e.t.Warning,`always`],"body-max-line-length":[e.t.Error,`always`,100],"footer-leading-blank":[e.t.Warning,`always`],"footer-max-line-length":[e.t.Error,`always`,100],"header-max-length":[e.t.Error,`always`,100],"header-trim":[e.t.Error,`always`],"subject-case":[e.t.Error,`never`,[`sentence-case`,`start-case`,`pascal-case`,`upper-case`]],"subject-empty":[e.t.Error,`never`],"subject-full-stop":[e.t.Error,`never`,`.`],"type-case":[e.t.Error,`always`,`lower-case`],"type-empty":[e.t.Error,`never`],"type-enum":[e.t.Error,`always`,[`build`,`chore`,`ci`,`docs`,`feat`,`fix`,`perf`,`refactor`,`revert`,`style`,`test`]]},prompt:{questions:{type:{description:`Select the type of change that you're committing`,enum:{feat:{description:`A new feature`,title:`Features`,emoji:`✨`},fix:{description:`A bug fix`,title:`Bug Fixes`,emoji:`🐛`},docs:{description:`Documentation only changes`,title:`Documentation`,emoji:`📚`},style:{description:`Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)`,title:`Styles`,emoji:`💎`},refactor:{description:`A code change that neither fixes a bug nor adds a feature`,title:`Code Refactoring`,emoji:`📦`},perf:{description:`A code change that improves performance`,title:`Performance Improvements`,emoji:`🚀`},test:{description:`Adding missing tests or correcting existing tests`,title:`Tests`,emoji:`🚨`},build:{description:`Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)`,title:`Builds`,emoji:`🛠`},ci:{description:`Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)`,title:`Continuous Integrations`,emoji:`⚙️`},chore:{description:`Other changes that don't modify src or test files`,title:`Chores`,emoji:`♻️`},revert:{description:`Reverts a previous commit`,title:`Reverts`,emoji:`🗑`}}},scope:{description:`What is the scope of this change (e.g. component or file name)`},subject:{description:`Write a short, imperative tense description of the change`},body:{description:`Provide a longer description of the change`},isBreaking:{description:`Are there any breaking changes?`},breakingBody:{description:`A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself`},breaking:{description:`Describe the breaking changes`},isIssueAffected:{description:`Does this change affect any open issues?`},issuesBody:{description:`If issues are closed, the commit requires a body. Please enter a longer description of the commit itself`},issues:{description:`Add issue references (e.g. "fix #123", "re #123".)`}}}};exports.default=t;
|
|
3
|
+
// Generated by @kcconfigs/tsdown
|
|
4
|
+
//# sourceMappingURL=lib-CewO3LXT.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib-
|
|
1
|
+
{"version":3,"file":"lib-CewO3LXT.cjs","names":["RuleConfigSeverity"],"sources":["../../../../node_modules/.pnpm/@commitlint+config-conventional@20.2.0/node_modules/@commitlint/config-conventional/lib/index.js"],"sourcesContent":["import { RuleConfigSeverity, } from \"@commitlint/types\";\nexport default {\n parserPreset: \"conventional-changelog-conventionalcommits\",\n rules: {\n \"body-leading-blank\": [RuleConfigSeverity.Warning, \"always\"],\n \"body-max-line-length\": [RuleConfigSeverity.Error, \"always\", 100],\n \"footer-leading-blank\": [RuleConfigSeverity.Warning, \"always\"],\n \"footer-max-line-length\": [\n RuleConfigSeverity.Error,\n \"always\",\n 100,\n ],\n \"header-max-length\": [RuleConfigSeverity.Error, \"always\", 100],\n \"header-trim\": [RuleConfigSeverity.Error, \"always\"],\n \"subject-case\": [\n RuleConfigSeverity.Error,\n \"never\",\n [\"sentence-case\", \"start-case\", \"pascal-case\", \"upper-case\"],\n ],\n \"subject-empty\": [RuleConfigSeverity.Error, \"never\"],\n \"subject-full-stop\": [RuleConfigSeverity.Error, \"never\", \".\"],\n \"type-case\": [RuleConfigSeverity.Error, \"always\", \"lower-case\"],\n \"type-empty\": [RuleConfigSeverity.Error, \"never\"],\n \"type-enum\": [\n RuleConfigSeverity.Error,\n \"always\",\n [\n \"build\",\n \"chore\",\n \"ci\",\n \"docs\",\n \"feat\",\n \"fix\",\n \"perf\",\n \"refactor\",\n \"revert\",\n \"style\",\n \"test\",\n ],\n ],\n },\n prompt: {\n questions: {\n type: {\n description: \"Select the type of change that you're committing\",\n enum: {\n feat: {\n description: \"A new feature\",\n title: \"Features\",\n emoji: \"✨\",\n },\n fix: {\n description: \"A bug fix\",\n title: \"Bug Fixes\",\n emoji: \"🐛\",\n },\n docs: {\n description: \"Documentation only changes\",\n title: \"Documentation\",\n emoji: \"📚\",\n },\n style: {\n description: \"Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)\",\n title: \"Styles\",\n emoji: \"💎\",\n },\n refactor: {\n description: \"A code change that neither fixes a bug nor adds a feature\",\n title: \"Code Refactoring\",\n emoji: \"📦\",\n },\n perf: {\n description: \"A code change that improves performance\",\n title: \"Performance Improvements\",\n emoji: \"🚀\",\n },\n test: {\n description: \"Adding missing tests or correcting existing tests\",\n title: \"Tests\",\n emoji: \"🚨\",\n },\n build: {\n description: \"Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)\",\n title: \"Builds\",\n emoji: \"🛠\",\n },\n ci: {\n description: \"Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)\",\n title: \"Continuous Integrations\",\n emoji: \"⚙️\",\n },\n chore: {\n description: \"Other changes that don't modify src or test files\",\n title: \"Chores\",\n emoji: \"♻️\",\n },\n revert: {\n description: \"Reverts a previous commit\",\n title: \"Reverts\",\n emoji: \"🗑\",\n },\n },\n },\n scope: {\n description: \"What is the scope of this change (e.g. component or file name)\",\n },\n subject: {\n description: \"Write a short, imperative tense description of the change\",\n },\n body: {\n description: \"Provide a longer description of the change\",\n },\n isBreaking: {\n description: \"Are there any breaking changes?\",\n },\n breakingBody: {\n description: \"A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself\",\n },\n breaking: {\n description: \"Describe the breaking changes\",\n },\n isIssueAffected: {\n description: \"Does this change affect any open issues?\",\n },\n issuesBody: {\n description: \"If issues are closed, the commit requires a body. Please enter a longer description of the commit itself\",\n },\n issues: {\n description: 'Add issue references (e.g. \"fix #123\", \"re #123\".)',\n },\n },\n },\n};\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";sCACA,IAAA,EAAe,CACX,aAAc,6CACd,MAAO,CACH,qBAAsB,CAACA,EAAAA,EAAmB,QAAS,SAAS,CAC5D,uBAAwB,CAACA,EAAAA,EAAmB,MAAO,SAAU,IAAI,CACjE,uBAAwB,CAACA,EAAAA,EAAmB,QAAS,SAAS,CAC9D,yBAA0B,CACtBA,EAAAA,EAAmB,MACnB,SACA,IACH,CACD,oBAAqB,CAACA,EAAAA,EAAmB,MAAO,SAAU,IAAI,CAC9D,cAAe,CAACA,EAAAA,EAAmB,MAAO,SAAS,CACnD,eAAgB,CACZA,EAAAA,EAAmB,MACnB,QACA,CAAC,gBAAiB,aAAc,cAAe,aAAa,CAC/D,CACD,gBAAiB,CAACA,EAAAA,EAAmB,MAAO,QAAQ,CACpD,oBAAqB,CAACA,EAAAA,EAAmB,MAAO,QAAS,IAAI,CAC7D,YAAa,CAACA,EAAAA,EAAmB,MAAO,SAAU,aAAa,CAC/D,aAAc,CAACA,EAAAA,EAAmB,MAAO,QAAQ,CACjD,YAAa,CACTA,EAAAA,EAAmB,MACnB,SACA,CACI,QACA,QACA,KACA,OACA,OACA,MACA,OACA,WACA,SACA,QACA,OACH,CACJ,CACJ,CACD,OAAQ,CACJ,UAAW,CACP,KAAM,CACF,YAAa,mDACb,KAAM,CACF,KAAM,CACF,YAAa,gBACb,MAAO,WACP,MAAO,IACV,CACD,IAAK,CACD,YAAa,YACb,MAAO,YACP,MAAO,KACV,CACD,KAAM,CACF,YAAa,6BACb,MAAO,gBACP,MAAO,KACV,CACD,MAAO,CACH,YAAa,yGACb,MAAO,SACP,MAAO,KACV,CACD,SAAU,CACN,YAAa,4DACb,MAAO,mBACP,MAAO,KACV,CACD,KAAM,CACF,YAAa,0CACb,MAAO,2BACP,MAAO,KACV,CACD,KAAM,CACF,YAAa,oDACb,MAAO,QACP,MAAO,KACV,CACD,MAAO,CACH,YAAa,sGACb,MAAO,SACP,MAAO,KACV,CACD,GAAI,CACA,YAAa,8GACb,MAAO,0BACP,MAAO,KACV,CACD,MAAO,CACH,YAAa,oDACb,MAAO,SACP,MAAO,KACV,CACD,OAAQ,CACJ,YAAa,4BACb,MAAO,UACP,MAAO,KACV,CACJ,CACJ,CACD,MAAO,CACH,YAAa,iEAChB,CACD,QAAS,CACL,YAAa,4DAChB,CACD,KAAM,CACF,YAAa,6CAChB,CACD,WAAY,CACR,YAAa,kCAChB,CACD,aAAc,CACV,YAAa,mGAChB,CACD,SAAU,CACN,YAAa,gCAChB,CACD,gBAAiB,CACb,YAAa,2CAChB,CACD,WAAY,CACR,YAAa,2GAChB,CACD,OAAQ,CACJ,YAAa,qDAChB,CACJ,CACJ,CACJ"}
|
package/package.json
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kcconfigs/commitlint",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.2",
|
|
4
4
|
"description": "Shared commitlint configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@pnpm/workspace.find-packages": "1000.0.
|
|
7
|
+
"@pnpm/workspace.find-packages": "1000.0.52",
|
|
8
8
|
"yaml": "2.8.2"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@biomejs/biome": "2.3.10",
|
|
12
12
|
"@commitlint/config-conventional": "20.2.0",
|
|
13
13
|
"@commitlint/types": "20.2.0",
|
|
14
|
-
"tsdown": "0.18.
|
|
14
|
+
"tsdown": "0.18.4",
|
|
15
15
|
"vitest": "4.0.15",
|
|
16
|
-
"@kcconfigs/
|
|
17
|
-
"@kcconfigs/
|
|
18
|
-
"@kcconfigs/
|
|
19
|
-
"@kcconfigs/
|
|
16
|
+
"@kcconfigs/biome": "0.2.1",
|
|
17
|
+
"@kcconfigs/tsconfig": "0.1.0",
|
|
18
|
+
"@kcconfigs/tsdown": "0.1.0-beta.3",
|
|
19
|
+
"@kcconfigs/vitest": "0.1.0-beta.2",
|
|
20
|
+
"@kctypes/generic": "1.30.3"
|
|
20
21
|
},
|
|
21
22
|
"main": "./dist/index.js",
|
|
22
23
|
"types": "./dist/index.d.cts",
|
|
@@ -74,6 +75,6 @@
|
|
|
74
75
|
"format:check": "biome format",
|
|
75
76
|
"lint": "biome lint --fix --unsafe",
|
|
76
77
|
"lint:check": "biome lint",
|
|
77
|
-
"type:check": "tsc --
|
|
78
|
+
"type:check": "tsc --noEmit"
|
|
78
79
|
}
|
|
79
80
|
}
|
package/dist/lib-26NWB_Cl.cjs
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
-
const require_lib = require('./lib-CzUh7oEE.cjs');
|
|
3
|
-
|
|
4
|
-
//#region ../../../node_modules/.pnpm/@commitlint+config-conventional@20.2.0/node_modules/@commitlint/config-conventional/lib/index.js
|
|
5
|
-
var lib_default = {
|
|
6
|
-
parserPreset: "conventional-changelog-conventionalcommits",
|
|
7
|
-
rules: {
|
|
8
|
-
"body-leading-blank": [require_lib.RuleConfigSeverity.Warning, "always"],
|
|
9
|
-
"body-max-line-length": [
|
|
10
|
-
require_lib.RuleConfigSeverity.Error,
|
|
11
|
-
"always",
|
|
12
|
-
100
|
|
13
|
-
],
|
|
14
|
-
"footer-leading-blank": [require_lib.RuleConfigSeverity.Warning, "always"],
|
|
15
|
-
"footer-max-line-length": [
|
|
16
|
-
require_lib.RuleConfigSeverity.Error,
|
|
17
|
-
"always",
|
|
18
|
-
100
|
|
19
|
-
],
|
|
20
|
-
"header-max-length": [
|
|
21
|
-
require_lib.RuleConfigSeverity.Error,
|
|
22
|
-
"always",
|
|
23
|
-
100
|
|
24
|
-
],
|
|
25
|
-
"header-trim": [require_lib.RuleConfigSeverity.Error, "always"],
|
|
26
|
-
"subject-case": [
|
|
27
|
-
require_lib.RuleConfigSeverity.Error,
|
|
28
|
-
"never",
|
|
29
|
-
[
|
|
30
|
-
"sentence-case",
|
|
31
|
-
"start-case",
|
|
32
|
-
"pascal-case",
|
|
33
|
-
"upper-case"
|
|
34
|
-
]
|
|
35
|
-
],
|
|
36
|
-
"subject-empty": [require_lib.RuleConfigSeverity.Error, "never"],
|
|
37
|
-
"subject-full-stop": [
|
|
38
|
-
require_lib.RuleConfigSeverity.Error,
|
|
39
|
-
"never",
|
|
40
|
-
"."
|
|
41
|
-
],
|
|
42
|
-
"type-case": [
|
|
43
|
-
require_lib.RuleConfigSeverity.Error,
|
|
44
|
-
"always",
|
|
45
|
-
"lower-case"
|
|
46
|
-
],
|
|
47
|
-
"type-empty": [require_lib.RuleConfigSeverity.Error, "never"],
|
|
48
|
-
"type-enum": [
|
|
49
|
-
require_lib.RuleConfigSeverity.Error,
|
|
50
|
-
"always",
|
|
51
|
-
[
|
|
52
|
-
"build",
|
|
53
|
-
"chore",
|
|
54
|
-
"ci",
|
|
55
|
-
"docs",
|
|
56
|
-
"feat",
|
|
57
|
-
"fix",
|
|
58
|
-
"perf",
|
|
59
|
-
"refactor",
|
|
60
|
-
"revert",
|
|
61
|
-
"style",
|
|
62
|
-
"test"
|
|
63
|
-
]
|
|
64
|
-
]
|
|
65
|
-
},
|
|
66
|
-
prompt: { questions: {
|
|
67
|
-
type: {
|
|
68
|
-
description: "Select the type of change that you're committing",
|
|
69
|
-
enum: {
|
|
70
|
-
feat: {
|
|
71
|
-
description: "A new feature",
|
|
72
|
-
title: "Features",
|
|
73
|
-
emoji: "✨"
|
|
74
|
-
},
|
|
75
|
-
fix: {
|
|
76
|
-
description: "A bug fix",
|
|
77
|
-
title: "Bug Fixes",
|
|
78
|
-
emoji: "🐛"
|
|
79
|
-
},
|
|
80
|
-
docs: {
|
|
81
|
-
description: "Documentation only changes",
|
|
82
|
-
title: "Documentation",
|
|
83
|
-
emoji: "📚"
|
|
84
|
-
},
|
|
85
|
-
style: {
|
|
86
|
-
description: "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",
|
|
87
|
-
title: "Styles",
|
|
88
|
-
emoji: "💎"
|
|
89
|
-
},
|
|
90
|
-
refactor: {
|
|
91
|
-
description: "A code change that neither fixes a bug nor adds a feature",
|
|
92
|
-
title: "Code Refactoring",
|
|
93
|
-
emoji: "📦"
|
|
94
|
-
},
|
|
95
|
-
perf: {
|
|
96
|
-
description: "A code change that improves performance",
|
|
97
|
-
title: "Performance Improvements",
|
|
98
|
-
emoji: "🚀"
|
|
99
|
-
},
|
|
100
|
-
test: {
|
|
101
|
-
description: "Adding missing tests or correcting existing tests",
|
|
102
|
-
title: "Tests",
|
|
103
|
-
emoji: "🚨"
|
|
104
|
-
},
|
|
105
|
-
build: {
|
|
106
|
-
description: "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)",
|
|
107
|
-
title: "Builds",
|
|
108
|
-
emoji: "🛠"
|
|
109
|
-
},
|
|
110
|
-
ci: {
|
|
111
|
-
description: "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)",
|
|
112
|
-
title: "Continuous Integrations",
|
|
113
|
-
emoji: "⚙️"
|
|
114
|
-
},
|
|
115
|
-
chore: {
|
|
116
|
-
description: "Other changes that don't modify src or test files",
|
|
117
|
-
title: "Chores",
|
|
118
|
-
emoji: "♻️"
|
|
119
|
-
},
|
|
120
|
-
revert: {
|
|
121
|
-
description: "Reverts a previous commit",
|
|
122
|
-
title: "Reverts",
|
|
123
|
-
emoji: "🗑"
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
scope: { description: "What is the scope of this change (e.g. component or file name)" },
|
|
128
|
-
subject: { description: "Write a short, imperative tense description of the change" },
|
|
129
|
-
body: { description: "Provide a longer description of the change" },
|
|
130
|
-
isBreaking: { description: "Are there any breaking changes?" },
|
|
131
|
-
breakingBody: { description: "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself" },
|
|
132
|
-
breaking: { description: "Describe the breaking changes" },
|
|
133
|
-
isIssueAffected: { description: "Does this change affect any open issues?" },
|
|
134
|
-
issuesBody: { description: "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself" },
|
|
135
|
-
issues: { description: "Add issue references (e.g. \"fix #123\", \"re #123\".)" }
|
|
136
|
-
} }
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
//#endregion
|
|
140
|
-
exports.default = lib_default;
|
|
141
|
-
// Generated by @kcconfigs/tsdown
|
|
142
|
-
//# sourceMappingURL=lib-26NWB_Cl.cjs.map
|
package/dist/lib-CzUh7oEE.cjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
-
|
|
3
|
-
//#region ../../../node_modules/.pnpm/@commitlint+types@20.2.0/node_modules/@commitlint/types/lib/rules.js
|
|
4
|
-
/**
|
|
5
|
-
* Rules always have a severity.
|
|
6
|
-
* Severity indicates what to do if the rule is found to be broken
|
|
7
|
-
* 0 - Disable this rule
|
|
8
|
-
* 1 - Warn for violations
|
|
9
|
-
* 2 - Error for violations
|
|
10
|
-
*/
|
|
11
|
-
var RuleConfigSeverity;
|
|
12
|
-
(function(RuleConfigSeverity$1) {
|
|
13
|
-
RuleConfigSeverity$1[RuleConfigSeverity$1["Disabled"] = 0] = "Disabled";
|
|
14
|
-
RuleConfigSeverity$1[RuleConfigSeverity$1["Warning"] = 1] = "Warning";
|
|
15
|
-
RuleConfigSeverity$1[RuleConfigSeverity$1["Error"] = 2] = "Error";
|
|
16
|
-
})(RuleConfigSeverity || (RuleConfigSeverity = {}));
|
|
17
|
-
var RuleConfigQuality;
|
|
18
|
-
(function(RuleConfigQuality$1) {
|
|
19
|
-
RuleConfigQuality$1[RuleConfigQuality$1["User"] = 0] = "User";
|
|
20
|
-
RuleConfigQuality$1[RuleConfigQuality$1["Qualified"] = 1] = "Qualified";
|
|
21
|
-
})(RuleConfigQuality || (RuleConfigQuality = {}));
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
Object.defineProperty(exports, 'RuleConfigSeverity', {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return RuleConfigSeverity;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
// Generated by @kcconfigs/tsdown
|
|
31
|
-
//# sourceMappingURL=lib-CzUh7oEE.cjs.map
|
package/dist/lib-D5qzG1z4.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
-
//#region ../../../node_modules/.pnpm/@commitlint+types@20.2.0/node_modules/@commitlint/types/lib/rules.js
|
|
3
|
-
/**
|
|
4
|
-
* Rules always have a severity.
|
|
5
|
-
* Severity indicates what to do if the rule is found to be broken
|
|
6
|
-
* 0 - Disable this rule
|
|
7
|
-
* 1 - Warn for violations
|
|
8
|
-
* 2 - Error for violations
|
|
9
|
-
*/
|
|
10
|
-
var RuleConfigSeverity;
|
|
11
|
-
(function(RuleConfigSeverity$1) {
|
|
12
|
-
RuleConfigSeverity$1[RuleConfigSeverity$1["Disabled"] = 0] = "Disabled";
|
|
13
|
-
RuleConfigSeverity$1[RuleConfigSeverity$1["Warning"] = 1] = "Warning";
|
|
14
|
-
RuleConfigSeverity$1[RuleConfigSeverity$1["Error"] = 2] = "Error";
|
|
15
|
-
})(RuleConfigSeverity || (RuleConfigSeverity = {}));
|
|
16
|
-
var RuleConfigQuality;
|
|
17
|
-
(function(RuleConfigQuality$1) {
|
|
18
|
-
RuleConfigQuality$1[RuleConfigQuality$1["User"] = 0] = "User";
|
|
19
|
-
RuleConfigQuality$1[RuleConfigQuality$1["Qualified"] = 1] = "Qualified";
|
|
20
|
-
})(RuleConfigQuality || (RuleConfigQuality = {}));
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
export { RuleConfigSeverity as t };
|
|
24
|
-
// Generated by @kcconfigs/tsdown
|
|
25
|
-
//# sourceMappingURL=lib-D5qzG1z4.js.map
|
package/dist/lib-DPex9ONF.js
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
-
import { t as RuleConfigSeverity } from "./lib-D5qzG1z4.js";
|
|
3
|
-
|
|
4
|
-
//#region ../../../node_modules/.pnpm/@commitlint+config-conventional@20.2.0/node_modules/@commitlint/config-conventional/lib/index.js
|
|
5
|
-
var lib_default = {
|
|
6
|
-
parserPreset: "conventional-changelog-conventionalcommits",
|
|
7
|
-
rules: {
|
|
8
|
-
"body-leading-blank": [RuleConfigSeverity.Warning, "always"],
|
|
9
|
-
"body-max-line-length": [
|
|
10
|
-
RuleConfigSeverity.Error,
|
|
11
|
-
"always",
|
|
12
|
-
100
|
|
13
|
-
],
|
|
14
|
-
"footer-leading-blank": [RuleConfigSeverity.Warning, "always"],
|
|
15
|
-
"footer-max-line-length": [
|
|
16
|
-
RuleConfigSeverity.Error,
|
|
17
|
-
"always",
|
|
18
|
-
100
|
|
19
|
-
],
|
|
20
|
-
"header-max-length": [
|
|
21
|
-
RuleConfigSeverity.Error,
|
|
22
|
-
"always",
|
|
23
|
-
100
|
|
24
|
-
],
|
|
25
|
-
"header-trim": [RuleConfigSeverity.Error, "always"],
|
|
26
|
-
"subject-case": [
|
|
27
|
-
RuleConfigSeverity.Error,
|
|
28
|
-
"never",
|
|
29
|
-
[
|
|
30
|
-
"sentence-case",
|
|
31
|
-
"start-case",
|
|
32
|
-
"pascal-case",
|
|
33
|
-
"upper-case"
|
|
34
|
-
]
|
|
35
|
-
],
|
|
36
|
-
"subject-empty": [RuleConfigSeverity.Error, "never"],
|
|
37
|
-
"subject-full-stop": [
|
|
38
|
-
RuleConfigSeverity.Error,
|
|
39
|
-
"never",
|
|
40
|
-
"."
|
|
41
|
-
],
|
|
42
|
-
"type-case": [
|
|
43
|
-
RuleConfigSeverity.Error,
|
|
44
|
-
"always",
|
|
45
|
-
"lower-case"
|
|
46
|
-
],
|
|
47
|
-
"type-empty": [RuleConfigSeverity.Error, "never"],
|
|
48
|
-
"type-enum": [
|
|
49
|
-
RuleConfigSeverity.Error,
|
|
50
|
-
"always",
|
|
51
|
-
[
|
|
52
|
-
"build",
|
|
53
|
-
"chore",
|
|
54
|
-
"ci",
|
|
55
|
-
"docs",
|
|
56
|
-
"feat",
|
|
57
|
-
"fix",
|
|
58
|
-
"perf",
|
|
59
|
-
"refactor",
|
|
60
|
-
"revert",
|
|
61
|
-
"style",
|
|
62
|
-
"test"
|
|
63
|
-
]
|
|
64
|
-
]
|
|
65
|
-
},
|
|
66
|
-
prompt: { questions: {
|
|
67
|
-
type: {
|
|
68
|
-
description: "Select the type of change that you're committing",
|
|
69
|
-
enum: {
|
|
70
|
-
feat: {
|
|
71
|
-
description: "A new feature",
|
|
72
|
-
title: "Features",
|
|
73
|
-
emoji: "✨"
|
|
74
|
-
},
|
|
75
|
-
fix: {
|
|
76
|
-
description: "A bug fix",
|
|
77
|
-
title: "Bug Fixes",
|
|
78
|
-
emoji: "🐛"
|
|
79
|
-
},
|
|
80
|
-
docs: {
|
|
81
|
-
description: "Documentation only changes",
|
|
82
|
-
title: "Documentation",
|
|
83
|
-
emoji: "📚"
|
|
84
|
-
},
|
|
85
|
-
style: {
|
|
86
|
-
description: "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",
|
|
87
|
-
title: "Styles",
|
|
88
|
-
emoji: "💎"
|
|
89
|
-
},
|
|
90
|
-
refactor: {
|
|
91
|
-
description: "A code change that neither fixes a bug nor adds a feature",
|
|
92
|
-
title: "Code Refactoring",
|
|
93
|
-
emoji: "📦"
|
|
94
|
-
},
|
|
95
|
-
perf: {
|
|
96
|
-
description: "A code change that improves performance",
|
|
97
|
-
title: "Performance Improvements",
|
|
98
|
-
emoji: "🚀"
|
|
99
|
-
},
|
|
100
|
-
test: {
|
|
101
|
-
description: "Adding missing tests or correcting existing tests",
|
|
102
|
-
title: "Tests",
|
|
103
|
-
emoji: "🚨"
|
|
104
|
-
},
|
|
105
|
-
build: {
|
|
106
|
-
description: "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)",
|
|
107
|
-
title: "Builds",
|
|
108
|
-
emoji: "🛠"
|
|
109
|
-
},
|
|
110
|
-
ci: {
|
|
111
|
-
description: "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)",
|
|
112
|
-
title: "Continuous Integrations",
|
|
113
|
-
emoji: "⚙️"
|
|
114
|
-
},
|
|
115
|
-
chore: {
|
|
116
|
-
description: "Other changes that don't modify src or test files",
|
|
117
|
-
title: "Chores",
|
|
118
|
-
emoji: "♻️"
|
|
119
|
-
},
|
|
120
|
-
revert: {
|
|
121
|
-
description: "Reverts a previous commit",
|
|
122
|
-
title: "Reverts",
|
|
123
|
-
emoji: "🗑"
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
scope: { description: "What is the scope of this change (e.g. component or file name)" },
|
|
128
|
-
subject: { description: "Write a short, imperative tense description of the change" },
|
|
129
|
-
body: { description: "Provide a longer description of the change" },
|
|
130
|
-
isBreaking: { description: "Are there any breaking changes?" },
|
|
131
|
-
breakingBody: { description: "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself" },
|
|
132
|
-
breaking: { description: "Describe the breaking changes" },
|
|
133
|
-
isIssueAffected: { description: "Does this change affect any open issues?" },
|
|
134
|
-
issuesBody: { description: "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself" },
|
|
135
|
-
issues: { description: "Add issue references (e.g. \"fix #123\", \"re #123\".)" }
|
|
136
|
-
} }
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
//#endregion
|
|
140
|
-
export { lib_default as default };
|
|
141
|
-
// Generated by @kcconfigs/tsdown
|
|
142
|
-
//# sourceMappingURL=lib-DPex9ONF.js.map
|