commitlint-config-spellbookx 0.11.0 → 0.12.0

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.
Files changed (60) hide show
  1. package/.turbo/turbo-build.log +19 -7
  2. package/.turbo/turbo-test.log +59 -0
  3. package/README.md +211 -30
  4. package/__tests__/index.test.ts +47 -0
  5. package/__tests__/lint.test.ts +65 -0
  6. package/__tests__/scopes.test.ts +55 -0
  7. package/__tests__/workspaces.test.ts +76 -0
  8. package/dist/constants/commit-types.d.ts +13 -0
  9. package/dist/constants/commit-types.d.ts.map +1 -0
  10. package/dist/constants/commit-types.js +24 -0
  11. package/dist/get-scopes-D9bIfVqN.js +5698 -0
  12. package/dist/get-workspaces-raw-path-Cg196xaD.js +2043 -0
  13. package/dist/helpers.d.ts +8 -17
  14. package/dist/helpers.d.ts.map +1 -1
  15. package/dist/helpers.js +21 -0
  16. package/dist/index.d.ts +14 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +15 -7878
  19. package/dist/lib/find-git-root.d.ts +16 -0
  20. package/dist/lib/find-git-root.d.ts.map +1 -0
  21. package/dist/lib/find-git-root.js +30 -0
  22. package/dist/lib/get-scope-description.d.ts +21 -0
  23. package/dist/lib/get-scope-description.d.ts.map +1 -0
  24. package/dist/lib/get-scope-description.js +35 -0
  25. package/dist/lib/get-scopes.d.ts +16 -0
  26. package/dist/lib/get-scopes.d.ts.map +1 -0
  27. package/dist/lib/get-scopes.js +4 -0
  28. package/dist/lib/get-workspaces-raw-path.d.ts +19 -0
  29. package/dist/lib/get-workspaces-raw-path.d.ts.map +1 -0
  30. package/dist/lib/get-workspaces-raw-path.js +3 -0
  31. package/dist/lib/index.d.ts +10 -0
  32. package/dist/lib/index.d.ts.map +1 -0
  33. package/dist/lib/index.js +7 -0
  34. package/dist/lib/package-json.d.ts +14 -0
  35. package/dist/lib/package-json.d.ts.map +1 -0
  36. package/dist/lib/package-json.js +16 -0
  37. package/dist/prompt.d.ts +10 -0
  38. package/dist/prompt.d.ts.map +1 -0
  39. package/dist/prompt.js +99 -0
  40. package/dist/rules.d.ts +10 -0
  41. package/dist/rules.d.ts.map +1 -0
  42. package/dist/rules.js +45 -0
  43. package/dist/scopes.d.ts +23 -0
  44. package/dist/scopes.d.ts.map +1 -0
  45. package/dist/scopes.js +38 -0
  46. package/package.json +43 -9
  47. package/rolldown.config.ts +13 -1
  48. package/src/constants/commit-types.ts +26 -0
  49. package/src/index.ts +26 -153
  50. package/src/lib/find-git-root.ts +31 -0
  51. package/src/lib/get-scope-description.ts +38 -0
  52. package/src/lib/get-scopes.ts +89 -0
  53. package/src/lib/get-workspaces-raw-path.ts +53 -0
  54. package/src/lib/index.ts +10 -0
  55. package/src/lib/package-json.ts +22 -0
  56. package/src/prompt.ts +99 -0
  57. package/src/rules.ts +22 -0
  58. package/src/scopes.ts +40 -0
  59. package/tsconfig.json +1 -0
  60. package/src/helpers.ts +0 -123
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @file find-git-root.ts
3
+ * Utility to locate the root directory of a git repository.
4
+ */
5
+ /**
6
+ * Finds the git root directory by traversing upwards from startDir.
7
+ *
8
+ * @param startDir - Directory to start searching from (defaults to process.cwd()).
9
+ * @returns Path to git root directory, or null if not within a git repository.
10
+ * @example
11
+ * ```ts
12
+ * const root = findGitRoot();
13
+ * ```
14
+ */
15
+ export declare function findGitRoot(startDir?: string): string | null;
16
+ //# sourceMappingURL=find-git-root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-git-root.d.ts","sourceRoot":"","sources":["../../src/lib/find-git-root.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,GAAG,IAAI,CAY3E"}
@@ -0,0 +1,30 @@
1
+ import { existsSync } from "node:fs";
2
+ import path from "node:path";
3
+
4
+ //#region src/lib/find-git-root.ts
5
+ /**
6
+ * @file find-git-root.ts
7
+ * Utility to locate the root directory of a git repository.
8
+ */
9
+ /**
10
+ * Finds the git root directory by traversing upwards from startDir.
11
+ *
12
+ * @param startDir - Directory to start searching from (defaults to process.cwd()).
13
+ * @returns Path to git root directory, or null if not within a git repository.
14
+ * @example
15
+ * ```ts
16
+ * const root = findGitRoot();
17
+ * ```
18
+ */
19
+ function findGitRoot(startDir = process.cwd()) {
20
+ let current = path.resolve(startDir);
21
+ while (true) {
22
+ if (existsSync(path.join(current, ".git"))) return current;
23
+ const parent = path.dirname(current);
24
+ if (parent === current) return null;
25
+ current = parent;
26
+ }
27
+ }
28
+
29
+ //#endregion
30
+ export { findGitRoot };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @file get-scope-description.ts
3
+ * Formats user-facing description strings for commit scopes.
4
+ */
5
+ /**
6
+ * Returns a human-readable description for a given commit scope.
7
+ *
8
+ * @param scope - The scope identifier.
9
+ * @returns The description string for the scope.
10
+ * @example
11
+ * ```ts
12
+ * getScopeDescription('workspace');
13
+ * // 'workspace scope - root files such as config files, root package.json, etc'
14
+ * getScopeDescription('release');
15
+ * // 'Special scope for release commits'
16
+ * getScopeDescription('my-package');
17
+ * // 'my-package scope'
18
+ * ```
19
+ */
20
+ export declare function getScopeDescription(scope: string): string;
21
+ //# sourceMappingURL=get-scope-description.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-scope-description.d.ts","sourceRoot":"","sources":["../../src/lib/get-scope-description.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOzD"}
@@ -0,0 +1,35 @@
1
+ //#region src/lib/get-scope-description.ts
2
+ /**
3
+ * @file get-scope-description.ts
4
+ * Formats user-facing description strings for commit scopes.
5
+ */
6
+ /**
7
+ * Scope identifier for workspace-level changes.
8
+ */
9
+ const SCOPE_WORKSPACE = "workspace";
10
+ /**
11
+ * Scope identifier for release commits.
12
+ */
13
+ const SCOPE_RELEASE = "release";
14
+ /**
15
+ * Returns a human-readable description for a given commit scope.
16
+ *
17
+ * @param scope - The scope identifier.
18
+ * @returns The description string for the scope.
19
+ * @example
20
+ * ```ts
21
+ * getScopeDescription('workspace');
22
+ * // 'workspace scope - root files such as config files, root package.json, etc'
23
+ * getScopeDescription('release');
24
+ * // 'Special scope for release commits'
25
+ * getScopeDescription('my-package');
26
+ * // 'my-package scope'
27
+ * ```
28
+ */
29
+ function getScopeDescription(scope) {
30
+ if (scope === SCOPE_WORKSPACE) return "workspace scope - root files such as config files, root package.json, etc";
31
+ return scope === SCOPE_RELEASE ? "Special scope for release commits" : `${scope} scope`;
32
+ }
33
+
34
+ //#endregion
35
+ export { getScopeDescription };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @file get-scopes.ts
3
+ * Discovers and gathers workspace package scopes in a monorepo or standard repository.
4
+ */
5
+ /**
6
+ * Retrieves a list of package scope names from monorepo configuration files (npm, pnpm, lerna).
7
+ *
8
+ * @param cwd - Working directory to start git root discovery from (defaults to process.cwd()).
9
+ * @returns An array of package scope names found in the repository.
10
+ * @example
11
+ * ```ts
12
+ * const scopes = getScopes();
13
+ * ```
14
+ */
15
+ export declare function getScopes(cwd?: string): string[];
16
+ //# sourceMappingURL=get-scopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-scopes.d.ts","sourceRoot":"","sources":["../../src/lib/get-scopes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,EAAE,CAiE/D"}
@@ -0,0 +1,4 @@
1
+ import { t as getScopes } from "../get-scopes-D9bIfVqN.js";
2
+ import "../get-workspaces-raw-path-Cg196xaD.js";
3
+
4
+ export { getScopes };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @file get-workspaces-raw-path.ts
3
+ * Parser for extracting workspace path globs from JSON and YAML configuration files.
4
+ */
5
+ /**
6
+ * Reads workspace paths from configuration files (JSON or YAML).
7
+ *
8
+ * @param configPath - The path to the config file (e.g., package.json, pnpm-workspace.yaml).
9
+ * @param parser - The parser type to use for reading the file ('json' or 'yaml').
10
+ * @param property - The property name in the config containing workspace paths (defaults to 'workspaces').
11
+ * @returns Array of raw workspace path patterns.
12
+ * @example
13
+ * ```ts
14
+ * getWorkspacesRawPath('package.json', 'json', 'workspaces');
15
+ * getWorkspacesRawPath('pnpm-workspace.yaml', 'yaml', 'packages');
16
+ * ```
17
+ */
18
+ export declare function getWorkspacesRawPath(configPath: string, parser: 'json' | 'yaml', property?: string): string[];
19
+ //# sourceMappingURL=get-workspaces-raw-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-workspaces-raw-path.d.ts","sourceRoot":"","sources":["../../src/lib/get-workspaces-raw-path.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,QAAQ,GAAE,MAAqB,GAC9B,MAAM,EAAE,CA0BV"}
@@ -0,0 +1,3 @@
1
+ import { t as getWorkspacesRawPath } from "../get-workspaces-raw-path-Cg196xaD.js";
2
+
3
+ export { getWorkspacesRawPath };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @file index.ts
3
+ * Barrel export for atomic utility functions in commitlint-config-spellbookx.
4
+ */
5
+ export { findGitRoot } from './find-git-root.js';
6
+ export { getScopeDescription } from './get-scope-description.js';
7
+ export { getScopes } from './get-scopes.js';
8
+ export { getWorkspacesRawPath } from './get-workspaces-raw-path.js';
9
+ export { packageJson } from './package-json.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { t as getScopes } from "../get-scopes-D9bIfVqN.js";
2
+ import { getScopeDescription } from "./get-scope-description.js";
3
+ import { findGitRoot } from "./find-git-root.js";
4
+ import { t as getWorkspacesRawPath } from "../get-workspaces-raw-path-Cg196xaD.js";
5
+ import packageJson from "./package-json.js";
6
+
7
+ export { findGitRoot, getScopeDescription, getScopes, getWorkspacesRawPath, packageJson };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @file package-json.ts
3
+ * Reads package metadata for commitlint-config-spellbookx.
4
+ */
5
+ /**
6
+ * Parsed `package.json` metadata for `commitlint-config-spellbookx`.
7
+ */
8
+ export declare const packageJson: {
9
+ name: string;
10
+ version: string;
11
+ peerDependencies: Record<string, string>;
12
+ };
13
+ export default packageJson;
14
+ //# sourceMappingURL=package-json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package-json.d.ts","sourceRoot":"","sources":["../../src/lib/package-json.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH;;GAEG;AACH,eAAO,MAAM,WAAW,EAAoD;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { URL, fileURLToPath } from "node:url";
3
+
4
+ //#region src/lib/package-json.ts
5
+ /**
6
+ * @file package-json.ts
7
+ * Reads package metadata for commitlint-config-spellbookx.
8
+ */
9
+ const packagePath = fileURLToPath(new URL("../../package.json", import.meta.url));
10
+ /**
11
+ * Parsed `package.json` metadata for `commitlint-config-spellbookx`.
12
+ */
13
+ const packageJson = JSON.parse(readFileSync(packagePath, "utf8"));
14
+
15
+ //#endregion
16
+ export { packageJson as default, packageJson };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @file prompt.ts
3
+ * Commitizen prompt questions and settings for interactive commits with cz-git.
4
+ */
5
+ import type { UserConfig } from '@commitlint/types';
6
+ /**
7
+ * Commitizen and cz-git interactive prompt configuration.
8
+ */
9
+ export declare const prompt: UserConfig['prompt'];
10
+ //# sourceMappingURL=prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAIpD;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,QAAQ,CAsFvC,CAAC"}
package/dist/prompt.js ADDED
@@ -0,0 +1,99 @@
1
+ import "./get-scopes-D9bIfVqN.js";
2
+ import "./get-workspaces-raw-path-Cg196xaD.js";
3
+ import { scopesEnum } from "./scopes.js";
4
+
5
+ //#region src/prompt.ts
6
+ /**
7
+ * Commitizen and cz-git interactive prompt configuration.
8
+ */
9
+ const prompt = {
10
+ settings: {
11
+ enableMultipleScopes: true,
12
+ scopeEnumSeparator: ","
13
+ },
14
+ messages: {
15
+ skip: ":skip",
16
+ max: "upper %d chars",
17
+ min: "%d chars at least",
18
+ emptyWarning: "can not be empty",
19
+ upperLimitWarning: "over limit",
20
+ lowerLimitWarning: "below limit"
21
+ },
22
+ questions: {
23
+ type: {
24
+ description: "Select the type of change that you're committing:",
25
+ enum: {
26
+ feat: {
27
+ description: "A new feature",
28
+ title: "Features",
29
+ emoji: "✨"
30
+ },
31
+ fix: {
32
+ description: "A bug fix",
33
+ title: "Bug Fixes",
34
+ emoji: "🐛"
35
+ },
36
+ docs: {
37
+ description: "Documentation only changes",
38
+ title: "Documentation",
39
+ emoji: "📚"
40
+ },
41
+ style: {
42
+ description: "Changes that do not affect meaning of the code",
43
+ title: "Styles",
44
+ emoji: "💎"
45
+ },
46
+ refactor: {
47
+ description: "Code refactoring",
48
+ title: "Code Refactoring",
49
+ emoji: "📦"
50
+ },
51
+ perf: {
52
+ description: "Performance improvements",
53
+ title: "Performance Improvements",
54
+ emoji: "🚀"
55
+ },
56
+ test: {
57
+ description: "Adding or fixing tests",
58
+ title: "Tests",
59
+ emoji: "🚨"
60
+ },
61
+ build: {
62
+ description: "Changes that affect build system",
63
+ title: "Builds",
64
+ emoji: "🛠"
65
+ },
66
+ ci: {
67
+ description: "Changes to CI config",
68
+ title: "Continuous Integrations",
69
+ emoji: "⚙️"
70
+ },
71
+ chore: {
72
+ description: "Other changes",
73
+ title: "Chores",
74
+ emoji: "♻️"
75
+ },
76
+ revert: {
77
+ description: "Reverts a previous commit",
78
+ title: "Reverts",
79
+ emoji: "🗑"
80
+ }
81
+ }
82
+ },
83
+ scope: {
84
+ description: "Select the scope(s) of the change (use arrow keys or space to select multiple)",
85
+ enum: scopesEnum
86
+ },
87
+ subject: { description: "Write a short, imperative tense description of the change" },
88
+ body: { description: "Provide a longer description of the change" },
89
+ isBreaking: { description: "Are there any breaking changes?" },
90
+ breakingBody: { description: "Describe the breaking changes with body" },
91
+ breaking: { description: "Describe the breaking changes" },
92
+ isIssueAffected: { description: "Does this change affect any open issues?" },
93
+ issuesBody: { description: "If issues are closed, enter longer description" },
94
+ issues: { description: "Add issue references (e.g., \"fix #123\")" }
95
+ }
96
+ };
97
+
98
+ //#endregion
99
+ export { prompt };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @file rules.ts
3
+ * Commitlint rule definitions for enforcing conventional commits.
4
+ */
5
+ import type { QualifiedRules } from '@commitlint/types';
6
+ /**
7
+ * Standard commitlint rules configuration.
8
+ */
9
+ export declare const rules: QualifiedRules;
10
+ //# sourceMappingURL=rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKxD;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,cAQnB,CAAC"}
package/dist/rules.js ADDED
@@ -0,0 +1,45 @@
1
+ import "./get-scopes-D9bIfVqN.js";
2
+ import "./get-workspaces-raw-path-Cg196xaD.js";
3
+ import { scopesArray } from "./scopes.js";
4
+ import { COMMIT_TYPES } from "./constants/commit-types.js";
5
+
6
+ //#region src/rules.ts
7
+ /**
8
+ * Standard commitlint rules configuration.
9
+ */
10
+ const rules = {
11
+ "type-enum": [
12
+ 2,
13
+ "always",
14
+ [...COMMIT_TYPES]
15
+ ],
16
+ "scope-enum": [
17
+ 2,
18
+ "always",
19
+ scopesArray
20
+ ],
21
+ "subject-empty": [2, "never"],
22
+ "subject-full-stop": [
23
+ 2,
24
+ "never",
25
+ "."
26
+ ],
27
+ "header-max-length": [
28
+ 2,
29
+ "always",
30
+ 72
31
+ ],
32
+ "body-max-line-length": [
33
+ 2,
34
+ "always",
35
+ 100
36
+ ],
37
+ "footer-max-line-length": [
38
+ 2,
39
+ "always",
40
+ 100
41
+ ]
42
+ };
43
+
44
+ //#endregion
45
+ export { rules };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @file scopes.ts
3
+ * Scopes constants and scope enumeration generator for commitlint and commitizen.
4
+ */
5
+ /**
6
+ * Scope identifier for repository-wide or workspace-level changes.
7
+ */
8
+ export declare const SCOPE_WORKSPACE = "workspace";
9
+ /**
10
+ * Scope identifier for release and versioning commits.
11
+ */
12
+ export declare const SCOPE_RELEASE = "release";
13
+ /**
14
+ * Array of all valid commit scopes, including workspace, release, and discovered monorepo packages.
15
+ */
16
+ export declare const scopesArray: string[];
17
+ /**
18
+ * Record of scopes mapped to their human-readable descriptions for Commitizen interactive prompt.
19
+ */
20
+ export declare const scopesEnum: Record<string, {
21
+ description: string;
22
+ }>;
23
+ //# sourceMappingURL=scopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;GAEG;AACH,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,EAI/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAAM,CAAC"}
package/dist/scopes.js ADDED
@@ -0,0 +1,38 @@
1
+ import { t as getScopes } from "./get-scopes-D9bIfVqN.js";
2
+ import { getScopeDescription } from "./lib/get-scope-description.js";
3
+ import "./get-workspaces-raw-path-Cg196xaD.js";
4
+
5
+ //#region src/scopes.ts
6
+ /**
7
+ * @file scopes.ts
8
+ * Scopes constants and scope enumeration generator for commitlint and commitizen.
9
+ */
10
+ /**
11
+ * Scope identifier for repository-wide or workspace-level changes.
12
+ */
13
+ const SCOPE_WORKSPACE = "workspace";
14
+ /**
15
+ * Scope identifier for release and versioning commits.
16
+ */
17
+ const SCOPE_RELEASE = "release";
18
+ /**
19
+ * Array of all valid commit scopes, including workspace, release, and discovered monorepo packages.
20
+ */
21
+ const scopesArray = [
22
+ SCOPE_WORKSPACE,
23
+ SCOPE_RELEASE,
24
+ ...getScopes()
25
+ ];
26
+ /**
27
+ * Record of scopes mapped to their human-readable descriptions for Commitizen interactive prompt.
28
+ */
29
+ const scopesEnum = {};
30
+ for (const scope of scopesArray) Object.defineProperty(scopesEnum, scope, {
31
+ value: { description: getScopeDescription(scope) },
32
+ enumerable: true,
33
+ writable: true,
34
+ configurable: true
35
+ });
36
+
37
+ //#endregion
38
+ export { SCOPE_RELEASE, SCOPE_WORKSPACE, scopesArray, scopesEnum };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commitlint-config-spellbookx",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "private": false,
5
5
  "description": "A shareable Commitlint configuration for enforcing conventional commits.",
6
6
  "keywords": [
@@ -29,32 +29,66 @@
29
29
  "types": "./dist/index.d.ts",
30
30
  "import": "./dist/index.js",
31
31
  "default": "./dist/index.js"
32
+ },
33
+ "./rules": {
34
+ "types": "./dist/rules.d.ts",
35
+ "import": "./dist/rules.js",
36
+ "default": "./dist/rules.js"
37
+ },
38
+ "./prompt": {
39
+ "types": "./dist/prompt.d.ts",
40
+ "import": "./dist/prompt.js",
41
+ "default": "./dist/prompt.js"
42
+ },
43
+ "./scopes": {
44
+ "types": "./dist/scopes.d.ts",
45
+ "import": "./dist/scopes.js",
46
+ "default": "./dist/scopes.js"
47
+ },
48
+ "./constants": {
49
+ "types": "./dist/constants/commit-types.d.ts",
50
+ "import": "./dist/constants/commit-types.js",
51
+ "default": "./dist/constants/commit-types.js"
52
+ },
53
+ "./lib": {
54
+ "types": "./dist/lib/index.d.ts",
55
+ "import": "./dist/lib/index.js",
56
+ "default": "./dist/lib/index.js"
57
+ },
58
+ "./lib/*": {
59
+ "types": "./dist/lib/*.d.ts",
60
+ "import": "./dist/lib/*.js",
61
+ "default": "./dist/lib/*.js"
32
62
  }
33
63
  },
34
64
  "main": "./dist/index.js",
35
65
  "module": "./dist/index.js",
36
66
  "types": "./dist/index.d.ts",
37
67
  "dependencies": {
38
- "@commitlint/cli": "^20.4.2",
39
- "@commitlint/config-conventional": "^20.4.2",
40
- "commitizen": "^4.3.1",
41
- "conventional-changelog-conventionalcommits": "^9.1.0",
42
- "cz-git": "^1.12.0",
68
+ "@commitlint/cli": "^21.2.4",
69
+ "@commitlint/config-conventional": "^21.2.4",
70
+ "commitizen": "^4.3.2",
71
+ "conventional-changelog-conventionalcommits": "^10.4.1",
72
+ "cz-git": "^1.14.0",
43
73
  "fast-glob": "^3.3.3",
44
74
  "js-yaml": "^4.1.1"
45
75
  },
46
76
  "devDependencies": {
47
- "@commitlint/types": "^20.4.0",
77
+ "@commitlint/lint": "^21.2.4",
78
+ "@commitlint/load": "^21.2.4",
79
+ "@commitlint/types": "^21.2.3",
48
80
  "@dcdavidev/tsconfig": "^0.1.0",
49
81
  "@types/js-yaml": "^4.0.9",
50
82
  "@types/node": "^25.3.0",
51
83
  "rolldown": "1.0.0-rc.5",
52
- "typescript": "5.9.3"
84
+ "typescript": "5.9.3",
85
+ "vitest": "^5.0.5"
53
86
  },
54
87
  "publishConfig": {
55
88
  "access": "public"
56
89
  },
57
90
  "scripts": {
58
- "build": "rolldown -c && tsc"
91
+ "build": "rolldown -c && tsc",
92
+ "test": "vitest run"
59
93
  }
60
94
  }
@@ -2,7 +2,19 @@ import { defineConfig } from 'rolldown';
2
2
 
3
3
  export default defineConfig([
4
4
  {
5
- input: 'src/index.ts',
5
+ input: {
6
+ index: 'src/index.ts',
7
+ rules: 'src/rules.ts',
8
+ prompt: 'src/prompt.ts',
9
+ scopes: 'src/scopes.ts',
10
+ 'constants/commit-types': 'src/constants/commit-types.ts',
11
+ 'lib/index': 'src/lib/index.ts',
12
+ 'lib/package-json': 'src/lib/package-json.ts',
13
+ 'lib/find-git-root': 'src/lib/find-git-root.ts',
14
+ 'lib/get-scope-description': 'src/lib/get-scope-description.ts',
15
+ 'lib/get-scopes': 'src/lib/get-scopes.ts',
16
+ 'lib/get-workspaces-raw-path': 'src/lib/get-workspaces-raw-path.ts',
17
+ },
6
18
  output: {
7
19
  format: 'esm',
8
20
  dir: 'dist',
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @file commit-types.ts
3
+ * Standard Conventional Commit types supported by Spellbookx.
4
+ */
5
+
6
+ /**
7
+ * List of allowed commit types based on the Conventional Commits specification.
8
+ */
9
+ export const COMMIT_TYPES = [
10
+ 'feat',
11
+ 'fix',
12
+ 'docs',
13
+ 'style',
14
+ 'refactor',
15
+ 'perf',
16
+ 'test',
17
+ 'chore',
18
+ 'ci',
19
+ 'build',
20
+ 'revert',
21
+ ] as const;
22
+
23
+ /**
24
+ * Valid Conventional Commit type string.
25
+ */
26
+ export type CommitType = (typeof COMMIT_TYPES)[number];