@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
@@ -0,0 +1,213 @@
1
+ import {
2
+ getCrateRegistryVersion
3
+ } from "./chunk-EGI64HQ2.mjs";
4
+ import {
5
+ parseCargoToml,
6
+ parseCargoTomlWithTree,
7
+ stringifyCargoToml
8
+ } from "./chunk-X2SLQ73Q.mjs";
9
+ import {
10
+ getWorkspaceConfig
11
+ } from "./chunk-NOTQLVZP.mjs";
12
+
13
+ // src/release/rust-version-actions.ts
14
+ import {
15
+ joinPathFragments
16
+ } from "@nx/devkit";
17
+ import { VersionActions } from "nx/release";
18
+ var StormRustVersionActions = class extends VersionActions {
19
+ validManifestFilenames = ["Cargo.toml"];
20
+ /**
21
+ * The Storm workspace configuration object, which is loaded from the `storm-workspace.json` file.
22
+ *
23
+ * @remarks
24
+ * This member variable is populated during the {@link init} method.
25
+ */
26
+ workspaceConfig = null;
27
+ constructor(releaseGroup, projectGraphNode, finalConfigForProject) {
28
+ super(releaseGroup, projectGraphNode, finalConfigForProject);
29
+ }
30
+ /**
31
+ * Asynchronous initialization of the version actions and resolution of manifest paths.
32
+ *
33
+ * @remarks
34
+ * This does NOT validate that manifest files exist - that happens later in validate().
35
+ *
36
+ * @params tree - The file system tree to read from.
37
+ */
38
+ async init(tree) {
39
+ this.workspaceConfig = await getWorkspaceConfig();
40
+ return super.init(tree);
41
+ }
42
+ async readCurrentVersionFromSourceManifest(tree) {
43
+ const sourceCargoTomlPath = joinPathFragments(
44
+ this.projectGraphNode.data.root,
45
+ "Cargo.toml"
46
+ );
47
+ try {
48
+ const cargoToml = parseCargoTomlWithTree(
49
+ tree,
50
+ this.projectGraphNode.data.root,
51
+ this.projectGraphNode.name
52
+ );
53
+ return {
54
+ manifestPath: sourceCargoTomlPath,
55
+ currentVersion: cargoToml.package.version
56
+ };
57
+ } catch {
58
+ throw new Error(
59
+ `Unable to determine the current version for project "${this.projectGraphNode.name}" from ${sourceCargoTomlPath}, please ensure that the "version" field is set within the Cargo.toml file`
60
+ );
61
+ }
62
+ }
63
+ async readCurrentVersionFromRegistry(tree, currentVersionResolverMetadata) {
64
+ const cargoToml = parseCargoTomlWithTree(
65
+ tree,
66
+ this.projectGraphNode.data.root,
67
+ this.projectGraphNode.name
68
+ );
69
+ const crateName = cargoToml.package.name;
70
+ const metadata = currentVersionResolverMetadata;
71
+ const registryArg = typeof metadata?.registry === "string" ? metadata.registry : this.workspaceConfig?.registry?.cargo || "https://crates.io";
72
+ const tagArg = typeof metadata?.tag === "string" ? metadata.tag : "latest";
73
+ let currentVersion = null;
74
+ try {
75
+ currentVersion = await getCrateRegistryVersion(
76
+ crateName,
77
+ tagArg,
78
+ registryArg
79
+ );
80
+ } catch {
81
+ }
82
+ return {
83
+ currentVersion: currentVersion || "0.0.0",
84
+ // Make troubleshooting easier by including the registry and tag data in the log text
85
+ logText: `"cargoRegistry=${registryArg}" tag=${tagArg}`
86
+ };
87
+ }
88
+ async readCurrentVersionOfDependency(tree, projectGraph, dependencyProjectName) {
89
+ const cargoToml = parseCargoTomlWithTree(
90
+ tree,
91
+ this.projectGraphNode.data.root,
92
+ this.projectGraphNode.name
93
+ );
94
+ if (!projectGraph.nodes[dependencyProjectName]?.data?.root) {
95
+ return {
96
+ currentVersion: null,
97
+ dependencyCollection: null
98
+ };
99
+ }
100
+ const dependencyCargoToml = parseCargoTomlWithTree(
101
+ tree,
102
+ projectGraph.nodes[dependencyProjectName]?.data.root,
103
+ dependencyProjectName
104
+ );
105
+ if (!dependencyCargoToml?.package?.name) {
106
+ return {
107
+ currentVersion: null,
108
+ dependencyCollection: null
109
+ };
110
+ }
111
+ let currentVersion = null;
112
+ let dependencyCollection = null;
113
+ for (const depType of ["dependencies", "dev-dependencies"]) {
114
+ if (cargoToml[depType] && cargoToml[depType][dependencyCargoToml.package.name]) {
115
+ currentVersion = typeof cargoToml[depType][dependencyCargoToml.package.name] === "string" ? cargoToml[depType][dependencyCargoToml.package.name] : cargoToml[depType][dependencyCargoToml.package.name].version;
116
+ dependencyCollection = depType;
117
+ break;
118
+ }
119
+ }
120
+ return {
121
+ currentVersion,
122
+ dependencyCollection
123
+ };
124
+ }
125
+ async updateProjectVersion(tree, newVersion) {
126
+ const logMessages = [];
127
+ for (const manifestToUpdate of this.manifestsToUpdate) {
128
+ const cargoTomlString = tree.read(manifestToUpdate.manifestPath)?.toString();
129
+ if (!cargoTomlString) {
130
+ throw new Error(
131
+ `Unable to read Cargo.toml at path: ${manifestToUpdate.manifestPath}`
132
+ );
133
+ }
134
+ const cargoToml = parseCargoToml(cargoTomlString);
135
+ cargoToml.package.version = newVersion;
136
+ tree.write(manifestToUpdate.manifestPath, stringifyCargoToml(cargoToml));
137
+ logMessages.push(
138
+ `\u270D\uFE0F New version ${newVersion} written to manifest: ${manifestToUpdate.manifestPath}`
139
+ );
140
+ }
141
+ return logMessages;
142
+ }
143
+ /**
144
+ * Updates the dependencies of the project in the specified Cargo.toml files.
145
+ *
146
+ * @param tree - The file system tree to read from and write to.
147
+ * @param projectGraph - The project graph to use for resolving dependencies.
148
+ * @param dependenciesToUpdate - A mapping of dependency names to their new versions.
149
+ * @returns An array of log messages indicating the results of the updates.
150
+ */
151
+ async updateProjectDependencies(tree, projectGraph, dependenciesToUpdate = {}) {
152
+ const numDependenciesToUpdate = Object.keys(dependenciesToUpdate).length;
153
+ if (numDependenciesToUpdate === 0) {
154
+ return [];
155
+ }
156
+ const logMessages = [];
157
+ for (const manifestToUpdate of this.manifestsToUpdate) {
158
+ const cargoTomlString = tree.read(manifestToUpdate.manifestPath)?.toString();
159
+ if (!cargoTomlString) {
160
+ throw new Error(
161
+ `Unable to read Cargo.toml at path: ${manifestToUpdate.manifestPath}`
162
+ );
163
+ }
164
+ const cargoToml = parseCargoToml(cargoTomlString);
165
+ for (const depType of ["dependencies", "dev-dependencies"]) {
166
+ if (cargoToml[depType]) {
167
+ for (const [dep, version] of Object.entries(dependenciesToUpdate)) {
168
+ try {
169
+ const projectRoot = projectGraph.nodes[dep]?.data.root;
170
+ if (!projectRoot) {
171
+ throw new Error(
172
+ `Unable to determine the project root for "${dep}" from the project graph metadata, please ensure that the "@storm-software/workspace-tools" plugin is installed and the project graph has been built. If the issue persists, please report this issue on https://github.com/storm-software/storm-ops/issues`
173
+ );
174
+ }
175
+ const dependencyCargoTomlString = tree.read(manifestToUpdate.manifestPath)?.toString();
176
+ if (!dependencyCargoTomlString) {
177
+ throw new Error(
178
+ `Unable to read Cargo.toml at path: ${manifestToUpdate.manifestPath}`
179
+ );
180
+ }
181
+ const dependencyCargoToml = parseCargoToml(
182
+ dependencyCargoTomlString
183
+ );
184
+ const dependencyCrateName = cargoToml[depType][dependencyCargoToml.package.name] ? dependencyCargoToml.package.name : dep;
185
+ if (typeof cargoToml[depType][dependencyCrateName] === "string") {
186
+ cargoToml[depType][dependencyCrateName] = version;
187
+ } else {
188
+ cargoToml[depType][dependencyCrateName].version = version;
189
+ }
190
+ tree.write(
191
+ manifestToUpdate.manifestPath,
192
+ stringifyCargoToml(cargoToml)
193
+ );
194
+ } catch (error) {
195
+ throw new Error(
196
+ `Unable to update ${depType === "dev-dependencies" ? "dev-dependency" : "dependency"} "${dep}" in manifest at path: ${manifestToUpdate.manifestPath}.`,
197
+ { cause: error }
198
+ );
199
+ }
200
+ }
201
+ }
202
+ }
203
+ logMessages.push(
204
+ `\u270D\uFE0F Updated ${numDependenciesToUpdate} ${numDependenciesToUpdate === 1 ? "dependency" : "dependencies"} in manifest: ${manifestToUpdate.manifestPath}`
205
+ );
206
+ }
207
+ return logMessages;
208
+ }
209
+ };
210
+
211
+ export {
212
+ StormRustVersionActions
213
+ };
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__2f3cd688ba388d22c915010bc14d2fbe/node_modules/tsup/assets/esm_shims.js
1
+ // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__ddff3f80acdb8654ef4815831fcbcdde/node_modules/tsup/assets/esm_shims.js
2
2
  import { fileURLToPath } from "url";
3
3
  import path from "path";
4
4
  var getFilename = () => fileURLToPath(import.meta.url);
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-JGFRV7ZL.mjs";
8
8
  import {
9
9
  __dirname
10
- } from "./chunk-LOFMB5G3.mjs";
10
+ } from "./chunk-IPWUJVZZ.mjs";
11
11
 
12
12
  // src/generators/preset/generator.ts
13
13
  import {
@@ -29,14 +29,9 @@ function stringifyCargoToml(cargoToml) {
29
29
  }
30
30
  return tomlString;
31
31
  }
32
- function modifyCargoTable(toml, section, key, value) {
33
- toml[section] ??= _jtoml2.default.Section({});
34
- toml[section][key] = typeof value === "object" && !Array.isArray(value) ? _jtoml2.default.inline(value) : typeof value === "function" ? value() : value;
35
- }
36
-
37
32
 
38
33
 
39
34
 
40
35
 
41
36
 
42
- exports.parseCargoTomlWithTree = parseCargoTomlWithTree; exports.parseCargoToml = parseCargoToml; exports.stringifyCargoToml = stringifyCargoToml; exports.modifyCargoTable = modifyCargoTable;
37
+ exports.parseCargoTomlWithTree = parseCargoTomlWithTree; exports.parseCargoToml = parseCargoToml; exports.stringifyCargoToml = stringifyCargoToml;
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-C26A6BXG.mjs";
14
14
  import {
15
15
  __dirname
16
- } from "./chunk-LOFMB5G3.mjs";
16
+ } from "./chunk-IPWUJVZZ.mjs";
17
17
 
18
18
  // src/generators/node-library/generator.ts
19
19
  import {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  parseCargoToml
3
- } from "./chunk-SVIG7SR3.mjs";
3
+ } from "./chunk-X2SLQ73Q.mjs";
4
4
 
5
5
  // src/executors/cargo-publish/executor.ts
6
6
  import { joinPathFragments } from "@nx/devkit";
@@ -297,13 +297,16 @@ var RELEASE = {
297
297
  },
298
298
  version: {
299
299
  groupPreVersionCommand: "pnpm build",
300
- generator: "@storm-software/workspace-tools:release-version",
301
300
  currentVersionResolver: "git-tag",
302
301
  specifierSource: "conventional-commits",
303
- generatorOptions: {
302
+ versionActions: "@storm-software/workspace-tools:release-version",
303
+ versionActionsOptions: {
304
304
  currentVersionResolver: "git-tag",
305
305
  specifierSource: "conventional-commits"
306
306
  }
307
+ },
308
+ releaseTag: {
309
+ pattern: "{projectName}@{version}"
307
310
  }
308
311
  }
309
312
  }
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
  var _chunkJ6F3WHRBjs = require('./chunk-J6F3WHRB.js');
4
4
 
@@ -18,6 +18,7 @@ var _chunkAX3RSZT7js = require('./chunk-AX3RSZT7.js');
18
18
 
19
19
 
20
20
  var _devkit = require('@nx/devkit');
21
+ var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
21
22
  var _fs = require('fs');
22
23
  var _path = require('path');
23
24
 
@@ -85,7 +86,7 @@ var createNodesV2 = [
85
86
  if (includeApps === false && project.projectType === "application") {
86
87
  continue;
87
88
  }
88
- project.targets = {
89
+ const targets = {
89
90
  "lint-markdown": {
90
91
  cache: true,
91
92
  outputs: ["{projectRoot}/**/*.md", "{projectRoot}/**/*.mdx"],
@@ -234,7 +235,7 @@ var createNodesV2 = [
234
235
  }
235
236
  };
236
237
  if (skipDocs != true) {
237
- project.targets.docs = {
238
+ targets.docs = {
238
239
  cache: true,
239
240
  inputs: ["linting", "documentation", "^production"],
240
241
  dependsOn: ["format-readme", "lint-docs", "^docs"],
@@ -254,7 +255,7 @@ var createNodesV2 = [
254
255
  _chunkAX3RSZT7js.ProjectTagConstants.Registry.CARGO,
255
256
  { overwrite: true }
256
257
  );
257
- project.targets["nx-release-publish"] = {
258
+ targets["nx-release-publish"] = {
258
259
  cache: true,
259
260
  inputs: [
260
261
  "linting",
@@ -279,21 +280,22 @@ var createNodesV2 = [
279
280
  { overwrite: true }
280
281
  );
281
282
  _chunkAX3RSZT7js.setDefaultProjectTags.call(void 0, project, name);
282
- projects[root] = {
283
- ...project,
284
- release: {
285
- ...project.release,
286
- version: {
287
- ..._optionalChain([project, 'access', _6 => _6.release, 'optionalAccess', _7 => _7.version]),
288
- generator: "@storm-software/workspace-tools:release-version"
283
+ projects[root] = _defu2.default.call(void 0,
284
+ {
285
+ targets,
286
+ release: {
287
+ version: {
288
+ versionActions: "@storm-software/workspace-tools/release/rust-version-actions"
289
+ }
289
290
  }
290
- }
291
- };
291
+ },
292
+ project
293
+ );
292
294
  }
293
295
  for (const dep of cargoPackage.dependencies) {
294
296
  if (_chunkLJDV7HFTjs.isExternal.call(void 0, dep, context2.workspaceRoot)) {
295
297
  const externalDepName = `cargo:${dep.name}`;
296
- if (!_optionalChain([externalNodes, 'optionalAccess', _8 => _8[externalDepName]])) {
298
+ if (!_optionalChain([externalNodes, 'optionalAccess', _6 => _6[externalDepName]])) {
297
299
  externalNodes[externalDepName] = {
298
300
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
299
301
  type: "cargo",
@@ -301,7 +303,7 @@ var createNodesV2 = [
301
303
  name: externalDepName,
302
304
  data: {
303
305
  packageName: dep.name,
304
- version: _nullishCoalesce(_optionalChain([cargoPackageMap, 'access', _9 => _9.get, 'call', _10 => _10(dep.name), 'optionalAccess', _11 => _11.version]), () => ( "0.0.0"))
306
+ version: _nullishCoalesce(_optionalChain([cargoPackageMap, 'access', _7 => _7.get, 'call', _8 => _8(dep.name), 'optionalAccess', _9 => _9.version]), () => ( "0.0.0"))
305
307
  }
306
308
  };
307
309
  }
@@ -1,10 +1,9 @@
1
1
  import {
2
2
  addPackageJsonGitHead
3
- } from "./chunk-UCXAD2SG.mjs";
3
+ } from "./chunk-6PVCCKX4.mjs";
4
4
  import {
5
- getNpmRegistry,
6
- getRegistry
7
- } from "./chunk-JLXBL5BC.mjs";
5
+ getConfig
6
+ } from "./chunk-NOTQLVZP.mjs";
8
7
  import {
9
8
  findWorkspaceRoot
10
9
  } from "./chunk-VGJEUOUN.mjs";
@@ -12,6 +11,37 @@ import {
12
11
  joinPaths
13
12
  } from "./chunk-C26A6BXG.mjs";
14
13
 
14
+ // ../npm-tools/src/helpers/get-registry.ts
15
+ import { exec } from "node:child_process";
16
+
17
+ // ../npm-tools/src/constants.ts
18
+ var DEFAULT_NPM_REGISTRY = "https://registry.npmjs.org";
19
+
20
+ // ../npm-tools/src/helpers/get-registry.ts
21
+ async function getRegistry() {
22
+ return new Promise((resolve, reject) => {
23
+ exec("npm config get registry", (error, stdout, stderr) => {
24
+ if (error) {
25
+ return reject(error);
26
+ }
27
+ if (stderr) {
28
+ return reject(stderr);
29
+ }
30
+ return resolve(stdout.trim());
31
+ });
32
+ });
33
+ }
34
+ async function getNpmRegistry() {
35
+ if (process.env.STORM_REGISTRY_NPM) {
36
+ return process.env.STORM_REGISTRY_NPM;
37
+ }
38
+ const workspaceConfig = await getConfig();
39
+ if (workspaceConfig?.registry?.npm) {
40
+ return workspaceConfig?.registry?.npm;
41
+ }
42
+ return DEFAULT_NPM_REGISTRY;
43
+ }
44
+
15
45
  // ../pnpm-tools/src/helpers/replace-deps-aliases.ts
16
46
  import {
17
47
  createProjectGraphAsync,
@@ -21,6 +51,9 @@ import { existsSync as existsSync2 } from "node:fs";
21
51
  import { readFile as readFile2, writeFile as writeFile2 } from "node:fs/promises";
22
52
  import { format } from "prettier";
23
53
 
54
+ // ../npm-tools/src/helpers/get-version.ts
55
+ import { exec as exec2 } from "node:child_process";
56
+
24
57
  // ../pnpm-tools/src/helpers/catalog.ts
25
58
  import { coerce, gt, valid } from "semver";
26
59
 
@@ -297,13 +297,16 @@ var RELEASE = {
297
297
  },
298
298
  version: {
299
299
  groupPreVersionCommand: "pnpm build",
300
- generator: "@storm-software/workspace-tools:release-version",
301
300
  currentVersionResolver: "git-tag",
302
301
  specifierSource: "conventional-commits",
303
- generatorOptions: {
302
+ versionActions: "@storm-software/workspace-tools:release-version",
303
+ versionActionsOptions: {
304
304
  currentVersionResolver: "git-tag",
305
305
  specifierSource: "conventional-commits"
306
306
  }
307
+ },
308
+ releaseTag: {
309
+ pattern: "{projectName}@{version}"
307
310
  }
308
311
  }
309
312
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunk452FQZ3Bjs = require('./chunk-452FQZ3B.js');
3
+ var _chunkJWFGGMYQjs = require('./chunk-JWFGGMYQ.js');
4
4
 
5
5
  // src/executors/cargo-publish/executor.ts
6
6
  var _devkit = require('@nx/devkit');
@@ -25,7 +25,7 @@ async function runExecutor(options, context) {
25
25
  context.root,
26
26
  options.packageRoot ? options.packageRoot : root
27
27
  );
28
- const cargoToml = _chunk452FQZ3Bjs.parseCargoToml.call(void 0,
28
+ const cargoToml = _chunkJWFGGMYQjs.parseCargoToml.call(void 0,
29
29
  _fs.readFileSync.call(void 0, _devkit.joinPathFragments.call(void 0, packageRoot, "Cargo.toml"), "utf-8")
30
30
  );
31
31
  try {
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-C26A6BXG.mjs";
11
11
  import {
12
12
  __dirname
13
- } from "./chunk-LOFMB5G3.mjs";
13
+ } from "./chunk-IPWUJVZZ.mjs";
14
14
 
15
15
  // src/generators/browser-library/generator.ts
16
16
  import {
File without changes