@storm-software/workspace-tools 1.294.38 → 1.294.40

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 (106) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-7KSP37MJ.mjs → chunk-253SGFZD.mjs} +1 -1
  4. package/dist/{chunk-CEM3HM3B.mjs → chunk-2SCDO4SB.mjs} +1 -1
  5. package/dist/{chunk-E7FF7KFZ.mjs → chunk-3DVMTFVU.mjs} +1 -1
  6. package/dist/chunk-54MA4WSQ.mjs +32 -0
  7. package/dist/chunk-652HZZQ6.mjs +82 -0
  8. package/dist/chunk-BLSUQ4AI.mjs +32 -0
  9. package/dist/chunk-CFGJEIMQ.js +31 -0
  10. package/dist/{chunk-CEC4FZYL.mjs → chunk-CX42PCEC.mjs} +5 -5
  11. package/dist/chunk-DGX22JSK.js +32 -0
  12. package/dist/chunk-EFCYTQCA.js +93 -0
  13. package/dist/chunk-FUI4YPOR.js +41 -0
  14. package/dist/chunk-G3ETC7F5.mjs +41 -0
  15. package/dist/chunk-GBESJVYG.mjs +32 -0
  16. package/dist/chunk-GGYEFCAI.mjs +116 -0
  17. package/dist/{chunk-LNV6TE5T.mjs → chunk-GX3NWVA7.mjs} +1 -1
  18. package/dist/chunk-HUC5CYJB.mjs +31 -0
  19. package/dist/chunk-JBRRO6VB.js +548 -0
  20. package/dist/chunk-JMKTY5ZQ.js +32 -0
  21. package/dist/chunk-KMDUHEVQ.js +79 -0
  22. package/dist/{chunk-OBA5LSVN.js → chunk-MLI55MFR.js} +3 -3
  23. package/dist/chunk-MORI7YVO.js +32 -0
  24. package/dist/chunk-NJLZBEYW.mjs +93 -0
  25. package/dist/chunk-OUFCTM3O.js +250 -0
  26. package/dist/chunk-RPQZ234N.js +116 -0
  27. package/dist/chunk-VWKETDBY.mjs +548 -0
  28. package/dist/chunk-XMDK4R7M.mjs +253 -0
  29. package/dist/executors.mjs +1 -1
  30. package/dist/generators.js +2 -2
  31. package/dist/generators.mjs +5 -5
  32. package/dist/index.js +2 -2
  33. package/dist/index.mjs +5 -5
  34. package/dist/src/base/base-executor.mjs +1 -1
  35. package/dist/src/base/base-executor.untyped.mjs +1 -1
  36. package/dist/src/base/base-generator.mjs +1 -1
  37. package/dist/src/base/base-generator.untyped.mjs +1 -1
  38. package/dist/src/base/cargo-base-executor.untyped.mjs +1 -1
  39. package/dist/src/base/index.mjs +1 -1
  40. package/dist/src/base/typescript-build-executor.untyped.mjs +1 -1
  41. package/dist/src/base/typescript-library-generator.untyped.mjs +1 -1
  42. package/dist/src/executors/cargo-build/executor.mjs +1 -1
  43. package/dist/src/executors/cargo-build/untyped.mjs +1 -1
  44. package/dist/src/executors/cargo-check/executor.mjs +1 -1
  45. package/dist/src/executors/cargo-check/untyped.mjs +1 -1
  46. package/dist/src/executors/cargo-clippy/executor.mjs +1 -1
  47. package/dist/src/executors/cargo-clippy/untyped.mjs +1 -1
  48. package/dist/src/executors/cargo-doc/executor.mjs +1 -1
  49. package/dist/src/executors/cargo-doc/untyped.mjs +1 -1
  50. package/dist/src/executors/cargo-format/executor.mjs +1 -1
  51. package/dist/src/executors/cargo-format/untyped.mjs +1 -1
  52. package/dist/src/executors/cargo-publish/executor.mjs +1 -1
  53. package/dist/src/executors/cargo-publish/untyped.mjs +1 -1
  54. package/dist/src/executors/clean-package/executor.mjs +1 -1
  55. package/dist/src/executors/clean-package/untyped.mjs +1 -1
  56. package/dist/src/executors/esbuild/executor.mjs +1 -1
  57. package/dist/src/executors/esbuild/untyped.mjs +1 -1
  58. package/dist/src/executors/napi/executor.mjs +1 -1
  59. package/dist/src/executors/napi/untyped.mjs +1 -1
  60. package/dist/src/executors/npm-publish/executor.mjs +1 -1
  61. package/dist/src/executors/npm-publish/untyped.mjs +1 -1
  62. package/dist/src/executors/size-limit/executor.mjs +1 -1
  63. package/dist/src/executors/size-limit/untyped.mjs +1 -1
  64. package/dist/src/executors/tsdown/executor.mjs +1 -1
  65. package/dist/src/executors/tsdown/untyped.mjs +1 -1
  66. package/dist/src/executors/typia/executor.mjs +1 -1
  67. package/dist/src/executors/typia/untyped.mjs +1 -1
  68. package/dist/src/executors/unbuild/executor.mjs +1 -1
  69. package/dist/src/executors/unbuild/untyped.mjs +1 -1
  70. package/dist/src/generators/browser-library/generator.mjs +2 -2
  71. package/dist/src/generators/browser-library/untyped.mjs +1 -1
  72. package/dist/src/generators/config-schema/generator.mjs +1 -1
  73. package/dist/src/generators/config-schema/untyped.mjs +1 -1
  74. package/dist/src/generators/init/init.mjs +1 -1
  75. package/dist/src/generators/init/untyped.mjs +1 -1
  76. package/dist/src/generators/neutral-library/generator.mjs +2 -2
  77. package/dist/src/generators/neutral-library/untyped.mjs +1 -1
  78. package/dist/src/generators/node-library/generator.mjs +2 -2
  79. package/dist/src/generators/node-library/untyped.mjs +1 -1
  80. package/dist/src/generators/preset/generator.js +2 -2
  81. package/dist/src/generators/preset/generator.mjs +2 -2
  82. package/dist/src/generators/preset/untyped.mjs +1 -1
  83. package/dist/src/plugins/rust/cargo-toml.mjs +1 -1
  84. package/dist/src/plugins/rust/index.mjs +1 -1
  85. package/dist/src/plugins/typescript/index.mjs +1 -1
  86. package/dist/src/plugins/typescript/tsdown.mjs +1 -1
  87. package/dist/src/plugins/typescript/tsup.mjs +1 -1
  88. package/dist/src/plugins/typescript/untyped-schema.mjs +1 -1
  89. package/dist/src/release/index.mjs +1 -1
  90. package/dist/src/release/js-version-actions.mjs +1 -1
  91. package/dist/src/release/rust-version-actions.mjs +1 -1
  92. package/dist/src/types.mjs +1 -1
  93. package/dist/src/utils/apply-workspace-tokens.mjs +1 -1
  94. package/dist/src/utils/cargo.mjs +1 -1
  95. package/dist/src/utils/create-cli-options.mjs +1 -1
  96. package/dist/src/utils/get-project-configurations.mjs +1 -1
  97. package/dist/src/utils/index.mjs +1 -1
  98. package/dist/src/utils/lock-file.mjs +1 -1
  99. package/dist/src/utils/nx-json.mjs +1 -1
  100. package/dist/src/utils/package-helpers.mjs +1 -1
  101. package/dist/src/utils/plugin-helpers.mjs +1 -1
  102. package/dist/src/utils/project-tags.mjs +1 -1
  103. package/dist/src/utils/registry-helpers.mjs +1 -1
  104. package/dist/src/utils/typia-transform.mjs +1 -1
  105. package/dist/src/utils/versions.mjs +1 -1
  106. package/package.json +10 -10
@@ -0,0 +1,548 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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
+
3
+ var _chunkEFCYTQCAjs = require('./chunk-EFCYTQCA.js');
4
+
5
+
6
+ var _chunk2VO5LA3Ujs = require('./chunk-2VO5LA3U.js');
7
+
8
+
9
+ var _chunkLMYTVXGXjs = require('./chunk-LMYTVXGX.js');
10
+
11
+
12
+ var _chunkCQDBLKPFjs = require('./chunk-CQDBLKPF.js');
13
+
14
+ // ../npm-tools/src/helpers/get-registry.ts
15
+ var _child_process = require('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(executable = "npm") {
22
+ return new Promise((resolve, reject) => {
23
+ _child_process.exec.call(void 0, `${executable} config get registry`, (error, stdout, stderr) => {
24
+ if (error && !error.message.toLowerCase().trim().startsWith("npm warn")) {
25
+ return reject(error);
26
+ }
27
+ if (stderr && !stderr.toLowerCase().trim().startsWith("npm warn")) {
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 _chunk2VO5LA3Ujs.getConfig.call(void 0, );
39
+ if (_optionalChain([workspaceConfig, 'optionalAccess', _ => _.registry, 'optionalAccess', _2 => _2.npm])) {
40
+ return _optionalChain([workspaceConfig, 'optionalAccess', _3 => _3.registry, 'optionalAccess', _4 => _4.npm]);
41
+ }
42
+ return DEFAULT_NPM_REGISTRY;
43
+ }
44
+
45
+ // ../pnpm-tools/src/helpers/replace-deps-aliases.ts
46
+
47
+
48
+
49
+ var _devkit = require('@nx/devkit');
50
+ var _fs = require('fs');
51
+ var _promises = require('fs/promises');
52
+ var _prettier = require('prettier');
53
+
54
+ // ../npm-tools/src/helpers/get-version.ts
55
+
56
+
57
+ // ../pnpm-tools/src/helpers/catalog.ts
58
+ var _semver = require('semver');
59
+
60
+ // ../pnpm-tools/src/helpers/pnpm-workspace.ts
61
+
62
+
63
+ var _yaml = require('yaml');
64
+ function getPnpmWorkspaceFilePath(workspaceRoot = _chunkLMYTVXGXjs.findWorkspaceRoot.call(void 0, process.cwd())) {
65
+ const pnpmWorkspacePath = _chunkCQDBLKPFjs.joinPaths.call(void 0, workspaceRoot, "pnpm-workspace.yaml");
66
+ if (!_fs.existsSync.call(void 0, pnpmWorkspacePath)) {
67
+ throw new Error(
68
+ `No \`pnpm-workspace.yaml\` file found in workspace root (searched in: ${pnpmWorkspacePath}).`
69
+ );
70
+ }
71
+ return pnpmWorkspacePath;
72
+ }
73
+ async function readPnpmWorkspaceFile(workspaceRoot = _chunkLMYTVXGXjs.findWorkspaceRoot.call(void 0, process.cwd())) {
74
+ const result = await _promises.readFile.call(void 0,
75
+ getPnpmWorkspaceFilePath(workspaceRoot),
76
+ "utf8"
77
+ );
78
+ if (!result) {
79
+ return void 0;
80
+ }
81
+ return _yaml.parse.call(void 0, result);
82
+ }
83
+
84
+ // ../pnpm-tools/src/helpers/catalog.ts
85
+ async function getCatalogSafe(workspaceRoot = _chunkLMYTVXGXjs.findWorkspaceRoot.call(void 0, process.cwd())) {
86
+ const pnpmWorkspaceFile = await readPnpmWorkspaceFile(workspaceRoot);
87
+ if (!pnpmWorkspaceFile) {
88
+ throw new Error("No pnpm-workspace.yaml file found");
89
+ }
90
+ if (_optionalChain([pnpmWorkspaceFile, 'optionalAccess', _5 => _5.catalog])) {
91
+ return Object.fromEntries(
92
+ Object.entries(pnpmWorkspaceFile.catalog).map(([key, value]) => {
93
+ return [key, value.replaceAll('"', "").replaceAll("'", "")];
94
+ })
95
+ );
96
+ } else {
97
+ console.warn(
98
+ `No catalog found in pnpm-workspace.yaml file located in workspace root: ${workspaceRoot}
99
+ File content: ${JSON.stringify(
100
+ pnpmWorkspaceFile,
101
+ null,
102
+ 2
103
+ )}`
104
+ );
105
+ }
106
+ return void 0;
107
+ }
108
+ async function getCatalog(workspaceRoot = _chunkLMYTVXGXjs.findWorkspaceRoot.call(void 0, process.cwd())) {
109
+ const catalog = await getCatalogSafe(workspaceRoot);
110
+ if (!catalog) {
111
+ throw new Error("No catalog entries found in pnpm-workspace.yaml file");
112
+ }
113
+ return catalog;
114
+ }
115
+
116
+ // ../pnpm-tools/src/helpers/replace-deps-aliases.ts
117
+ async function replaceDepsAliases(packageRoot = process.cwd(), workspaceRoot = _chunkLMYTVXGXjs.findWorkspaceRoot.call(void 0, packageRoot)) {
118
+ const packageJsonPath = _chunkCQDBLKPFjs.joinPaths.call(void 0, packageRoot, "package.json");
119
+ const packageJsonFile = await _promises.readFile.call(void 0, packageJsonPath, "utf8");
120
+ if (!packageJsonFile) {
121
+ throw new Error(
122
+ "No package.json file found in package root: " + packageRoot
123
+ );
124
+ }
125
+ const catalog = await getCatalog(workspaceRoot);
126
+ const packageJson = JSON.parse(packageJsonFile);
127
+ const pnpmWorkspacePath = _chunkCQDBLKPFjs.joinPaths.call(void 0, workspaceRoot, "pnpm-workspace.yaml");
128
+ if (!_fs.existsSync.call(void 0, pnpmWorkspacePath)) {
129
+ console.warn(
130
+ `No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${pnpmWorkspacePath}). Skipping pnpm catalog read for now.`
131
+ );
132
+ return packageJson;
133
+ }
134
+ if (!catalog) {
135
+ console.warn(
136
+ `No pnpm catalog found. Skipping dependencies replacement for now.`
137
+ );
138
+ return;
139
+ }
140
+ for (const dependencyType of [
141
+ "dependencies",
142
+ "devDependencies",
143
+ "peerDependencies"
144
+ ]) {
145
+ const dependencies = packageJson[dependencyType];
146
+ if (!dependencies) {
147
+ continue;
148
+ }
149
+ for (const dependencyName of Object.keys(dependencies)) {
150
+ if (dependencies[dependencyName] === "catalog:") {
151
+ if (!catalog) {
152
+ throw new Error(
153
+ `Dependency ${dependencyName} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`
154
+ );
155
+ }
156
+ const catalogVersion = catalog[dependencyName];
157
+ if (!catalogVersion) {
158
+ throw new Error("Missing pnpm catalog version for " + dependencyName);
159
+ }
160
+ dependencies[dependencyName] = catalogVersion;
161
+ } else if (dependencies[dependencyName].startsWith("catalog:")) {
162
+ throw new Error("multiple named catalogs not supported");
163
+ }
164
+ }
165
+ }
166
+ let projectGraph;
167
+ try {
168
+ projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
169
+ } catch (e) {
170
+ await _devkit.createProjectGraphAsync.call(void 0, );
171
+ projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
172
+ }
173
+ const workspacePackages = {};
174
+ if (projectGraph) {
175
+ await Promise.all(
176
+ Object.keys(projectGraph.nodes).map(async (node) => {
177
+ const projectNode = projectGraph.nodes[node];
178
+ if (_optionalChain([projectNode, 'optionalAccess', _6 => _6.data, 'access', _7 => _7.root])) {
179
+ const projectPackageJsonPath = _chunkCQDBLKPFjs.joinPaths.call(void 0,
180
+ workspaceRoot,
181
+ projectNode.data.root,
182
+ "package.json"
183
+ );
184
+ if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
185
+ const projectPackageJsonContent = await _promises.readFile.call(void 0,
186
+ projectPackageJsonPath,
187
+ "utf8"
188
+ );
189
+ const projectPackageJson = JSON.parse(projectPackageJsonContent);
190
+ if (projectPackageJson.private !== true) {
191
+ workspacePackages[projectPackageJson.name] = projectPackageJson.version;
192
+ }
193
+ }
194
+ }
195
+ })
196
+ );
197
+ }
198
+ for (const dependencyType of [
199
+ "dependencies",
200
+ "devDependencies",
201
+ "peerDependencies"
202
+ ]) {
203
+ const dependencies = packageJson[dependencyType];
204
+ if (!dependencies) {
205
+ continue;
206
+ }
207
+ for (const dependencyName of Object.keys(dependencies)) {
208
+ if (dependencies[dependencyName].startsWith("workspace:")) {
209
+ if (workspacePackages[dependencyName]) {
210
+ dependencies[dependencyName] = `^${workspacePackages[dependencyName]}`;
211
+ } else {
212
+ throw new Error(
213
+ `Workspace dependency ${dependencyName} not found in workspace packages.`
214
+ );
215
+ }
216
+ }
217
+ }
218
+ }
219
+ return _promises.writeFile.call(void 0,
220
+ packageJsonPath,
221
+ await _prettier.format.call(void 0, JSON.stringify(packageJson), {
222
+ parser: "json",
223
+ proseWrap: "preserve",
224
+ trailingComma: "none",
225
+ tabWidth: 2,
226
+ semi: true,
227
+ singleQuote: false,
228
+ quoteProps: "as-needed",
229
+ insertPragma: false,
230
+ bracketSameLine: true,
231
+ printWidth: 80,
232
+ bracketSpacing: true,
233
+ arrowParens: "avoid",
234
+ endOfLine: "lf",
235
+ plugins: ["prettier-plugin-packagejson"]
236
+ })
237
+ );
238
+ }
239
+
240
+ // src/executors/npm-publish/executor.ts
241
+
242
+
243
+
244
+ var LARGE_BUFFER = 1024 * 1e6;
245
+ async function npmPublishExecutorFn(options, context) {
246
+ const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
247
+ if (!context.projectName) {
248
+ throw new Error("The `npm-publish` executor requires a `projectName`.");
249
+ }
250
+ const projectConfig = _optionalChain([context, 'access', _8 => _8.projectsConfigurations, 'optionalAccess', _9 => _9.projects, 'optionalAccess', _10 => _10[context.projectName]]);
251
+ if (!projectConfig) {
252
+ throw new Error(
253
+ `Could not find project configuration for \`${context.projectName}\``
254
+ );
255
+ }
256
+ const packageRoot = _chunkCQDBLKPFjs.joinPaths.call(void 0,
257
+ context.root,
258
+ options.packageRoot || _chunkCQDBLKPFjs.joinPaths.call(void 0, "dist", projectConfig.root)
259
+ );
260
+ const projectRoot = _optionalChain([context, 'access', _11 => _11.projectsConfigurations, 'access', _12 => _12.projects, 'access', _13 => _13[context.projectName], 'optionalAccess', _14 => _14.root]) ? _chunkCQDBLKPFjs.joinPaths.call(void 0,
261
+ context.root,
262
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
263
+ context.projectsConfigurations.projects[context.projectName].root
264
+ ) : packageRoot;
265
+ const packageJsonPath = _chunkCQDBLKPFjs.joinPaths.call(void 0, packageRoot, "package.json");
266
+ const packageJsonFile = await _promises.readFile.call(void 0, packageJsonPath, "utf8");
267
+ if (!packageJsonFile) {
268
+ throw new Error(`Could not find \`package.json\` at ${packageJsonPath}`);
269
+ }
270
+ const packageJson = JSON.parse(packageJsonFile);
271
+ const projectPackageJsonPath = _chunkCQDBLKPFjs.joinPaths.call(void 0, projectRoot, "package.json");
272
+ const projectPackageJsonFile = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
273
+ if (!projectPackageJsonFile) {
274
+ throw new Error(
275
+ `Could not find \`package.json\` at ${projectPackageJsonPath}`
276
+ );
277
+ }
278
+ const projectPackageJson = JSON.parse(projectPackageJsonFile);
279
+ if (packageJson.version !== projectPackageJson.version) {
280
+ console.warn(
281
+ `The version in the package.json file at ${packageJsonPath} (current: ${packageJson.version}) does not match the version in the package.json file at ${projectPackageJsonPath} (current: ${projectPackageJson.version}). This file will be updated to match the version in the project package.json file.`
282
+ );
283
+ if (projectPackageJson.version) {
284
+ packageJson.version = projectPackageJson.version;
285
+ await _promises.writeFile.call(void 0,
286
+ packageJsonPath,
287
+ await _prettier.format.call(void 0, JSON.stringify(packageJson), {
288
+ parser: "json",
289
+ proseWrap: "preserve",
290
+ trailingComma: "none",
291
+ tabWidth: 2,
292
+ semi: true,
293
+ singleQuote: false,
294
+ quoteProps: "as-needed",
295
+ insertPragma: false,
296
+ bracketSameLine: true,
297
+ printWidth: 80,
298
+ bracketSpacing: true,
299
+ arrowParens: "avoid",
300
+ endOfLine: "lf",
301
+ plugins: ["prettier-plugin-packagejson"]
302
+ })
303
+ );
304
+ }
305
+ }
306
+ const packageName = packageJson.name;
307
+ console.info(
308
+ `\u{1F680} Running Storm NPM Publish executor on the ${packageName} package`
309
+ );
310
+ const packageTxt = packageName === context.projectName ? `package "${packageName}"` : `package "${packageName}" from project "${context.projectName}"`;
311
+ if (packageJson.private === true) {
312
+ console.warn(
313
+ `Skipped ${packageTxt}, because it has \`"private": true\` in ${packageJsonPath}`
314
+ );
315
+ return { success: true };
316
+ }
317
+ await replaceDepsAliases(packageRoot, context.root);
318
+ await _chunkEFCYTQCAjs.addPackageJsonGitHead.call(void 0, packageRoot);
319
+ const npmPublishCommandSegments = [`npm publish --json`];
320
+ const npmViewCommandSegments = [
321
+ `npm view ${packageName} versions dist-tags --json`
322
+ ];
323
+ const registry = await _asyncNullishCoalesce(options.registry, async () => ( (await getRegistry() || getNpmRegistry())));
324
+ if (registry) {
325
+ npmPublishCommandSegments.push(`--registry="${registry}" `);
326
+ npmViewCommandSegments.push(`--registry="${registry}" `);
327
+ }
328
+ if (options.otp) {
329
+ npmPublishCommandSegments.push(`--otp="${options.otp}" `);
330
+ }
331
+ if (isDryRun) {
332
+ npmPublishCommandSegments.push("--dry-run");
333
+ }
334
+ npmPublishCommandSegments.push("--provenance --access=public ");
335
+ const tag = options.tag || _child_process.execSync.call(void 0, "npm config get tag", {
336
+ cwd: packageRoot,
337
+ env: {
338
+ ...process.env,
339
+ FORCE_COLOR: "true"
340
+ },
341
+ maxBuffer: LARGE_BUFFER,
342
+ killSignal: "SIGTERM"
343
+ }).toString().trim();
344
+ if (tag) {
345
+ npmPublishCommandSegments.push(`--tag="${tag}" `);
346
+ }
347
+ if (!isDryRun) {
348
+ const currentVersion = options.version || packageJson.version;
349
+ try {
350
+ try {
351
+ const result = _child_process.execSync.call(void 0, npmViewCommandSegments.join(" "), {
352
+ cwd: packageRoot,
353
+ env: {
354
+ ...process.env,
355
+ FORCE_COLOR: "true"
356
+ },
357
+ maxBuffer: LARGE_BUFFER,
358
+ killSignal: "SIGTERM"
359
+ });
360
+ const resultJson = JSON.parse(result.toString());
361
+ const distTags = resultJson["dist-tags"] || {};
362
+ if (distTags[tag] === currentVersion) {
363
+ console.warn(
364
+ `Skipped ${packageTxt} because v${currentVersion} already exists in ${registry} with tag "${tag}"`
365
+ );
366
+ return { success: true };
367
+ }
368
+ } catch (err) {
369
+ console.warn("\n ********************** \n");
370
+ console.warn(
371
+ `An error occurred while checking for existing dist-tags
372
+ ${JSON.stringify(err)}
373
+
374
+ Note: If this is the first time this package has been published to NPM, this can be ignored.
375
+
376
+ `
377
+ );
378
+ console.info("");
379
+ }
380
+ try {
381
+ if (!isDryRun) {
382
+ const command = `npm dist-tag add ${packageName}@${currentVersion} ${tag} --registry="${registry}" `;
383
+ console.info(
384
+ `Adding the dist-tag ${tag} - preparing to run the following:
385
+ ${command}
386
+ `
387
+ );
388
+ const result = _child_process.execSync.call(void 0, command, {
389
+ cwd: packageRoot,
390
+ env: {
391
+ ...process.env,
392
+ FORCE_COLOR: "true"
393
+ },
394
+ maxBuffer: LARGE_BUFFER,
395
+ killSignal: "SIGTERM"
396
+ });
397
+ console.info(
398
+ `Added the dist-tag ${tag} to v${currentVersion} for registry "${registry}"
399
+
400
+ Execution response: ${result.toString()}
401
+ `
402
+ );
403
+ } else {
404
+ console.info(
405
+ `Would add the dist-tag ${tag} to v${currentVersion} for registry "${registry}", but [dry-run] was set.
406
+ `
407
+ );
408
+ }
409
+ return { success: true };
410
+ } catch (err) {
411
+ try {
412
+ console.warn("\n ********************** \n");
413
+ let error = err;
414
+ if (Buffer.isBuffer(error)) {
415
+ error = error.toString();
416
+ }
417
+ console.warn(
418
+ `An error occurred while adding dist-tags:
419
+ ${error}
420
+
421
+ Note: If this is the first time this package has been published to NPM, this can be ignored.
422
+
423
+ `
424
+ );
425
+ console.info("");
426
+ const stdoutData = JSON.parse(_optionalChain([err, 'access', _15 => _15.stdout, 'optionalAccess', _16 => _16.toString, 'call', _17 => _17()]) || "{}");
427
+ if (_optionalChain([stdoutData, 'optionalAccess', _18 => _18.error]) && !(_optionalChain([stdoutData, 'access', _19 => _19.error, 'optionalAccess', _20 => _20.code, 'optionalAccess', _21 => _21.includes, 'call', _22 => _22("E404")]) && _optionalChain([stdoutData, 'access', _23 => _23.error, 'optionalAccess', _24 => _24.summary, 'optionalAccess', _25 => _25.includes, 'call', _26 => _26("no such package available")])) && !(_optionalChain([err, 'access', _27 => _27.stderr, 'optionalAccess', _28 => _28.toString, 'call', _29 => _29(), 'access', _30 => _30.includes, 'call', _31 => _31("E404")]) && _optionalChain([err, 'access', _32 => _32.stderr, 'optionalAccess', _33 => _33.toString, 'call', _34 => _34(), 'access', _35 => _35.includes, 'call', _36 => _36("no such package available")]))) {
428
+ console.error(
429
+ "npm dist-tag add error please see below for more information:"
430
+ );
431
+ if (stdoutData.error.summary) {
432
+ console.error(_optionalChain([stdoutData, 'access', _37 => _37.error, 'optionalAccess', _38 => _38.summary]));
433
+ }
434
+ if (stdoutData.error.detail) {
435
+ console.error(_optionalChain([stdoutData, 'access', _39 => _39.error, 'optionalAccess', _40 => _40.detail]));
436
+ }
437
+ if (context.isVerbose) {
438
+ console.error(
439
+ `npm dist-tag add stdout: ${JSON.stringify(stdoutData, null, 2)}`
440
+ );
441
+ }
442
+ return { success: false };
443
+ }
444
+ } catch (err2) {
445
+ console.error(
446
+ `Something unexpected went wrong when processing the npm dist-tag add output
447
+ ${JSON.stringify(err2)}`
448
+ );
449
+ return { success: false };
450
+ }
451
+ }
452
+ } catch (err) {
453
+ let error = err;
454
+ if (Buffer.isBuffer(error)) {
455
+ error = error.toString();
456
+ }
457
+ console.error("\n ********************** \n");
458
+ console.info("");
459
+ console.error(
460
+ "An error occured trying to run the npm dist-tag add command."
461
+ );
462
+ console.error(error);
463
+ console.info("");
464
+ const stdoutData = JSON.parse(_optionalChain([err, 'access', _41 => _41.stdout, 'optionalAccess', _42 => _42.toString, 'call', _43 => _43()]) || "{}");
465
+ if (!(_optionalChain([stdoutData, 'access', _44 => _44.error, 'optionalAccess', _45 => _45.code, 'optionalAccess', _46 => _46.includes, 'call', _47 => _47("E404")]) && _optionalChain([stdoutData, 'access', _48 => _48.error, 'optionalAccess', _49 => _49.summary, 'optionalAccess', _50 => _50.toLowerCase, 'call', _51 => _51(), 'access', _52 => _52.includes, 'call', _53 => _53("not found")])) && !(_optionalChain([err, 'access', _54 => _54.stderr, 'optionalAccess', _55 => _55.toString, 'call', _56 => _56(), 'access', _57 => _57.includes, 'call', _58 => _58("E404")]) && _optionalChain([err, 'access', _59 => _59.stderr, 'optionalAccess', _60 => _60.toString, 'call', _61 => _61(), 'access', _62 => _62.toLowerCase, 'call', _63 => _63(), 'access', _64 => _64.includes, 'call', _65 => _65("not found")]))) {
466
+ console.error(
467
+ `Something unexpected went wrong when checking for existing dist-tags.
468
+
469
+ Error: ${JSON.stringify(err)}
470
+ `
471
+ );
472
+ return { success: false };
473
+ }
474
+ }
475
+ }
476
+ try {
477
+ const cwd = packageRoot;
478
+ const command = npmPublishCommandSegments.join(" ");
479
+ console.info(
480
+ `Running publish command "${command}" in current working directory: "${cwd}" `
481
+ );
482
+ const result = _child_process.execSync.call(void 0, command, {
483
+ cwd,
484
+ env: {
485
+ ...process.env,
486
+ FORCE_COLOR: "true"
487
+ },
488
+ maxBuffer: LARGE_BUFFER,
489
+ killSignal: "SIGTERM"
490
+ });
491
+ if (isDryRun) {
492
+ console.info(
493
+ `Would publish to ${registry} with tag "${tag}", but [dry-run] was set ${result ? `
494
+
495
+ Execution response: ${result.toString()}` : ""}
496
+ `
497
+ );
498
+ } else {
499
+ console.info(`Published to ${registry} with tag "${tag}" ${result ? `
500
+
501
+ Execution response: ${result.toString()}` : ""}
502
+ `);
503
+ }
504
+ return { success: true };
505
+ } catch (err) {
506
+ try {
507
+ console.error("\n ********************** \n");
508
+ console.info("");
509
+ console.error("An error occured running npm publish.");
510
+ console.error("Please see below for more information:");
511
+ console.info("");
512
+ const stdoutData = JSON.parse(_optionalChain([err, 'access', _66 => _66.stdout, 'optionalAccess', _67 => _67.toString, 'call', _68 => _68()]) || "{}");
513
+ if (stdoutData.error.summary) {
514
+ console.error(stdoutData.error.summary);
515
+ console.error(stdoutData.error.summary);
516
+ }
517
+ if (stdoutData.error.detail) {
518
+ console.error(stdoutData.error.detail);
519
+ }
520
+ if (context.isVerbose) {
521
+ console.error(
522
+ `npm publish stdout:
523
+ ${JSON.stringify(stdoutData, null, 2)}`
524
+ );
525
+ }
526
+ console.error("\n ********************** \n");
527
+ return { success: false };
528
+ } catch (err2) {
529
+ let error = err2;
530
+ if (Buffer.isBuffer(error)) {
531
+ error = error.toString();
532
+ }
533
+ console.error(
534
+ `Something unexpected went wrong when processing the npm publish output
535
+
536
+ Error: ${JSON.stringify(error)}
537
+ `
538
+ );
539
+ console.error("\n ********************** \n");
540
+ return { success: false };
541
+ }
542
+ }
543
+ }
544
+
545
+
546
+
547
+
548
+ exports.LARGE_BUFFER = LARGE_BUFFER; exports.npmPublishExecutorFn = npmPublishExecutorFn;
@@ -0,0 +1,32 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunk2DEV7MTDjs = require('./chunk-2DEV7MTD.js');
4
+
5
+
6
+
7
+ var _chunkD2PV33E5js = require('./chunk-D2PV33E5.js');
8
+
9
+ // src/executors/cargo-build/executor.ts
10
+ async function cargoBuildExecutor(options, context) {
11
+ const command = _chunkD2PV33E5js.buildCargoCommand.call(void 0, "build", options, context);
12
+ return await _chunkD2PV33E5js.cargoCommand.call(void 0, context.root, ...command);
13
+ }
14
+ var executor_default = _chunk2DEV7MTDjs.withRunExecutor.call(void 0,
15
+ "Cargo - Build",
16
+ cargoBuildExecutor,
17
+ {
18
+ skipReadingConfig: false,
19
+ hooks: {
20
+ applyDefaultOptions: (options) => {
21
+ options.outputPath ??= "dist/{projectRoot}/target";
22
+ options.toolchain ??= "stable";
23
+ return options;
24
+ }
25
+ }
26
+ }
27
+ );
28
+
29
+
30
+
31
+
32
+ exports.cargoBuildExecutor = cargoBuildExecutor; exports.executor_default = executor_default;
@@ -0,0 +1,79 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
+
3
+
4
+ var _chunkBZMYB75Mjs = require('./chunk-BZMYB75M.js');
5
+
6
+
7
+ var _chunkMS4BPPPOjs = require('./chunk-MS4BPPPO.js');
8
+
9
+
10
+ var _chunkSZWM7COVjs = require('./chunk-SZWM7COV.js');
11
+
12
+
13
+ var _chunkCQDBLKPFjs = require('./chunk-CQDBLKPF.js');
14
+
15
+ // src/generators/node-library/generator.ts
16
+
17
+
18
+
19
+
20
+
21
+ var _devkit = require('@nx/devkit');
22
+ async function nodeLibraryGeneratorFn(tree, schema, config) {
23
+ const filesDir = _chunkCQDBLKPFjs.joinPaths.call(void 0,
24
+ __dirname,
25
+ "src",
26
+ "generators",
27
+ "node-library",
28
+ "files"
29
+ );
30
+ const tsLibraryGeneratorOptions = {
31
+ platform: "node",
32
+ devDependencies: {
33
+ "@types/node": _chunkSZWM7COVjs.typesNodeVersion
34
+ },
35
+ buildExecutor: "@storm-software/workspace-tools:unbuild",
36
+ ...schema,
37
+ directory: schema.directory,
38
+ description: schema.description
39
+ };
40
+ const options = await _chunkBZMYB75Mjs.normalizeOptions.call(void 0, tree, tsLibraryGeneratorOptions);
41
+ const { className, name, propertyName } = _devkit.names.call(void 0, options.name);
42
+ _devkit.generateFiles.call(void 0, tree, filesDir, options.projectRoot, {
43
+ ...schema,
44
+ dot: ".",
45
+ className,
46
+ name,
47
+ namespace: _nullishCoalesce(process.env.STORM_NAMESPACE, () => ( "storm-software")),
48
+ description: _nullishCoalesce(schema.description, () => ( "")),
49
+ propertyName,
50
+ js: !!options.js,
51
+ cliCommand: "nx",
52
+ strict: void 0,
53
+ tmpl: "",
54
+ offsetFromRoot: _devkit.offsetFromRoot.call(void 0, options.projectRoot),
55
+ buildable: options.bundler && options.bundler !== "none",
56
+ hasUnitTestRunner: options.unitTestRunner !== "none"
57
+ });
58
+ await _chunkBZMYB75Mjs.typeScriptLibraryGeneratorFn.call(void 0, tree, tsLibraryGeneratorOptions, config);
59
+ await _devkit.formatFiles.call(void 0, tree);
60
+ return null;
61
+ }
62
+ var generator_default = _chunkMS4BPPPOjs.withRunGenerator.call(void 0,
63
+ "TypeScript Library Creator (NodeJs Platform)",
64
+ nodeLibraryGeneratorFn,
65
+ {
66
+ hooks: {
67
+ applyDefaultOptions: (options) => {
68
+ options.description ??= "A library used by Storm Software to support NodeJs applications";
69
+ options.platform ??= "node";
70
+ return options;
71
+ }
72
+ }
73
+ }
74
+ );
75
+
76
+
77
+
78
+
79
+ exports.nodeLibraryGeneratorFn = nodeLibraryGeneratorFn; exports.generator_default = generator_default;
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
2
2
 
3
+ var _chunkMS4BPPPOjs = require('./chunk-MS4BPPPO.js');
3
4
 
4
- var _chunkSZWM7COVjs = require('./chunk-SZWM7COV.js');
5
5
 
6
6
 
7
- var _chunkMS4BPPPOjs = require('./chunk-MS4BPPPO.js');
7
+ var _chunkSZWM7COVjs = require('./chunk-SZWM7COV.js');
8
8
 
9
9
  // src/generators/preset/generator.ts
10
10
 
@@ -185,7 +185,7 @@ async function presetGeneratorFn(tree, options) {
185
185
  "@storm-software/cspell": "latest",
186
186
  "@storm-software/prettier": "latest",
187
187
  "@taplo/cli": "0.7.0",
188
- "@types/node": "^20.14.10",
188
+ "@types/node": "^25.3.0",
189
189
  copyfiles: "2.4.1",
190
190
  eslint: "9.5.0",
191
191
  jest: "29.7.0",