@storm-software/workspace-tools 1.292.15 → 1.292.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +4 -36
  3. package/config/base.json +13 -14
  4. package/dist/{chunk-UCXAD2SG.mjs → chunk-6PVCCKX4.mjs} +1 -1
  5. package/dist/chunk-ANHKV7HZ.js +22 -0
  6. package/dist/{chunk-PUFTJ2BG.mjs → chunk-D2ENLOCH.mjs} +14 -12
  7. package/dist/{chunk-MGF3DTWM.js → chunk-EECJXHDA.js} +50 -17
  8. package/dist/chunk-EGI64HQ2.mjs +22 -0
  9. package/dist/chunk-EYRX4NM6.mjs +213 -0
  10. package/dist/{chunk-LOFMB5G3.mjs → chunk-IPWUJVZZ.mjs} +1 -1
  11. package/dist/{chunk-YNLDYAEE.mjs → chunk-JHJLQ2O7.mjs} +1 -1
  12. package/dist/{chunk-452FQZ3B.js → chunk-JWFGGMYQ.js} +1 -6
  13. package/dist/{chunk-Q57UD72U.mjs → chunk-KCVIHYZQ.mjs} +1 -1
  14. package/dist/{chunk-7DLHAWLG.mjs → chunk-MU6OJDOC.mjs} +1 -1
  15. package/dist/{chunk-IBTPJDV6.js → chunk-N3YCERS6.js} +5 -2
  16. package/dist/{chunk-WV5SNA37.js → chunk-O2FPRXPD.js} +17 -15
  17. package/dist/{chunk-FQSIFEMR.mjs → chunk-OOR7HG4P.mjs} +37 -4
  18. package/dist/{chunk-2LY7DGBH.mjs → chunk-OV33RACH.mjs} +5 -2
  19. package/dist/{chunk-WRXLSZ6I.js → chunk-POXELQII.js} +2 -2
  20. package/dist/{chunk-B4RJUBHW.mjs → chunk-QUHBEE5D.mjs} +1 -1
  21. package/dist/chunk-SAIDGUHG.mjs +0 -0
  22. package/dist/chunk-TCGF4GS7.js +213 -0
  23. package/dist/chunk-TJRQRM4Z.mjs +49 -0
  24. package/dist/chunk-W4IH547O.js +49 -0
  25. package/dist/{chunk-2ONEZU6V.mjs → chunk-WH72XZPS.mjs} +1 -1
  26. package/dist/{chunk-SVIG7SR3.mjs → chunk-X2SLQ73Q.mjs} +1 -6
  27. package/dist/chunk-YYLV7UA6.js +1 -0
  28. package/dist/{chunk-7QY4X73C.js → chunk-ZP4B44CQ.js} +2 -2
  29. package/dist/executors.js +16 -17
  30. package/dist/executors.mjs +19 -20
  31. package/dist/generators.d.mts +0 -2
  32. package/dist/generators.d.ts +0 -2
  33. package/dist/generators.js +8 -14
  34. package/dist/generators.mjs +13 -19
  35. package/dist/index.d.mts +7 -2
  36. package/dist/index.d.ts +7 -2
  37. package/dist/index.js +39 -34
  38. package/dist/index.mjs +53 -48
  39. package/dist/src/base/base-executor.mjs +1 -1
  40. package/dist/src/base/base-executor.untyped.mjs +1 -1
  41. package/dist/src/base/base-generator.mjs +1 -1
  42. package/dist/src/base/base-generator.untyped.mjs +1 -1
  43. package/dist/src/base/cargo-base-executor.untyped.mjs +1 -1
  44. package/dist/src/base/index.mjs +1 -1
  45. package/dist/src/base/typescript-build-executor.untyped.mjs +1 -1
  46. package/dist/src/base/typescript-library-generator.untyped.mjs +1 -1
  47. package/dist/src/executors/cargo-build/executor.mjs +1 -1
  48. package/dist/src/executors/cargo-build/untyped.mjs +1 -1
  49. package/dist/src/executors/cargo-check/executor.mjs +1 -1
  50. package/dist/src/executors/cargo-check/untyped.mjs +1 -1
  51. package/dist/src/executors/cargo-clippy/executor.mjs +1 -1
  52. package/dist/src/executors/cargo-clippy/untyped.mjs +1 -1
  53. package/dist/src/executors/cargo-doc/executor.mjs +1 -1
  54. package/dist/src/executors/cargo-doc/untyped.mjs +1 -1
  55. package/dist/src/executors/cargo-format/executor.mjs +1 -1
  56. package/dist/src/executors/cargo-format/untyped.mjs +1 -1
  57. package/dist/src/executors/cargo-publish/executor.js +3 -3
  58. package/dist/src/executors/cargo-publish/executor.mjs +3 -3
  59. package/dist/src/executors/cargo-publish/untyped.mjs +1 -1
  60. package/dist/src/executors/clean-package/executor.mjs +1 -1
  61. package/dist/src/executors/clean-package/untyped.mjs +1 -1
  62. package/dist/src/executors/esbuild/executor.mjs +1 -1
  63. package/dist/src/executors/esbuild/untyped.mjs +1 -1
  64. package/dist/src/executors/npm-publish/executor.js +4 -5
  65. package/dist/src/executors/npm-publish/executor.mjs +4 -5
  66. package/dist/src/executors/npm-publish/untyped.mjs +1 -1
  67. package/dist/src/executors/size-limit/executor.mjs +1 -1
  68. package/dist/src/executors/size-limit/untyped.mjs +1 -1
  69. package/dist/src/executors/tsdown/executor.mjs +1 -1
  70. package/dist/src/executors/tsdown/untyped.mjs +1 -1
  71. package/dist/src/executors/typia/executor.mjs +1 -1
  72. package/dist/src/executors/typia/untyped.mjs +1 -1
  73. package/dist/src/executors/unbuild/executor.mjs +1 -1
  74. package/dist/src/executors/unbuild/untyped.mjs +1 -1
  75. package/dist/src/generators/browser-library/generator.mjs +2 -2
  76. package/dist/src/generators/browser-library/untyped.mjs +1 -1
  77. package/dist/src/generators/config-schema/generator.mjs +1 -1
  78. package/dist/src/generators/config-schema/untyped.mjs +1 -1
  79. package/dist/src/generators/init/init.mjs +1 -1
  80. package/dist/src/generators/init/untyped.mjs +1 -1
  81. package/dist/src/generators/neutral-library/generator.mjs +2 -2
  82. package/dist/src/generators/neutral-library/untyped.mjs +1 -1
  83. package/dist/src/generators/node-library/generator.mjs +2 -2
  84. package/dist/src/generators/node-library/untyped.mjs +1 -1
  85. package/dist/src/generators/preset/generator.mjs +2 -2
  86. package/dist/src/generators/preset/untyped.mjs +1 -1
  87. package/dist/src/plugins/rust/cargo-toml.js +2 -2
  88. package/dist/src/plugins/rust/cargo-toml.mjs +2 -2
  89. package/dist/src/plugins/rust/index.js +2 -2
  90. package/dist/src/plugins/rust/index.mjs +2 -2
  91. package/dist/src/plugins/typescript/index.js +22 -22
  92. package/dist/src/plugins/typescript/index.mjs +23 -23
  93. package/dist/src/plugins/typescript/tsdown.mjs +1 -1
  94. package/dist/src/plugins/typescript/tsup.mjs +1 -1
  95. package/dist/src/plugins/typescript/untyped-schema.mjs +1 -1
  96. package/dist/src/release/index.d.mts +11 -0
  97. package/dist/src/release/index.d.ts +11 -0
  98. package/dist/src/release/index.js +17 -0
  99. package/dist/src/release/index.mjs +18 -0
  100. package/dist/src/release/js-version-actions.d.mts +44 -0
  101. package/dist/src/release/js-version-actions.d.ts +44 -0
  102. package/dist/src/release/js-version-actions.js +10 -0
  103. package/dist/src/release/js-version-actions.mjs +11 -0
  104. package/dist/src/release/rust-version-actions.d.mts +56 -0
  105. package/dist/src/release/rust-version-actions.d.ts +56 -0
  106. package/dist/src/release/rust-version-actions.js +12 -0
  107. package/dist/src/release/rust-version-actions.mjs +13 -0
  108. package/dist/src/types.mjs +1 -1
  109. package/dist/src/utils/apply-workspace-tokens.mjs +1 -1
  110. package/dist/src/utils/cargo.mjs +1 -1
  111. package/dist/src/utils/create-cli-options.mjs +1 -1
  112. package/dist/src/utils/get-project-configurations.mjs +1 -1
  113. package/dist/src/utils/index.js +11 -11
  114. package/dist/src/utils/index.mjs +18 -18
  115. package/dist/src/utils/lock-file.d.mts +2 -2
  116. package/dist/src/utils/lock-file.d.ts +2 -2
  117. package/dist/src/utils/lock-file.mjs +1 -1
  118. package/dist/src/utils/nx-json.d.mts +3 -27
  119. package/dist/src/utils/nx-json.d.ts +3 -27
  120. package/dist/src/utils/nx-json.js +2 -2
  121. package/dist/src/utils/nx-json.mjs +2 -2
  122. package/dist/src/utils/package-helpers.js +3 -3
  123. package/dist/src/utils/package-helpers.mjs +3 -3
  124. package/dist/src/utils/plugin-helpers.d.mts +2 -2
  125. package/dist/src/utils/plugin-helpers.d.ts +2 -2
  126. package/dist/src/utils/plugin-helpers.mjs +1 -1
  127. package/dist/src/utils/project-tags.mjs +1 -1
  128. package/dist/src/utils/registry-helpers.d.mts +11 -0
  129. package/dist/src/utils/registry-helpers.d.ts +11 -0
  130. package/dist/src/utils/registry-helpers.js +6 -0
  131. package/dist/src/utils/registry-helpers.mjs +7 -0
  132. package/dist/src/utils/typia-transform.mjs +1 -1
  133. package/dist/src/utils/versions.mjs +1 -1
  134. package/package.json +47 -18
  135. package/dist/chunk-J4I6MJT2.js +0 -73
  136. package/dist/chunk-JLXBL5BC.mjs +0 -73
  137. package/dist/chunk-WEL4BVFX.js +0 -1049
  138. package/dist/chunk-ZZWU35JU.mjs +0 -1049
  139. package/dist/generator-DLXza9BZ.d.ts +0 -186
  140. package/dist/generator-DVYJZa5j.d.mts +0 -186
  141. package/dist/src/generators/release-version/generator.d.mts +0 -6
  142. package/dist/src/generators/release-version/generator.d.ts +0 -6
  143. package/dist/src/generators/release-version/generator.js +0 -14
  144. package/dist/src/generators/release-version/generator.mjs +0 -15
  145. package/dist/src/generators/release-version/schema.d.ts +0 -180
  146. package/dist/src/generators/release-version/schema.json +0 -158
  147. package/dist/src/generators/release-version/untyped.d.mts +0 -5
  148. package/dist/src/generators/release-version/untyped.d.ts +0 -5
  149. package/dist/src/generators/release-version/untyped.js +0 -159
  150. package/dist/src/generators/release-version/untyped.mjs +0 -161
  151. package/docs/api/generators/release-version/schema.md +0 -160
  152. /package/dist/{chunk-RLIZVCIN.mjs → chunk-5GZC2PF6.mjs} +0 -0
  153. /package/dist/{chunk-INERRJ6Q.js → chunk-C3TC7AUW.js} +0 -0
@@ -1,1049 +0,0 @@
1
- import {
2
- DEFAULT_NPM_TAG,
3
- getGitHubRegistry,
4
- getNpmRegistry,
5
- getRegistry,
6
- getVersion
7
- } from "./chunk-JLXBL5BC.mjs";
8
- import {
9
- modifyCargoTable,
10
- parseCargoToml,
11
- parseCargoTomlWithTree,
12
- stringifyCargoToml
13
- } from "./chunk-SVIG7SR3.mjs";
14
- import {
15
- getConfig
16
- } from "./chunk-NOTQLVZP.mjs";
17
- import {
18
- getStopwatch,
19
- writeDebug,
20
- writeError,
21
- writeFatal,
22
- writeInfo,
23
- writeSuccess,
24
- writeTrace
25
- } from "./chunk-V44DYGWX.mjs";
26
- import {
27
- findWorkspaceRoot
28
- } from "./chunk-VGJEUOUN.mjs";
29
-
30
- // src/generators/release-version/generator.ts
31
- import {
32
- formatFiles,
33
- joinPathFragments,
34
- output,
35
- readJson,
36
- updateJson,
37
- writeJson
38
- } from "@nx/devkit";
39
- import { resolveLocalPackageDependencies as resolveLocalPackageJsonDependencies } from "@nx/js/src/generators/release-version/utils/resolve-local-package-dependencies";
40
- import { updateLockFile } from "@nx/js/src/release/utils/update-lock-file";
41
-
42
- // ../git-tools/dist/chunk-5XU2KBM6.js
43
- var DEFAULT_COMMIT_PROMPT_MESSAGES = {
44
- skip: "press enter to skip",
45
- max: "must be %d chars at most",
46
- min: "must be %d chars at least",
47
- emptyWarning: "can not be empty",
48
- upperLimitWarning: "%s is %d characters longer than the upper limit",
49
- lowerLimitWarning: "%s is %d characters less than the lower limit",
50
- closedIssueMessage: "Closes: "
51
- };
52
-
53
- // ../git-tools/dist/chunk-3GGWHKRP.js
54
- var DEFAULT_COMMIT_TYPES = {
55
- /* --- Bumps version when selected --- */
56
- "chore": {
57
- "description": "Other changes that don't modify src or test files",
58
- "title": "Chore",
59
- "emoji": "\u2699\uFE0F ",
60
- "semverBump": "patch",
61
- "changelog": {
62
- "title": "Miscellaneous",
63
- "hidden": false
64
- }
65
- },
66
- "fix": {
67
- "description": "A change that resolves an issue previously identified with the package",
68
- "title": "Bug Fix",
69
- "emoji": "\u{1FAB2} ",
70
- "semverBump": "patch",
71
- "changelog": {
72
- "title": "Bug Fixes",
73
- "hidden": false
74
- }
75
- },
76
- "feat": {
77
- "description": "A change that adds a new feature to the package",
78
- "title": "Feature",
79
- "emoji": "\u{1F511} ",
80
- "semverBump": "minor",
81
- "changelog": {
82
- "title": "Features",
83
- "hidden": false
84
- }
85
- },
86
- "ci": {
87
- "description": "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)",
88
- "title": "Continuous Integration",
89
- "emoji": "\u{1F9F0} ",
90
- "semverBump": "patch",
91
- "changelog": {
92
- "title": "Continuous Integration",
93
- "hidden": false
94
- }
95
- },
96
- "refactor": {
97
- "description": "A code change that neither fixes a bug nor adds a feature",
98
- "title": "Code Refactoring",
99
- "emoji": "\u{1F9EA} ",
100
- "semverBump": "patch",
101
- "changelog": {
102
- "title": "Source Code Improvements",
103
- "hidden": false
104
- }
105
- },
106
- "style": {
107
- "description": "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",
108
- "title": "Style Improvements",
109
- "emoji": "\u{1F48E} ",
110
- "semverBump": "patch",
111
- "changelog": {
112
- "title": "Style Improvements",
113
- "hidden": false
114
- }
115
- },
116
- "perf": {
117
- "description": "A code change that improves performance",
118
- "title": "Performance Improvement",
119
- "emoji": "\u23F1\uFE0F ",
120
- "semverBump": "patch",
121
- "changelog": {
122
- "title": "Performance Improvements",
123
- "hidden": false
124
- }
125
- },
126
- /* --- Does not bump version when selected --- */
127
- "docs": {
128
- "description": "A change that only includes documentation updates",
129
- "title": "Documentation",
130
- "emoji": "\u{1F4DC} ",
131
- "semverBump": "none",
132
- "changelog": {
133
- "title": "Documentation",
134
- "hidden": false
135
- }
136
- },
137
- "test": {
138
- "description": "Adding missing tests or correcting existing tests",
139
- "title": "Testing",
140
- "emoji": "\u{1F6A8} ",
141
- "semverBump": "none",
142
- "changelog": {
143
- "title": "Testing",
144
- "hidden": true
145
- }
146
- },
147
- /* --- Not included in commitlint but included in changelog --- */
148
- "deps": {
149
- "description": "Changes that add, update, or remove dependencies. This includes devDependencies and peerDependencies",
150
- "title": "Dependencies",
151
- "emoji": "\u{1F4E6} ",
152
- "hidden": true,
153
- "semverBump": "patch",
154
- "changelog": {
155
- "title": "Dependency Upgrades",
156
- "hidden": false
157
- }
158
- },
159
- /* --- Not included in commitlint or changelog --- */
160
- "build": {
161
- "description": "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)",
162
- "title": "Build",
163
- "emoji": "\u{1F6E0} ",
164
- "hidden": true,
165
- "semverBump": "none",
166
- "changelog": {
167
- "title": "Build",
168
- "hidden": true
169
- }
170
- },
171
- "release": {
172
- "description": "Publishing a commit containing a newly released version",
173
- "title": "Publish Release",
174
- "emoji": "\u{1F680} ",
175
- "hidden": true,
176
- "semverBump": "none",
177
- "changelog": {
178
- "title": "Publish Release",
179
- "hidden": true
180
- }
181
- }
182
- };
183
- var CHANGELOG_COMMIT_TYPES_OBJECT = Object.freeze(
184
- Object.entries(DEFAULT_COMMIT_TYPES).reduce(
185
- (ret, [key, commitType]) => {
186
- ret[key] = {
187
- ...commitType.changelog,
188
- type: key,
189
- section: commitType.changelog?.title || commitType.title,
190
- hidden: commitType.changelog?.hidden
191
- };
192
- return ret;
193
- },
194
- {}
195
- )
196
- );
197
- var CHANGELOG_COMMIT_TYPES = [
198
- CHANGELOG_COMMIT_TYPES_OBJECT.feat,
199
- CHANGELOG_COMMIT_TYPES_OBJECT.fix,
200
- CHANGELOG_COMMIT_TYPES_OBJECT.chore,
201
- CHANGELOG_COMMIT_TYPES_OBJECT.deps,
202
- CHANGELOG_COMMIT_TYPES_OBJECT.docs,
203
- CHANGELOG_COMMIT_TYPES_OBJECT.style,
204
- CHANGELOG_COMMIT_TYPES_OBJECT.refactor,
205
- CHANGELOG_COMMIT_TYPES_OBJECT.perf,
206
- CHANGELOG_COMMIT_TYPES_OBJECT.build,
207
- CHANGELOG_COMMIT_TYPES_OBJECT.ci,
208
- CHANGELOG_COMMIT_TYPES_OBJECT.test
209
- ];
210
- var CHANGELOG_COMMIT_TYPE_ORDER = CHANGELOG_COMMIT_TYPES.map(
211
- (entry) => entry.type
212
- );
213
- var CHANGELOG_COMMIT_SECTION_ORDER = CHANGELOG_COMMIT_TYPES.map(
214
- (entry) => entry.section
215
- );
216
- var changelogs = {
217
- props: {
218
- ignoreCommits: void 0,
219
- types: CHANGELOG_COMMIT_TYPES,
220
- bumpStrict: true,
221
- scope: void 0,
222
- scopeOnly: false
223
- }
224
- };
225
- var commitlint = {
226
- helpUrl: "https://developer.stormsoftware.com/commitlint/minimal",
227
- rules: {
228
- "body-leading-blank": [1, "always"],
229
- "body-max-length": [2, "always", 600],
230
- "footer-leading-blank": [1, "always"],
231
- "footer-max-line-length": [2, "always", 150],
232
- "header-max-length": [2, "always", 150],
233
- "header-trim": [2, "always"],
234
- "subject-case": [2, "always", ["sentence-case"]],
235
- "subject-empty": [2, "never"],
236
- "subject-full-stop": [2, "never", "."],
237
- "subject-max-length": [2, "always", 150],
238
- "subject-min-length": [2, "always", 3],
239
- "type-case": [2, "always", "kebab-case"],
240
- "type-empty": [2, "never"],
241
- "type-enum": [
242
- 2,
243
- "always",
244
- Object.keys(DEFAULT_COMMIT_TYPES)
245
- ],
246
- "type-max-length": [2, "always", 20],
247
- "type-min-length": [2, "always", 3],
248
- "scope-empty": [2, "always"]
249
- },
250
- settings: {
251
- enableMultipleScopes: false,
252
- disableEmoji: true,
253
- breakingChangePrefix: "\u{1F4A3} ",
254
- closedIssuePrefix: "\u2705 ",
255
- format: "{type}: {emoji}{subject}"
256
- }
257
- };
258
- var config = {
259
- types: DEFAULT_COMMIT_TYPES,
260
- changelogs,
261
- commitlint
262
- };
263
- var minimal_default = config;
264
- var changelogs2 = {
265
- props: {
266
- ignoreCommits: void 0,
267
- types: CHANGELOG_COMMIT_TYPES,
268
- bumpStrict: true,
269
- scope: ["monorepo"],
270
- scopeOnly: true
271
- }
272
- };
273
- var commitlint2 = {
274
- helpUrl: "https://developer.stormsoftware.com/commitlint/monorepo",
275
- rules: {
276
- "body-leading-blank": [1, "always"],
277
- "body-max-length": [2, "always", 600],
278
- "footer-leading-blank": [1, "always"],
279
- "footer-max-line-length": [2, "always", 150],
280
- "header-max-length": [2, "always", 150],
281
- "header-trim": [2, "always"],
282
- "subject-case": [2, "always", ["sentence-case"]],
283
- "subject-empty": [2, "never"],
284
- "subject-full-stop": [2, "never", "."],
285
- "subject-max-length": [2, "always", 150],
286
- "subject-min-length": [2, "always", 3],
287
- "type-case": [2, "always", "kebab-case"],
288
- "type-empty": [2, "never"],
289
- "type-enum": [
290
- 2,
291
- "always",
292
- Object.keys(DEFAULT_COMMIT_TYPES)
293
- ],
294
- "type-max-length": [2, "always", 20],
295
- "type-min-length": [2, "always", 3],
296
- "scope-case": [2, "always", ["kebab-case"]],
297
- "scope-empty": [2, "never"]
298
- },
299
- settings: {
300
- enableMultipleScopes: false,
301
- disableEmoji: true,
302
- breakingChangePrefix: "\u{1F4A3} ",
303
- closedIssuePrefix: "\u2705 ",
304
- format: "{type}({scope}): {emoji}{subject}"
305
- }
306
- };
307
- var config2 = {
308
- types: DEFAULT_COMMIT_TYPES,
309
- changelogs: changelogs2,
310
- commitlint: commitlint2
311
- };
312
- var monorepo_default = config2;
313
- var COMMIT_CONFIGS = { minimal: minimal_default, monorepo: monorepo_default };
314
-
315
- // ../git-tools/dist/chunk-KZRVQ5RZ.js
316
- var DEFAULT_MINIMAL_COMMIT_QUESTIONS = {
317
- type: {
318
- type: "select",
319
- title: "Commit Type",
320
- description: "Select the commit type that best describes your changes",
321
- enum: Object.keys(DEFAULT_COMMIT_TYPES).filter(
322
- (type) => DEFAULT_COMMIT_TYPES[type].hidden !== true
323
- ).reduce((ret, type) => {
324
- ret[type] = DEFAULT_COMMIT_TYPES[type];
325
- return ret;
326
- }, {}),
327
- defaultValue: "chore",
328
- maxLength: 20,
329
- minLength: 3
330
- },
331
- subject: {
332
- type: "input",
333
- title: "Commit Subject",
334
- description: "Write a short, imperative tense description of the change",
335
- maxLength: 150,
336
- minLength: 3
337
- },
338
- body: {
339
- type: "input",
340
- title: "Commit Body",
341
- description: "Provide a longer description of the change",
342
- maxLength: 600
343
- },
344
- isBreaking: {
345
- type: "confirm",
346
- title: "Breaking Changes",
347
- description: "Are there any breaking changes as a result of this commit?",
348
- defaultValue: false
349
- },
350
- breakingBody: {
351
- type: "input",
352
- title: "Breaking Changes (Details)",
353
- description: "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself",
354
- when: (answers) => answers.isBreaking === true,
355
- maxLength: 600,
356
- minLength: 3
357
- },
358
- isIssueAffected: {
359
- type: "confirm",
360
- title: "Open Issue Affected",
361
- description: "Does this change impact any open issues?",
362
- defaultValue: false
363
- },
364
- issuesBody: {
365
- type: "input",
366
- title: "Open Issue Affected (Details)",
367
- description: "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself",
368
- when: (answers) => answers.isIssueAffected === true,
369
- maxLength: 600,
370
- minLength: 3
371
- }
372
- };
373
- var config3 = {
374
- settings: COMMIT_CONFIGS.minimal.commitlint.settings,
375
- messages: DEFAULT_COMMIT_PROMPT_MESSAGES,
376
- questions: DEFAULT_MINIMAL_COMMIT_QUESTIONS,
377
- types: DEFAULT_COMMIT_TYPES
378
- };
379
-
380
- // ../git-tools/dist/chunk-JCEVFJCA.js
381
- var DEFAULT_MONOREPO_COMMIT_QUESTIONS = {
382
- type: DEFAULT_MINIMAL_COMMIT_QUESTIONS.type,
383
- scope: {
384
- type: "select",
385
- title: "Commit Scope",
386
- description: "Select the project that's the most impacted by this change",
387
- enum: {},
388
- defaultValue: "monorepo",
389
- maxLength: 50,
390
- minLength: 1
391
- },
392
- subject: DEFAULT_MINIMAL_COMMIT_QUESTIONS.subject,
393
- body: DEFAULT_MINIMAL_COMMIT_QUESTIONS.body,
394
- isBreaking: DEFAULT_MINIMAL_COMMIT_QUESTIONS.isBreaking,
395
- breakingBody: DEFAULT_MINIMAL_COMMIT_QUESTIONS.breakingBody,
396
- isIssueAffected: DEFAULT_MINIMAL_COMMIT_QUESTIONS.isIssueAffected,
397
- issuesBody: DEFAULT_MINIMAL_COMMIT_QUESTIONS.issuesBody
398
- };
399
- var config4 = {
400
- settings: COMMIT_CONFIGS.monorepo.commitlint.settings,
401
- messages: DEFAULT_COMMIT_PROMPT_MESSAGES,
402
- questions: DEFAULT_MONOREPO_COMMIT_QUESTIONS,
403
- types: DEFAULT_COMMIT_TYPES
404
- };
405
-
406
- // ../git-tools/dist/chunk-YCEUZFMU.js
407
- var DEFAULT_CONVENTIONAL_COMMITS_CONFIG = {
408
- questions: DEFAULT_MONOREPO_COMMIT_QUESTIONS,
409
- types: DEFAULT_COMMIT_TYPES
410
- };
411
-
412
- // src/generators/release-version/generator.ts
413
- import { execSync } from "node:child_process";
414
- import { relative } from "node:path";
415
- import { IMPLICIT_DEFAULT_RELEASE_GROUP } from "nx/src/command-line/release/config/config";
416
- import {
417
- getFirstGitCommit,
418
- getLatestGitTagForPattern
419
- } from "nx/src/command-line/release/utils/git";
420
- import {
421
- resolveSemverSpecifierFromConventionalCommits,
422
- resolveSemverSpecifierFromPrompt
423
- } from "nx/src/command-line/release/utils/resolve-semver-specifier";
424
- import { isValidSemverSpecifier } from "nx/src/command-line/release/utils/semver";
425
- import {
426
- deriveNewSemverVersion,
427
- validReleaseVersionPrefixes
428
- } from "nx/src/command-line/release/version-legacy";
429
- import { interpolate } from "nx/src/tasks-runner/utils";
430
- import { prerelease } from "semver";
431
- async function releaseVersionGeneratorFn(tree, options, config5) {
432
- writeInfo(`\u26A1 Running the Storm Release Version generator...
433
-
434
- `, config5);
435
- const stopwatch = getStopwatch("Storm Release Version generator");
436
- try {
437
- const workspaceRoot = findWorkspaceRoot();
438
- writeDebug(
439
- `Loading the Storm Config from environment variables and storm.config.js file...
440
- - workspaceRoot: ${workspaceRoot}`,
441
- config5
442
- );
443
- config5 = await getConfig(workspaceRoot);
444
- writeTrace(
445
- `Generator schema options \u2699\uFE0F
446
- ${Object.keys(options ?? {}).filter(
447
- (key) => ![
448
- "projects",
449
- "releaseGroup",
450
- "projectGraph",
451
- "currentVersionResolverMetadata"
452
- ].includes(key)
453
- ).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`,
454
- config5
455
- );
456
- const versionData = {};
457
- if (options.specifier) {
458
- if (!isValidSemverSpecifier(options.specifier)) {
459
- throw new Error(
460
- `The given version specifier "${options.specifier}" is not valid. You provide an exact version or a valid semver keyword such as "major", "minor", "patch", etc.`
461
- );
462
- }
463
- options.specifier = options.specifier.replace(/^v/, "");
464
- }
465
- if (options.versionPrefix && validReleaseVersionPrefixes.indexOf(
466
- options.versionPrefix
467
- ) === -1) {
468
- throw new Error(
469
- `Invalid value for version.generatorOptions.versionPrefix: "${options.versionPrefix}"
470
-
471
- Valid values are: ${validReleaseVersionPrefixes.map((s) => `"${s}"`).join(", ")}`
472
- );
473
- }
474
- options.fallbackCurrentVersionResolver ??= "disk";
475
- options.currentVersionResolver ??= "git-tag";
476
- const projects = options.projects;
477
- const createResolvePackageRoot = (customPackageRoot) => (projectNode) => {
478
- if (projectNode?.data?.root === config5?.workspaceRoot || projectNode?.data?.root === ".") {
479
- return config5?.workspaceRoot ?? findWorkspaceRoot();
480
- }
481
- if (!customPackageRoot) {
482
- return projectNode.data.root;
483
- }
484
- return interpolate(customPackageRoot, {
485
- workspaceRoot: "",
486
- projectRoot: projectNode.data.root,
487
- projectName: projectNode.name
488
- });
489
- };
490
- const resolvePackageRoot = createResolvePackageRoot(options.packageRoot);
491
- const projectNameToPackageRootMap = /* @__PURE__ */ new Map();
492
- for (const project of projects) {
493
- projectNameToPackageRootMap.set(
494
- project.name,
495
- resolvePackageRoot(project)
496
- );
497
- }
498
- let currentVersion = null;
499
- let currentVersionResolvedFromFallback = false;
500
- let latestMatchingGitTag = null;
501
- let specifier = options.specifier ? options.specifier : void 0;
502
- for (const project of projects) {
503
- const projectName = project.name;
504
- const packageRoot = projectNameToPackageRootMap.get(projectName);
505
- const packageJsonPath = joinPathFragments(
506
- packageRoot ?? "./",
507
- "package.json"
508
- );
509
- const cargoTomlPath = joinPathFragments(
510
- packageRoot ?? "./",
511
- "Cargo.toml"
512
- );
513
- if (!tree.exists(packageJsonPath) && !tree.exists(cargoTomlPath)) {
514
- throw new Error(
515
- `The project "${projectName}" does not have a package.json available at ${packageJsonPath} or a Cargo.toml file available at ${cargoTomlPath}.
516
-
517
- To fix this you will either need to add a package.json or Cargo.toml file at that location, or configure "release" within your nx.json to exclude "${projectName}" from the current release group, or amend the packageRoot configuration to point to where the package.json should be.`
518
- );
519
- }
520
- const workspaceRelativePackagePath = relative(
521
- config5?.workspaceRoot ?? findWorkspaceRoot(),
522
- tree.exists(packageJsonPath) ? packageJsonPath : cargoTomlPath
523
- );
524
- const log = (msg) => {
525
- writeInfo(`${projectName}: ${msg}`, config5);
526
- };
527
- writeInfo(`Running release version for project: ${project.name}`, config5);
528
- let packageName;
529
- let currentVersionFromDisk;
530
- if (tree.exists(packageJsonPath)) {
531
- const projectPackageJson = readJson(tree, packageJsonPath);
532
- log(
533
- `\u{1F50D} Reading data for package "${projectPackageJson.name}" from ${workspaceRelativePackagePath}`
534
- );
535
- packageName = projectPackageJson.name;
536
- currentVersionFromDisk = projectPackageJson.version;
537
- } else if (tree.exists(cargoTomlPath)) {
538
- const cargoToml = parseCargoToml(
539
- tree.read(cargoTomlPath)?.toString("utf-8")
540
- );
541
- log(
542
- `\u{1F50D} Reading data for package "${cargoToml.package.name}" from ${workspaceRelativePackagePath}`
543
- );
544
- packageName = cargoToml.package.name;
545
- currentVersionFromDisk = cargoToml.package.version;
546
- if (options.currentVersionResolver === "registry") {
547
- options.currentVersionResolver = "disk";
548
- }
549
- } else {
550
- throw new Error(
551
- `The project "${projectName}" does not have a package.json available at ${workspaceRelativePackagePath} or a Cargo.toml file available at ${cargoTomlPath}.
552
-
553
- To fix this you will either need to add a package.json or Cargo.toml file at that location, or configure "release" within your nx.json to exclude "${projectName}" from the current release group, or amend the packageRoot configuration to point to where the package.json should be.`
554
- );
555
- }
556
- switch (options.currentVersionResolver) {
557
- case "registry": {
558
- const metadata = options.currentVersionResolverMetadata ?? {};
559
- const tag = metadata.tag ?? DEFAULT_NPM_TAG;
560
- const registry = metadata.registry ?? await getRegistry();
561
- const npmRegistry = await getNpmRegistry();
562
- const githubRegistry = await getGitHubRegistry();
563
- if (options.releaseGroup.projectsRelationship === "independent") {
564
- try {
565
- currentVersion = await getVersion(packageName, tag, { registry });
566
- if (!currentVersion) {
567
- currentVersion = await getVersion(packageName, tag, {
568
- registry: npmRegistry
569
- });
570
- if (!currentVersion) {
571
- currentVersion = await getVersion(packageName, tag, {
572
- registry: githubRegistry
573
- });
574
- }
575
- }
576
- log(
577
- `\u{1F4C4} Resolved the current version as ${currentVersion} for tag "${tag}" from registry ${registry}`
578
- );
579
- } catch {
580
- try {
581
- currentVersion = await getVersion(packageName, tag, {
582
- registry: githubRegistry
583
- });
584
- log(
585
- `\u{1F4C4} Resolved the current version as ${currentVersion} for tag "${tag}" from registry ${githubRegistry}`
586
- );
587
- } catch {
588
- if (options.fallbackCurrentVersionResolver === "disk") {
589
- log(
590
- `\u{1F4C4} Unable to resolve the current version from the registry ${npmRegistry}${githubRegistry ? ` or ${githubRegistry}` : ""}. Falling back to the version on disk of ${currentVersionFromDisk}`
591
- );
592
- currentVersion = currentVersionFromDisk;
593
- currentVersionResolvedFromFallback = true;
594
- } else {
595
- throw new Error(
596
- `Unable to resolve the current version from the registry ${npmRegistry}${githubRegistry ? ` or ${githubRegistry}` : ""}. Please ensure that the package exists in the registry in order to use the "registry" currentVersionResolver. Alternatively, you can use the --first-release option or set "release.version.generatorOptions.fallbackCurrentVersionResolver" to "disk" in order to fallback to the version on disk when the registry lookup fails.`
597
- );
598
- }
599
- }
600
- }
601
- } else {
602
- if (currentVersionResolvedFromFallback) {
603
- log(
604
- `\u{1F4C4} Using the current version ${currentVersion} already resolved from disk fallback.`
605
- );
606
- } else {
607
- log(
608
- `\u{1F4C4} Using the current version ${currentVersion} already resolved from the registry ${npmRegistry ?? githubRegistry}`
609
- );
610
- }
611
- }
612
- break;
613
- }
614
- case "disk":
615
- currentVersion = currentVersionFromDisk;
616
- log(
617
- `\u{1F4C4} Resolved the current version as ${currentVersion} from ${packageJsonPath}`
618
- );
619
- break;
620
- case "git-tag": {
621
- if (
622
- // We always need to independently resolve the current version from git tag per project if the projects are independent
623
- options.releaseGroup.projectsRelationship === "independent"
624
- ) {
625
- const releaseTagPattern = options.releaseGroup.releaseTagPattern;
626
- latestMatchingGitTag = await getLatestGitTagForPattern(
627
- releaseTagPattern,
628
- {
629
- projectName: project.name
630
- },
631
- {
632
- releaseTagPatternRequireSemver: false,
633
- releaseTagPatternStrictPreid: false
634
- }
635
- );
636
- if (!latestMatchingGitTag) {
637
- if (currentVersionFromDisk) {
638
- log(
639
- `\u{1F4C4} Unable to resolve the current version from git tag using pattern "${releaseTagPattern}". Falling back to the version on disk of ${currentVersionFromDisk}`
640
- );
641
- currentVersion = currentVersionFromDisk;
642
- } else {
643
- log(
644
- `No git tags matching pattern "${releaseTagPattern}" for project "${project.name}" were found. This process also could not determine the version by checking the package files on disk, so we will attempt to use the default version value: "0.0.1".`
645
- );
646
- currentVersion = "0.0.1";
647
- }
648
- currentVersionResolvedFromFallback = true;
649
- } else {
650
- currentVersion = latestMatchingGitTag.extractedVersion;
651
- log(
652
- `\u{1F4C4} Resolved the current version as ${currentVersion} from git tag "${latestMatchingGitTag.tag}".`
653
- );
654
- }
655
- } else {
656
- if (currentVersionResolvedFromFallback) {
657
- log(
658
- `\u{1F4C4} Using the current version ${currentVersion} already resolved from disk fallback.`
659
- );
660
- } else {
661
- log(
662
- `\u{1F4C4} Using the current version ${currentVersion} already resolved from git tag "${latestMatchingGitTag.tag}".`
663
- );
664
- }
665
- }
666
- break;
667
- }
668
- default:
669
- throw new Error(
670
- `Invalid value for options.currentVersionResolver: ${options.currentVersionResolver}`
671
- );
672
- }
673
- if (options.specifier) {
674
- log(`\u{1F4C4} Using the provided version specifier "${options.specifier}".`);
675
- }
676
- if (specifier === void 0 || options.releaseGroup.projectsRelationship === "independent" && !options.specifier) {
677
- const specifierSource = options.specifierSource;
678
- switch (specifierSource) {
679
- case "conventional-commits": {
680
- if (options.currentVersionResolver !== "git-tag") {
681
- throw new Error(
682
- `Invalid currentVersionResolver "${options.currentVersionResolver}" provided for release group "${options.releaseGroup.name}". Must be "git-tag" when "specifierSource" is "conventional-commits"`
683
- );
684
- }
685
- const affectedProjects = options.releaseGroup.projectsRelationship === "independent" ? [projectName] : projects.map((p) => p.name);
686
- let previousVersionRef = latestMatchingGitTag?.tag ? latestMatchingGitTag.tag : await getFirstGitCommit();
687
- if (!previousVersionRef) {
688
- log(
689
- `Unable to determine previous version ref for the projects ${affectedProjects.join(
690
- ", "
691
- )}. This is likely a bug in Storm's Release Versioning. We will attempt to use the default version value "0.0.1" and continue with the process.`
692
- );
693
- previousVersionRef = "0.0.1";
694
- }
695
- specifier = await resolveSemverSpecifierFromConventionalCommits(
696
- previousVersionRef,
697
- options.projectGraph,
698
- affectedProjects,
699
- DEFAULT_CONVENTIONAL_COMMITS_CONFIG
700
- ) ?? void 0;
701
- if (!specifier) {
702
- log(
703
- "\u{1F6AB} No changes were detected using git history and the conventional commits standard."
704
- );
705
- break;
706
- }
707
- if (currentVersion && prerelease(currentVersion)) {
708
- specifier = "prerelease";
709
- log(
710
- `\u{1F4C4} Resolved the specifier as "${specifier}" since the current version is a prerelease.`
711
- );
712
- } else {
713
- log(
714
- `\u{1F4C4} Resolved the specifier as "${specifier}" using git history and the conventional commits standard.`
715
- );
716
- }
717
- break;
718
- }
719
- case "prompt": {
720
- const maybeLogReleaseGroup = (log2) => {
721
- if (options.releaseGroup.name === IMPLICIT_DEFAULT_RELEASE_GROUP) {
722
- return log2;
723
- }
724
- return `${log2} within release group "${options.releaseGroup.name}"`;
725
- };
726
- if (options.releaseGroup.projectsRelationship === "independent") {
727
- specifier = await resolveSemverSpecifierFromPrompt(
728
- `${maybeLogReleaseGroup(
729
- `What kind of change is this for project "${projectName}"`
730
- )}?`,
731
- `${maybeLogReleaseGroup(`What is the exact version for project "${projectName}"`)}?`
732
- );
733
- } else {
734
- specifier = await resolveSemverSpecifierFromPrompt(
735
- `${maybeLogReleaseGroup(
736
- `What kind of change is this for the ${projects.length} matched projects(s)`
737
- )}?`,
738
- `${maybeLogReleaseGroup(
739
- `What is the exact version for the ${projects.length} matched project(s)`
740
- )}?`
741
- );
742
- }
743
- break;
744
- }
745
- default:
746
- throw new Error(
747
- `Invalid specifierSource "${specifierSource}" provided. Must be one of "prompt" or "conventional-commits"`
748
- );
749
- }
750
- }
751
- const localPackageDependencies = resolveLocalPackageDependencies(
752
- tree,
753
- options.projectGraph,
754
- projects.filter(
755
- (project2) => project2?.data?.root && project2?.data?.root !== config5?.workspaceRoot
756
- ),
757
- projectNameToPackageRootMap,
758
- resolvePackageRoot,
759
- // includeAll when the release group is independent, as we may be filtering to a specific subset of projects, but we still want to update their dependents
760
- options.releaseGroup.projectsRelationship === "independent",
761
- tree.exists(packageJsonPath)
762
- );
763
- const dependentProjects = Object.values(localPackageDependencies).flat().filter((localPackageDependency) => {
764
- return localPackageDependency.target === project.name;
765
- });
766
- if (!currentVersion) {
767
- throw new Error(
768
- `Unable to determine the current version for project "${projectName}"`
769
- );
770
- }
771
- versionData[projectName] = {
772
- currentVersion: currentVersion ? currentVersion : "0.0.1",
773
- dependentProjects,
774
- newVersion: null
775
- // will stay as null in the final result in the case that no changes are detected
776
- };
777
- if (!specifier) {
778
- log(
779
- `\u{1F6AB} Skipping versioning "${packageName}" as no changes were detected.`
780
- );
781
- continue;
782
- }
783
- const newVersion = deriveNewSemverVersion(
784
- currentVersion,
785
- specifier,
786
- options.preid
787
- );
788
- if (versionData[projectName]) {
789
- versionData[projectName].newVersion = newVersion;
790
- }
791
- if (tree.exists(packageJsonPath)) {
792
- const projectPackageJson = readJson(tree, packageJsonPath);
793
- writeJson(tree, packageJsonPath, {
794
- ...projectPackageJson,
795
- version: newVersion
796
- });
797
- } else if (tree.exists(cargoTomlPath)) {
798
- const cargoToml = parseCargoToml(
799
- tree.read(cargoTomlPath)?.toString("utf-8")
800
- );
801
- cargoToml.package ??= {};
802
- cargoToml.package.version = newVersion;
803
- tree.write(cargoTomlPath, stringifyCargoToml(cargoToml));
804
- }
805
- log(
806
- `\u270D\uFE0F New version ${newVersion} written to ${workspaceRelativePackagePath}`
807
- );
808
- if (dependentProjects.length > 0) {
809
- log(
810
- `\u270D\uFE0F Applying new version ${newVersion} to ${dependentProjects.length} ${dependentProjects.length > 1 ? "packages which depend" : "package which depends"} on ${project.name}`
811
- );
812
- }
813
- for (const dependentProject of dependentProjects) {
814
- const dependentPackageRoot = projectNameToPackageRootMap.get(
815
- dependentProject.source
816
- );
817
- if (!dependentPackageRoot) {
818
- throw new Error(
819
- `The dependent project "${dependentProject.source}" does not have a packageRoot available.
820
-
821
- Projects with packageRoot configured: ${Array.from(projectNameToPackageRootMap.keys()).join(", ")}`
822
- );
823
- }
824
- const dependentPackageJsonPath = joinPathFragments(
825
- dependentPackageRoot,
826
- "package.json"
827
- );
828
- const dependentCargoTomlPath = joinPathFragments(
829
- dependentPackageRoot,
830
- "Cargo.toml"
831
- );
832
- if (tree.exists(dependentPackageJsonPath)) {
833
- updateJson(tree, dependentPackageJsonPath, (json) => {
834
- let versionPrefix = options.versionPrefix ?? "auto";
835
- if (versionPrefix === "auto") {
836
- versionPrefix = "";
837
- const current = json[dependentProject.dependencyCollection][packageName];
838
- if (current) {
839
- const prefixMatch = current.match(/^[~^]/);
840
- if (prefixMatch) {
841
- versionPrefix = prefixMatch[0];
842
- } else {
843
- versionPrefix = "";
844
- }
845
- }
846
- }
847
- json[dependentProject.dependencyCollection][packageName] = `${versionPrefix}${newVersion}`;
848
- return json;
849
- });
850
- } else if (tree.exists(dependentCargoTomlPath)) {
851
- const dependentPkg = parseCargoTomlWithTree(
852
- tree,
853
- dependentPackageRoot,
854
- dependentProject.source
855
- );
856
- let versionPrefix = options.versionPrefix ?? "auto";
857
- let updatedDependencyData = "";
858
- for (const dependency of Object.entries(
859
- dependentPkg[dependentProject.dependencyCollection] ?? {}
860
- )) {
861
- const [dependencyName, dependencyData] = dependency;
862
- if (dependencyName !== dependentProject.target) {
863
- continue;
864
- }
865
- if (versionPrefix === "auto") {
866
- versionPrefix = "";
867
- if (currentVersion) {
868
- const dependencyVersion = typeof dependencyData === "string" ? dependencyData : dependencyData.version;
869
- const prefixMatch = dependencyVersion?.match(/^[~^=]/);
870
- if (prefixMatch) {
871
- versionPrefix = prefixMatch[0];
872
- } else {
873
- versionPrefix = "";
874
- }
875
- if (versionPrefix === "^") {
876
- if (typeof dependencyData !== "string" && !dependencyData.version?.startsWith("^")) {
877
- versionPrefix = "";
878
- }
879
- }
880
- }
881
- }
882
- const newVersionWithPrefix = `${versionPrefix}${newVersion}`;
883
- updatedDependencyData = typeof dependencyData === "string" ? newVersionWithPrefix : {
884
- ...dependencyData,
885
- version: newVersionWithPrefix
886
- };
887
- break;
888
- }
889
- const cargoTomlToUpdate = joinPathFragments(
890
- dependentPackageRoot,
891
- "Cargo.toml"
892
- );
893
- modifyCargoTable(
894
- dependentPkg,
895
- dependentProject.dependencyCollection,
896
- dependentProject.target,
897
- updatedDependencyData
898
- );
899
- tree.write(cargoTomlToUpdate, stringifyCargoToml(dependentPkg));
900
- }
901
- }
902
- }
903
- await formatFiles(tree);
904
- writeSuccess(
905
- `Completed running the Storm Release Version generator!
906
- `,
907
- config5
908
- );
909
- return {
910
- data: versionData,
911
- callback: async (tree2, opts) => {
912
- output.logSingleLine("Updating Cargo.lock file");
913
- const cwd = tree2.root;
914
- const updatedFiles = await updateLockFile(cwd, opts) ?? [];
915
- const updatedCargoPackages = [];
916
- for (const [projectName, projectVersionData] of Object.entries(
917
- versionData
918
- )) {
919
- const project = projects.find((proj) => proj.name === projectName);
920
- if (projectVersionData.newVersion && project?.name && projectNameToPackageRootMap.get(project.name)) {
921
- const projectRoot = projectNameToPackageRootMap.get(project.name);
922
- if (projectRoot && tree2.exists(joinPathFragments(projectRoot, "Cargo.toml"))) {
923
- updatedCargoPackages.push(projectName);
924
- }
925
- }
926
- }
927
- if (updatedCargoPackages.length > 0) {
928
- execSync(`cargo update ${updatedCargoPackages.join(" ")}`, {
929
- maxBuffer: 1024 * 1024 * 1024,
930
- env: {
931
- ...process.env
932
- },
933
- cwd: tree2.root
934
- });
935
- if (hasGitDiff("Cargo.lock")) {
936
- updatedFiles.push("Cargo.lock");
937
- }
938
- }
939
- return updatedFiles;
940
- }
941
- };
942
- } catch (error) {
943
- writeFatal(
944
- "A fatal error occurred while running the Storm Release Version generator - the process was forced to terminate",
945
- config5
946
- );
947
- writeError(
948
- `An exception was thrown in the Storm Release Version generator's process
949
- - Details: ${error.message}
950
- - Stacktrace: ${error.stack}`,
951
- config5
952
- );
953
- throw new Error(
954
- `An exception was thrown in the Storm Release Version generator's process
955
- - Details: ${error.message}`,
956
- { cause: error }
957
- );
958
- } finally {
959
- stopwatch();
960
- }
961
- }
962
- var generator_default = releaseVersionGeneratorFn;
963
- function hasGitDiff(filePath) {
964
- try {
965
- const result = execSync(`git diff --name-only "${filePath}"`).toString();
966
- return result.trim() === filePath;
967
- } catch (_) {
968
- return false;
969
- }
970
- }
971
- function resolveLocalPackageDependencies(tree, projectGraph, filteredProjects, projectNameToPackageRootMap, resolvePackageRoot, includeAll = false, isNodeProject = true) {
972
- if (isNodeProject) {
973
- return resolveLocalPackageJsonDependencies(
974
- tree,
975
- projectGraph,
976
- filteredProjects,
977
- projectNameToPackageRootMap,
978
- resolvePackageRoot,
979
- includeAll
980
- );
981
- }
982
- return resolveLocalPackageCargoDependencies(
983
- tree,
984
- projectGraph,
985
- filteredProjects,
986
- projectNameToPackageRootMap,
987
- resolvePackageRoot,
988
- includeAll
989
- );
990
- }
991
- function resolveLocalPackageCargoDependencies(tree, projectGraph, filteredProjects, projectNameToPackageRootMap, resolvePackageRoot, includeAll = false) {
992
- const localPackageDependencies = {};
993
- const projects = includeAll ? Object.values(projectGraph.nodes) : filteredProjects;
994
- for (const projectNode of projects) {
995
- let packageRoot = projectNameToPackageRootMap.get(projectNode.name);
996
- if (!packageRoot && includeAll) {
997
- packageRoot = resolvePackageRoot(projectNode);
998
- if (!packageRoot) {
999
- continue;
1000
- }
1001
- projectNameToPackageRootMap.set(projectNode.name, packageRoot);
1002
- }
1003
- const cargoTomlPath = joinPathFragments(packageRoot ?? "./", "Cargo.toml");
1004
- if (!tree.exists(cargoTomlPath)) {
1005
- continue;
1006
- }
1007
- const projectDeps = projectGraph.dependencies[projectNode.name];
1008
- if (!projectDeps) {
1009
- continue;
1010
- }
1011
- const localPackageDepsForProject = [];
1012
- for (const dep of projectDeps) {
1013
- const depProject = projectGraph.nodes[dep.target];
1014
- if (!depProject) {
1015
- continue;
1016
- }
1017
- const depProjectRoot = projectNameToPackageRootMap.get(dep.target);
1018
- if (!depProjectRoot) {
1019
- throw new Error(
1020
- `The project "${dep.target}" does not have a packageRoot available.`
1021
- );
1022
- }
1023
- const cargoToml = parseCargoTomlWithTree(
1024
- tree,
1025
- resolvePackageRoot(projectNode),
1026
- projectNode.name
1027
- );
1028
- const dependencies = cargoToml.dependencies ?? {};
1029
- const devDependencies = cargoToml["dev-dependencies"] ?? {};
1030
- const dependencyCollection = dependencies[depProject.name] ? "dependencies" : devDependencies[depProject.name] ? "dev-dependencies" : null;
1031
- if (!dependencyCollection) {
1032
- throw new Error(
1033
- `The project "${projectNode.name}" does not have a local dependency on "${depProject.name}" in its Cargo.toml`
1034
- );
1035
- }
1036
- localPackageDepsForProject.push({
1037
- ...dep,
1038
- dependencyCollection
1039
- });
1040
- }
1041
- localPackageDependencies[projectNode.name] = localPackageDepsForProject;
1042
- }
1043
- return localPackageDependencies;
1044
- }
1045
-
1046
- export {
1047
- releaseVersionGeneratorFn,
1048
- generator_default
1049
- };