@storm-software/git-tools 2.121.4 → 2.122.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 (64) hide show
  1. package/README.md +2 -1
  2. package/bin/{chunk-N5U2S3QK.cjs → chunk-5SPAQH6A.cjs} +10 -15
  3. package/bin/{chunk-QBJQH2IK.js → chunk-LBURTJLB.js} +10 -10
  4. package/bin/git.cjs +405 -480
  5. package/bin/git.js +342 -417
  6. package/bin/post-checkout.cjs +9 -9
  7. package/bin/post-checkout.js +1 -1
  8. package/bin/post-commit.cjs +9 -9
  9. package/bin/post-commit.js +1 -1
  10. package/bin/post-merge.cjs +9 -9
  11. package/bin/post-merge.js +1 -1
  12. package/bin/pre-commit.cjs +9 -9
  13. package/bin/pre-commit.js +1 -1
  14. package/bin/pre-install.cjs +9 -9
  15. package/bin/pre-install.js +1 -1
  16. package/bin/pre-push.cjs +13 -13
  17. package/bin/pre-push.js +1 -1
  18. package/bin/prepare.cjs +7 -7
  19. package/bin/prepare.js +1 -1
  20. package/bin/version-warning.cjs +5 -5
  21. package/bin/version-warning.js +1 -1
  22. package/dist/chunk-3GGWHKRP.js +274 -0
  23. package/dist/chunk-4VPJA7YJ.cjs +274 -0
  24. package/dist/chunk-5XU2KBM6.js +14 -0
  25. package/dist/chunk-F7OO6L26.cjs +78 -0
  26. package/dist/{chunk-RG47FAF4.cjs → chunk-GOKUSEH3.cjs} +5 -3
  27. package/dist/chunk-JCEVFJCA.js +42 -0
  28. package/dist/chunk-KZRVQ5RZ.js +78 -0
  29. package/dist/chunk-NY53WLGC.cjs +42 -0
  30. package/dist/chunk-YBAE6I5L.cjs +14 -0
  31. package/dist/{chunk-2IQTQBAX.js → chunk-YCEUZFMU.js} +5 -3
  32. package/dist/commit/minimal.cjs +4 -12
  33. package/dist/commit/minimal.d.cts +249 -7
  34. package/dist/commit/minimal.d.ts +249 -7
  35. package/dist/commit/minimal.js +5 -13
  36. package/dist/commit/monorepo.cjs +7 -3
  37. package/dist/commit/monorepo.d.cts +269 -4
  38. package/dist/commit/monorepo.d.ts +269 -4
  39. package/dist/commit/monorepo.js +6 -2
  40. package/dist/commitlint/minimal.cjs +2 -3
  41. package/dist/commitlint/minimal.d.cts +27 -6
  42. package/dist/commitlint/minimal.d.ts +27 -6
  43. package/dist/commitlint/minimal.js +3 -4
  44. package/dist/commitlint/monorepo.cjs +2 -3
  45. package/dist/commitlint/monorepo.d.cts +28 -6
  46. package/dist/commitlint/monorepo.d.ts +28 -6
  47. package/dist/commitlint/monorepo.js +3 -4
  48. package/dist/index.cjs +6 -19
  49. package/dist/index.d.cts +4 -2
  50. package/dist/index.d.ts +4 -2
  51. package/dist/index.js +9 -22
  52. package/dist/release/config.cjs +6 -3
  53. package/dist/release/config.d.cts +2 -1
  54. package/dist/release/config.d.ts +2 -1
  55. package/dist/release/config.js +5 -2
  56. package/dist/types.cjs +2 -20
  57. package/dist/types.d.cts +3 -250
  58. package/dist/types.d.ts +3 -250
  59. package/dist/types.js +3 -21
  60. package/package.json +5 -5
  61. package/dist/chunk-25G45MG4.js +0 -19
  62. package/dist/chunk-2RKFQIWE.cjs +0 -19
  63. package/dist/chunk-2SHAD3P5.cjs +0 -301
  64. package/dist/chunk-GRCMQK4Q.js +0 -301
package/bin/git.js CHANGED
@@ -1,21 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  import { run } from './chunk-54Q5U5WW.js';
3
- import { getConfig, handleProcess, writeSuccess, exitWithSuccess, exitWithError, writeInfo, findWorkspaceRootSafe, writeFatal, getWorkspaceConfig, joinPaths, writeDebug, defu, isVerbose, writeWarning, writeTrace, STORM_DEFAULT_RELEASE_BANNER, __require } from './chunk-QBJQH2IK.js';
3
+ import { getConfig, handleProcess, writeSuccess, exitWithSuccess, exitWithError, writeInfo, findWorkspaceRootSafe, writeFatal, getWorkspaceConfig, joinPaths, writeDebug, defu, isVerbose, writeWarning, writeTrace, STORM_DEFAULT_RELEASE_BANNER, __require } from './chunk-LBURTJLB.js';
4
4
  import TOML from '@ltd/j-toml';
5
5
  import { Command, Option } from 'commander';
6
6
  import { select, confirm, input } from '@inquirer/prompts';
7
7
  import shellescape from 'any-shell-escape';
8
8
  import chalkTemplate from 'chalk-template';
9
9
  import fs, { readFile as readFile$1, writeFile } from 'node:fs/promises';
10
+ import createBasePreset from 'conventional-changelog-conventionalcommits';
11
+ import { readCachedProjectGraph, createProjectGraphAsync as createProjectGraphAsync$1, readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph$1 } from 'nx/src/project-graph/project-graph';
10
12
  import { existsSync } from 'fs';
11
13
  import { readFile } from 'fs/promises';
12
14
  import childProcess, { execSync } from 'node:child_process';
13
- import { createJiti } from 'jiti';
14
- import { existsSync as existsSync$1, rmSync, readdirSync, readFileSync, writeFileSync, statSync, promises } from 'node:fs';
15
15
  import defaultRules from '@commitlint/rules';
16
16
  import 'stream';
17
- import util from 'util';
18
- import { readCachedProjectGraph, createProjectGraphAsync as createProjectGraphAsync$1, readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph$1 } from 'nx/src/project-graph/project-graph';
17
+ import util from 'node:util';
18
+ import { existsSync as existsSync$1, rmSync, readdirSync, readFileSync, writeFileSync, statSync, promises } from 'node:fs';
19
19
  import wrap from 'word-wrap';
20
20
  import Path, { join as join$1, extname } from 'node:path';
21
21
  import { createProjectGraphAsync, readProjectsConfigurationFromProjectGraph } from 'nx/src/project-graph/project-graph.js';
@@ -77,7 +77,7 @@ function stringifyCargoToml(cargoToml) {
77
77
  }
78
78
 
79
79
  // ../conventional-changelog/src/commit-types.ts
80
- var COMMIT_TYPES = {
80
+ var DEFAULT_COMMIT_TYPES = {
81
81
  /* --- Bumps version when selected --- */
82
82
  "chore": {
83
83
  "description": "Other changes that don't modify src or test files",
@@ -208,255 +208,217 @@ var COMMIT_TYPES = {
208
208
  };
209
209
 
210
210
  // ../conventional-changelog/src/utilities/constants.ts
211
- var CHANGELOG_COMMITS = Object.entries(COMMIT_TYPES).reduce(
212
- (ret, [key, commitType]) => {
213
- ret[key] = {
214
- ...commitType.changelog,
215
- type: key,
216
- title: commitType.changelog?.title || commitType.title,
217
- hidden: commitType.changelog?.hidden
218
- };
219
- return ret;
220
- },
221
- {}
211
+ var CHANGELOG_COMMIT_TYPES_OBJECT = Object.freeze(
212
+ Object.entries(DEFAULT_COMMIT_TYPES).reduce(
213
+ (ret, [key, commitType]) => {
214
+ ret[key] = {
215
+ ...commitType.changelog,
216
+ type: key,
217
+ section: commitType.changelog?.title || commitType.title,
218
+ hidden: commitType.changelog?.hidden
219
+ };
220
+ return ret;
221
+ },
222
+ {}
223
+ )
222
224
  );
223
- var CHANGELOG_COMMIT_ORDER = [
224
- CHANGELOG_COMMITS.feat,
225
- CHANGELOG_COMMITS.fix,
226
- CHANGELOG_COMMITS.chore,
227
- CHANGELOG_COMMITS.deps,
228
- CHANGELOG_COMMITS.docs,
229
- CHANGELOG_COMMITS.style,
230
- CHANGELOG_COMMITS.refactor,
231
- CHANGELOG_COMMITS.perf,
232
- CHANGELOG_COMMITS.build,
233
- CHANGELOG_COMMITS.ci,
234
- CHANGELOG_COMMITS.test
225
+ var CHANGELOG_COMMIT_TYPES = [
226
+ CHANGELOG_COMMIT_TYPES_OBJECT.feat,
227
+ CHANGELOG_COMMIT_TYPES_OBJECT.fix,
228
+ CHANGELOG_COMMIT_TYPES_OBJECT.chore,
229
+ CHANGELOG_COMMIT_TYPES_OBJECT.deps,
230
+ CHANGELOG_COMMIT_TYPES_OBJECT.docs,
231
+ CHANGELOG_COMMIT_TYPES_OBJECT.style,
232
+ CHANGELOG_COMMIT_TYPES_OBJECT.refactor,
233
+ CHANGELOG_COMMIT_TYPES_OBJECT.perf,
234
+ CHANGELOG_COMMIT_TYPES_OBJECT.build,
235
+ CHANGELOG_COMMIT_TYPES_OBJECT.ci,
236
+ CHANGELOG_COMMIT_TYPES_OBJECT.test
235
237
  ];
236
- CHANGELOG_COMMIT_ORDER.map(
238
+ CHANGELOG_COMMIT_TYPES.map(
237
239
  (entry) => entry.type
238
240
  );
239
- CHANGELOG_COMMIT_ORDER.map(
240
- (entry) => entry.title
241
+ CHANGELOG_COMMIT_TYPES.map(
242
+ (entry) => entry.section
241
243
  );
242
- var MINIMAL_PARSER_DEFAULT_OPTIONS = {
243
- headerPattern: /^(\w*): (.*)$/,
244
- breakingHeaderPattern: /^(\w*): (.*)$/,
245
- headerCorrespondence: ["type", "subject"],
246
- noteKeywords: ["BREAKING CHANGE", "BREAKING-CHANGE"],
247
- revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i,
248
- revertCorrespondence: ["header", "hash"],
249
- issuePrefixes: ["#"]
250
- };
251
- var MONOREPO_PARSER_DEFAULT_OPTIONS = {
252
- headerPattern: /^(\w*)(?:\((.*)\))!?: (.*)$/,
253
- breakingHeaderPattern: /^(\w*)(?:\((.*)\))!: (.*)$/,
254
- headerCorrespondence: ["type", "scope", "subject"],
255
- noteKeywords: ["BREAKING CHANGE", "BREAKING-CHANGE"],
256
- revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i,
257
- revertCorrespondence: ["header", "hash"],
258
- issuePrefixes: ["#"]
259
- };
260
-
261
- // ../conventional-changelog/src/parser.ts
262
- function createParserOpts(variant) {
263
- return variant === "minimal" ? MINIMAL_PARSER_DEFAULT_OPTIONS : MONOREPO_PARSER_DEFAULT_OPTIONS;
264
- }
265
244
 
266
- // src/types.ts
267
- var DEFAULT_MINIMAL_COMMIT_QUESTIONS = {
268
- type: {
269
- type: "select",
270
- title: "Commit Type",
271
- description: "Select the commit type that best describes your changes",
272
- enum: Object.keys(COMMIT_TYPES).filter(
273
- (type) => COMMIT_TYPES[type].hidden !== true
274
- ).reduce((ret, type) => {
275
- ret[type] = COMMIT_TYPES[type];
276
- return ret;
277
- }, {}),
278
- defaultValue: "chore",
279
- maxLength: 20,
280
- minLength: 3
281
- },
282
- subject: {
283
- type: "input",
284
- title: "Commit Subject",
285
- description: "Write a short, imperative tense description of the change",
286
- maxLength: 150,
287
- minLength: 3
288
- },
289
- body: {
290
- type: "input",
291
- title: "Commit Body",
292
- description: "Provide a longer description of the change",
293
- maxLength: 600
294
- },
295
- isBreaking: {
296
- type: "confirm",
297
- title: "Breaking Changes",
298
- description: "Are there any breaking changes as a result of this commit?",
299
- defaultValue: false
300
- },
301
- breakingBody: {
302
- type: "input",
303
- title: "Breaking Changes (Details)",
304
- description: "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself",
305
- when: (answers) => answers.isBreaking === true,
306
- maxLength: 600,
307
- minLength: 3
308
- },
309
- isIssueAffected: {
310
- type: "confirm",
311
- title: "Open Issue Affected",
312
- description: "Does this change impact any open issues?",
313
- defaultValue: false
314
- },
315
- issuesBody: {
316
- type: "input",
317
- title: "Open Issue Affected (Details)",
318
- description: "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself",
319
- when: (answers) => answers.isIssueAffected === true,
320
- maxLength: 600,
321
- minLength: 3
245
+ // ../conventional-changelog/src/configs/minimal.ts
246
+ var changelogs = {
247
+ props: {
248
+ ignoreCommits: void 0,
249
+ types: CHANGELOG_COMMIT_TYPES,
250
+ bumpStrict: true,
251
+ scope: void 0,
252
+ scopeOnly: false
322
253
  }
323
254
  };
324
- var DEFAULT_MONOREPO_COMMIT_QUESTIONS = {
325
- type: DEFAULT_MINIMAL_COMMIT_QUESTIONS.type,
326
- scope: {
327
- type: "select",
328
- title: "Commit Scope",
329
- description: "Select the project that's the most impacted by this change",
330
- enum: {},
331
- defaultValue: "monorepo",
332
- maxLength: 50,
333
- minLength: 1
255
+ var commitlint = {
256
+ helpUrl: "https://developer.stormsoftware.com/commitlint/minimal",
257
+ rules: {
258
+ "body-leading-blank": [1 /* Warning */, "always"],
259
+ "body-max-length": [2 /* Error */, "always", 600],
260
+ "footer-leading-blank": [1 /* Warning */, "always"],
261
+ "footer-max-line-length": [2 /* Error */, "always", 150],
262
+ "header-max-length": [2 /* Error */, "always", 150],
263
+ "header-trim": [2 /* Error */, "always"],
264
+ "subject-case": [2 /* Error */, "always", ["sentence-case"]],
265
+ "subject-empty": [2 /* Error */, "never"],
266
+ "subject-full-stop": [2 /* Error */, "never", "."],
267
+ "subject-max-length": [2 /* Error */, "always", 150],
268
+ "subject-min-length": [2 /* Error */, "always", 3],
269
+ "type-case": [2 /* Error */, "always", "kebab-case"],
270
+ "type-empty": [2 /* Error */, "never"],
271
+ "type-enum": [
272
+ 2 /* Error */,
273
+ "always",
274
+ Object.keys(DEFAULT_COMMIT_TYPES)
275
+ ],
276
+ "type-max-length": [2 /* Error */, "always", 20],
277
+ "type-min-length": [2 /* Error */, "always", 3],
278
+ "scope-empty": [2 /* Error */, "always"]
334
279
  },
335
- subject: DEFAULT_MINIMAL_COMMIT_QUESTIONS.subject,
336
- body: DEFAULT_MINIMAL_COMMIT_QUESTIONS.body,
337
- isBreaking: DEFAULT_MINIMAL_COMMIT_QUESTIONS.isBreaking,
338
- breakingBody: DEFAULT_MINIMAL_COMMIT_QUESTIONS.breakingBody,
339
- isIssueAffected: DEFAULT_MINIMAL_COMMIT_QUESTIONS.isIssueAffected,
340
- issuesBody: DEFAULT_MINIMAL_COMMIT_QUESTIONS.issuesBody
341
- };
342
- var DEFAULT_COMMIT_PROMPT_MESSAGES = {
343
- skip: "press enter to skip",
344
- max: "must be %d chars at most",
345
- min: "must be %d chars at least",
346
- emptyWarning: "can not be empty",
347
- upperLimitWarning: "%s is %d characters longer than the upper limit",
348
- lowerLimitWarning: "%s is %d characters less than the lower limit",
349
- closedIssueMessage: "Closes: "
350
- };
351
- var DEFAULT_MINIMAL_COMMIT_MESSAGE_FORMAT = "{type}: {emoji}{subject}";
352
- var DEFAULT_MINIMAL_COMMIT_SETTINGS = {
353
- enableMultipleScopes: false,
354
- disableEmoji: true,
355
- breakingChangePrefix: "\u{1F4A3} ",
356
- closedIssuePrefix: "\u2705 ",
357
- format: DEFAULT_MINIMAL_COMMIT_MESSAGE_FORMAT
358
- };
359
- var DEFAULT_MONOREPO_COMMIT_MESSAGE_FORMAT = "{type}({scope}): {emoji}{subject}";
360
- var DEFAULT_MONOREPO_COMMIT_SETTINGS = {
361
- enableMultipleScopes: false,
362
- disableEmoji: true,
363
- breakingChangePrefix: "\u{1F4A3} ",
364
- closedIssuePrefix: "\u2705 ",
365
- format: DEFAULT_MONOREPO_COMMIT_MESSAGE_FORMAT
366
- };
367
- var DEFAULT_MINIMAL_COMMIT_RULES = {
368
- "body-leading-blank": [1 /* Warning */, "always"],
369
- "body-max-length": [2 /* Error */, "always", 600],
370
- "footer-leading-blank": [1 /* Warning */, "always"],
371
- "footer-max-line-length": [2 /* Error */, "always", 150],
372
- "header-max-length": [2 /* Error */, "always", 150],
373
- "header-trim": [2 /* Error */, "always"],
374
- "subject-case": [2 /* Error */, "always", ["sentence-case"]],
375
- "subject-empty": [2 /* Error */, "never"],
376
- "subject-full-stop": [2 /* Error */, "never", "."],
377
- "subject-max-length": [2 /* Error */, "always", 150],
378
- "subject-min-length": [2 /* Error */, "always", 3],
379
- "type-case": [2 /* Error */, "always", "kebab-case"],
380
- "type-empty": [2 /* Error */, "never"],
381
- "type-enum": [
382
- 2 /* Error */,
383
- "always",
384
- Object.keys(COMMIT_TYPES)
385
- ],
386
- "type-max-length": [2 /* Error */, "always", 20],
387
- "type-min-length": [2 /* Error */, "always", 3],
388
- "scope-empty": 0 /* Disabled */,
389
- "scope-case": 0 /* Disabled */,
390
- "scope-enum": 0 /* Disabled */
391
- };
392
- var DEFAULT_MONOREPO_COMMIT_RULES = {
393
- "body-leading-blank": [1 /* Warning */, "always"],
394
- "body-max-length": [2 /* Error */, "always", 600],
395
- "footer-leading-blank": [1 /* Warning */, "always"],
396
- "footer-max-line-length": [2 /* Error */, "always", 150],
397
- "header-max-length": [2 /* Error */, "always", 150],
398
- "header-trim": [2 /* Error */, "always"],
399
- "subject-case": [2 /* Error */, "always", ["sentence-case"]],
400
- "subject-empty": [2 /* Error */, "never"],
401
- "subject-full-stop": [2 /* Error */, "never", "."],
402
- "subject-max-length": [2 /* Error */, "always", 150],
403
- "subject-min-length": [2 /* Error */, "always", 3],
404
- "type-case": [2 /* Error */, "always", "kebab-case"],
405
- "type-empty": [2 /* Error */, "never"],
406
- "type-enum": [
407
- 2 /* Error */,
408
- "always",
409
- Object.keys(COMMIT_TYPES)
410
- ],
411
- "type-max-length": [2 /* Error */, "always", 20],
412
- "type-min-length": [2 /* Error */, "always", 3],
413
- "scope-case": [2 /* Error */, "always", ["kebab-case"]],
414
- "scope-empty": [2 /* Error */, "never"]
280
+ settings: {
281
+ enableMultipleScopes: false,
282
+ disableEmoji: true,
283
+ breakingChangePrefix: "\u{1F4A3} ",
284
+ closedIssuePrefix: "\u2705 ",
285
+ format: "{type}: {emoji}{subject}"
286
+ }
415
287
  };
416
-
417
- // src/commitlint/config/minimal.ts
418
288
  var config = {
419
- rules: DEFAULT_MINIMAL_COMMIT_RULES,
420
- helpUrl: "https://developer.stormsoftware.com/commitlint/minimal"
289
+ types: DEFAULT_COMMIT_TYPES,
290
+ changelogs,
291
+ commitlint
421
292
  };
422
293
  var minimal_default = config;
423
294
 
424
- // src/commitlint/config/monorepo.ts
295
+ // ../conventional-changelog/src/configs/monorepo.ts
296
+ var changelogs2 = {
297
+ props: {
298
+ ignoreCommits: void 0,
299
+ types: CHANGELOG_COMMIT_TYPES,
300
+ bumpStrict: true,
301
+ scope: ["monorepo"],
302
+ scopeOnly: true
303
+ }
304
+ };
305
+ var commitlint2 = {
306
+ helpUrl: "https://developer.stormsoftware.com/commitlint/monorepo",
307
+ rules: {
308
+ "body-leading-blank": [1 /* Warning */, "always"],
309
+ "body-max-length": [2 /* Error */, "always", 600],
310
+ "footer-leading-blank": [1 /* Warning */, "always"],
311
+ "footer-max-line-length": [2 /* Error */, "always", 150],
312
+ "header-max-length": [2 /* Error */, "always", 150],
313
+ "header-trim": [2 /* Error */, "always"],
314
+ "subject-case": [2 /* Error */, "always", ["sentence-case"]],
315
+ "subject-empty": [2 /* Error */, "never"],
316
+ "subject-full-stop": [2 /* Error */, "never", "."],
317
+ "subject-max-length": [2 /* Error */, "always", 150],
318
+ "subject-min-length": [2 /* Error */, "always", 3],
319
+ "type-case": [2 /* Error */, "always", "kebab-case"],
320
+ "type-empty": [2 /* Error */, "never"],
321
+ "type-enum": [
322
+ 2 /* Error */,
323
+ "always",
324
+ Object.keys(DEFAULT_COMMIT_TYPES)
325
+ ],
326
+ "type-max-length": [2 /* Error */, "always", 20],
327
+ "type-min-length": [2 /* Error */, "always", 3],
328
+ "scope-case": [2 /* Error */, "always", ["kebab-case"]],
329
+ "scope-empty": [2 /* Error */, "never"]
330
+ },
331
+ settings: {
332
+ enableMultipleScopes: false,
333
+ disableEmoji: true,
334
+ breakingChangePrefix: "\u{1F4A3} ",
335
+ closedIssuePrefix: "\u2705 ",
336
+ format: "{type}({scope}): {emoji}{subject}"
337
+ }
338
+ };
425
339
  var config2 = {
426
- rules: DEFAULT_MONOREPO_COMMIT_RULES,
427
- helpUrl: "https://developer.stormsoftware.com/commitlint/monorepo"
340
+ types: DEFAULT_COMMIT_TYPES,
341
+ changelogs: changelogs2,
342
+ commitlint: commitlint2
428
343
  };
429
344
  var monorepo_default = config2;
430
345
 
431
- // src/commitlint/helpers.ts
432
- var jiti = createJiti(import.meta.url, { importMeta: import.meta });
433
- async function resolveCommitlintConfig(workspaceConfig, configPath) {
434
- if (configPath && configPath !== "@storm-software/git-tools/commitlint/minimal" && configPath !== "@storm-software/git-tools/commitlint/monorepo") {
435
- writeInfo(
436
- `Using custom commitlint config file: ${configPath}`,
437
- workspaceConfig
438
- );
439
- } else {
440
- configPath = workspaceConfig?.variant === "minimal" ? "@storm-software/git-tools/commitlint/minimal" : "@storm-software/git-tools/commitlint/monorepo";
441
- writeInfo(
442
- `Using standard commitlint config file: ${configPath}`,
443
- workspaceConfig
346
+ // ../conventional-changelog/src/configs/index.ts
347
+ var COMMIT_CONFIGS = { minimal: minimal_default, monorepo: monorepo_default };
348
+ async function getNxScopes(context) {
349
+ let projectGraph;
350
+ try {
351
+ projectGraph = readCachedProjectGraph();
352
+ } catch {
353
+ await createProjectGraphAsync$1();
354
+ projectGraph = readCachedProjectGraph();
355
+ }
356
+ if (!projectGraph) {
357
+ throw new Error(
358
+ "The commit process failed because the project graph is not available. Please run the build command again."
444
359
  );
445
360
  }
446
- let config5 = {};
447
- if ((configPath.endsWith(".json") || configPath.endsWith(".jsonc")) && !existsSync$1(jiti.esmResolve(configPath, workspaceConfig.workspaceRoot))) {
448
- const configContent = await readFile$1(
449
- jiti.esmResolve(configPath, workspaceConfig.workspaceRoot),
450
- "utf8"
361
+ const projectConfigs = readProjectsConfigurationFromProjectGraph$1(projectGraph);
362
+ const result = Object.entries(projectConfigs.projects || {}).map(([name, project]) => ({
363
+ name,
364
+ ...project
365
+ })).filter(
366
+ (project) => project.name && project.root && project.root !== "." && project.root !== context.config.workspaceRoot && !project.name.includes("e2e")
367
+ ).filter((project) => project.targets).map((project) => project.name).filter(Boolean).sort((a, b) => a.localeCompare(b));
368
+ result.unshift("monorepo");
369
+ return result;
370
+ }
371
+ function getScopeEnum(context) {
372
+ return getNxScopes(context);
373
+ }
374
+ function getRuleFromScopeEnum(scopeEnum) {
375
+ if (!scopeEnum?.filter(Boolean).length) {
376
+ throw new Error("No scopes found in the Storm workspace.");
377
+ }
378
+ return [
379
+ 2 /* Error */,
380
+ "always",
381
+ scopeEnum.filter(Boolean)
382
+ ];
383
+ }
384
+
385
+ // ../conventional-changelog/src/index.ts
386
+ async function createPreset(variant = "monorepo") {
387
+ const workspaceConfig = await getWorkspaceConfig();
388
+ if (variant === "minimal") {
389
+ return defu(
390
+ await createBasePreset({ ...COMMIT_CONFIGS.minimal.changelogs.props }),
391
+ {
392
+ ...COMMIT_CONFIGS.minimal,
393
+ commitlint: {
394
+ ...COMMIT_CONFIGS.minimal.commitlint,
395
+ regex: new RegExp(
396
+ `(${Object.keys(DEFAULT_COMMIT_TYPES).join("|")})!?:\\s([a-z0-9:\\-\\/\\s])+`
397
+ )
398
+ }
399
+ }
451
400
  );
452
- config5 = JSON.parse(configContent);
453
- } else {
454
- config5 = await jiti.import(jiti.esmResolve(configPath), { default: true });
455
401
  }
456
- return {
457
- ...workspaceConfig.variant === "minimal" ? minimal_default : monorepo_default,
458
- ...config5 ?? {}
459
- };
402
+ const nxScopes = await getNxScopes({ config: workspaceConfig });
403
+ return defu(
404
+ await createBasePreset({
405
+ ...COMMIT_CONFIGS.monorepo.changelogs.props,
406
+ scope: nxScopes
407
+ }),
408
+ {
409
+ ...COMMIT_CONFIGS.monorepo,
410
+ commitlint: {
411
+ ...COMMIT_CONFIGS.monorepo.commitlint,
412
+ rules: {
413
+ ...COMMIT_CONFIGS.monorepo.commitlint.rules,
414
+ ["scope-enum"]: getRuleFromScopeEnum(nxScopes)
415
+ },
416
+ regex: new RegExp(
417
+ `(${Object.keys(DEFAULT_COMMIT_TYPES).join("|")})\\((${nxScopes.join("|")})\\)!?:\\s([a-z0-9:\\-\\/\\s])+`
418
+ )
419
+ }
420
+ }
421
+ );
460
422
  }
461
423
 
462
424
  // ../../node_modules/.pnpm/conventional-commits-parser@6.2.0/node_modules/conventional-commits-parser/dist/regex.js
@@ -874,12 +836,8 @@ ${body}` : message;
874
836
  ${footer}` : message;
875
837
  return message || "";
876
838
  };
877
- async function lint(message, commitlintConfig) {
878
- const workspaceConfig = await getWorkspaceConfig();
879
- const parserOpts = await createParserOpts(workspaceConfig.variant);
880
- const parser = new CommitParser(
881
- defu(commitlintConfig.parserOpts, parserOpts)
882
- );
839
+ async function lint(message, config5) {
840
+ const parser = new CommitParser(config5.parser || {});
883
841
  const parsed = parser.parse(message);
884
842
  if (parsed.header === null && parsed.body === null && parsed.footer === null) {
885
843
  return {
@@ -890,7 +848,7 @@ async function lint(message, commitlintConfig) {
890
848
  };
891
849
  }
892
850
  const allRules = new Map(Object.entries(defaultRules));
893
- const missing = Object.keys(commitlintConfig.rules).filter(
851
+ const missing = Object.keys(config5.commitlint.rules).filter(
894
852
  (name) => typeof allRules.get(name) !== "function"
895
853
  );
896
854
  if (missing.length > 0) {
@@ -902,19 +860,19 @@ async function lint(message, commitlintConfig) {
902
860
  ].join("\n")
903
861
  );
904
862
  }
905
- const invalid = Object.entries(commitlintConfig.rules).map(([name, config5]) => {
906
- if (!Array.isArray(config5)) {
863
+ const invalid = Object.entries(config5.commitlint.rules).map(([name, config6]) => {
864
+ if (!Array.isArray(config6)) {
907
865
  return new Error(
908
866
  `config for rule ${name} must be array, received ${util.inspect(
909
- config5
910
- )} of type ${typeof config5}`
867
+ config6
868
+ )} of type ${typeof config6}`
911
869
  );
912
870
  }
913
- const [level] = config5;
914
- if (level === 0 /* Disabled */ && config5.length === 1) {
871
+ const [level] = config6;
872
+ if (level === 0 /* Disabled */ && config6.length === 1) {
915
873
  return null;
916
874
  }
917
- const [, when] = config5;
875
+ const [, when] = config6;
918
876
  if (typeof level !== "number" || isNaN(level)) {
919
877
  return new Error(
920
878
  `level for rule ${name} must be number, received ${util.inspect(
@@ -922,11 +880,11 @@ async function lint(message, commitlintConfig) {
922
880
  )} of type ${typeof level}`
923
881
  );
924
882
  }
925
- if (config5.length < 2 || config5.length > 3) {
883
+ if (config6.length < 2 || config6.length > 3) {
926
884
  return new Error(
927
885
  `config for rule ${name} must be 2 or 3 items long, received ${util.inspect(
928
- config5
929
- )} of length ${config5.length}`
886
+ config6
887
+ )} of length ${config6.length}`
930
888
  );
931
889
  }
932
890
  if (level < 0 || level > 2) {
@@ -956,10 +914,10 @@ async function lint(message, commitlintConfig) {
956
914
  throw new Error(invalid.map((i) => i.message).join("\n"));
957
915
  }
958
916
  const pendingResults = Object.entries(
959
- commitlintConfig.rules
960
- ).filter(([, config5]) => !!config5 && config5.length && config5[0] > 0).map(async (entry) => {
961
- const [name, config5] = entry;
962
- const [level, when, value] = config5;
917
+ config5.commitlint.rules
918
+ ).filter(([, config6]) => !!config6 && config6.length && config6[0] > 0).map(async (entry) => {
919
+ const [name, config6] = entry;
920
+ const [level, when, value] = config6;
963
921
  const rule = allRules.get(name);
964
922
  if (!rule) {
965
923
  throw new Error(`Could not find rule implementation for ${name}`);
@@ -990,45 +948,6 @@ async function lint(message, commitlintConfig) {
990
948
  input: buildCommitMessage(parsed)
991
949
  };
992
950
  }
993
- async function getNxScopes(context) {
994
- let projectGraph;
995
- try {
996
- projectGraph = readCachedProjectGraph();
997
- } catch {
998
- await createProjectGraphAsync$1();
999
- projectGraph = readCachedProjectGraph();
1000
- }
1001
- if (!projectGraph) {
1002
- throw new Error(
1003
- "The commit process failed because the project graph is not available. Please run the build command again."
1004
- );
1005
- }
1006
- const projectConfigs = readProjectsConfigurationFromProjectGraph$1(projectGraph);
1007
- const result = Object.entries(projectConfigs.projects || {}).map(([name, project]) => ({
1008
- name,
1009
- ...project
1010
- })).filter(
1011
- (project) => project.name && project.root && project.root !== "." && project.root !== context.config.workspaceRoot && !project.name.includes("e2e")
1012
- ).filter((project) => project.targets).map((project) => project.name).filter(Boolean).sort((a, b) => a.localeCompare(b));
1013
- result.unshift("monorepo");
1014
- return result;
1015
- }
1016
- function getScopeEnumUtil(context) {
1017
- return () => getScopeEnum(context);
1018
- }
1019
- function getScopeEnum(context) {
1020
- return getNxScopes(context);
1021
- }
1022
- function getRuleFromScopeEnum(scopeEnum) {
1023
- if (!scopeEnum?.filter(Boolean).length) {
1024
- throw new Error("No scopes found in the Storm workspace.");
1025
- }
1026
- return [
1027
- 2 /* Error */,
1028
- "always",
1029
- scopeEnum.filter(Boolean)
1030
- ];
1031
- }
1032
951
 
1033
952
  // src/commitlint/run.ts
1034
953
  var COMMIT_EDITMSG_PATH = ".git/COMMIT_EDITMSG";
@@ -1083,31 +1002,9 @@ async function runCommitLint(workspaceConfig, options) {
1083
1002
  return;
1084
1003
  }
1085
1004
  }
1086
- const commitlintConfig = await resolveCommitlintConfig(
1087
- workspaceConfig,
1088
- options.config
1089
- );
1090
- let commitlintRegex;
1091
- const allowedTypes = commitlintConfig.rules["type-enum"] ?? COMMIT_TYPES;
1092
- let allowedScopes = [];
1093
- if (workspaceConfig.variant !== "minimal" && commitlintConfig.rules["scope-empty"] && commitlintConfig.rules["scope-empty"][0] !== 0 /* Disabled */) {
1094
- allowedScopes = await getNxScopes({
1095
- config: workspaceConfig
1096
- });
1097
- commitlintConfig.rules["scope-enum"] = getRuleFromScopeEnum(allowedScopes);
1098
- commitlintRegex = new RegExp(
1099
- `(${Object.keys(allowedTypes).join("|")})\\((${allowedScopes})\\)!?:\\s([a-z0-9:\\-\\/\\s])+`
1100
- );
1101
- } else {
1102
- commitlintRegex = new RegExp(
1103
- `(${Object.keys(allowedTypes).join("|")})!?:\\s([a-z0-9:\\-\\/\\s])+`
1104
- );
1105
- }
1106
- const report = await lint(commitMessage, {
1107
- ...commitlintConfig,
1108
- parserOpts: createParserOpts(workspaceConfig.variant)
1109
- });
1110
- if (!commitlintRegex.test(commitMessage) || report.errors.length || report.warnings.length) {
1005
+ const preset = await createPreset(workspaceConfig.variant);
1006
+ const report = await lint(commitMessage, preset);
1007
+ if (!preset.commitlint.regex.test(commitMessage) || report.errors.length || report.warnings.length) {
1111
1008
  writeSuccess(
1112
1009
  `Commit was processing completed successfully!`,
1113
1010
  workspaceConfig
@@ -1116,14 +1013,16 @@ async function runCommitLint(workspaceConfig, options) {
1116
1013
  let errorMessage = " Oh no! Your commit message: \n-------------------------------------------------------------------\n" + commitMessage + `
1117
1014
  -------------------------------------------------------------------
1118
1015
 
1119
- Does not follow the ${workspaceConfig.variant} commit message convention specified by the ${(typeof workspaceConfig.organization === "string" ? workspaceConfig.organization : workspaceConfig.organization?.name) || "Storm Software"} team.`;
1120
- errorMessage += allowedScopes.length ? "\ntype(scope): subject \n BLANK LINE \n body" : "\ntype: subject \n BLANK LINE \n body";
1016
+ Does not follow the \`${workspaceConfig.variant}\` commit message convention specified by the ${(typeof workspaceConfig.organization === "string" ? workspaceConfig.organization : workspaceConfig.organization?.name) || "Storm Software"} team.`;
1017
+ errorMessage += preset.changelogs.props.scope?.length ? "\ntype(scope): subject \n BLANK LINE \n body" : "\ntype: subject \n BLANK LINE \n body";
1121
1018
  errorMessage += "\n";
1122
1019
  errorMessage += `
1123
- Possible types: ${allowedTypes}`;
1124
- if (allowedScopes.length) {
1020
+ Possible types: ${preset.changelogs.props.types.map(
1021
+ (type) => `${type.section} (${type.type})`
1022
+ )}`;
1023
+ if (preset.changelogs.props.scope?.length) {
1125
1024
  errorMessage += `
1126
- Possible scopes: ${allowedScopes} (if unsure use "monorepo")`;
1025
+ Possible scopes: ${preset.changelogs.props.scope} (if unsure use "monorepo")`;
1127
1026
  }
1128
1027
  errorMessage += "\n\nEXAMPLE: \nfeat(my-lib): add an option to generate lazy-loadable modules\nfix(monorepo)!: breaking change should have exclamation mark\n";
1129
1028
  errorMessage += `
@@ -1134,86 +1033,116 @@ CommitLint Warnings: ${report.warnings.length ? report.warnings.map((warning) =>
1134
1033
  errorMessage += "\n\nPlease fix the commit message and rerun storm-commit.";
1135
1034
  errorMessage += `
1136
1035
 
1137
- More details about the Storm Software commit message specification can be found at: ${commitlintConfig.helpUrl}`;
1036
+ More details about the Storm Software commit message specification can be found at: ${preset.commitlint.helpUrl}`;
1138
1037
  throw new Error(errorMessage);
1139
1038
  }
1140
1039
  return report.input;
1141
1040
  }
1142
1041
 
1042
+ // src/types.ts
1043
+ var DEFAULT_COMMIT_PROMPT_MESSAGES = {
1044
+ skip: "press enter to skip",
1045
+ max: "must be %d chars at most",
1046
+ min: "must be %d chars at least",
1047
+ emptyWarning: "can not be empty",
1048
+ upperLimitWarning: "%s is %d characters longer than the upper limit",
1049
+ lowerLimitWarning: "%s is %d characters less than the lower limit",
1050
+ closedIssueMessage: "Closes: "
1051
+ };
1052
+
1143
1053
  // src/commit/config/minimal.ts
1054
+ var DEFAULT_MINIMAL_COMMIT_QUESTIONS = {
1055
+ type: {
1056
+ type: "select",
1057
+ title: "Commit Type",
1058
+ description: "Select the commit type that best describes your changes",
1059
+ enum: Object.keys(DEFAULT_COMMIT_TYPES).filter(
1060
+ (type) => DEFAULT_COMMIT_TYPES[type].hidden !== true
1061
+ ).reduce((ret, type) => {
1062
+ ret[type] = DEFAULT_COMMIT_TYPES[type];
1063
+ return ret;
1064
+ }, {}),
1065
+ defaultValue: "chore",
1066
+ maxLength: 20,
1067
+ minLength: 3
1068
+ },
1069
+ subject: {
1070
+ type: "input",
1071
+ title: "Commit Subject",
1072
+ description: "Write a short, imperative tense description of the change",
1073
+ maxLength: 150,
1074
+ minLength: 3
1075
+ },
1076
+ body: {
1077
+ type: "input",
1078
+ title: "Commit Body",
1079
+ description: "Provide a longer description of the change",
1080
+ maxLength: 600
1081
+ },
1082
+ isBreaking: {
1083
+ type: "confirm",
1084
+ title: "Breaking Changes",
1085
+ description: "Are there any breaking changes as a result of this commit?",
1086
+ defaultValue: false
1087
+ },
1088
+ breakingBody: {
1089
+ type: "input",
1090
+ title: "Breaking Changes (Details)",
1091
+ description: "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself",
1092
+ when: (answers) => answers.isBreaking === true,
1093
+ maxLength: 600,
1094
+ minLength: 3
1095
+ },
1096
+ isIssueAffected: {
1097
+ type: "confirm",
1098
+ title: "Open Issue Affected",
1099
+ description: "Does this change impact any open issues?",
1100
+ defaultValue: false
1101
+ },
1102
+ issuesBody: {
1103
+ type: "input",
1104
+ title: "Open Issue Affected (Details)",
1105
+ description: "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself",
1106
+ when: (answers) => answers.isIssueAffected === true,
1107
+ maxLength: 600,
1108
+ minLength: 3
1109
+ }
1110
+ };
1144
1111
  var config3 = {
1145
- settings: DEFAULT_MINIMAL_COMMIT_SETTINGS,
1112
+ settings: COMMIT_CONFIGS.minimal.commitlint.settings,
1146
1113
  messages: DEFAULT_COMMIT_PROMPT_MESSAGES,
1147
1114
  questions: DEFAULT_MINIMAL_COMMIT_QUESTIONS,
1148
- types: COMMIT_TYPES
1115
+ types: DEFAULT_COMMIT_TYPES
1149
1116
  };
1150
1117
  var minimal_default2 = config3;
1151
1118
 
1152
1119
  // src/commit/config/monorepo.ts
1120
+ var DEFAULT_MONOREPO_COMMIT_QUESTIONS = {
1121
+ type: DEFAULT_MINIMAL_COMMIT_QUESTIONS.type,
1122
+ scope: {
1123
+ type: "select",
1124
+ title: "Commit Scope",
1125
+ description: "Select the project that's the most impacted by this change",
1126
+ enum: {},
1127
+ defaultValue: "monorepo",
1128
+ maxLength: 50,
1129
+ minLength: 1
1130
+ },
1131
+ subject: DEFAULT_MINIMAL_COMMIT_QUESTIONS.subject,
1132
+ body: DEFAULT_MINIMAL_COMMIT_QUESTIONS.body,
1133
+ isBreaking: DEFAULT_MINIMAL_COMMIT_QUESTIONS.isBreaking,
1134
+ breakingBody: DEFAULT_MINIMAL_COMMIT_QUESTIONS.breakingBody,
1135
+ isIssueAffected: DEFAULT_MINIMAL_COMMIT_QUESTIONS.isIssueAffected,
1136
+ issuesBody: DEFAULT_MINIMAL_COMMIT_QUESTIONS.issuesBody
1137
+ };
1153
1138
  var config4 = {
1154
- settings: DEFAULT_MONOREPO_COMMIT_SETTINGS,
1139
+ settings: COMMIT_CONFIGS.monorepo.commitlint.settings,
1155
1140
  messages: DEFAULT_COMMIT_PROMPT_MESSAGES,
1156
1141
  questions: DEFAULT_MONOREPO_COMMIT_QUESTIONS,
1157
- types: COMMIT_TYPES
1142
+ types: DEFAULT_COMMIT_TYPES
1158
1143
  };
1159
1144
  var monorepo_default2 = config4;
1160
1145
 
1161
- // src/commit/helpers.ts
1162
- function resolveMinimalCommitOptions(config5 = minimal_default2) {
1163
- return {
1164
- parserPreset: "conventional-changelog-storm-software",
1165
- prompt: {
1166
- settings: config5.settings,
1167
- messages: config5.messages,
1168
- questions: config5.questions
1169
- }
1170
- };
1171
- }
1172
- function resolveMonorepoCommitOptions(workspaceConfig, config5 = monorepo_default2) {
1173
- return {
1174
- utils: { getScopeEnum: getScopeEnumUtil({ config: workspaceConfig }) },
1175
- parserPreset: "conventional-changelog-storm-software",
1176
- prompt: {
1177
- settings: config5.settings,
1178
- messages: config5.messages,
1179
- questions: config5.questions
1180
- }
1181
- };
1182
- }
1183
- var jiti2 = createJiti(import.meta.url, { importMeta: import.meta });
1184
- async function resolveCommitConfig(workspaceConfig, configPath) {
1185
- if (configPath && configPath !== "@storm-software/git-tools/commit/minimal" && configPath !== "@storm-software/git-tools/commit/monorepo") {
1186
- writeInfo(
1187
- `Using custom commit config file: ${configPath}`,
1188
- workspaceConfig
1189
- );
1190
- } else {
1191
- configPath = workspaceConfig?.variant === "minimal" ? "@storm-software/git-tools/commit/minimal" : "@storm-software/git-tools/commit/monorepo";
1192
- writeInfo(
1193
- `Using standard commit config file: ${configPath}`,
1194
- workspaceConfig
1195
- );
1196
- }
1197
- let config5 = {};
1198
- if ((configPath.endsWith(".json") || configPath.endsWith(".jsonc")) && !existsSync$1(jiti2.esmResolve(configPath, workspaceConfig.workspaceRoot))) {
1199
- const configContent = await readFile$1(
1200
- jiti2.esmResolve(configPath, workspaceConfig.workspaceRoot),
1201
- "utf8"
1202
- );
1203
- config5 = JSON.parse(configContent);
1204
- } else {
1205
- config5 = await jiti2.import(jiti2.esmResolve(configPath), { default: true });
1206
- }
1207
- const mergedConfig = {
1208
- ...config5 ?? {},
1209
- ...workspaceConfig.variant === "minimal" ? minimal_default2 : monorepo_default2
1210
- };
1211
- return workspaceConfig.variant === "minimal" ? resolveMinimalCommitOptions(mergedConfig) : resolveMonorepoCommitOptions(
1212
- workspaceConfig,
1213
- mergedConfig
1214
- );
1215
- }
1216
-
1217
1146
  // src/commit/commit-state.ts
1218
1147
  function getGitDir() {
1219
1148
  const devNull = process.platform === "win32" ? " nul" : "/dev/null";
@@ -1234,34 +1163,33 @@ async function createState(workspaceConfig, configPath) {
1234
1163
  }
1235
1164
  const state = {
1236
1165
  variant: workspaceConfig.variant,
1237
- config: await resolveCommitConfig(workspaceConfig, configPath),
1166
+ config: workspaceConfig.variant === "minimal" ? minimal_default2 : monorepo_default2,
1238
1167
  root,
1239
1168
  answers: {}
1240
1169
  };
1241
- if (state.config.prompt.questions.type && state.config.prompt.questions.type.enum) {
1242
- state.config.prompt.questions.type.enum = Object.keys(state.config.prompt.questions.type.enum).reduce(
1243
- (ret, key) => {
1244
- if (state.config.prompt.questions.type.enum) {
1245
- ret[key] = {
1246
- ...state.config.prompt.questions.type.enum[key],
1247
- title: chalkTemplate`${state.config.prompt.questions.type.enum[key]?.emoji ? `${state.config.prompt.questions.type.enum[key]?.emoji} ` : ""}{bold ${key}} ${state.config.prompt.questions.type.enum[key]?.title && state.config.prompt.questions.type.enum[key]?.title !== key ? `- ${state.config.prompt.questions.type.enum[key]?.title}` : ""}${state.config.prompt.questions.type.enum[key]?.semverBump ? ` (version bump: ${state.config.prompt.questions.type.enum[key]?.semverBump})` : ""}`,
1248
- hidden: false
1249
- };
1250
- }
1251
- return ret;
1252
- },
1253
- {}
1254
- );
1170
+ if (state.config.questions.type && state.config.questions.type.enum) {
1171
+ state.config.questions.type.enum = Object.keys(
1172
+ state.config.questions.type.enum
1173
+ ).reduce((ret, key) => {
1174
+ if (state.config.questions.type.enum) {
1175
+ ret[key] = {
1176
+ ...state.config.questions.type.enum[key],
1177
+ title: chalkTemplate`${state.config.questions.type.enum[key]?.emoji ? `${state.config.questions.type.enum[key]?.emoji} ` : ""}{bold ${key}} ${state.config.questions.type.enum[key]?.title && state.config.questions.type.enum[key]?.title !== key ? `- ${state.config.questions.type.enum[key]?.title}` : ""}${state.config.questions.type.enum[key]?.semverBump ? ` (version bump: ${state.config.questions.type.enum[key]?.semverBump})` : ""}`,
1178
+ hidden: false
1179
+ };
1180
+ }
1181
+ return ret;
1182
+ }, {});
1255
1183
  }
1256
- if (workspaceConfig.variant === "monorepo" && (!state.config.prompt.questions?.scope || !state.config.prompt.questions?.scope.enum || Object.keys(
1257
- state.config.prompt.questions?.scope.enum
1184
+ if (workspaceConfig.variant === "monorepo" && (!state.config.questions?.scope || !state.config.questions?.scope.enum || Object.keys(
1185
+ state.config.questions?.scope.enum
1258
1186
  ).length === 0)) {
1259
1187
  const scopes = await getScopeEnum({
1260
1188
  config: workspaceConfig
1261
1189
  });
1262
1190
  for (const scope of scopes) {
1263
1191
  if (scope === "monorepo") {
1264
- state.config.prompt.questions.scope.enum[scope] = {
1192
+ state.config.questions.scope.enum[scope] = {
1265
1193
  title: chalkTemplate`{bold monorepo} - workspace root`,
1266
1194
  description: "The base workspace package (workspace root)",
1267
1195
  hidden: false,
@@ -1295,7 +1223,7 @@ async function createState(workspaceConfig, configPath) {
1295
1223
  const packageJson = JSON.parse(packageJsonFile);
1296
1224
  description = packageJson.description || description;
1297
1225
  }
1298
- state.config.prompt.questions.scope.enum[scope] = {
1226
+ state.config.questions.scope.enum[scope] = {
1299
1227
  title: chalkTemplate`{bold ${project.name}} - ${project.root}`,
1300
1228
  description,
1301
1229
  hidden: false,
@@ -1305,7 +1233,7 @@ async function createState(workspaceConfig, configPath) {
1305
1233
  }
1306
1234
  }
1307
1235
  }
1308
- state.answers = Object.keys(state.config.prompt.questions).reduce(
1236
+ state.answers = Object.keys(state.config.questions).reduce(
1309
1237
  (ret, key) => {
1310
1238
  ret[key] = "";
1311
1239
  return ret;
@@ -1335,14 +1263,11 @@ var formatCommitMessage = (state, workspaceConfig) => {
1335
1263
  const scope = workspaceConfig.variant !== "minimal" && typeof answers.scope === "string" && answers.scope ? answers.scope.trim() : "";
1336
1264
  const subject = answers.subject?.trim();
1337
1265
  const type = answers.type;
1338
- const format2 = config5.prompt.settings.format || (workspaceConfig.variant !== "minimal" ? "{type}({scope}): {emoji}{subject}" : "{type}: {emoji}{subject}");
1266
+ const format2 = config5.settings.format || (workspaceConfig.variant !== "minimal" ? "{type}({scope}): {emoji}{subject}" : "{type}: {emoji}{subject}");
1339
1267
  const body = answers.body && typeof answers.body === "string" ? wrap(answers.body || "", wrapOptions) : "";
1340
1268
  const breaking = answers.breakingBody && typeof answers.breakingBody === "string" ? wrap(answers.breakingBody || "", wrapOptions) : "";
1341
1269
  const issues = answers.issuesBody && typeof answers.issuesBody === "string" ? wrap(answers.issuesBody || "", wrapOptions) : "";
1342
- const head = format2.replace(
1343
- /\{emoji\}/g,
1344
- config5.prompt.settings.disableEmoji ? "" : `${emoji} `
1345
- ).replace(/\{scope\}/g, scope).replace(/\{subject\}/g, subject || "").replace(/\{type\}/g, type || "");
1270
+ const head = format2.replace(/\{emoji\}/g, config5.settings.disableEmoji ? "" : `${emoji} `).replace(/\{scope\}/g, scope).replace(/\{subject\}/g, subject || "").replace(/\{type\}/g, type || "");
1346
1271
  let msg = head;
1347
1272
  if (body) {
1348
1273
  msg += `
@@ -1350,16 +1275,16 @@ var formatCommitMessage = (state, workspaceConfig) => {
1350
1275
  ${body}`;
1351
1276
  }
1352
1277
  if (breaking) {
1353
- const breakingEmoji = config5.prompt.settings.disableEmoji ? "" : config5.prompt.settings.breakingChangePrefix;
1278
+ const breakingEmoji = config5.settings.disableEmoji ? "" : config5.settings.breakingChangePrefix;
1354
1279
  msg += `
1355
1280
 
1356
1281
  BREAKING CHANGE: ${breakingEmoji}${breaking}`;
1357
1282
  }
1358
1283
  if (issues) {
1359
- const closedIssueEmoji = config5.prompt.settings.disableEmoji ? "" : config5.prompt.settings.closedIssuePrefix;
1284
+ const closedIssueEmoji = config5.settings.disableEmoji ? "" : config5.settings.closedIssuePrefix;
1360
1285
  msg += `
1361
1286
 
1362
- ${closedIssueEmoji}${config5.prompt.settings.closedIssueMessage}${issues}`;
1287
+ ${closedIssueEmoji}${config5.settings.closedIssueMessage}${issues}`;
1363
1288
  }
1364
1289
  return msg;
1365
1290
  };
@@ -1367,7 +1292,7 @@ ${closedIssueEmoji}${config5.prompt.settings.closedIssueMessage}${issues}`;
1367
1292
  // src/commit/run.ts
1368
1293
  async function runCommit(commitizenFile, dryRun = false) {
1369
1294
  const workspaceConfig = await getWorkspaceConfig();
1370
- const state = await createState(workspaceConfig, commitizenFile);
1295
+ const state = await createState(workspaceConfig);
1371
1296
  if (dryRun) {
1372
1297
  writeInfo("Running in dry mode.", workspaceConfig);
1373
1298
  }
@@ -1404,11 +1329,11 @@ async function runCommit(commitizenFile, dryRun = false) {
1404
1329
  }
1405
1330
  async function askQuestions(state) {
1406
1331
  let index = 0;
1407
- for (const key of Object.keys(state.config.prompt.questions)) {
1408
- if (state.config.prompt.questions[key] && !state.config.prompt.questions[key].hidden && (!state.config.prompt.questions[key].when || state.config.prompt.questions[key].when(state.answers))) {
1332
+ for (const key of Object.keys(state.config.questions)) {
1333
+ if (state.config.questions[key] && !state.config.questions[key].hidden && (!state.config.questions[key].when || state.config.questions[key].when(state.answers))) {
1409
1334
  state.answers[key] = await askQuestion(
1410
1335
  index,
1411
- state.config.prompt.questions[key]
1336
+ state.config.questions[key]
1412
1337
  );
1413
1338
  index++;
1414
1339
  }
@@ -4256,7 +4181,7 @@ ${workspaceConfig.release.footer}
4256
4181
  // src/release/config.ts
4257
4182
  var DEFAULT_CONVENTIONAL_COMMITS_CONFIG2 = {
4258
4183
  questions: DEFAULT_MONOREPO_COMMIT_QUESTIONS,
4259
- types: COMMIT_TYPES
4184
+ types: DEFAULT_COMMIT_TYPES
4260
4185
  };
4261
4186
  var DEFAULT_RELEASE_GROUP_CONFIG = {
4262
4187
  projectsRelationship: "independent",