@storm-software/git-tools 2.121.4 → 2.122.1
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/README.md +1 -1
- package/bin/{chunk-N5U2S3QK.cjs → chunk-5SPAQH6A.cjs} +10 -15
- package/bin/{chunk-QBJQH2IK.js → chunk-LBURTJLB.js} +10 -10
- package/bin/git.cjs +405 -480
- package/bin/git.js +342 -417
- package/bin/post-checkout.cjs +9 -9
- package/bin/post-checkout.js +1 -1
- package/bin/post-commit.cjs +9 -9
- package/bin/post-commit.js +1 -1
- package/bin/post-merge.cjs +9 -9
- package/bin/post-merge.js +1 -1
- package/bin/pre-commit.cjs +9 -9
- package/bin/pre-commit.js +1 -1
- package/bin/pre-install.cjs +9 -9
- package/bin/pre-install.js +1 -1
- package/bin/pre-push.cjs +13 -13
- package/bin/pre-push.js +1 -1
- package/bin/prepare.cjs +7 -7
- package/bin/prepare.js +1 -1
- package/bin/version-warning.cjs +5 -5
- package/bin/version-warning.js +1 -1
- package/dist/chunk-3GGWHKRP.js +274 -0
- package/dist/chunk-4VPJA7YJ.cjs +274 -0
- package/dist/chunk-5XU2KBM6.js +14 -0
- package/dist/chunk-F7OO6L26.cjs +78 -0
- package/dist/{chunk-RG47FAF4.cjs → chunk-GOKUSEH3.cjs} +5 -3
- package/dist/chunk-JCEVFJCA.js +42 -0
- package/dist/chunk-KZRVQ5RZ.js +78 -0
- package/dist/chunk-NY53WLGC.cjs +42 -0
- package/dist/chunk-YBAE6I5L.cjs +14 -0
- package/dist/{chunk-2IQTQBAX.js → chunk-YCEUZFMU.js} +5 -3
- package/dist/commit/minimal.cjs +4 -12
- package/dist/commit/minimal.d.cts +249 -7
- package/dist/commit/minimal.d.ts +249 -7
- package/dist/commit/minimal.js +5 -13
- package/dist/commit/monorepo.cjs +7 -3
- package/dist/commit/monorepo.d.cts +269 -4
- package/dist/commit/monorepo.d.ts +269 -4
- package/dist/commit/monorepo.js +6 -2
- package/dist/commitlint/minimal.cjs +2 -3
- package/dist/commitlint/minimal.d.cts +27 -6
- package/dist/commitlint/minimal.d.ts +27 -6
- package/dist/commitlint/minimal.js +3 -4
- package/dist/commitlint/monorepo.cjs +2 -3
- package/dist/commitlint/monorepo.d.cts +28 -6
- package/dist/commitlint/monorepo.d.ts +28 -6
- package/dist/commitlint/monorepo.js +3 -4
- package/dist/index.cjs +6 -19
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +9 -22
- package/dist/release/config.cjs +6 -3
- package/dist/release/config.d.cts +2 -1
- package/dist/release/config.d.ts +2 -1
- package/dist/release/config.js +5 -2
- package/dist/types.cjs +2 -20
- package/dist/types.d.cts +3 -250
- package/dist/types.d.ts +3 -250
- package/dist/types.js +3 -21
- package/package.json +5 -5
- package/dist/chunk-25G45MG4.js +0 -19
- package/dist/chunk-2RKFQIWE.cjs +0 -19
- package/dist/chunk-2SHAD3P5.cjs +0 -301
- package/dist/chunk-GRCMQK4Q.js +0 -301
package/bin/git.cjs
CHANGED
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkCIJVSMK2_cjs = require('./chunk-CIJVSMK2.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunk5SPAQH6A_cjs = require('./chunk-5SPAQH6A.cjs');
|
|
6
6
|
var TOML = require('@ltd/j-toml');
|
|
7
7
|
var commander = require('commander');
|
|
8
8
|
var prompts = require('@inquirer/prompts');
|
|
9
9
|
var shellescape = require('any-shell-escape');
|
|
10
10
|
var chalkTemplate = require('chalk-template');
|
|
11
11
|
var fs = require('fs/promises');
|
|
12
|
+
var createBasePreset = require('conventional-changelog-conventionalcommits');
|
|
13
|
+
var projectGraph = require('nx/src/project-graph/project-graph');
|
|
12
14
|
var fs$1 = require('fs');
|
|
13
15
|
var childProcess = require('child_process');
|
|
14
|
-
var jiti$1 = require('jiti');
|
|
15
16
|
var defaultRules = require('@commitlint/rules');
|
|
16
17
|
require('stream');
|
|
17
18
|
var util = require('util');
|
|
18
|
-
var projectGraph = require('nx/src/project-graph/project-graph');
|
|
19
19
|
var wrap = require('word-wrap');
|
|
20
20
|
var Path = require('path');
|
|
21
21
|
var projectGraph_js = require('nx/src/project-graph/project-graph.js');
|
|
@@ -58,13 +58,13 @@ var conventionalCommits = require('nx/src/command-line/release/config/convention
|
|
|
58
58
|
var os = require('os');
|
|
59
59
|
var yaml = require('yaml');
|
|
60
60
|
|
|
61
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
62
61
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
63
62
|
|
|
64
63
|
var TOML__default = /*#__PURE__*/_interopDefault(TOML);
|
|
65
64
|
var shellescape__default = /*#__PURE__*/_interopDefault(shellescape);
|
|
66
65
|
var chalkTemplate__default = /*#__PURE__*/_interopDefault(chalkTemplate);
|
|
67
66
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
67
|
+
var createBasePreset__default = /*#__PURE__*/_interopDefault(createBasePreset);
|
|
68
68
|
var childProcess__default = /*#__PURE__*/_interopDefault(childProcess);
|
|
69
69
|
var defaultRules__default = /*#__PURE__*/_interopDefault(defaultRules);
|
|
70
70
|
var util__default = /*#__PURE__*/_interopDefault(util);
|
|
@@ -95,7 +95,7 @@ function stringifyCargoToml(cargoToml) {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
// ../conventional-changelog/src/commit-types.ts
|
|
98
|
-
var
|
|
98
|
+
var DEFAULT_COMMIT_TYPES = {
|
|
99
99
|
/* --- Bumps version when selected --- */
|
|
100
100
|
"chore": {
|
|
101
101
|
"description": "Other changes that don't modify src or test files",
|
|
@@ -226,255 +226,217 @@ var COMMIT_TYPES = {
|
|
|
226
226
|
};
|
|
227
227
|
|
|
228
228
|
// ../conventional-changelog/src/utilities/constants.ts
|
|
229
|
-
var
|
|
230
|
-
(
|
|
231
|
-
ret[key]
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
229
|
+
var CHANGELOG_COMMIT_TYPES_OBJECT = Object.freeze(
|
|
230
|
+
Object.entries(DEFAULT_COMMIT_TYPES).reduce(
|
|
231
|
+
(ret, [key, commitType]) => {
|
|
232
|
+
ret[key] = {
|
|
233
|
+
...commitType.changelog,
|
|
234
|
+
type: key,
|
|
235
|
+
section: commitType.changelog?.title || commitType.title,
|
|
236
|
+
hidden: commitType.changelog?.hidden
|
|
237
|
+
};
|
|
238
|
+
return ret;
|
|
239
|
+
},
|
|
240
|
+
{}
|
|
241
|
+
)
|
|
240
242
|
);
|
|
241
|
-
var
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
243
|
+
var CHANGELOG_COMMIT_TYPES = [
|
|
244
|
+
CHANGELOG_COMMIT_TYPES_OBJECT.feat,
|
|
245
|
+
CHANGELOG_COMMIT_TYPES_OBJECT.fix,
|
|
246
|
+
CHANGELOG_COMMIT_TYPES_OBJECT.chore,
|
|
247
|
+
CHANGELOG_COMMIT_TYPES_OBJECT.deps,
|
|
248
|
+
CHANGELOG_COMMIT_TYPES_OBJECT.docs,
|
|
249
|
+
CHANGELOG_COMMIT_TYPES_OBJECT.style,
|
|
250
|
+
CHANGELOG_COMMIT_TYPES_OBJECT.refactor,
|
|
251
|
+
CHANGELOG_COMMIT_TYPES_OBJECT.perf,
|
|
252
|
+
CHANGELOG_COMMIT_TYPES_OBJECT.build,
|
|
253
|
+
CHANGELOG_COMMIT_TYPES_OBJECT.ci,
|
|
254
|
+
CHANGELOG_COMMIT_TYPES_OBJECT.test
|
|
253
255
|
];
|
|
254
|
-
|
|
256
|
+
CHANGELOG_COMMIT_TYPES.map(
|
|
255
257
|
(entry) => entry.type
|
|
256
258
|
);
|
|
257
|
-
|
|
258
|
-
(entry) => entry.
|
|
259
|
+
CHANGELOG_COMMIT_TYPES.map(
|
|
260
|
+
(entry) => entry.section
|
|
259
261
|
);
|
|
260
|
-
var MINIMAL_PARSER_DEFAULT_OPTIONS = {
|
|
261
|
-
headerPattern: /^(\w*): (.*)$/,
|
|
262
|
-
breakingHeaderPattern: /^(\w*): (.*)$/,
|
|
263
|
-
headerCorrespondence: ["type", "subject"],
|
|
264
|
-
noteKeywords: ["BREAKING CHANGE", "BREAKING-CHANGE"],
|
|
265
|
-
revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i,
|
|
266
|
-
revertCorrespondence: ["header", "hash"],
|
|
267
|
-
issuePrefixes: ["#"]
|
|
268
|
-
};
|
|
269
|
-
var MONOREPO_PARSER_DEFAULT_OPTIONS = {
|
|
270
|
-
headerPattern: /^(\w*)(?:\((.*)\))!?: (.*)$/,
|
|
271
|
-
breakingHeaderPattern: /^(\w*)(?:\((.*)\))!: (.*)$/,
|
|
272
|
-
headerCorrespondence: ["type", "scope", "subject"],
|
|
273
|
-
noteKeywords: ["BREAKING CHANGE", "BREAKING-CHANGE"],
|
|
274
|
-
revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i,
|
|
275
|
-
revertCorrespondence: ["header", "hash"],
|
|
276
|
-
issuePrefixes: ["#"]
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
// ../conventional-changelog/src/parser.ts
|
|
280
|
-
function createParserOpts(variant) {
|
|
281
|
-
return variant === "minimal" ? MINIMAL_PARSER_DEFAULT_OPTIONS : MONOREPO_PARSER_DEFAULT_OPTIONS;
|
|
282
|
-
}
|
|
283
262
|
|
|
284
|
-
// src/
|
|
285
|
-
var
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
).reduce((ret, type) => {
|
|
293
|
-
ret[type] = COMMIT_TYPES[type];
|
|
294
|
-
return ret;
|
|
295
|
-
}, {}),
|
|
296
|
-
defaultValue: "chore",
|
|
297
|
-
maxLength: 20,
|
|
298
|
-
minLength: 3
|
|
299
|
-
},
|
|
300
|
-
subject: {
|
|
301
|
-
type: "input",
|
|
302
|
-
title: "Commit Subject",
|
|
303
|
-
description: "Write a short, imperative tense description of the change",
|
|
304
|
-
maxLength: 150,
|
|
305
|
-
minLength: 3
|
|
306
|
-
},
|
|
307
|
-
body: {
|
|
308
|
-
type: "input",
|
|
309
|
-
title: "Commit Body",
|
|
310
|
-
description: "Provide a longer description of the change",
|
|
311
|
-
maxLength: 600
|
|
312
|
-
},
|
|
313
|
-
isBreaking: {
|
|
314
|
-
type: "confirm",
|
|
315
|
-
title: "Breaking Changes",
|
|
316
|
-
description: "Are there any breaking changes as a result of this commit?",
|
|
317
|
-
defaultValue: false
|
|
318
|
-
},
|
|
319
|
-
breakingBody: {
|
|
320
|
-
type: "input",
|
|
321
|
-
title: "Breaking Changes (Details)",
|
|
322
|
-
description: "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself",
|
|
323
|
-
when: (answers) => answers.isBreaking === true,
|
|
324
|
-
maxLength: 600,
|
|
325
|
-
minLength: 3
|
|
326
|
-
},
|
|
327
|
-
isIssueAffected: {
|
|
328
|
-
type: "confirm",
|
|
329
|
-
title: "Open Issue Affected",
|
|
330
|
-
description: "Does this change impact any open issues?",
|
|
331
|
-
defaultValue: false
|
|
332
|
-
},
|
|
333
|
-
issuesBody: {
|
|
334
|
-
type: "input",
|
|
335
|
-
title: "Open Issue Affected (Details)",
|
|
336
|
-
description: "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself",
|
|
337
|
-
when: (answers) => answers.isIssueAffected === true,
|
|
338
|
-
maxLength: 600,
|
|
339
|
-
minLength: 3
|
|
263
|
+
// ../conventional-changelog/src/configs/minimal.ts
|
|
264
|
+
var changelogs = {
|
|
265
|
+
props: {
|
|
266
|
+
ignoreCommits: void 0,
|
|
267
|
+
types: CHANGELOG_COMMIT_TYPES,
|
|
268
|
+
bumpStrict: true,
|
|
269
|
+
scope: void 0,
|
|
270
|
+
scopeOnly: false
|
|
340
271
|
}
|
|
341
272
|
};
|
|
342
|
-
var
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
273
|
+
var commitlint = {
|
|
274
|
+
helpUrl: "https://developer.stormsoftware.com/commitlint/minimal",
|
|
275
|
+
rules: {
|
|
276
|
+
"body-leading-blank": [1 /* Warning */, "always"],
|
|
277
|
+
"body-max-length": [2 /* Error */, "always", 600],
|
|
278
|
+
"footer-leading-blank": [1 /* Warning */, "always"],
|
|
279
|
+
"footer-max-line-length": [2 /* Error */, "always", 150],
|
|
280
|
+
"header-max-length": [2 /* Error */, "always", 150],
|
|
281
|
+
"header-trim": [2 /* Error */, "always"],
|
|
282
|
+
"subject-case": [2 /* Error */, "always", ["sentence-case"]],
|
|
283
|
+
"subject-empty": [2 /* Error */, "never"],
|
|
284
|
+
"subject-full-stop": [2 /* Error */, "never", "."],
|
|
285
|
+
"subject-max-length": [2 /* Error */, "always", 150],
|
|
286
|
+
"subject-min-length": [2 /* Error */, "always", 3],
|
|
287
|
+
"type-case": [2 /* Error */, "always", "kebab-case"],
|
|
288
|
+
"type-empty": [2 /* Error */, "never"],
|
|
289
|
+
"type-enum": [
|
|
290
|
+
2 /* Error */,
|
|
291
|
+
"always",
|
|
292
|
+
Object.keys(DEFAULT_COMMIT_TYPES)
|
|
293
|
+
],
|
|
294
|
+
"type-max-length": [2 /* Error */, "always", 20],
|
|
295
|
+
"type-min-length": [2 /* Error */, "always", 3],
|
|
296
|
+
"scope-empty": [2 /* Error */, "always"]
|
|
352
297
|
},
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
var DEFAULT_COMMIT_PROMPT_MESSAGES = {
|
|
361
|
-
skip: "press enter to skip",
|
|
362
|
-
max: "must be %d chars at most",
|
|
363
|
-
min: "must be %d chars at least",
|
|
364
|
-
emptyWarning: "can not be empty",
|
|
365
|
-
upperLimitWarning: "%s is %d characters longer than the upper limit",
|
|
366
|
-
lowerLimitWarning: "%s is %d characters less than the lower limit",
|
|
367
|
-
closedIssueMessage: "Closes: "
|
|
368
|
-
};
|
|
369
|
-
var DEFAULT_MINIMAL_COMMIT_MESSAGE_FORMAT = "{type}: {emoji}{subject}";
|
|
370
|
-
var DEFAULT_MINIMAL_COMMIT_SETTINGS = {
|
|
371
|
-
enableMultipleScopes: false,
|
|
372
|
-
disableEmoji: true,
|
|
373
|
-
breakingChangePrefix: "\u{1F4A3} ",
|
|
374
|
-
closedIssuePrefix: "\u2705 ",
|
|
375
|
-
format: DEFAULT_MINIMAL_COMMIT_MESSAGE_FORMAT
|
|
376
|
-
};
|
|
377
|
-
var DEFAULT_MONOREPO_COMMIT_MESSAGE_FORMAT = "{type}({scope}): {emoji}{subject}";
|
|
378
|
-
var DEFAULT_MONOREPO_COMMIT_SETTINGS = {
|
|
379
|
-
enableMultipleScopes: false,
|
|
380
|
-
disableEmoji: true,
|
|
381
|
-
breakingChangePrefix: "\u{1F4A3} ",
|
|
382
|
-
closedIssuePrefix: "\u2705 ",
|
|
383
|
-
format: DEFAULT_MONOREPO_COMMIT_MESSAGE_FORMAT
|
|
384
|
-
};
|
|
385
|
-
var DEFAULT_MINIMAL_COMMIT_RULES = {
|
|
386
|
-
"body-leading-blank": [1 /* Warning */, "always"],
|
|
387
|
-
"body-max-length": [2 /* Error */, "always", 600],
|
|
388
|
-
"footer-leading-blank": [1 /* Warning */, "always"],
|
|
389
|
-
"footer-max-line-length": [2 /* Error */, "always", 150],
|
|
390
|
-
"header-max-length": [2 /* Error */, "always", 150],
|
|
391
|
-
"header-trim": [2 /* Error */, "always"],
|
|
392
|
-
"subject-case": [2 /* Error */, "always", ["sentence-case"]],
|
|
393
|
-
"subject-empty": [2 /* Error */, "never"],
|
|
394
|
-
"subject-full-stop": [2 /* Error */, "never", "."],
|
|
395
|
-
"subject-max-length": [2 /* Error */, "always", 150],
|
|
396
|
-
"subject-min-length": [2 /* Error */, "always", 3],
|
|
397
|
-
"type-case": [2 /* Error */, "always", "kebab-case"],
|
|
398
|
-
"type-empty": [2 /* Error */, "never"],
|
|
399
|
-
"type-enum": [
|
|
400
|
-
2 /* Error */,
|
|
401
|
-
"always",
|
|
402
|
-
Object.keys(COMMIT_TYPES)
|
|
403
|
-
],
|
|
404
|
-
"type-max-length": [2 /* Error */, "always", 20],
|
|
405
|
-
"type-min-length": [2 /* Error */, "always", 3],
|
|
406
|
-
"scope-empty": 0 /* Disabled */,
|
|
407
|
-
"scope-case": 0 /* Disabled */,
|
|
408
|
-
"scope-enum": 0 /* Disabled */
|
|
409
|
-
};
|
|
410
|
-
var DEFAULT_MONOREPO_COMMIT_RULES = {
|
|
411
|
-
"body-leading-blank": [1 /* Warning */, "always"],
|
|
412
|
-
"body-max-length": [2 /* Error */, "always", 600],
|
|
413
|
-
"footer-leading-blank": [1 /* Warning */, "always"],
|
|
414
|
-
"footer-max-line-length": [2 /* Error */, "always", 150],
|
|
415
|
-
"header-max-length": [2 /* Error */, "always", 150],
|
|
416
|
-
"header-trim": [2 /* Error */, "always"],
|
|
417
|
-
"subject-case": [2 /* Error */, "always", ["sentence-case"]],
|
|
418
|
-
"subject-empty": [2 /* Error */, "never"],
|
|
419
|
-
"subject-full-stop": [2 /* Error */, "never", "."],
|
|
420
|
-
"subject-max-length": [2 /* Error */, "always", 150],
|
|
421
|
-
"subject-min-length": [2 /* Error */, "always", 3],
|
|
422
|
-
"type-case": [2 /* Error */, "always", "kebab-case"],
|
|
423
|
-
"type-empty": [2 /* Error */, "never"],
|
|
424
|
-
"type-enum": [
|
|
425
|
-
2 /* Error */,
|
|
426
|
-
"always",
|
|
427
|
-
Object.keys(COMMIT_TYPES)
|
|
428
|
-
],
|
|
429
|
-
"type-max-length": [2 /* Error */, "always", 20],
|
|
430
|
-
"type-min-length": [2 /* Error */, "always", 3],
|
|
431
|
-
"scope-case": [2 /* Error */, "always", ["kebab-case"]],
|
|
432
|
-
"scope-empty": [2 /* Error */, "never"]
|
|
298
|
+
settings: {
|
|
299
|
+
enableMultipleScopes: false,
|
|
300
|
+
disableEmoji: true,
|
|
301
|
+
breakingChangePrefix: "\u{1F4A3} ",
|
|
302
|
+
closedIssuePrefix: "\u2705 ",
|
|
303
|
+
format: "{type}: {emoji}{subject}"
|
|
304
|
+
}
|
|
433
305
|
};
|
|
434
|
-
|
|
435
|
-
// src/commitlint/config/minimal.ts
|
|
436
306
|
var config = {
|
|
437
|
-
|
|
438
|
-
|
|
307
|
+
types: DEFAULT_COMMIT_TYPES,
|
|
308
|
+
changelogs,
|
|
309
|
+
commitlint
|
|
439
310
|
};
|
|
440
311
|
var minimal_default = config;
|
|
441
312
|
|
|
442
|
-
// src/
|
|
313
|
+
// ../conventional-changelog/src/configs/monorepo.ts
|
|
314
|
+
var changelogs2 = {
|
|
315
|
+
props: {
|
|
316
|
+
ignoreCommits: void 0,
|
|
317
|
+
types: CHANGELOG_COMMIT_TYPES,
|
|
318
|
+
bumpStrict: true,
|
|
319
|
+
scope: ["monorepo"],
|
|
320
|
+
scopeOnly: true
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
var commitlint2 = {
|
|
324
|
+
helpUrl: "https://developer.stormsoftware.com/commitlint/monorepo",
|
|
325
|
+
rules: {
|
|
326
|
+
"body-leading-blank": [1 /* Warning */, "always"],
|
|
327
|
+
"body-max-length": [2 /* Error */, "always", 600],
|
|
328
|
+
"footer-leading-blank": [1 /* Warning */, "always"],
|
|
329
|
+
"footer-max-line-length": [2 /* Error */, "always", 150],
|
|
330
|
+
"header-max-length": [2 /* Error */, "always", 150],
|
|
331
|
+
"header-trim": [2 /* Error */, "always"],
|
|
332
|
+
"subject-case": [2 /* Error */, "always", ["sentence-case"]],
|
|
333
|
+
"subject-empty": [2 /* Error */, "never"],
|
|
334
|
+
"subject-full-stop": [2 /* Error */, "never", "."],
|
|
335
|
+
"subject-max-length": [2 /* Error */, "always", 150],
|
|
336
|
+
"subject-min-length": [2 /* Error */, "always", 3],
|
|
337
|
+
"type-case": [2 /* Error */, "always", "kebab-case"],
|
|
338
|
+
"type-empty": [2 /* Error */, "never"],
|
|
339
|
+
"type-enum": [
|
|
340
|
+
2 /* Error */,
|
|
341
|
+
"always",
|
|
342
|
+
Object.keys(DEFAULT_COMMIT_TYPES)
|
|
343
|
+
],
|
|
344
|
+
"type-max-length": [2 /* Error */, "always", 20],
|
|
345
|
+
"type-min-length": [2 /* Error */, "always", 3],
|
|
346
|
+
"scope-case": [2 /* Error */, "always", ["kebab-case"]],
|
|
347
|
+
"scope-empty": [2 /* Error */, "never"]
|
|
348
|
+
},
|
|
349
|
+
settings: {
|
|
350
|
+
enableMultipleScopes: false,
|
|
351
|
+
disableEmoji: true,
|
|
352
|
+
breakingChangePrefix: "\u{1F4A3} ",
|
|
353
|
+
closedIssuePrefix: "\u2705 ",
|
|
354
|
+
format: "{type}({scope}): {emoji}{subject}"
|
|
355
|
+
}
|
|
356
|
+
};
|
|
443
357
|
var config2 = {
|
|
444
|
-
|
|
445
|
-
|
|
358
|
+
types: DEFAULT_COMMIT_TYPES,
|
|
359
|
+
changelogs: changelogs2,
|
|
360
|
+
commitlint: commitlint2
|
|
446
361
|
};
|
|
447
362
|
var monorepo_default = config2;
|
|
448
363
|
|
|
449
|
-
// src/
|
|
450
|
-
var
|
|
451
|
-
async function
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
);
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
364
|
+
// ../conventional-changelog/src/configs/index.ts
|
|
365
|
+
var COMMIT_CONFIGS = { minimal: minimal_default, monorepo: monorepo_default };
|
|
366
|
+
async function getNxScopes(context) {
|
|
367
|
+
let projectGraph$1;
|
|
368
|
+
try {
|
|
369
|
+
projectGraph$1 = projectGraph.readCachedProjectGraph();
|
|
370
|
+
} catch {
|
|
371
|
+
await projectGraph.createProjectGraphAsync();
|
|
372
|
+
projectGraph$1 = projectGraph.readCachedProjectGraph();
|
|
373
|
+
}
|
|
374
|
+
if (!projectGraph$1) {
|
|
375
|
+
throw new Error(
|
|
376
|
+
"The commit process failed because the project graph is not available. Please run the build command again."
|
|
462
377
|
);
|
|
463
378
|
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
379
|
+
const projectConfigs = projectGraph.readProjectsConfigurationFromProjectGraph(projectGraph$1);
|
|
380
|
+
const result = Object.entries(projectConfigs.projects || {}).map(([name, project]) => ({
|
|
381
|
+
name,
|
|
382
|
+
...project
|
|
383
|
+
})).filter(
|
|
384
|
+
(project) => project.name && project.root && project.root !== "." && project.root !== context.config.workspaceRoot && !project.name.includes("e2e")
|
|
385
|
+
).filter((project) => project.targets).map((project) => project.name).filter(Boolean).sort((a, b) => a.localeCompare(b));
|
|
386
|
+
result.unshift("monorepo");
|
|
387
|
+
return result;
|
|
388
|
+
}
|
|
389
|
+
function getScopeEnum(context) {
|
|
390
|
+
return getNxScopes(context);
|
|
391
|
+
}
|
|
392
|
+
function getRuleFromScopeEnum(scopeEnum) {
|
|
393
|
+
if (!scopeEnum?.filter(Boolean).length) {
|
|
394
|
+
throw new Error("No scopes found in the Storm workspace.");
|
|
395
|
+
}
|
|
396
|
+
return [
|
|
397
|
+
2 /* Error */,
|
|
398
|
+
"always",
|
|
399
|
+
scopeEnum.filter(Boolean)
|
|
400
|
+
];
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// ../conventional-changelog/src/index.ts
|
|
404
|
+
async function createPreset(variant = "monorepo") {
|
|
405
|
+
const workspaceConfig = await chunk5SPAQH6A_cjs.getWorkspaceConfig();
|
|
406
|
+
if (variant === "minimal") {
|
|
407
|
+
return chunk5SPAQH6A_cjs.defu(
|
|
408
|
+
await createBasePreset__default.default({ ...COMMIT_CONFIGS.minimal.changelogs.props }),
|
|
409
|
+
{
|
|
410
|
+
...COMMIT_CONFIGS.minimal,
|
|
411
|
+
commitlint: {
|
|
412
|
+
...COMMIT_CONFIGS.minimal.commitlint,
|
|
413
|
+
regex: new RegExp(
|
|
414
|
+
`(${Object.keys(DEFAULT_COMMIT_TYPES).join("|")})!?:\\s([a-z0-9:\\-\\/\\s])+`
|
|
415
|
+
)
|
|
416
|
+
}
|
|
417
|
+
}
|
|
469
418
|
);
|
|
470
|
-
config5 = JSON.parse(configContent);
|
|
471
|
-
} else {
|
|
472
|
-
config5 = await jiti.import(jiti.esmResolve(configPath), { default: true });
|
|
473
419
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
420
|
+
const nxScopes = await getNxScopes({ config: workspaceConfig });
|
|
421
|
+
return chunk5SPAQH6A_cjs.defu(
|
|
422
|
+
await createBasePreset__default.default({
|
|
423
|
+
...COMMIT_CONFIGS.monorepo.changelogs.props,
|
|
424
|
+
scope: nxScopes
|
|
425
|
+
}),
|
|
426
|
+
{
|
|
427
|
+
...COMMIT_CONFIGS.monorepo,
|
|
428
|
+
commitlint: {
|
|
429
|
+
...COMMIT_CONFIGS.monorepo.commitlint,
|
|
430
|
+
rules: {
|
|
431
|
+
...COMMIT_CONFIGS.monorepo.commitlint.rules,
|
|
432
|
+
["scope-enum"]: getRuleFromScopeEnum(nxScopes)
|
|
433
|
+
},
|
|
434
|
+
regex: new RegExp(
|
|
435
|
+
`(${Object.keys(DEFAULT_COMMIT_TYPES).join("|")})\\((${nxScopes.join("|")})\\)!?:\\s([a-z0-9:\\-\\/\\s])+`
|
|
436
|
+
)
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
);
|
|
478
440
|
}
|
|
479
441
|
|
|
480
442
|
// ../../node_modules/.pnpm/conventional-commits-parser@6.2.0/node_modules/conventional-commits-parser/dist/regex.js
|
|
@@ -892,12 +854,8 @@ ${body}` : message;
|
|
|
892
854
|
${footer}` : message;
|
|
893
855
|
return message || "";
|
|
894
856
|
};
|
|
895
|
-
async function lint(message,
|
|
896
|
-
const
|
|
897
|
-
const parserOpts = await createParserOpts(workspaceConfig.variant);
|
|
898
|
-
const parser = new CommitParser(
|
|
899
|
-
chunkN5U2S3QK_cjs.defu(commitlintConfig.parserOpts, parserOpts)
|
|
900
|
-
);
|
|
857
|
+
async function lint(message, config5) {
|
|
858
|
+
const parser = new CommitParser(config5.parser || {});
|
|
901
859
|
const parsed = parser.parse(message);
|
|
902
860
|
if (parsed.header === null && parsed.body === null && parsed.footer === null) {
|
|
903
861
|
return {
|
|
@@ -908,7 +866,7 @@ async function lint(message, commitlintConfig) {
|
|
|
908
866
|
};
|
|
909
867
|
}
|
|
910
868
|
const allRules = new Map(Object.entries(defaultRules__default.default));
|
|
911
|
-
const missing = Object.keys(
|
|
869
|
+
const missing = Object.keys(config5.commitlint.rules).filter(
|
|
912
870
|
(name) => typeof allRules.get(name) !== "function"
|
|
913
871
|
);
|
|
914
872
|
if (missing.length > 0) {
|
|
@@ -920,19 +878,19 @@ async function lint(message, commitlintConfig) {
|
|
|
920
878
|
].join("\n")
|
|
921
879
|
);
|
|
922
880
|
}
|
|
923
|
-
const invalid = Object.entries(
|
|
924
|
-
if (!Array.isArray(
|
|
881
|
+
const invalid = Object.entries(config5.commitlint.rules).map(([name, config6]) => {
|
|
882
|
+
if (!Array.isArray(config6)) {
|
|
925
883
|
return new Error(
|
|
926
884
|
`config for rule ${name} must be array, received ${util__default.default.inspect(
|
|
927
|
-
|
|
928
|
-
)} of type ${typeof
|
|
885
|
+
config6
|
|
886
|
+
)} of type ${typeof config6}`
|
|
929
887
|
);
|
|
930
888
|
}
|
|
931
|
-
const [level] =
|
|
932
|
-
if (level === 0 /* Disabled */ &&
|
|
889
|
+
const [level] = config6;
|
|
890
|
+
if (level === 0 /* Disabled */ && config6.length === 1) {
|
|
933
891
|
return null;
|
|
934
892
|
}
|
|
935
|
-
const [, when] =
|
|
893
|
+
const [, when] = config6;
|
|
936
894
|
if (typeof level !== "number" || isNaN(level)) {
|
|
937
895
|
return new Error(
|
|
938
896
|
`level for rule ${name} must be number, received ${util__default.default.inspect(
|
|
@@ -940,11 +898,11 @@ async function lint(message, commitlintConfig) {
|
|
|
940
898
|
)} of type ${typeof level}`
|
|
941
899
|
);
|
|
942
900
|
}
|
|
943
|
-
if (
|
|
901
|
+
if (config6.length < 2 || config6.length > 3) {
|
|
944
902
|
return new Error(
|
|
945
903
|
`config for rule ${name} must be 2 or 3 items long, received ${util__default.default.inspect(
|
|
946
|
-
|
|
947
|
-
)} of length ${
|
|
904
|
+
config6
|
|
905
|
+
)} of length ${config6.length}`
|
|
948
906
|
);
|
|
949
907
|
}
|
|
950
908
|
if (level < 0 || level > 2) {
|
|
@@ -974,10 +932,10 @@ async function lint(message, commitlintConfig) {
|
|
|
974
932
|
throw new Error(invalid.map((i) => i.message).join("\n"));
|
|
975
933
|
}
|
|
976
934
|
const pendingResults = Object.entries(
|
|
977
|
-
|
|
978
|
-
).filter(([,
|
|
979
|
-
const [name,
|
|
980
|
-
const [level, when, value] =
|
|
935
|
+
config5.commitlint.rules
|
|
936
|
+
).filter(([, config6]) => !!config6 && config6.length && config6[0] > 0).map(async (entry) => {
|
|
937
|
+
const [name, config6] = entry;
|
|
938
|
+
const [level, when, value] = config6;
|
|
981
939
|
const rule = allRules.get(name);
|
|
982
940
|
if (!rule) {
|
|
983
941
|
throw new Error(`Could not find rule implementation for ${name}`);
|
|
@@ -1008,50 +966,11 @@ async function lint(message, commitlintConfig) {
|
|
|
1008
966
|
input: buildCommitMessage(parsed)
|
|
1009
967
|
};
|
|
1010
968
|
}
|
|
1011
|
-
async function getNxScopes(context) {
|
|
1012
|
-
let projectGraph$1;
|
|
1013
|
-
try {
|
|
1014
|
-
projectGraph$1 = projectGraph.readCachedProjectGraph();
|
|
1015
|
-
} catch {
|
|
1016
|
-
await projectGraph.createProjectGraphAsync();
|
|
1017
|
-
projectGraph$1 = projectGraph.readCachedProjectGraph();
|
|
1018
|
-
}
|
|
1019
|
-
if (!projectGraph$1) {
|
|
1020
|
-
throw new Error(
|
|
1021
|
-
"The commit process failed because the project graph is not available. Please run the build command again."
|
|
1022
|
-
);
|
|
1023
|
-
}
|
|
1024
|
-
const projectConfigs = projectGraph.readProjectsConfigurationFromProjectGraph(projectGraph$1);
|
|
1025
|
-
const result = Object.entries(projectConfigs.projects || {}).map(([name, project]) => ({
|
|
1026
|
-
name,
|
|
1027
|
-
...project
|
|
1028
|
-
})).filter(
|
|
1029
|
-
(project) => project.name && project.root && project.root !== "." && project.root !== context.config.workspaceRoot && !project.name.includes("e2e")
|
|
1030
|
-
).filter((project) => project.targets).map((project) => project.name).filter(Boolean).sort((a, b) => a.localeCompare(b));
|
|
1031
|
-
result.unshift("monorepo");
|
|
1032
|
-
return result;
|
|
1033
|
-
}
|
|
1034
|
-
function getScopeEnumUtil(context) {
|
|
1035
|
-
return () => getScopeEnum(context);
|
|
1036
|
-
}
|
|
1037
|
-
function getScopeEnum(context) {
|
|
1038
|
-
return getNxScopes(context);
|
|
1039
|
-
}
|
|
1040
|
-
function getRuleFromScopeEnum(scopeEnum) {
|
|
1041
|
-
if (!scopeEnum?.filter(Boolean).length) {
|
|
1042
|
-
throw new Error("No scopes found in the Storm workspace.");
|
|
1043
|
-
}
|
|
1044
|
-
return [
|
|
1045
|
-
2 /* Error */,
|
|
1046
|
-
"always",
|
|
1047
|
-
scopeEnum.filter(Boolean)
|
|
1048
|
-
];
|
|
1049
|
-
}
|
|
1050
969
|
|
|
1051
970
|
// src/commitlint/run.ts
|
|
1052
971
|
var COMMIT_EDITMSG_PATH = ".git/COMMIT_EDITMSG";
|
|
1053
972
|
async function runCommitLint(workspaceConfig, options) {
|
|
1054
|
-
|
|
973
|
+
chunk5SPAQH6A_cjs.writeInfo(
|
|
1055
974
|
"\u{1F4DD} Validating git commit message aligns with the Storm Software specification",
|
|
1056
975
|
workspaceConfig
|
|
1057
976
|
);
|
|
@@ -1059,7 +978,7 @@ async function runCommitLint(workspaceConfig, options) {
|
|
|
1059
978
|
if (options.message && options.message !== COMMIT_EDITMSG_PATH) {
|
|
1060
979
|
commitMessage = options.message;
|
|
1061
980
|
} else {
|
|
1062
|
-
const commitFile =
|
|
981
|
+
const commitFile = chunk5SPAQH6A_cjs.joinPaths(
|
|
1063
982
|
workspaceConfig.workspaceRoot,
|
|
1064
983
|
options.file || options.message || COMMIT_EDITMSG_PATH
|
|
1065
984
|
);
|
|
@@ -1076,17 +995,17 @@ async function runCommitLint(workspaceConfig, options) {
|
|
|
1076
995
|
if (upstreamRemote) {
|
|
1077
996
|
const upstreamRemoteIdentifier = upstreamRemote.split(" ")[0]?.trim();
|
|
1078
997
|
if (!upstreamRemoteIdentifier) {
|
|
1079
|
-
|
|
998
|
+
chunk5SPAQH6A_cjs.writeWarning(
|
|
1080
999
|
`No upstream remote found for ${workspaceConfig.name}.git. Skipping comparison.`,
|
|
1081
1000
|
workspaceConfig
|
|
1082
1001
|
);
|
|
1083
1002
|
return;
|
|
1084
1003
|
}
|
|
1085
|
-
|
|
1004
|
+
chunk5SPAQH6A_cjs.writeDebug(`Comparing against remote ${upstreamRemoteIdentifier}`);
|
|
1086
1005
|
const currentBranch = childProcess__default.default.execSync("git branch --show-current").toString().trim();
|
|
1087
1006
|
gitLogCmd = gitLogCmd + ` ${currentBranch} ^${upstreamRemoteIdentifier}/main`;
|
|
1088
1007
|
} else {
|
|
1089
|
-
|
|
1008
|
+
chunk5SPAQH6A_cjs.writeWarning(
|
|
1090
1009
|
`No upstream remote found for ${workspaceConfig.name}.git. Skipping comparison against upstream main.`,
|
|
1091
1010
|
workspaceConfig
|
|
1092
1011
|
);
|
|
@@ -1094,39 +1013,17 @@ async function runCommitLint(workspaceConfig, options) {
|
|
|
1094
1013
|
}
|
|
1095
1014
|
commitMessage = childProcess__default.default.execSync(gitLogCmd).toString().trim();
|
|
1096
1015
|
if (!commitMessage) {
|
|
1097
|
-
|
|
1016
|
+
chunk5SPAQH6A_cjs.writeWarning(
|
|
1098
1017
|
"No commits found. Skipping commit message validation.",
|
|
1099
1018
|
workspaceConfig
|
|
1100
1019
|
);
|
|
1101
1020
|
return;
|
|
1102
1021
|
}
|
|
1103
1022
|
}
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
let commitlintRegex;
|
|
1109
|
-
const allowedTypes = commitlintConfig.rules["type-enum"] ?? COMMIT_TYPES;
|
|
1110
|
-
let allowedScopes = [];
|
|
1111
|
-
if (workspaceConfig.variant !== "minimal" && commitlintConfig.rules["scope-empty"] && commitlintConfig.rules["scope-empty"][0] !== 0 /* Disabled */) {
|
|
1112
|
-
allowedScopes = await getNxScopes({
|
|
1113
|
-
config: workspaceConfig
|
|
1114
|
-
});
|
|
1115
|
-
commitlintConfig.rules["scope-enum"] = getRuleFromScopeEnum(allowedScopes);
|
|
1116
|
-
commitlintRegex = new RegExp(
|
|
1117
|
-
`(${Object.keys(allowedTypes).join("|")})\\((${allowedScopes})\\)!?:\\s([a-z0-9:\\-\\/\\s])+`
|
|
1118
|
-
);
|
|
1119
|
-
} else {
|
|
1120
|
-
commitlintRegex = new RegExp(
|
|
1121
|
-
`(${Object.keys(allowedTypes).join("|")})!?:\\s([a-z0-9:\\-\\/\\s])+`
|
|
1122
|
-
);
|
|
1123
|
-
}
|
|
1124
|
-
const report = await lint(commitMessage, {
|
|
1125
|
-
...commitlintConfig,
|
|
1126
|
-
parserOpts: createParserOpts(workspaceConfig.variant)
|
|
1127
|
-
});
|
|
1128
|
-
if (!commitlintRegex.test(commitMessage) || report.errors.length || report.warnings.length) {
|
|
1129
|
-
chunkN5U2S3QK_cjs.writeSuccess(
|
|
1023
|
+
const preset = await createPreset(workspaceConfig.variant);
|
|
1024
|
+
const report = await lint(commitMessage, preset);
|
|
1025
|
+
if (!preset.commitlint.regex.test(commitMessage) || report.errors.length || report.warnings.length) {
|
|
1026
|
+
chunk5SPAQH6A_cjs.writeSuccess(
|
|
1130
1027
|
`Commit was processing completed successfully!`,
|
|
1131
1028
|
workspaceConfig
|
|
1132
1029
|
);
|
|
@@ -1134,14 +1031,16 @@ async function runCommitLint(workspaceConfig, options) {
|
|
|
1134
1031
|
let errorMessage = " Oh no! Your commit message: \n-------------------------------------------------------------------\n" + commitMessage + `
|
|
1135
1032
|
-------------------------------------------------------------------
|
|
1136
1033
|
|
|
1137
|
-
Does not follow the
|
|
1138
|
-
errorMessage +=
|
|
1034
|
+
Does not follow the \`${workspaceConfig.variant}\` commit message convention specified by the ${(typeof workspaceConfig.organization === "string" ? workspaceConfig.organization : workspaceConfig.organization?.name) || "Storm Software"} team.`;
|
|
1035
|
+
errorMessage += preset.changelogs.props.scope?.length ? "\ntype(scope): subject \n BLANK LINE \n body" : "\ntype: subject \n BLANK LINE \n body";
|
|
1139
1036
|
errorMessage += "\n";
|
|
1140
1037
|
errorMessage += `
|
|
1141
|
-
Possible types: ${
|
|
1142
|
-
|
|
1038
|
+
Possible types: ${preset.changelogs.props.types.map(
|
|
1039
|
+
(type) => `${type.section} (${type.type})`
|
|
1040
|
+
)}`;
|
|
1041
|
+
if (preset.changelogs.props.scope?.length) {
|
|
1143
1042
|
errorMessage += `
|
|
1144
|
-
Possible scopes: ${
|
|
1043
|
+
Possible scopes: ${preset.changelogs.props.scope} (if unsure use "monorepo")`;
|
|
1145
1044
|
}
|
|
1146
1045
|
errorMessage += "\n\nEXAMPLE: \nfeat(my-lib): add an option to generate lazy-loadable modules\nfix(monorepo)!: breaking change should have exclamation mark\n";
|
|
1147
1046
|
errorMessage += `
|
|
@@ -1152,86 +1051,116 @@ CommitLint Warnings: ${report.warnings.length ? report.warnings.map((warning) =>
|
|
|
1152
1051
|
errorMessage += "\n\nPlease fix the commit message and rerun storm-commit.";
|
|
1153
1052
|
errorMessage += `
|
|
1154
1053
|
|
|
1155
|
-
More details about the Storm Software commit message specification can be found at: ${
|
|
1054
|
+
More details about the Storm Software commit message specification can be found at: ${preset.commitlint.helpUrl}`;
|
|
1156
1055
|
throw new Error(errorMessage);
|
|
1157
1056
|
}
|
|
1158
1057
|
return report.input;
|
|
1159
1058
|
}
|
|
1160
1059
|
|
|
1060
|
+
// src/types.ts
|
|
1061
|
+
var DEFAULT_COMMIT_PROMPT_MESSAGES = {
|
|
1062
|
+
skip: "press enter to skip",
|
|
1063
|
+
max: "must be %d chars at most",
|
|
1064
|
+
min: "must be %d chars at least",
|
|
1065
|
+
emptyWarning: "can not be empty",
|
|
1066
|
+
upperLimitWarning: "%s is %d characters longer than the upper limit",
|
|
1067
|
+
lowerLimitWarning: "%s is %d characters less than the lower limit",
|
|
1068
|
+
closedIssueMessage: "Closes: "
|
|
1069
|
+
};
|
|
1070
|
+
|
|
1161
1071
|
// src/commit/config/minimal.ts
|
|
1072
|
+
var DEFAULT_MINIMAL_COMMIT_QUESTIONS = {
|
|
1073
|
+
type: {
|
|
1074
|
+
type: "select",
|
|
1075
|
+
title: "Commit Type",
|
|
1076
|
+
description: "Select the commit type that best describes your changes",
|
|
1077
|
+
enum: Object.keys(DEFAULT_COMMIT_TYPES).filter(
|
|
1078
|
+
(type) => DEFAULT_COMMIT_TYPES[type].hidden !== true
|
|
1079
|
+
).reduce((ret, type) => {
|
|
1080
|
+
ret[type] = DEFAULT_COMMIT_TYPES[type];
|
|
1081
|
+
return ret;
|
|
1082
|
+
}, {}),
|
|
1083
|
+
defaultValue: "chore",
|
|
1084
|
+
maxLength: 20,
|
|
1085
|
+
minLength: 3
|
|
1086
|
+
},
|
|
1087
|
+
subject: {
|
|
1088
|
+
type: "input",
|
|
1089
|
+
title: "Commit Subject",
|
|
1090
|
+
description: "Write a short, imperative tense description of the change",
|
|
1091
|
+
maxLength: 150,
|
|
1092
|
+
minLength: 3
|
|
1093
|
+
},
|
|
1094
|
+
body: {
|
|
1095
|
+
type: "input",
|
|
1096
|
+
title: "Commit Body",
|
|
1097
|
+
description: "Provide a longer description of the change",
|
|
1098
|
+
maxLength: 600
|
|
1099
|
+
},
|
|
1100
|
+
isBreaking: {
|
|
1101
|
+
type: "confirm",
|
|
1102
|
+
title: "Breaking Changes",
|
|
1103
|
+
description: "Are there any breaking changes as a result of this commit?",
|
|
1104
|
+
defaultValue: false
|
|
1105
|
+
},
|
|
1106
|
+
breakingBody: {
|
|
1107
|
+
type: "input",
|
|
1108
|
+
title: "Breaking Changes (Details)",
|
|
1109
|
+
description: "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself",
|
|
1110
|
+
when: (answers) => answers.isBreaking === true,
|
|
1111
|
+
maxLength: 600,
|
|
1112
|
+
minLength: 3
|
|
1113
|
+
},
|
|
1114
|
+
isIssueAffected: {
|
|
1115
|
+
type: "confirm",
|
|
1116
|
+
title: "Open Issue Affected",
|
|
1117
|
+
description: "Does this change impact any open issues?",
|
|
1118
|
+
defaultValue: false
|
|
1119
|
+
},
|
|
1120
|
+
issuesBody: {
|
|
1121
|
+
type: "input",
|
|
1122
|
+
title: "Open Issue Affected (Details)",
|
|
1123
|
+
description: "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself",
|
|
1124
|
+
when: (answers) => answers.isIssueAffected === true,
|
|
1125
|
+
maxLength: 600,
|
|
1126
|
+
minLength: 3
|
|
1127
|
+
}
|
|
1128
|
+
};
|
|
1162
1129
|
var config3 = {
|
|
1163
|
-
settings:
|
|
1130
|
+
settings: COMMIT_CONFIGS.minimal.commitlint.settings,
|
|
1164
1131
|
messages: DEFAULT_COMMIT_PROMPT_MESSAGES,
|
|
1165
1132
|
questions: DEFAULT_MINIMAL_COMMIT_QUESTIONS,
|
|
1166
|
-
types:
|
|
1133
|
+
types: DEFAULT_COMMIT_TYPES
|
|
1167
1134
|
};
|
|
1168
1135
|
var minimal_default2 = config3;
|
|
1169
1136
|
|
|
1170
1137
|
// src/commit/config/monorepo.ts
|
|
1138
|
+
var DEFAULT_MONOREPO_COMMIT_QUESTIONS = {
|
|
1139
|
+
type: DEFAULT_MINIMAL_COMMIT_QUESTIONS.type,
|
|
1140
|
+
scope: {
|
|
1141
|
+
type: "select",
|
|
1142
|
+
title: "Commit Scope",
|
|
1143
|
+
description: "Select the project that's the most impacted by this change",
|
|
1144
|
+
enum: {},
|
|
1145
|
+
defaultValue: "monorepo",
|
|
1146
|
+
maxLength: 50,
|
|
1147
|
+
minLength: 1
|
|
1148
|
+
},
|
|
1149
|
+
subject: DEFAULT_MINIMAL_COMMIT_QUESTIONS.subject,
|
|
1150
|
+
body: DEFAULT_MINIMAL_COMMIT_QUESTIONS.body,
|
|
1151
|
+
isBreaking: DEFAULT_MINIMAL_COMMIT_QUESTIONS.isBreaking,
|
|
1152
|
+
breakingBody: DEFAULT_MINIMAL_COMMIT_QUESTIONS.breakingBody,
|
|
1153
|
+
isIssueAffected: DEFAULT_MINIMAL_COMMIT_QUESTIONS.isIssueAffected,
|
|
1154
|
+
issuesBody: DEFAULT_MINIMAL_COMMIT_QUESTIONS.issuesBody
|
|
1155
|
+
};
|
|
1171
1156
|
var config4 = {
|
|
1172
|
-
settings:
|
|
1157
|
+
settings: COMMIT_CONFIGS.monorepo.commitlint.settings,
|
|
1173
1158
|
messages: DEFAULT_COMMIT_PROMPT_MESSAGES,
|
|
1174
1159
|
questions: DEFAULT_MONOREPO_COMMIT_QUESTIONS,
|
|
1175
|
-
types:
|
|
1160
|
+
types: DEFAULT_COMMIT_TYPES
|
|
1176
1161
|
};
|
|
1177
1162
|
var monorepo_default2 = config4;
|
|
1178
1163
|
|
|
1179
|
-
// src/commit/helpers.ts
|
|
1180
|
-
function resolveMinimalCommitOptions(config5 = minimal_default2) {
|
|
1181
|
-
return {
|
|
1182
|
-
parserPreset: "conventional-changelog-storm-software",
|
|
1183
|
-
prompt: {
|
|
1184
|
-
settings: config5.settings,
|
|
1185
|
-
messages: config5.messages,
|
|
1186
|
-
questions: config5.questions
|
|
1187
|
-
}
|
|
1188
|
-
};
|
|
1189
|
-
}
|
|
1190
|
-
function resolveMonorepoCommitOptions(workspaceConfig, config5 = monorepo_default2) {
|
|
1191
|
-
return {
|
|
1192
|
-
utils: { getScopeEnum: getScopeEnumUtil({ config: workspaceConfig }) },
|
|
1193
|
-
parserPreset: "conventional-changelog-storm-software",
|
|
1194
|
-
prompt: {
|
|
1195
|
-
settings: config5.settings,
|
|
1196
|
-
messages: config5.messages,
|
|
1197
|
-
questions: config5.questions
|
|
1198
|
-
}
|
|
1199
|
-
};
|
|
1200
|
-
}
|
|
1201
|
-
var jiti2 = jiti$1.createJiti(chunkN5U2S3QK_cjs.importMetaUrl, { importMeta: ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('git.cjs', document.baseURI).href)) }) });
|
|
1202
|
-
async function resolveCommitConfig(workspaceConfig, configPath) {
|
|
1203
|
-
if (configPath && configPath !== "@storm-software/git-tools/commit/minimal" && configPath !== "@storm-software/git-tools/commit/monorepo") {
|
|
1204
|
-
chunkN5U2S3QK_cjs.writeInfo(
|
|
1205
|
-
`Using custom commit config file: ${configPath}`,
|
|
1206
|
-
workspaceConfig
|
|
1207
|
-
);
|
|
1208
|
-
} else {
|
|
1209
|
-
configPath = workspaceConfig?.variant === "minimal" ? "@storm-software/git-tools/commit/minimal" : "@storm-software/git-tools/commit/monorepo";
|
|
1210
|
-
chunkN5U2S3QK_cjs.writeInfo(
|
|
1211
|
-
`Using standard commit config file: ${configPath}`,
|
|
1212
|
-
workspaceConfig
|
|
1213
|
-
);
|
|
1214
|
-
}
|
|
1215
|
-
let config5 = {};
|
|
1216
|
-
if ((configPath.endsWith(".json") || configPath.endsWith(".jsonc")) && !fs$1.existsSync(jiti2.esmResolve(configPath, workspaceConfig.workspaceRoot))) {
|
|
1217
|
-
const configContent = await fs.readFile(
|
|
1218
|
-
jiti2.esmResolve(configPath, workspaceConfig.workspaceRoot),
|
|
1219
|
-
"utf8"
|
|
1220
|
-
);
|
|
1221
|
-
config5 = JSON.parse(configContent);
|
|
1222
|
-
} else {
|
|
1223
|
-
config5 = await jiti2.import(jiti2.esmResolve(configPath), { default: true });
|
|
1224
|
-
}
|
|
1225
|
-
const mergedConfig = {
|
|
1226
|
-
...config5 ?? {},
|
|
1227
|
-
...workspaceConfig.variant === "minimal" ? minimal_default2 : monorepo_default2
|
|
1228
|
-
};
|
|
1229
|
-
return workspaceConfig.variant === "minimal" ? resolveMinimalCommitOptions(mergedConfig) : resolveMonorepoCommitOptions(
|
|
1230
|
-
workspaceConfig,
|
|
1231
|
-
mergedConfig
|
|
1232
|
-
);
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
1164
|
// src/commit/commit-state.ts
|
|
1236
1165
|
function getGitDir() {
|
|
1237
1166
|
const devNull = process.platform === "win32" ? " nul" : "/dev/null";
|
|
@@ -1252,34 +1181,33 @@ async function createState(workspaceConfig, configPath) {
|
|
|
1252
1181
|
}
|
|
1253
1182
|
const state = {
|
|
1254
1183
|
variant: workspaceConfig.variant,
|
|
1255
|
-
config:
|
|
1184
|
+
config: workspaceConfig.variant === "minimal" ? minimal_default2 : monorepo_default2,
|
|
1256
1185
|
root,
|
|
1257
1186
|
answers: {}
|
|
1258
1187
|
};
|
|
1259
|
-
if (state.config.
|
|
1260
|
-
state.config.
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
);
|
|
1188
|
+
if (state.config.questions.type && state.config.questions.type.enum) {
|
|
1189
|
+
state.config.questions.type.enum = Object.keys(
|
|
1190
|
+
state.config.questions.type.enum
|
|
1191
|
+
).reduce((ret, key) => {
|
|
1192
|
+
if (state.config.questions.type.enum) {
|
|
1193
|
+
ret[key] = {
|
|
1194
|
+
...state.config.questions.type.enum[key],
|
|
1195
|
+
title: chalkTemplate__default.default`${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})` : ""}`,
|
|
1196
|
+
hidden: false
|
|
1197
|
+
};
|
|
1198
|
+
}
|
|
1199
|
+
return ret;
|
|
1200
|
+
}, {});
|
|
1273
1201
|
}
|
|
1274
|
-
if (workspaceConfig.variant === "monorepo" && (!state.config.
|
|
1275
|
-
state.config.
|
|
1202
|
+
if (workspaceConfig.variant === "monorepo" && (!state.config.questions?.scope || !state.config.questions?.scope.enum || Object.keys(
|
|
1203
|
+
state.config.questions?.scope.enum
|
|
1276
1204
|
).length === 0)) {
|
|
1277
1205
|
const scopes = await getScopeEnum({
|
|
1278
1206
|
config: workspaceConfig
|
|
1279
1207
|
});
|
|
1280
1208
|
for (const scope of scopes) {
|
|
1281
1209
|
if (scope === "monorepo") {
|
|
1282
|
-
state.config.
|
|
1210
|
+
state.config.questions.scope.enum[scope] = {
|
|
1283
1211
|
title: chalkTemplate__default.default`{bold monorepo} - workspace root`,
|
|
1284
1212
|
description: "The base workspace package (workspace root)",
|
|
1285
1213
|
hidden: false,
|
|
@@ -1307,13 +1235,13 @@ async function createState(workspaceConfig, configPath) {
|
|
|
1307
1235
|
const project = projectConfigurations.projects[scope];
|
|
1308
1236
|
if (project) {
|
|
1309
1237
|
let description = `${project.name} - ${project.root}`;
|
|
1310
|
-
const packageJsonPath =
|
|
1238
|
+
const packageJsonPath = chunk5SPAQH6A_cjs.joinPaths(project.root, "package.json");
|
|
1311
1239
|
if (fs$1.existsSync(packageJsonPath)) {
|
|
1312
1240
|
const packageJsonFile = await fs.readFile(packageJsonPath, "utf8");
|
|
1313
1241
|
const packageJson = JSON.parse(packageJsonFile);
|
|
1314
1242
|
description = packageJson.description || description;
|
|
1315
1243
|
}
|
|
1316
|
-
state.config.
|
|
1244
|
+
state.config.questions.scope.enum[scope] = {
|
|
1317
1245
|
title: chalkTemplate__default.default`{bold ${project.name}} - ${project.root}`,
|
|
1318
1246
|
description,
|
|
1319
1247
|
hidden: false,
|
|
@@ -1323,7 +1251,7 @@ async function createState(workspaceConfig, configPath) {
|
|
|
1323
1251
|
}
|
|
1324
1252
|
}
|
|
1325
1253
|
}
|
|
1326
|
-
state.answers = Object.keys(state.config.
|
|
1254
|
+
state.answers = Object.keys(state.config.questions).reduce(
|
|
1327
1255
|
(ret, key) => {
|
|
1328
1256
|
ret[key] = "";
|
|
1329
1257
|
return ret;
|
|
@@ -1353,14 +1281,11 @@ var formatCommitMessage = (state, workspaceConfig) => {
|
|
|
1353
1281
|
const scope = workspaceConfig.variant !== "minimal" && typeof answers.scope === "string" && answers.scope ? answers.scope.trim() : "";
|
|
1354
1282
|
const subject = answers.subject?.trim();
|
|
1355
1283
|
const type = answers.type;
|
|
1356
|
-
const format2 = config5.
|
|
1284
|
+
const format2 = config5.settings.format || (workspaceConfig.variant !== "minimal" ? "{type}({scope}): {emoji}{subject}" : "{type}: {emoji}{subject}");
|
|
1357
1285
|
const body = answers.body && typeof answers.body === "string" ? wrap__default.default(answers.body || "", wrapOptions) : "";
|
|
1358
1286
|
const breaking = answers.breakingBody && typeof answers.breakingBody === "string" ? wrap__default.default(answers.breakingBody || "", wrapOptions) : "";
|
|
1359
1287
|
const issues = answers.issuesBody && typeof answers.issuesBody === "string" ? wrap__default.default(answers.issuesBody || "", wrapOptions) : "";
|
|
1360
|
-
const head = format2.replace(
|
|
1361
|
-
/\{emoji\}/g,
|
|
1362
|
-
config5.prompt.settings.disableEmoji ? "" : `${emoji} `
|
|
1363
|
-
).replace(/\{scope\}/g, scope).replace(/\{subject\}/g, subject || "").replace(/\{type\}/g, type || "");
|
|
1288
|
+
const head = format2.replace(/\{emoji\}/g, config5.settings.disableEmoji ? "" : `${emoji} `).replace(/\{scope\}/g, scope).replace(/\{subject\}/g, subject || "").replace(/\{type\}/g, type || "");
|
|
1364
1289
|
let msg = head;
|
|
1365
1290
|
if (body) {
|
|
1366
1291
|
msg += `
|
|
@@ -1368,26 +1293,26 @@ var formatCommitMessage = (state, workspaceConfig) => {
|
|
|
1368
1293
|
${body}`;
|
|
1369
1294
|
}
|
|
1370
1295
|
if (breaking) {
|
|
1371
|
-
const breakingEmoji = config5.
|
|
1296
|
+
const breakingEmoji = config5.settings.disableEmoji ? "" : config5.settings.breakingChangePrefix;
|
|
1372
1297
|
msg += `
|
|
1373
1298
|
|
|
1374
1299
|
BREAKING CHANGE: ${breakingEmoji}${breaking}`;
|
|
1375
1300
|
}
|
|
1376
1301
|
if (issues) {
|
|
1377
|
-
const closedIssueEmoji = config5.
|
|
1302
|
+
const closedIssueEmoji = config5.settings.disableEmoji ? "" : config5.settings.closedIssuePrefix;
|
|
1378
1303
|
msg += `
|
|
1379
1304
|
|
|
1380
|
-
${closedIssueEmoji}${config5.
|
|
1305
|
+
${closedIssueEmoji}${config5.settings.closedIssueMessage}${issues}`;
|
|
1381
1306
|
}
|
|
1382
1307
|
return msg;
|
|
1383
1308
|
};
|
|
1384
1309
|
|
|
1385
1310
|
// src/commit/run.ts
|
|
1386
1311
|
async function runCommit(commitizenFile, dryRun = false) {
|
|
1387
|
-
const workspaceConfig = await
|
|
1388
|
-
const state = await createState(workspaceConfig
|
|
1312
|
+
const workspaceConfig = await chunk5SPAQH6A_cjs.getWorkspaceConfig();
|
|
1313
|
+
const state = await createState(workspaceConfig);
|
|
1389
1314
|
if (dryRun) {
|
|
1390
|
-
|
|
1315
|
+
chunk5SPAQH6A_cjs.writeInfo("Running in dry mode.", workspaceConfig);
|
|
1391
1316
|
}
|
|
1392
1317
|
console.log(chalkTemplate__default.default`
|
|
1393
1318
|
{bold.#999999 ----------------------------------------}
|
|
@@ -1397,7 +1322,7 @@ async function runCommit(commitizenFile, dryRun = false) {
|
|
|
1397
1322
|
`);
|
|
1398
1323
|
state.answers = await askQuestions(state);
|
|
1399
1324
|
const message = formatCommitMessage(state, workspaceConfig);
|
|
1400
|
-
const commitMsgFile =
|
|
1325
|
+
const commitMsgFile = chunk5SPAQH6A_cjs.joinPaths(getGitDir(), "COMMIT_EDITMSG");
|
|
1401
1326
|
console.log(chalkTemplate__default.default`
|
|
1402
1327
|
{bold.#999999 ----------------------------------------}
|
|
1403
1328
|
|
|
@@ -1410,11 +1335,11 @@ async function runCommit(commitizenFile, dryRun = false) {
|
|
|
1410
1335
|
commandItems.push(...["--file", commitMsgFile]);
|
|
1411
1336
|
const command = shellescape__default.default(commandItems);
|
|
1412
1337
|
if (dryRun) {
|
|
1413
|
-
|
|
1338
|
+
chunk5SPAQH6A_cjs.writeDebug(
|
|
1414
1339
|
`Skipping execution [dry-run]: ${command.replace(commitMsgFile, ".git/COMMIT_EDITMSG")}`,
|
|
1415
1340
|
workspaceConfig
|
|
1416
1341
|
);
|
|
1417
|
-
|
|
1342
|
+
chunk5SPAQH6A_cjs.writeDebug(`Message [dry-run]: ${message}`, workspaceConfig);
|
|
1418
1343
|
} else {
|
|
1419
1344
|
await fs__default.default.writeFile(commitMsgFile, message);
|
|
1420
1345
|
chunkCIJVSMK2_cjs.run(workspaceConfig, command);
|
|
@@ -1422,11 +1347,11 @@ async function runCommit(commitizenFile, dryRun = false) {
|
|
|
1422
1347
|
}
|
|
1423
1348
|
async function askQuestions(state) {
|
|
1424
1349
|
let index = 0;
|
|
1425
|
-
for (const key of Object.keys(state.config.
|
|
1426
|
-
if (state.config.
|
|
1350
|
+
for (const key of Object.keys(state.config.questions)) {
|
|
1351
|
+
if (state.config.questions[key] && !state.config.questions[key].hidden && (!state.config.questions[key].when || state.config.questions[key].when(state.answers))) {
|
|
1427
1352
|
state.answers[key] = await askQuestion(
|
|
1428
1353
|
index,
|
|
1429
|
-
state.config.
|
|
1354
|
+
state.config.questions[key]
|
|
1430
1355
|
);
|
|
1431
1356
|
index++;
|
|
1432
1357
|
}
|
|
@@ -2446,7 +2371,7 @@ async function generateChangelogContent(releaseVersion, filepath, newContent, cu
|
|
|
2446
2371
|
const header = await prettier.format(
|
|
2447
2372
|
` : void 0 : workspaceConfig?.release.banner.alt) || "Branded release banner image"}](${bannerUrl || chunk5SPAQH6A_cjs.STORM_DEFAULT_RELEASE_BANNER})
|
|
2450
2375
|
|
|
2451
2376
|
# Changelog ${project || workspaceConfig?.name ? "for" : ""}${workspaceConfig?.name ? ` ${titleCase(workspaceConfig.name)}` : ""}${project ? `${workspaceConfig?.name ? " -" : ""} ${titleCase(project)}` : ""}
|
|
2452
2377
|
|
|
@@ -2685,7 +2610,7 @@ var StormChangelogRenderer = class extends DefaultChangelogRenderer__default.def
|
|
|
2685
2610
|
};
|
|
2686
2611
|
}
|
|
2687
2612
|
async render() {
|
|
2688
|
-
this.workspaceConfig = await
|
|
2613
|
+
this.workspaceConfig = await chunk5SPAQH6A_cjs.getWorkspaceConfig();
|
|
2689
2614
|
return await super.render();
|
|
2690
2615
|
}
|
|
2691
2616
|
preprocessChanges() {
|
|
@@ -2996,7 +2921,7 @@ async function createOrUpdateGithubReleaseInternal(githubRequestConfig, release,
|
|
|
2996
2921
|
if (!shouldContinueInGitHub) {
|
|
2997
2922
|
return;
|
|
2998
2923
|
}
|
|
2999
|
-
const open =
|
|
2924
|
+
const open = chunk5SPAQH6A_cjs.__require("open");
|
|
3000
2925
|
await open(result.url).then(() => {
|
|
3001
2926
|
console.info(
|
|
3002
2927
|
`
|
|
@@ -3222,7 +3147,7 @@ async function isUserAnOrganizationMember(userId, config5, remoteName = "origin"
|
|
|
3222
3147
|
// src/release/changelog.ts
|
|
3223
3148
|
function createAPI(overrideReleaseConfig) {
|
|
3224
3149
|
return async function releaseChangelog(args) {
|
|
3225
|
-
const workspaceConfig = await
|
|
3150
|
+
const workspaceConfig = await chunk5SPAQH6A_cjs.getWorkspaceConfig();
|
|
3226
3151
|
const projectGraph$1 = await projectGraph.createProjectGraphAsync({ exitOnError: true });
|
|
3227
3152
|
const nxJson$1 = nxJson.readNxJson();
|
|
3228
3153
|
const userProvidedReleaseConfig = deepMergeJson.deepMergeJson(
|
|
@@ -3883,7 +3808,7 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
|
3883
3808
|
});
|
|
3884
3809
|
latestCommit = await git.getCommitHash("HEAD");
|
|
3885
3810
|
} else if ((args.stageChanges ?? nxReleaseConfig.changelog?.git.stageChanges) && changes.length) {
|
|
3886
|
-
|
|
3811
|
+
chunk5SPAQH6A_cjs.writeDebug(`Staging changed files with git`);
|
|
3887
3812
|
await git.gitAdd({
|
|
3888
3813
|
changedFiles,
|
|
3889
3814
|
deletedFiles,
|
|
@@ -3892,7 +3817,7 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
|
3892
3817
|
});
|
|
3893
3818
|
}
|
|
3894
3819
|
if (args.gitTag ?? nxReleaseConfig.changelog?.git.tag) {
|
|
3895
|
-
|
|
3820
|
+
chunk5SPAQH6A_cjs.writeDebug(`Tagging commit with git`);
|
|
3896
3821
|
for (const tag of gitTagValues) {
|
|
3897
3822
|
await gitTag({
|
|
3898
3823
|
tag,
|
|
@@ -3904,7 +3829,7 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
|
3904
3829
|
}
|
|
3905
3830
|
}
|
|
3906
3831
|
if (args.gitPush ?? nxReleaseConfig.changelog?.git.push) {
|
|
3907
|
-
|
|
3832
|
+
chunk5SPAQH6A_cjs.writeDebug(`Pushing to git remote "${args.gitRemote}"`);
|
|
3908
3833
|
await git.gitPush({
|
|
3909
3834
|
gitRemote: args.gitRemote,
|
|
3910
3835
|
dryRun: args.dryRun,
|
|
@@ -3923,7 +3848,7 @@ async function generateChangelogForWorkspace({
|
|
|
3923
3848
|
workspaceChangelogVersion,
|
|
3924
3849
|
changes
|
|
3925
3850
|
}) {
|
|
3926
|
-
const workspaceConfig = await
|
|
3851
|
+
const workspaceConfig = await chunk5SPAQH6A_cjs.getWorkspaceConfig();
|
|
3927
3852
|
if (!workspaceConfig) {
|
|
3928
3853
|
throw new Error(
|
|
3929
3854
|
`Unable to determine the Storm workspace config. Please ensure that your storm-workspace.json file is present and valid.`
|
|
@@ -4037,7 +3962,7 @@ async function generateChangelogForProjects({
|
|
|
4037
3962
|
nxReleaseConfig,
|
|
4038
3963
|
projectToAdditionalDependencyBumps
|
|
4039
3964
|
}) {
|
|
4040
|
-
const workspaceConfig = await
|
|
3965
|
+
const workspaceConfig = await chunk5SPAQH6A_cjs.getWorkspaceConfig();
|
|
4041
3966
|
if (!workspaceConfig) {
|
|
4042
3967
|
throw new Error(
|
|
4043
3968
|
`Unable to determine the Storm workspace config. Please ensure that your storm-workspace.json file is present and valid.`
|
|
@@ -4274,7 +4199,7 @@ ${workspaceConfig.release.footer}
|
|
|
4274
4199
|
// src/release/config.ts
|
|
4275
4200
|
var DEFAULT_CONVENTIONAL_COMMITS_CONFIG2 = {
|
|
4276
4201
|
questions: DEFAULT_MONOREPO_COMMIT_QUESTIONS,
|
|
4277
|
-
types:
|
|
4202
|
+
types: DEFAULT_COMMIT_TYPES
|
|
4278
4203
|
};
|
|
4279
4204
|
var DEFAULT_RELEASE_GROUP_CONFIG = {
|
|
4280
4205
|
projectsRelationship: "independent",
|
|
@@ -4342,7 +4267,7 @@ var runRelease = async (config5, options) => {
|
|
|
4342
4267
|
throw new Error("The `GITHUB_ACTOR` environment variable is not set.");
|
|
4343
4268
|
}
|
|
4344
4269
|
if (!await isUserAnOrganizationMember(process.env.GITHUB_ACTOR, config5)) {
|
|
4345
|
-
|
|
4270
|
+
chunk5SPAQH6A_cjs.writeFatal(
|
|
4346
4271
|
"You must be a member of the Storm Software organization to run the release process.",
|
|
4347
4272
|
config5
|
|
4348
4273
|
);
|
|
@@ -4359,12 +4284,12 @@ var runRelease = async (config5, options) => {
|
|
|
4359
4284
|
process.env.NODE_AUTH_TOKEN = process.env.NPM_TOKEN;
|
|
4360
4285
|
process.env.NPM_AUTH_TOKEN = process.env.NPM_TOKEN;
|
|
4361
4286
|
process.env.NPM_CONFIG_PROVENANCE = "true";
|
|
4362
|
-
|
|
4287
|
+
chunk5SPAQH6A_cjs.writeDebug("Creating workspace Project Graph data...", config5);
|
|
4363
4288
|
const nxJson = nxJson_js.readNxJson();
|
|
4364
|
-
|
|
4289
|
+
chunk5SPAQH6A_cjs.writeDebug("Reading in the workspaces release configuration", config5);
|
|
4365
4290
|
const to = options.head || process.env.NX_HEAD;
|
|
4366
4291
|
const from = options.base || process.env.NX_BASE;
|
|
4367
|
-
|
|
4292
|
+
chunk5SPAQH6A_cjs.writeDebug(
|
|
4368
4293
|
`Using the following Git SHAs to determine the release content:
|
|
4369
4294
|
- From: ${from}
|
|
4370
4295
|
- To: ${to}
|
|
@@ -4375,28 +4300,28 @@ var runRelease = async (config5, options) => {
|
|
|
4375
4300
|
nxJson.release.groups = Object.keys(nxJson.release.groups).reduce(
|
|
4376
4301
|
(ret, groupName) => {
|
|
4377
4302
|
const groupConfig = nxJson.release?.groups?.[groupName];
|
|
4378
|
-
ret[groupName] =
|
|
4303
|
+
ret[groupName] = chunk5SPAQH6A_cjs.defu(groupConfig, DEFAULT_RELEASE_GROUP_CONFIG);
|
|
4379
4304
|
return ret;
|
|
4380
4305
|
},
|
|
4381
4306
|
{}
|
|
4382
4307
|
);
|
|
4383
4308
|
}
|
|
4384
|
-
const nxReleaseConfig =
|
|
4309
|
+
const nxReleaseConfig = chunk5SPAQH6A_cjs.defu(
|
|
4385
4310
|
nxJson.release,
|
|
4386
4311
|
DEFAULT_RELEASE_CONFIG
|
|
4387
4312
|
);
|
|
4388
|
-
|
|
4313
|
+
chunk5SPAQH6A_cjs.writeInfo(
|
|
4389
4314
|
"Using the following `nx.json` release configuration values",
|
|
4390
4315
|
config5
|
|
4391
4316
|
);
|
|
4392
|
-
|
|
4317
|
+
chunk5SPAQH6A_cjs.writeInfo(nxReleaseConfig, config5);
|
|
4393
4318
|
const releaseVersion = version_js.createAPI(nxReleaseConfig);
|
|
4394
4319
|
const releaseChangelog = createAPI(nxReleaseConfig);
|
|
4395
4320
|
const releasePublish = publish_js.createAPI(nxReleaseConfig);
|
|
4396
|
-
|
|
4321
|
+
chunk5SPAQH6A_cjs.writeDebug("Determining the current release versions...", config5);
|
|
4397
4322
|
const { workspaceVersion, projectsVersionData } = await releaseVersion({
|
|
4398
4323
|
dryRun: false,
|
|
4399
|
-
verbose:
|
|
4324
|
+
verbose: chunk5SPAQH6A_cjs.isVerbose(config5.logLevel),
|
|
4400
4325
|
preid: config5.preid,
|
|
4401
4326
|
deleteVersionPlans: false,
|
|
4402
4327
|
stageChanges: true,
|
|
@@ -4407,15 +4332,15 @@ var runRelease = async (config5, options) => {
|
|
|
4407
4332
|
version: nxReleaseConfig?.projectsRelationship !== "fixed" ? void 0 : workspaceVersion,
|
|
4408
4333
|
versionData: projectsVersionData,
|
|
4409
4334
|
dryRun: false,
|
|
4410
|
-
verbose:
|
|
4335
|
+
verbose: chunk5SPAQH6A_cjs.isVerbose(config5.logLevel),
|
|
4411
4336
|
to,
|
|
4412
4337
|
from,
|
|
4413
4338
|
gitCommit: true,
|
|
4414
4339
|
gitCommitMessage: "release(monorepo): Publish workspace release updates"
|
|
4415
4340
|
});
|
|
4416
|
-
|
|
4341
|
+
chunk5SPAQH6A_cjs.writeDebug("Tagging commit with git", config5);
|
|
4417
4342
|
if (options.skipPublish) {
|
|
4418
|
-
|
|
4343
|
+
chunk5SPAQH6A_cjs.writeWarning(
|
|
4419
4344
|
"Skipping publishing packages since `skipPublish` was provided as `true` in the release options.",
|
|
4420
4345
|
config5
|
|
4421
4346
|
);
|
|
@@ -4424,7 +4349,7 @@ var runRelease = async (config5, options) => {
|
|
|
4424
4349
|
(key) => projectsVersionData[key]?.newVersion
|
|
4425
4350
|
);
|
|
4426
4351
|
if (changedProjects.length > 0) {
|
|
4427
|
-
|
|
4352
|
+
chunk5SPAQH6A_cjs.writeInfo(
|
|
4428
4353
|
`Publishing release for ${changedProjects.length} ${changedProjects.length === 1 ? "project" : "projects"}:
|
|
4429
4354
|
${changedProjects.map((changedProject) => ` - ${changedProject}`).join("\n")}
|
|
4430
4355
|
`,
|
|
@@ -4434,7 +4359,7 @@ ${changedProjects.map((changedProject) => ` - ${changedProject}`).join("\n")}
|
|
|
4434
4359
|
const result = await releasePublish({
|
|
4435
4360
|
...options,
|
|
4436
4361
|
dryRun: !!options.dryRun,
|
|
4437
|
-
verbose:
|
|
4362
|
+
verbose: chunk5SPAQH6A_cjs.isVerbose(config5.logLevel)
|
|
4438
4363
|
});
|
|
4439
4364
|
const failedProjects = Object.keys(result).filter(
|
|
4440
4365
|
(key) => result[key]?.code && result[key]?.code > 0
|
|
@@ -4449,10 +4374,10 @@ ${failedProjects.map((failedProject) => ` - ${failedProject} (Error Code: ${res
|
|
|
4449
4374
|
);
|
|
4450
4375
|
}
|
|
4451
4376
|
} else {
|
|
4452
|
-
|
|
4377
|
+
chunk5SPAQH6A_cjs.writeWarning("Skipped publishing packages.", config5);
|
|
4453
4378
|
}
|
|
4454
4379
|
}
|
|
4455
|
-
|
|
4380
|
+
chunk5SPAQH6A_cjs.writeSuccess("Completed the Storm workspace release process!", config5);
|
|
4456
4381
|
};
|
|
4457
4382
|
async function updatePackageManifests(projectsVersionData, config5) {
|
|
4458
4383
|
let projectGraph;
|
|
@@ -4467,7 +4392,7 @@ async function updatePackageManifests(projectsVersionData, config5) {
|
|
|
4467
4392
|
Object.keys(projectsVersionData).map(async (node) => {
|
|
4468
4393
|
const projectNode = projectGraph.nodes[node];
|
|
4469
4394
|
if (!projectNode?.data.root) {
|
|
4470
|
-
|
|
4395
|
+
chunk5SPAQH6A_cjs.writeWarning(
|
|
4471
4396
|
`Project node ${node} not found in the project graph. Skipping manifest update.`,
|
|
4472
4397
|
config5
|
|
4473
4398
|
);
|
|
@@ -4475,17 +4400,17 @@ async function updatePackageManifests(projectsVersionData, config5) {
|
|
|
4475
4400
|
}
|
|
4476
4401
|
const versionData = projectsVersionData[node];
|
|
4477
4402
|
if (projectNode?.data.root && versionData && versionData.newVersion !== null) {
|
|
4478
|
-
|
|
4403
|
+
chunk5SPAQH6A_cjs.writeTrace(
|
|
4479
4404
|
`Writing version ${versionData.newVersion} update to manifest file for ${node}
|
|
4480
4405
|
`,
|
|
4481
4406
|
config5
|
|
4482
4407
|
);
|
|
4483
|
-
const projectRoot =
|
|
4408
|
+
const projectRoot = chunk5SPAQH6A_cjs.joinPaths(
|
|
4484
4409
|
config5.workspaceRoot,
|
|
4485
4410
|
projectNode.data.root
|
|
4486
4411
|
);
|
|
4487
|
-
const packageJsonPath =
|
|
4488
|
-
const cargoTomlPath =
|
|
4412
|
+
const packageJsonPath = chunk5SPAQH6A_cjs.joinPaths(projectRoot, "package.json");
|
|
4413
|
+
const cargoTomlPath = chunk5SPAQH6A_cjs.joinPaths(projectRoot, "Cargo.toml");
|
|
4489
4414
|
if (fs$1.existsSync(packageJsonPath)) {
|
|
4490
4415
|
const packageJsonContent = await fs.readFile(packageJsonPath, "utf8");
|
|
4491
4416
|
const packageJson = JSON.parse(packageJsonContent);
|
|
@@ -4503,7 +4428,7 @@ async function updatePackageManifests(projectsVersionData, config5) {
|
|
|
4503
4428
|
})
|
|
4504
4429
|
);
|
|
4505
4430
|
} else {
|
|
4506
|
-
|
|
4431
|
+
chunk5SPAQH6A_cjs.writeWarning("No project nodes found. Skipping manifest updates.", config5);
|
|
4507
4432
|
}
|
|
4508
4433
|
}
|
|
4509
4434
|
|
|
@@ -4511,8 +4436,8 @@ async function updatePackageManifests(projectsVersionData, config5) {
|
|
|
4511
4436
|
var _config = {};
|
|
4512
4437
|
function createProgram(config5) {
|
|
4513
4438
|
_config = config5;
|
|
4514
|
-
|
|
4515
|
-
const root =
|
|
4439
|
+
chunk5SPAQH6A_cjs.writeInfo("\u26A1 Running Storm Git Tools", config5);
|
|
4440
|
+
const root = chunk5SPAQH6A_cjs.findWorkspaceRootSafe(process.cwd());
|
|
4516
4441
|
process.env.STORM_WORKSPACE_ROOT ??= root;
|
|
4517
4442
|
process.env.NX_WORKSPACE_ROOT_PATH ??= root;
|
|
4518
4443
|
if (root) {
|
|
@@ -4581,12 +4506,12 @@ async function commitAction({
|
|
|
4581
4506
|
dryRun = false
|
|
4582
4507
|
}) {
|
|
4583
4508
|
try {
|
|
4584
|
-
|
|
4509
|
+
chunk5SPAQH6A_cjs.writeInfo(
|
|
4585
4510
|
`\u26A1 Preparing to commit your changes. Please provide the requested details below...`,
|
|
4586
4511
|
_config
|
|
4587
4512
|
);
|
|
4588
4513
|
await runCommit(config5, dryRun);
|
|
4589
|
-
|
|
4514
|
+
chunk5SPAQH6A_cjs.writeSuccess(
|
|
4590
4515
|
`\u{1F389} Storm Commit processing completed successfully!
|
|
4591
4516
|
|
|
4592
4517
|
Note: Please run "pnpm push" to upload these changes to the remote ${_config.name ? _config.name : _config.namespace ? _config.namespace : _config.organization ? _config.organization : "Storm-Software"} Git repository at ${_config.repository}
|
|
@@ -4594,7 +4519,7 @@ Note: Please run "pnpm push" to upload these changes to the remote ${_config.nam
|
|
|
4594
4519
|
_config
|
|
4595
4520
|
);
|
|
4596
4521
|
} catch (error) {
|
|
4597
|
-
|
|
4522
|
+
chunk5SPAQH6A_cjs.writeFatal(
|
|
4598
4523
|
`A fatal error occurred while running commit action:
|
|
4599
4524
|
|
|
4600
4525
|
${error.message}${error.stack ? `
|
|
@@ -4609,14 +4534,14 @@ Please fix any errors and try committing again.`,
|
|
|
4609
4534
|
}
|
|
4610
4535
|
async function readmeAction(options) {
|
|
4611
4536
|
try {
|
|
4612
|
-
|
|
4537
|
+
chunk5SPAQH6A_cjs.writeInfo("\u26A1 Formatting the workspace's README.md files", _config);
|
|
4613
4538
|
await runReadme(options);
|
|
4614
|
-
|
|
4539
|
+
chunk5SPAQH6A_cjs.writeSuccess(
|
|
4615
4540
|
"Formatting of the workspace's README.md files is complete\n",
|
|
4616
4541
|
_config
|
|
4617
4542
|
);
|
|
4618
4543
|
} catch (error) {
|
|
4619
|
-
|
|
4544
|
+
chunk5SPAQH6A_cjs.writeFatal(
|
|
4620
4545
|
`A fatal error occurred while running README format action:
|
|
4621
4546
|
|
|
4622
4547
|
${error.message}`
|
|
@@ -4631,7 +4556,7 @@ async function releaseAction({
|
|
|
4631
4556
|
dryRun
|
|
4632
4557
|
}) {
|
|
4633
4558
|
try {
|
|
4634
|
-
|
|
4559
|
+
chunk5SPAQH6A_cjs.writeInfo(
|
|
4635
4560
|
"\u26A1 Running the Storm Release and Publish process on the workspace",
|
|
4636
4561
|
_config
|
|
4637
4562
|
);
|
|
@@ -4641,9 +4566,9 @@ async function releaseAction({
|
|
|
4641
4566
|
base,
|
|
4642
4567
|
head
|
|
4643
4568
|
});
|
|
4644
|
-
|
|
4569
|
+
chunk5SPAQH6A_cjs.writeSuccess("Release completed successfully!\n", _config);
|
|
4645
4570
|
} catch (error) {
|
|
4646
|
-
|
|
4571
|
+
chunk5SPAQH6A_cjs.writeFatal(
|
|
4647
4572
|
`A fatal error occurred while running release action:
|
|
4648
4573
|
|
|
4649
4574
|
${error.message} ${error.stack ? `
|
|
@@ -4657,17 +4582,17 @@ Stacktrace: ${error.stack}` : ""}`,
|
|
|
4657
4582
|
}
|
|
4658
4583
|
async function commitLintAction(options) {
|
|
4659
4584
|
try {
|
|
4660
|
-
|
|
4585
|
+
chunk5SPAQH6A_cjs.writeInfo(
|
|
4661
4586
|
`\u26A1 Linting the ${_config.repository ? _config.repository : _config.namespace ? _config.namespace : _config.name ? _config.name : typeof _config.organization === "string" ? _config.organization : _config.organization?.name ? _config.organization?.name : "Storm-Software"} repository's commit messages.`,
|
|
4662
4587
|
_config
|
|
4663
4588
|
);
|
|
4664
4589
|
await runCommitLint(_config, options);
|
|
4665
|
-
|
|
4590
|
+
chunk5SPAQH6A_cjs.writeSuccess(
|
|
4666
4591
|
"Linting the commit messages completed successfully!\n",
|
|
4667
4592
|
_config
|
|
4668
4593
|
);
|
|
4669
4594
|
} catch (error) {
|
|
4670
|
-
|
|
4595
|
+
chunk5SPAQH6A_cjs.writeFatal(
|
|
4671
4596
|
`A fatal error occurred while linting the commit messages:
|
|
4672
4597
|
|
|
4673
4598
|
${error.message}`,
|
|
@@ -4679,18 +4604,18 @@ ${error.message}`,
|
|
|
4679
4604
|
|
|
4680
4605
|
// bin/git.ts
|
|
4681
4606
|
void (async () => {
|
|
4682
|
-
const config5 = await
|
|
4607
|
+
const config5 = await chunk5SPAQH6A_cjs.getConfig();
|
|
4683
4608
|
try {
|
|
4684
|
-
|
|
4609
|
+
chunk5SPAQH6A_cjs.handleProcess(config5);
|
|
4685
4610
|
const program = createProgram(config5);
|
|
4686
4611
|
await program.parseAsync(process.argv);
|
|
4687
|
-
|
|
4612
|
+
chunk5SPAQH6A_cjs.writeSuccess(
|
|
4688
4613
|
`\u{1F389} Git ${process.argv && process.argv.length >= 3 && process.argv[2] ? process.argv[2] : "tool"} processing completed successfully!`,
|
|
4689
4614
|
config5
|
|
4690
4615
|
);
|
|
4691
|
-
|
|
4616
|
+
chunk5SPAQH6A_cjs.exitWithSuccess(config5);
|
|
4692
4617
|
} catch (error) {
|
|
4693
|
-
|
|
4618
|
+
chunk5SPAQH6A_cjs.exitWithError(config5);
|
|
4694
4619
|
process.exit(1);
|
|
4695
4620
|
}
|
|
4696
4621
|
})();
|