@storm-software/git-tools 2.121.3 → 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.
- package/README.md +2 -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 -476
- package/bin/git.js +342 -413
- 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,8 +854,8 @@ ${body}` : message;
|
|
|
892
854
|
${footer}` : message;
|
|
893
855
|
return message || "";
|
|
894
856
|
};
|
|
895
|
-
async function lint(message,
|
|
896
|
-
const parser = new CommitParser(
|
|
857
|
+
async function lint(message, config5) {
|
|
858
|
+
const parser = new CommitParser(config5.parser || {});
|
|
897
859
|
const parsed = parser.parse(message);
|
|
898
860
|
if (parsed.header === null && parsed.body === null && parsed.footer === null) {
|
|
899
861
|
return {
|
|
@@ -904,7 +866,7 @@ async function lint(message, commitlintConfig) {
|
|
|
904
866
|
};
|
|
905
867
|
}
|
|
906
868
|
const allRules = new Map(Object.entries(defaultRules__default.default));
|
|
907
|
-
const missing = Object.keys(
|
|
869
|
+
const missing = Object.keys(config5.commitlint.rules).filter(
|
|
908
870
|
(name) => typeof allRules.get(name) !== "function"
|
|
909
871
|
);
|
|
910
872
|
if (missing.length > 0) {
|
|
@@ -916,19 +878,19 @@ async function lint(message, commitlintConfig) {
|
|
|
916
878
|
].join("\n")
|
|
917
879
|
);
|
|
918
880
|
}
|
|
919
|
-
const invalid = Object.entries(
|
|
920
|
-
if (!Array.isArray(
|
|
881
|
+
const invalid = Object.entries(config5.commitlint.rules).map(([name, config6]) => {
|
|
882
|
+
if (!Array.isArray(config6)) {
|
|
921
883
|
return new Error(
|
|
922
884
|
`config for rule ${name} must be array, received ${util__default.default.inspect(
|
|
923
|
-
|
|
924
|
-
)} of type ${typeof
|
|
885
|
+
config6
|
|
886
|
+
)} of type ${typeof config6}`
|
|
925
887
|
);
|
|
926
888
|
}
|
|
927
|
-
const [level] =
|
|
928
|
-
if (level === 0 /* Disabled */ &&
|
|
889
|
+
const [level] = config6;
|
|
890
|
+
if (level === 0 /* Disabled */ && config6.length === 1) {
|
|
929
891
|
return null;
|
|
930
892
|
}
|
|
931
|
-
const [, when] =
|
|
893
|
+
const [, when] = config6;
|
|
932
894
|
if (typeof level !== "number" || isNaN(level)) {
|
|
933
895
|
return new Error(
|
|
934
896
|
`level for rule ${name} must be number, received ${util__default.default.inspect(
|
|
@@ -936,11 +898,11 @@ async function lint(message, commitlintConfig) {
|
|
|
936
898
|
)} of type ${typeof level}`
|
|
937
899
|
);
|
|
938
900
|
}
|
|
939
|
-
if (
|
|
901
|
+
if (config6.length < 2 || config6.length > 3) {
|
|
940
902
|
return new Error(
|
|
941
903
|
`config for rule ${name} must be 2 or 3 items long, received ${util__default.default.inspect(
|
|
942
|
-
|
|
943
|
-
)} of length ${
|
|
904
|
+
config6
|
|
905
|
+
)} of length ${config6.length}`
|
|
944
906
|
);
|
|
945
907
|
}
|
|
946
908
|
if (level < 0 || level > 2) {
|
|
@@ -970,10 +932,10 @@ async function lint(message, commitlintConfig) {
|
|
|
970
932
|
throw new Error(invalid.map((i) => i.message).join("\n"));
|
|
971
933
|
}
|
|
972
934
|
const pendingResults = Object.entries(
|
|
973
|
-
|
|
974
|
-
).filter(([,
|
|
975
|
-
const [name,
|
|
976
|
-
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;
|
|
977
939
|
const rule = allRules.get(name);
|
|
978
940
|
if (!rule) {
|
|
979
941
|
throw new Error(`Could not find rule implementation for ${name}`);
|
|
@@ -1004,50 +966,11 @@ async function lint(message, commitlintConfig) {
|
|
|
1004
966
|
input: buildCommitMessage(parsed)
|
|
1005
967
|
};
|
|
1006
968
|
}
|
|
1007
|
-
async function getNxScopes(context) {
|
|
1008
|
-
let projectGraph$1;
|
|
1009
|
-
try {
|
|
1010
|
-
projectGraph$1 = projectGraph.readCachedProjectGraph();
|
|
1011
|
-
} catch {
|
|
1012
|
-
await projectGraph.createProjectGraphAsync();
|
|
1013
|
-
projectGraph$1 = projectGraph.readCachedProjectGraph();
|
|
1014
|
-
}
|
|
1015
|
-
if (!projectGraph$1) {
|
|
1016
|
-
throw new Error(
|
|
1017
|
-
"The commit process failed because the project graph is not available. Please run the build command again."
|
|
1018
|
-
);
|
|
1019
|
-
}
|
|
1020
|
-
const projectConfigs = projectGraph.readProjectsConfigurationFromProjectGraph(projectGraph$1);
|
|
1021
|
-
const result = Object.entries(projectConfigs.projects || {}).map(([name, project]) => ({
|
|
1022
|
-
name,
|
|
1023
|
-
...project
|
|
1024
|
-
})).filter(
|
|
1025
|
-
(project) => project.name && project.root && project.root !== "." && project.root !== context.config.workspaceRoot && !project.name.includes("e2e")
|
|
1026
|
-
).filter((project) => project.targets).map((project) => project.name).filter(Boolean).sort((a, b) => a.localeCompare(b));
|
|
1027
|
-
result.unshift("monorepo");
|
|
1028
|
-
return result;
|
|
1029
|
-
}
|
|
1030
|
-
function getScopeEnumUtil(context) {
|
|
1031
|
-
return () => getScopeEnum(context);
|
|
1032
|
-
}
|
|
1033
|
-
function getScopeEnum(context) {
|
|
1034
|
-
return getNxScopes(context);
|
|
1035
|
-
}
|
|
1036
|
-
function getRuleFromScopeEnum(scopeEnum) {
|
|
1037
|
-
if (!scopeEnum?.filter(Boolean).length) {
|
|
1038
|
-
throw new Error("No scopes found in the Storm workspace.");
|
|
1039
|
-
}
|
|
1040
|
-
return [
|
|
1041
|
-
2 /* Error */,
|
|
1042
|
-
"always",
|
|
1043
|
-
scopeEnum.filter(Boolean)
|
|
1044
|
-
];
|
|
1045
|
-
}
|
|
1046
969
|
|
|
1047
970
|
// src/commitlint/run.ts
|
|
1048
971
|
var COMMIT_EDITMSG_PATH = ".git/COMMIT_EDITMSG";
|
|
1049
972
|
async function runCommitLint(workspaceConfig, options) {
|
|
1050
|
-
|
|
973
|
+
chunk5SPAQH6A_cjs.writeInfo(
|
|
1051
974
|
"\u{1F4DD} Validating git commit message aligns with the Storm Software specification",
|
|
1052
975
|
workspaceConfig
|
|
1053
976
|
);
|
|
@@ -1055,7 +978,7 @@ async function runCommitLint(workspaceConfig, options) {
|
|
|
1055
978
|
if (options.message && options.message !== COMMIT_EDITMSG_PATH) {
|
|
1056
979
|
commitMessage = options.message;
|
|
1057
980
|
} else {
|
|
1058
|
-
const commitFile =
|
|
981
|
+
const commitFile = chunk5SPAQH6A_cjs.joinPaths(
|
|
1059
982
|
workspaceConfig.workspaceRoot,
|
|
1060
983
|
options.file || options.message || COMMIT_EDITMSG_PATH
|
|
1061
984
|
);
|
|
@@ -1072,17 +995,17 @@ async function runCommitLint(workspaceConfig, options) {
|
|
|
1072
995
|
if (upstreamRemote) {
|
|
1073
996
|
const upstreamRemoteIdentifier = upstreamRemote.split(" ")[0]?.trim();
|
|
1074
997
|
if (!upstreamRemoteIdentifier) {
|
|
1075
|
-
|
|
998
|
+
chunk5SPAQH6A_cjs.writeWarning(
|
|
1076
999
|
`No upstream remote found for ${workspaceConfig.name}.git. Skipping comparison.`,
|
|
1077
1000
|
workspaceConfig
|
|
1078
1001
|
);
|
|
1079
1002
|
return;
|
|
1080
1003
|
}
|
|
1081
|
-
|
|
1004
|
+
chunk5SPAQH6A_cjs.writeDebug(`Comparing against remote ${upstreamRemoteIdentifier}`);
|
|
1082
1005
|
const currentBranch = childProcess__default.default.execSync("git branch --show-current").toString().trim();
|
|
1083
1006
|
gitLogCmd = gitLogCmd + ` ${currentBranch} ^${upstreamRemoteIdentifier}/main`;
|
|
1084
1007
|
} else {
|
|
1085
|
-
|
|
1008
|
+
chunk5SPAQH6A_cjs.writeWarning(
|
|
1086
1009
|
`No upstream remote found for ${workspaceConfig.name}.git. Skipping comparison against upstream main.`,
|
|
1087
1010
|
workspaceConfig
|
|
1088
1011
|
);
|
|
@@ -1090,39 +1013,17 @@ async function runCommitLint(workspaceConfig, options) {
|
|
|
1090
1013
|
}
|
|
1091
1014
|
commitMessage = childProcess__default.default.execSync(gitLogCmd).toString().trim();
|
|
1092
1015
|
if (!commitMessage) {
|
|
1093
|
-
|
|
1016
|
+
chunk5SPAQH6A_cjs.writeWarning(
|
|
1094
1017
|
"No commits found. Skipping commit message validation.",
|
|
1095
1018
|
workspaceConfig
|
|
1096
1019
|
);
|
|
1097
1020
|
return;
|
|
1098
1021
|
}
|
|
1099
1022
|
}
|
|
1100
|
-
const
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
let commitlintRegex;
|
|
1105
|
-
const allowedTypes = commitlintConfig.rules["type-enum"] ?? COMMIT_TYPES;
|
|
1106
|
-
let allowedScopes = [];
|
|
1107
|
-
if (workspaceConfig.variant !== "minimal" && commitlintConfig.rules["scope-empty"] && commitlintConfig.rules["scope-empty"][0] !== 0 /* Disabled */) {
|
|
1108
|
-
allowedScopes = await getNxScopes({
|
|
1109
|
-
config: workspaceConfig
|
|
1110
|
-
});
|
|
1111
|
-
commitlintConfig.rules["scope-enum"] = getRuleFromScopeEnum(allowedScopes);
|
|
1112
|
-
commitlintRegex = new RegExp(
|
|
1113
|
-
`(${Object.keys(allowedTypes).join("|")})\\((${allowedScopes})\\)!?:\\s([a-z0-9:\\-\\/\\s])+`
|
|
1114
|
-
);
|
|
1115
|
-
} else {
|
|
1116
|
-
commitlintRegex = new RegExp(
|
|
1117
|
-
`(${Object.keys(allowedTypes).join("|")})!?:\\s([a-z0-9:\\-\\/\\s])+`
|
|
1118
|
-
);
|
|
1119
|
-
}
|
|
1120
|
-
const report = await lint(commitMessage, {
|
|
1121
|
-
...commitlintConfig,
|
|
1122
|
-
parserOpts: createParserOpts(workspaceConfig.variant)
|
|
1123
|
-
});
|
|
1124
|
-
if (!commitlintRegex.test(commitMessage) || report.errors.length || report.warnings.length) {
|
|
1125
|
-
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(
|
|
1126
1027
|
`Commit was processing completed successfully!`,
|
|
1127
1028
|
workspaceConfig
|
|
1128
1029
|
);
|
|
@@ -1130,14 +1031,16 @@ async function runCommitLint(workspaceConfig, options) {
|
|
|
1130
1031
|
let errorMessage = " Oh no! Your commit message: \n-------------------------------------------------------------------\n" + commitMessage + `
|
|
1131
1032
|
-------------------------------------------------------------------
|
|
1132
1033
|
|
|
1133
|
-
Does not follow the
|
|
1134
|
-
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";
|
|
1135
1036
|
errorMessage += "\n";
|
|
1136
1037
|
errorMessage += `
|
|
1137
|
-
Possible types: ${
|
|
1138
|
-
|
|
1038
|
+
Possible types: ${preset.changelogs.props.types.map(
|
|
1039
|
+
(type) => `${type.section} (${type.type})`
|
|
1040
|
+
)}`;
|
|
1041
|
+
if (preset.changelogs.props.scope?.length) {
|
|
1139
1042
|
errorMessage += `
|
|
1140
|
-
Possible scopes: ${
|
|
1043
|
+
Possible scopes: ${preset.changelogs.props.scope} (if unsure use "monorepo")`;
|
|
1141
1044
|
}
|
|
1142
1045
|
errorMessage += "\n\nEXAMPLE: \nfeat(my-lib): add an option to generate lazy-loadable modules\nfix(monorepo)!: breaking change should have exclamation mark\n";
|
|
1143
1046
|
errorMessage += `
|
|
@@ -1148,86 +1051,116 @@ CommitLint Warnings: ${report.warnings.length ? report.warnings.map((warning) =>
|
|
|
1148
1051
|
errorMessage += "\n\nPlease fix the commit message and rerun storm-commit.";
|
|
1149
1052
|
errorMessage += `
|
|
1150
1053
|
|
|
1151
|
-
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}`;
|
|
1152
1055
|
throw new Error(errorMessage);
|
|
1153
1056
|
}
|
|
1154
1057
|
return report.input;
|
|
1155
1058
|
}
|
|
1156
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
|
+
|
|
1157
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
|
+
};
|
|
1158
1129
|
var config3 = {
|
|
1159
|
-
settings:
|
|
1130
|
+
settings: COMMIT_CONFIGS.minimal.commitlint.settings,
|
|
1160
1131
|
messages: DEFAULT_COMMIT_PROMPT_MESSAGES,
|
|
1161
1132
|
questions: DEFAULT_MINIMAL_COMMIT_QUESTIONS,
|
|
1162
|
-
types:
|
|
1133
|
+
types: DEFAULT_COMMIT_TYPES
|
|
1163
1134
|
};
|
|
1164
1135
|
var minimal_default2 = config3;
|
|
1165
1136
|
|
|
1166
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
|
+
};
|
|
1167
1156
|
var config4 = {
|
|
1168
|
-
settings:
|
|
1157
|
+
settings: COMMIT_CONFIGS.monorepo.commitlint.settings,
|
|
1169
1158
|
messages: DEFAULT_COMMIT_PROMPT_MESSAGES,
|
|
1170
1159
|
questions: DEFAULT_MONOREPO_COMMIT_QUESTIONS,
|
|
1171
|
-
types:
|
|
1160
|
+
types: DEFAULT_COMMIT_TYPES
|
|
1172
1161
|
};
|
|
1173
1162
|
var monorepo_default2 = config4;
|
|
1174
1163
|
|
|
1175
|
-
// src/commit/helpers.ts
|
|
1176
|
-
function resolveMinimalCommitOptions(config5 = minimal_default2) {
|
|
1177
|
-
return {
|
|
1178
|
-
parserPreset: "conventional-changelog-storm-software",
|
|
1179
|
-
prompt: {
|
|
1180
|
-
settings: config5.settings,
|
|
1181
|
-
messages: config5.messages,
|
|
1182
|
-
questions: config5.questions
|
|
1183
|
-
}
|
|
1184
|
-
};
|
|
1185
|
-
}
|
|
1186
|
-
function resolveMonorepoCommitOptions(workspaceConfig, config5 = monorepo_default2) {
|
|
1187
|
-
return {
|
|
1188
|
-
utils: { getScopeEnum: getScopeEnumUtil({ config: workspaceConfig }) },
|
|
1189
|
-
parserPreset: "conventional-changelog-storm-software",
|
|
1190
|
-
prompt: {
|
|
1191
|
-
settings: config5.settings,
|
|
1192
|
-
messages: config5.messages,
|
|
1193
|
-
questions: config5.questions
|
|
1194
|
-
}
|
|
1195
|
-
};
|
|
1196
|
-
}
|
|
1197
|
-
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)) }) });
|
|
1198
|
-
async function resolveCommitConfig(workspaceConfig, configPath) {
|
|
1199
|
-
if (configPath && configPath !== "@storm-software/git-tools/commit/minimal" && configPath !== "@storm-software/git-tools/commit/monorepo") {
|
|
1200
|
-
chunkN5U2S3QK_cjs.writeInfo(
|
|
1201
|
-
`Using custom commit config file: ${configPath}`,
|
|
1202
|
-
workspaceConfig
|
|
1203
|
-
);
|
|
1204
|
-
} else {
|
|
1205
|
-
configPath = workspaceConfig?.variant === "minimal" ? "@storm-software/git-tools/commit/minimal" : "@storm-software/git-tools/commit/monorepo";
|
|
1206
|
-
chunkN5U2S3QK_cjs.writeInfo(
|
|
1207
|
-
`Using standard commit config file: ${configPath}`,
|
|
1208
|
-
workspaceConfig
|
|
1209
|
-
);
|
|
1210
|
-
}
|
|
1211
|
-
let config5 = {};
|
|
1212
|
-
if ((configPath.endsWith(".json") || configPath.endsWith(".jsonc")) && !fs$1.existsSync(jiti2.esmResolve(configPath, workspaceConfig.workspaceRoot))) {
|
|
1213
|
-
const configContent = await fs.readFile(
|
|
1214
|
-
jiti2.esmResolve(configPath, workspaceConfig.workspaceRoot),
|
|
1215
|
-
"utf8"
|
|
1216
|
-
);
|
|
1217
|
-
config5 = JSON.parse(configContent);
|
|
1218
|
-
} else {
|
|
1219
|
-
config5 = await jiti2.import(jiti2.esmResolve(configPath), { default: true });
|
|
1220
|
-
}
|
|
1221
|
-
const mergedConfig = {
|
|
1222
|
-
...config5 ?? {},
|
|
1223
|
-
...workspaceConfig.variant === "minimal" ? minimal_default2 : monorepo_default2
|
|
1224
|
-
};
|
|
1225
|
-
return workspaceConfig.variant === "minimal" ? resolveMinimalCommitOptions(mergedConfig) : resolveMonorepoCommitOptions(
|
|
1226
|
-
workspaceConfig,
|
|
1227
|
-
mergedConfig
|
|
1228
|
-
);
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
1164
|
// src/commit/commit-state.ts
|
|
1232
1165
|
function getGitDir() {
|
|
1233
1166
|
const devNull = process.platform === "win32" ? " nul" : "/dev/null";
|
|
@@ -1248,34 +1181,33 @@ async function createState(workspaceConfig, configPath) {
|
|
|
1248
1181
|
}
|
|
1249
1182
|
const state = {
|
|
1250
1183
|
variant: workspaceConfig.variant,
|
|
1251
|
-
config:
|
|
1184
|
+
config: workspaceConfig.variant === "minimal" ? minimal_default2 : monorepo_default2,
|
|
1252
1185
|
root,
|
|
1253
1186
|
answers: {}
|
|
1254
1187
|
};
|
|
1255
|
-
if (state.config.
|
|
1256
|
-
state.config.
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
);
|
|
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
|
+
}, {});
|
|
1269
1201
|
}
|
|
1270
|
-
if (workspaceConfig.variant === "monorepo" && (!state.config.
|
|
1271
|
-
state.config.
|
|
1202
|
+
if (workspaceConfig.variant === "monorepo" && (!state.config.questions?.scope || !state.config.questions?.scope.enum || Object.keys(
|
|
1203
|
+
state.config.questions?.scope.enum
|
|
1272
1204
|
).length === 0)) {
|
|
1273
1205
|
const scopes = await getScopeEnum({
|
|
1274
1206
|
config: workspaceConfig
|
|
1275
1207
|
});
|
|
1276
1208
|
for (const scope of scopes) {
|
|
1277
1209
|
if (scope === "monorepo") {
|
|
1278
|
-
state.config.
|
|
1210
|
+
state.config.questions.scope.enum[scope] = {
|
|
1279
1211
|
title: chalkTemplate__default.default`{bold monorepo} - workspace root`,
|
|
1280
1212
|
description: "The base workspace package (workspace root)",
|
|
1281
1213
|
hidden: false,
|
|
@@ -1303,13 +1235,13 @@ async function createState(workspaceConfig, configPath) {
|
|
|
1303
1235
|
const project = projectConfigurations.projects[scope];
|
|
1304
1236
|
if (project) {
|
|
1305
1237
|
let description = `${project.name} - ${project.root}`;
|
|
1306
|
-
const packageJsonPath =
|
|
1238
|
+
const packageJsonPath = chunk5SPAQH6A_cjs.joinPaths(project.root, "package.json");
|
|
1307
1239
|
if (fs$1.existsSync(packageJsonPath)) {
|
|
1308
1240
|
const packageJsonFile = await fs.readFile(packageJsonPath, "utf8");
|
|
1309
1241
|
const packageJson = JSON.parse(packageJsonFile);
|
|
1310
1242
|
description = packageJson.description || description;
|
|
1311
1243
|
}
|
|
1312
|
-
state.config.
|
|
1244
|
+
state.config.questions.scope.enum[scope] = {
|
|
1313
1245
|
title: chalkTemplate__default.default`{bold ${project.name}} - ${project.root}`,
|
|
1314
1246
|
description,
|
|
1315
1247
|
hidden: false,
|
|
@@ -1319,7 +1251,7 @@ async function createState(workspaceConfig, configPath) {
|
|
|
1319
1251
|
}
|
|
1320
1252
|
}
|
|
1321
1253
|
}
|
|
1322
|
-
state.answers = Object.keys(state.config.
|
|
1254
|
+
state.answers = Object.keys(state.config.questions).reduce(
|
|
1323
1255
|
(ret, key) => {
|
|
1324
1256
|
ret[key] = "";
|
|
1325
1257
|
return ret;
|
|
@@ -1349,14 +1281,11 @@ var formatCommitMessage = (state, workspaceConfig) => {
|
|
|
1349
1281
|
const scope = workspaceConfig.variant !== "minimal" && typeof answers.scope === "string" && answers.scope ? answers.scope.trim() : "";
|
|
1350
1282
|
const subject = answers.subject?.trim();
|
|
1351
1283
|
const type = answers.type;
|
|
1352
|
-
const format2 = config5.
|
|
1284
|
+
const format2 = config5.settings.format || (workspaceConfig.variant !== "minimal" ? "{type}({scope}): {emoji}{subject}" : "{type}: {emoji}{subject}");
|
|
1353
1285
|
const body = answers.body && typeof answers.body === "string" ? wrap__default.default(answers.body || "", wrapOptions) : "";
|
|
1354
1286
|
const breaking = answers.breakingBody && typeof answers.breakingBody === "string" ? wrap__default.default(answers.breakingBody || "", wrapOptions) : "";
|
|
1355
1287
|
const issues = answers.issuesBody && typeof answers.issuesBody === "string" ? wrap__default.default(answers.issuesBody || "", wrapOptions) : "";
|
|
1356
|
-
const head = format2.replace(
|
|
1357
|
-
/\{emoji\}/g,
|
|
1358
|
-
config5.prompt.settings.disableEmoji ? "" : `${emoji} `
|
|
1359
|
-
).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 || "");
|
|
1360
1289
|
let msg = head;
|
|
1361
1290
|
if (body) {
|
|
1362
1291
|
msg += `
|
|
@@ -1364,26 +1293,26 @@ var formatCommitMessage = (state, workspaceConfig) => {
|
|
|
1364
1293
|
${body}`;
|
|
1365
1294
|
}
|
|
1366
1295
|
if (breaking) {
|
|
1367
|
-
const breakingEmoji = config5.
|
|
1296
|
+
const breakingEmoji = config5.settings.disableEmoji ? "" : config5.settings.breakingChangePrefix;
|
|
1368
1297
|
msg += `
|
|
1369
1298
|
|
|
1370
1299
|
BREAKING CHANGE: ${breakingEmoji}${breaking}`;
|
|
1371
1300
|
}
|
|
1372
1301
|
if (issues) {
|
|
1373
|
-
const closedIssueEmoji = config5.
|
|
1302
|
+
const closedIssueEmoji = config5.settings.disableEmoji ? "" : config5.settings.closedIssuePrefix;
|
|
1374
1303
|
msg += `
|
|
1375
1304
|
|
|
1376
|
-
${closedIssueEmoji}${config5.
|
|
1305
|
+
${closedIssueEmoji}${config5.settings.closedIssueMessage}${issues}`;
|
|
1377
1306
|
}
|
|
1378
1307
|
return msg;
|
|
1379
1308
|
};
|
|
1380
1309
|
|
|
1381
1310
|
// src/commit/run.ts
|
|
1382
1311
|
async function runCommit(commitizenFile, dryRun = false) {
|
|
1383
|
-
const workspaceConfig = await
|
|
1384
|
-
const state = await createState(workspaceConfig
|
|
1312
|
+
const workspaceConfig = await chunk5SPAQH6A_cjs.getWorkspaceConfig();
|
|
1313
|
+
const state = await createState(workspaceConfig);
|
|
1385
1314
|
if (dryRun) {
|
|
1386
|
-
|
|
1315
|
+
chunk5SPAQH6A_cjs.writeInfo("Running in dry mode.", workspaceConfig);
|
|
1387
1316
|
}
|
|
1388
1317
|
console.log(chalkTemplate__default.default`
|
|
1389
1318
|
{bold.#999999 ----------------------------------------}
|
|
@@ -1393,7 +1322,7 @@ async function runCommit(commitizenFile, dryRun = false) {
|
|
|
1393
1322
|
`);
|
|
1394
1323
|
state.answers = await askQuestions(state);
|
|
1395
1324
|
const message = formatCommitMessage(state, workspaceConfig);
|
|
1396
|
-
const commitMsgFile =
|
|
1325
|
+
const commitMsgFile = chunk5SPAQH6A_cjs.joinPaths(getGitDir(), "COMMIT_EDITMSG");
|
|
1397
1326
|
console.log(chalkTemplate__default.default`
|
|
1398
1327
|
{bold.#999999 ----------------------------------------}
|
|
1399
1328
|
|
|
@@ -1406,11 +1335,11 @@ async function runCommit(commitizenFile, dryRun = false) {
|
|
|
1406
1335
|
commandItems.push(...["--file", commitMsgFile]);
|
|
1407
1336
|
const command = shellescape__default.default(commandItems);
|
|
1408
1337
|
if (dryRun) {
|
|
1409
|
-
|
|
1338
|
+
chunk5SPAQH6A_cjs.writeDebug(
|
|
1410
1339
|
`Skipping execution [dry-run]: ${command.replace(commitMsgFile, ".git/COMMIT_EDITMSG")}`,
|
|
1411
1340
|
workspaceConfig
|
|
1412
1341
|
);
|
|
1413
|
-
|
|
1342
|
+
chunk5SPAQH6A_cjs.writeDebug(`Message [dry-run]: ${message}`, workspaceConfig);
|
|
1414
1343
|
} else {
|
|
1415
1344
|
await fs__default.default.writeFile(commitMsgFile, message);
|
|
1416
1345
|
chunkCIJVSMK2_cjs.run(workspaceConfig, command);
|
|
@@ -1418,11 +1347,11 @@ async function runCommit(commitizenFile, dryRun = false) {
|
|
|
1418
1347
|
}
|
|
1419
1348
|
async function askQuestions(state) {
|
|
1420
1349
|
let index = 0;
|
|
1421
|
-
for (const key of Object.keys(state.config.
|
|
1422
|
-
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))) {
|
|
1423
1352
|
state.answers[key] = await askQuestion(
|
|
1424
1353
|
index,
|
|
1425
|
-
state.config.
|
|
1354
|
+
state.config.questions[key]
|
|
1426
1355
|
);
|
|
1427
1356
|
index++;
|
|
1428
1357
|
}
|
|
@@ -2442,7 +2371,7 @@ async function generateChangelogContent(releaseVersion, filepath, newContent, cu
|
|
|
2442
2371
|
const header = await prettier.format(
|
|
2443
2372
|
` : void 0 : workspaceConfig?.release.banner.alt) || "Branded release banner image"}](${bannerUrl || chunk5SPAQH6A_cjs.STORM_DEFAULT_RELEASE_BANNER})
|
|
2446
2375
|
|
|
2447
2376
|
# Changelog ${project || workspaceConfig?.name ? "for" : ""}${workspaceConfig?.name ? ` ${titleCase(workspaceConfig.name)}` : ""}${project ? `${workspaceConfig?.name ? " -" : ""} ${titleCase(project)}` : ""}
|
|
2448
2377
|
|
|
@@ -2681,7 +2610,7 @@ var StormChangelogRenderer = class extends DefaultChangelogRenderer__default.def
|
|
|
2681
2610
|
};
|
|
2682
2611
|
}
|
|
2683
2612
|
async render() {
|
|
2684
|
-
this.workspaceConfig = await
|
|
2613
|
+
this.workspaceConfig = await chunk5SPAQH6A_cjs.getWorkspaceConfig();
|
|
2685
2614
|
return await super.render();
|
|
2686
2615
|
}
|
|
2687
2616
|
preprocessChanges() {
|
|
@@ -2992,7 +2921,7 @@ async function createOrUpdateGithubReleaseInternal(githubRequestConfig, release,
|
|
|
2992
2921
|
if (!shouldContinueInGitHub) {
|
|
2993
2922
|
return;
|
|
2994
2923
|
}
|
|
2995
|
-
const open =
|
|
2924
|
+
const open = chunk5SPAQH6A_cjs.__require("open");
|
|
2996
2925
|
await open(result.url).then(() => {
|
|
2997
2926
|
console.info(
|
|
2998
2927
|
`
|
|
@@ -3218,7 +3147,7 @@ async function isUserAnOrganizationMember(userId, config5, remoteName = "origin"
|
|
|
3218
3147
|
// src/release/changelog.ts
|
|
3219
3148
|
function createAPI(overrideReleaseConfig) {
|
|
3220
3149
|
return async function releaseChangelog(args) {
|
|
3221
|
-
const workspaceConfig = await
|
|
3150
|
+
const workspaceConfig = await chunk5SPAQH6A_cjs.getWorkspaceConfig();
|
|
3222
3151
|
const projectGraph$1 = await projectGraph.createProjectGraphAsync({ exitOnError: true });
|
|
3223
3152
|
const nxJson$1 = nxJson.readNxJson();
|
|
3224
3153
|
const userProvidedReleaseConfig = deepMergeJson.deepMergeJson(
|
|
@@ -3879,7 +3808,7 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
|
3879
3808
|
});
|
|
3880
3809
|
latestCommit = await git.getCommitHash("HEAD");
|
|
3881
3810
|
} else if ((args.stageChanges ?? nxReleaseConfig.changelog?.git.stageChanges) && changes.length) {
|
|
3882
|
-
|
|
3811
|
+
chunk5SPAQH6A_cjs.writeDebug(`Staging changed files with git`);
|
|
3883
3812
|
await git.gitAdd({
|
|
3884
3813
|
changedFiles,
|
|
3885
3814
|
deletedFiles,
|
|
@@ -3888,7 +3817,7 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
|
3888
3817
|
});
|
|
3889
3818
|
}
|
|
3890
3819
|
if (args.gitTag ?? nxReleaseConfig.changelog?.git.tag) {
|
|
3891
|
-
|
|
3820
|
+
chunk5SPAQH6A_cjs.writeDebug(`Tagging commit with git`);
|
|
3892
3821
|
for (const tag of gitTagValues) {
|
|
3893
3822
|
await gitTag({
|
|
3894
3823
|
tag,
|
|
@@ -3900,7 +3829,7 @@ async function applyChangesAndExit(args, nxReleaseConfig, tree, toSHA, postGitTa
|
|
|
3900
3829
|
}
|
|
3901
3830
|
}
|
|
3902
3831
|
if (args.gitPush ?? nxReleaseConfig.changelog?.git.push) {
|
|
3903
|
-
|
|
3832
|
+
chunk5SPAQH6A_cjs.writeDebug(`Pushing to git remote "${args.gitRemote}"`);
|
|
3904
3833
|
await git.gitPush({
|
|
3905
3834
|
gitRemote: args.gitRemote,
|
|
3906
3835
|
dryRun: args.dryRun,
|
|
@@ -3919,7 +3848,7 @@ async function generateChangelogForWorkspace({
|
|
|
3919
3848
|
workspaceChangelogVersion,
|
|
3920
3849
|
changes
|
|
3921
3850
|
}) {
|
|
3922
|
-
const workspaceConfig = await
|
|
3851
|
+
const workspaceConfig = await chunk5SPAQH6A_cjs.getWorkspaceConfig();
|
|
3923
3852
|
if (!workspaceConfig) {
|
|
3924
3853
|
throw new Error(
|
|
3925
3854
|
`Unable to determine the Storm workspace config. Please ensure that your storm-workspace.json file is present and valid.`
|
|
@@ -4033,7 +3962,7 @@ async function generateChangelogForProjects({
|
|
|
4033
3962
|
nxReleaseConfig,
|
|
4034
3963
|
projectToAdditionalDependencyBumps
|
|
4035
3964
|
}) {
|
|
4036
|
-
const workspaceConfig = await
|
|
3965
|
+
const workspaceConfig = await chunk5SPAQH6A_cjs.getWorkspaceConfig();
|
|
4037
3966
|
if (!workspaceConfig) {
|
|
4038
3967
|
throw new Error(
|
|
4039
3968
|
`Unable to determine the Storm workspace config. Please ensure that your storm-workspace.json file is present and valid.`
|
|
@@ -4270,7 +4199,7 @@ ${workspaceConfig.release.footer}
|
|
|
4270
4199
|
// src/release/config.ts
|
|
4271
4200
|
var DEFAULT_CONVENTIONAL_COMMITS_CONFIG2 = {
|
|
4272
4201
|
questions: DEFAULT_MONOREPO_COMMIT_QUESTIONS,
|
|
4273
|
-
types:
|
|
4202
|
+
types: DEFAULT_COMMIT_TYPES
|
|
4274
4203
|
};
|
|
4275
4204
|
var DEFAULT_RELEASE_GROUP_CONFIG = {
|
|
4276
4205
|
projectsRelationship: "independent",
|
|
@@ -4338,7 +4267,7 @@ var runRelease = async (config5, options) => {
|
|
|
4338
4267
|
throw new Error("The `GITHUB_ACTOR` environment variable is not set.");
|
|
4339
4268
|
}
|
|
4340
4269
|
if (!await isUserAnOrganizationMember(process.env.GITHUB_ACTOR, config5)) {
|
|
4341
|
-
|
|
4270
|
+
chunk5SPAQH6A_cjs.writeFatal(
|
|
4342
4271
|
"You must be a member of the Storm Software organization to run the release process.",
|
|
4343
4272
|
config5
|
|
4344
4273
|
);
|
|
@@ -4355,12 +4284,12 @@ var runRelease = async (config5, options) => {
|
|
|
4355
4284
|
process.env.NODE_AUTH_TOKEN = process.env.NPM_TOKEN;
|
|
4356
4285
|
process.env.NPM_AUTH_TOKEN = process.env.NPM_TOKEN;
|
|
4357
4286
|
process.env.NPM_CONFIG_PROVENANCE = "true";
|
|
4358
|
-
|
|
4287
|
+
chunk5SPAQH6A_cjs.writeDebug("Creating workspace Project Graph data...", config5);
|
|
4359
4288
|
const nxJson = nxJson_js.readNxJson();
|
|
4360
|
-
|
|
4289
|
+
chunk5SPAQH6A_cjs.writeDebug("Reading in the workspaces release configuration", config5);
|
|
4361
4290
|
const to = options.head || process.env.NX_HEAD;
|
|
4362
4291
|
const from = options.base || process.env.NX_BASE;
|
|
4363
|
-
|
|
4292
|
+
chunk5SPAQH6A_cjs.writeDebug(
|
|
4364
4293
|
`Using the following Git SHAs to determine the release content:
|
|
4365
4294
|
- From: ${from}
|
|
4366
4295
|
- To: ${to}
|
|
@@ -4371,28 +4300,28 @@ var runRelease = async (config5, options) => {
|
|
|
4371
4300
|
nxJson.release.groups = Object.keys(nxJson.release.groups).reduce(
|
|
4372
4301
|
(ret, groupName) => {
|
|
4373
4302
|
const groupConfig = nxJson.release?.groups?.[groupName];
|
|
4374
|
-
ret[groupName] =
|
|
4303
|
+
ret[groupName] = chunk5SPAQH6A_cjs.defu(groupConfig, DEFAULT_RELEASE_GROUP_CONFIG);
|
|
4375
4304
|
return ret;
|
|
4376
4305
|
},
|
|
4377
4306
|
{}
|
|
4378
4307
|
);
|
|
4379
4308
|
}
|
|
4380
|
-
const nxReleaseConfig =
|
|
4309
|
+
const nxReleaseConfig = chunk5SPAQH6A_cjs.defu(
|
|
4381
4310
|
nxJson.release,
|
|
4382
4311
|
DEFAULT_RELEASE_CONFIG
|
|
4383
4312
|
);
|
|
4384
|
-
|
|
4313
|
+
chunk5SPAQH6A_cjs.writeInfo(
|
|
4385
4314
|
"Using the following `nx.json` release configuration values",
|
|
4386
4315
|
config5
|
|
4387
4316
|
);
|
|
4388
|
-
|
|
4317
|
+
chunk5SPAQH6A_cjs.writeInfo(nxReleaseConfig, config5);
|
|
4389
4318
|
const releaseVersion = version_js.createAPI(nxReleaseConfig);
|
|
4390
4319
|
const releaseChangelog = createAPI(nxReleaseConfig);
|
|
4391
4320
|
const releasePublish = publish_js.createAPI(nxReleaseConfig);
|
|
4392
|
-
|
|
4321
|
+
chunk5SPAQH6A_cjs.writeDebug("Determining the current release versions...", config5);
|
|
4393
4322
|
const { workspaceVersion, projectsVersionData } = await releaseVersion({
|
|
4394
4323
|
dryRun: false,
|
|
4395
|
-
verbose:
|
|
4324
|
+
verbose: chunk5SPAQH6A_cjs.isVerbose(config5.logLevel),
|
|
4396
4325
|
preid: config5.preid,
|
|
4397
4326
|
deleteVersionPlans: false,
|
|
4398
4327
|
stageChanges: true,
|
|
@@ -4403,15 +4332,15 @@ var runRelease = async (config5, options) => {
|
|
|
4403
4332
|
version: nxReleaseConfig?.projectsRelationship !== "fixed" ? void 0 : workspaceVersion,
|
|
4404
4333
|
versionData: projectsVersionData,
|
|
4405
4334
|
dryRun: false,
|
|
4406
|
-
verbose:
|
|
4335
|
+
verbose: chunk5SPAQH6A_cjs.isVerbose(config5.logLevel),
|
|
4407
4336
|
to,
|
|
4408
4337
|
from,
|
|
4409
4338
|
gitCommit: true,
|
|
4410
4339
|
gitCommitMessage: "release(monorepo): Publish workspace release updates"
|
|
4411
4340
|
});
|
|
4412
|
-
|
|
4341
|
+
chunk5SPAQH6A_cjs.writeDebug("Tagging commit with git", config5);
|
|
4413
4342
|
if (options.skipPublish) {
|
|
4414
|
-
|
|
4343
|
+
chunk5SPAQH6A_cjs.writeWarning(
|
|
4415
4344
|
"Skipping publishing packages since `skipPublish` was provided as `true` in the release options.",
|
|
4416
4345
|
config5
|
|
4417
4346
|
);
|
|
@@ -4420,7 +4349,7 @@ var runRelease = async (config5, options) => {
|
|
|
4420
4349
|
(key) => projectsVersionData[key]?.newVersion
|
|
4421
4350
|
);
|
|
4422
4351
|
if (changedProjects.length > 0) {
|
|
4423
|
-
|
|
4352
|
+
chunk5SPAQH6A_cjs.writeInfo(
|
|
4424
4353
|
`Publishing release for ${changedProjects.length} ${changedProjects.length === 1 ? "project" : "projects"}:
|
|
4425
4354
|
${changedProjects.map((changedProject) => ` - ${changedProject}`).join("\n")}
|
|
4426
4355
|
`,
|
|
@@ -4430,7 +4359,7 @@ ${changedProjects.map((changedProject) => ` - ${changedProject}`).join("\n")}
|
|
|
4430
4359
|
const result = await releasePublish({
|
|
4431
4360
|
...options,
|
|
4432
4361
|
dryRun: !!options.dryRun,
|
|
4433
|
-
verbose:
|
|
4362
|
+
verbose: chunk5SPAQH6A_cjs.isVerbose(config5.logLevel)
|
|
4434
4363
|
});
|
|
4435
4364
|
const failedProjects = Object.keys(result).filter(
|
|
4436
4365
|
(key) => result[key]?.code && result[key]?.code > 0
|
|
@@ -4445,10 +4374,10 @@ ${failedProjects.map((failedProject) => ` - ${failedProject} (Error Code: ${res
|
|
|
4445
4374
|
);
|
|
4446
4375
|
}
|
|
4447
4376
|
} else {
|
|
4448
|
-
|
|
4377
|
+
chunk5SPAQH6A_cjs.writeWarning("Skipped publishing packages.", config5);
|
|
4449
4378
|
}
|
|
4450
4379
|
}
|
|
4451
|
-
|
|
4380
|
+
chunk5SPAQH6A_cjs.writeSuccess("Completed the Storm workspace release process!", config5);
|
|
4452
4381
|
};
|
|
4453
4382
|
async function updatePackageManifests(projectsVersionData, config5) {
|
|
4454
4383
|
let projectGraph;
|
|
@@ -4463,7 +4392,7 @@ async function updatePackageManifests(projectsVersionData, config5) {
|
|
|
4463
4392
|
Object.keys(projectsVersionData).map(async (node) => {
|
|
4464
4393
|
const projectNode = projectGraph.nodes[node];
|
|
4465
4394
|
if (!projectNode?.data.root) {
|
|
4466
|
-
|
|
4395
|
+
chunk5SPAQH6A_cjs.writeWarning(
|
|
4467
4396
|
`Project node ${node} not found in the project graph. Skipping manifest update.`,
|
|
4468
4397
|
config5
|
|
4469
4398
|
);
|
|
@@ -4471,17 +4400,17 @@ async function updatePackageManifests(projectsVersionData, config5) {
|
|
|
4471
4400
|
}
|
|
4472
4401
|
const versionData = projectsVersionData[node];
|
|
4473
4402
|
if (projectNode?.data.root && versionData && versionData.newVersion !== null) {
|
|
4474
|
-
|
|
4403
|
+
chunk5SPAQH6A_cjs.writeTrace(
|
|
4475
4404
|
`Writing version ${versionData.newVersion} update to manifest file for ${node}
|
|
4476
4405
|
`,
|
|
4477
4406
|
config5
|
|
4478
4407
|
);
|
|
4479
|
-
const projectRoot =
|
|
4408
|
+
const projectRoot = chunk5SPAQH6A_cjs.joinPaths(
|
|
4480
4409
|
config5.workspaceRoot,
|
|
4481
4410
|
projectNode.data.root
|
|
4482
4411
|
);
|
|
4483
|
-
const packageJsonPath =
|
|
4484
|
-
const cargoTomlPath =
|
|
4412
|
+
const packageJsonPath = chunk5SPAQH6A_cjs.joinPaths(projectRoot, "package.json");
|
|
4413
|
+
const cargoTomlPath = chunk5SPAQH6A_cjs.joinPaths(projectRoot, "Cargo.toml");
|
|
4485
4414
|
if (fs$1.existsSync(packageJsonPath)) {
|
|
4486
4415
|
const packageJsonContent = await fs.readFile(packageJsonPath, "utf8");
|
|
4487
4416
|
const packageJson = JSON.parse(packageJsonContent);
|
|
@@ -4499,7 +4428,7 @@ async function updatePackageManifests(projectsVersionData, config5) {
|
|
|
4499
4428
|
})
|
|
4500
4429
|
);
|
|
4501
4430
|
} else {
|
|
4502
|
-
|
|
4431
|
+
chunk5SPAQH6A_cjs.writeWarning("No project nodes found. Skipping manifest updates.", config5);
|
|
4503
4432
|
}
|
|
4504
4433
|
}
|
|
4505
4434
|
|
|
@@ -4507,8 +4436,8 @@ async function updatePackageManifests(projectsVersionData, config5) {
|
|
|
4507
4436
|
var _config = {};
|
|
4508
4437
|
function createProgram(config5) {
|
|
4509
4438
|
_config = config5;
|
|
4510
|
-
|
|
4511
|
-
const root =
|
|
4439
|
+
chunk5SPAQH6A_cjs.writeInfo("\u26A1 Running Storm Git Tools", config5);
|
|
4440
|
+
const root = chunk5SPAQH6A_cjs.findWorkspaceRootSafe(process.cwd());
|
|
4512
4441
|
process.env.STORM_WORKSPACE_ROOT ??= root;
|
|
4513
4442
|
process.env.NX_WORKSPACE_ROOT_PATH ??= root;
|
|
4514
4443
|
if (root) {
|
|
@@ -4577,12 +4506,12 @@ async function commitAction({
|
|
|
4577
4506
|
dryRun = false
|
|
4578
4507
|
}) {
|
|
4579
4508
|
try {
|
|
4580
|
-
|
|
4509
|
+
chunk5SPAQH6A_cjs.writeInfo(
|
|
4581
4510
|
`\u26A1 Preparing to commit your changes. Please provide the requested details below...`,
|
|
4582
4511
|
_config
|
|
4583
4512
|
);
|
|
4584
4513
|
await runCommit(config5, dryRun);
|
|
4585
|
-
|
|
4514
|
+
chunk5SPAQH6A_cjs.writeSuccess(
|
|
4586
4515
|
`\u{1F389} Storm Commit processing completed successfully!
|
|
4587
4516
|
|
|
4588
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}
|
|
@@ -4590,7 +4519,7 @@ Note: Please run "pnpm push" to upload these changes to the remote ${_config.nam
|
|
|
4590
4519
|
_config
|
|
4591
4520
|
);
|
|
4592
4521
|
} catch (error) {
|
|
4593
|
-
|
|
4522
|
+
chunk5SPAQH6A_cjs.writeFatal(
|
|
4594
4523
|
`A fatal error occurred while running commit action:
|
|
4595
4524
|
|
|
4596
4525
|
${error.message}${error.stack ? `
|
|
@@ -4605,14 +4534,14 @@ Please fix any errors and try committing again.`,
|
|
|
4605
4534
|
}
|
|
4606
4535
|
async function readmeAction(options) {
|
|
4607
4536
|
try {
|
|
4608
|
-
|
|
4537
|
+
chunk5SPAQH6A_cjs.writeInfo("\u26A1 Formatting the workspace's README.md files", _config);
|
|
4609
4538
|
await runReadme(options);
|
|
4610
|
-
|
|
4539
|
+
chunk5SPAQH6A_cjs.writeSuccess(
|
|
4611
4540
|
"Formatting of the workspace's README.md files is complete\n",
|
|
4612
4541
|
_config
|
|
4613
4542
|
);
|
|
4614
4543
|
} catch (error) {
|
|
4615
|
-
|
|
4544
|
+
chunk5SPAQH6A_cjs.writeFatal(
|
|
4616
4545
|
`A fatal error occurred while running README format action:
|
|
4617
4546
|
|
|
4618
4547
|
${error.message}`
|
|
@@ -4627,7 +4556,7 @@ async function releaseAction({
|
|
|
4627
4556
|
dryRun
|
|
4628
4557
|
}) {
|
|
4629
4558
|
try {
|
|
4630
|
-
|
|
4559
|
+
chunk5SPAQH6A_cjs.writeInfo(
|
|
4631
4560
|
"\u26A1 Running the Storm Release and Publish process on the workspace",
|
|
4632
4561
|
_config
|
|
4633
4562
|
);
|
|
@@ -4637,9 +4566,9 @@ async function releaseAction({
|
|
|
4637
4566
|
base,
|
|
4638
4567
|
head
|
|
4639
4568
|
});
|
|
4640
|
-
|
|
4569
|
+
chunk5SPAQH6A_cjs.writeSuccess("Release completed successfully!\n", _config);
|
|
4641
4570
|
} catch (error) {
|
|
4642
|
-
|
|
4571
|
+
chunk5SPAQH6A_cjs.writeFatal(
|
|
4643
4572
|
`A fatal error occurred while running release action:
|
|
4644
4573
|
|
|
4645
4574
|
${error.message} ${error.stack ? `
|
|
@@ -4653,17 +4582,17 @@ Stacktrace: ${error.stack}` : ""}`,
|
|
|
4653
4582
|
}
|
|
4654
4583
|
async function commitLintAction(options) {
|
|
4655
4584
|
try {
|
|
4656
|
-
|
|
4585
|
+
chunk5SPAQH6A_cjs.writeInfo(
|
|
4657
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.`,
|
|
4658
4587
|
_config
|
|
4659
4588
|
);
|
|
4660
4589
|
await runCommitLint(_config, options);
|
|
4661
|
-
|
|
4590
|
+
chunk5SPAQH6A_cjs.writeSuccess(
|
|
4662
4591
|
"Linting the commit messages completed successfully!\n",
|
|
4663
4592
|
_config
|
|
4664
4593
|
);
|
|
4665
4594
|
} catch (error) {
|
|
4666
|
-
|
|
4595
|
+
chunk5SPAQH6A_cjs.writeFatal(
|
|
4667
4596
|
`A fatal error occurred while linting the commit messages:
|
|
4668
4597
|
|
|
4669
4598
|
${error.message}`,
|
|
@@ -4675,18 +4604,18 @@ ${error.message}`,
|
|
|
4675
4604
|
|
|
4676
4605
|
// bin/git.ts
|
|
4677
4606
|
void (async () => {
|
|
4678
|
-
const config5 = await
|
|
4607
|
+
const config5 = await chunk5SPAQH6A_cjs.getConfig();
|
|
4679
4608
|
try {
|
|
4680
|
-
|
|
4609
|
+
chunk5SPAQH6A_cjs.handleProcess(config5);
|
|
4681
4610
|
const program = createProgram(config5);
|
|
4682
4611
|
await program.parseAsync(process.argv);
|
|
4683
|
-
|
|
4612
|
+
chunk5SPAQH6A_cjs.writeSuccess(
|
|
4684
4613
|
`\u{1F389} Git ${process.argv && process.argv.length >= 3 && process.argv[2] ? process.argv[2] : "tool"} processing completed successfully!`,
|
|
4685
4614
|
config5
|
|
4686
4615
|
);
|
|
4687
|
-
|
|
4616
|
+
chunk5SPAQH6A_cjs.exitWithSuccess(config5);
|
|
4688
4617
|
} catch (error) {
|
|
4689
|
-
|
|
4618
|
+
chunk5SPAQH6A_cjs.exitWithError(config5);
|
|
4690
4619
|
process.exit(1);
|
|
4691
4620
|
}
|
|
4692
4621
|
})();
|