@storm-software/workspace-tools 1.297.3 → 1.297.5

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 (86) hide show
  1. package/dist/chunk-2Z34TDPM.mjs +328 -0
  2. package/dist/{chunk-7MP6UB5O.mjs → chunk-66BSGJ2T.mjs} +1 -1
  3. package/dist/{chunk-J2GBJI2Q.mjs → chunk-7MEFG7DB.mjs} +1 -1
  4. package/dist/{chunk-MUPYJTR5.mjs → chunk-QEFQEGLM.mjs} +1 -1
  5. package/dist/{chunk-BWQQDCFP.mjs → chunk-QLBSUHOH.mjs} +1 -1
  6. package/dist/chunk-QSQTOZGN.js +328 -0
  7. package/dist/{chunk-4HSMRKXL.mjs → chunk-Y3Q7HHA7.mjs} +1 -1
  8. package/dist/executors.mjs +1 -1
  9. package/dist/generators.mjs +5 -5
  10. package/dist/index.mjs +5 -5
  11. package/dist/src/base/base-executor.mjs +1 -1
  12. package/dist/src/base/base-executor.untyped.mjs +1 -1
  13. package/dist/src/base/base-generator.mjs +1 -1
  14. package/dist/src/base/base-generator.untyped.mjs +1 -1
  15. package/dist/src/base/cargo-base-executor.untyped.mjs +1 -1
  16. package/dist/src/base/index.mjs +1 -1
  17. package/dist/src/base/typescript-build-executor.untyped.mjs +1 -1
  18. package/dist/src/base/typescript-library-generator.untyped.mjs +1 -1
  19. package/dist/src/executors/cargo-build/executor.mjs +1 -1
  20. package/dist/src/executors/cargo-build/untyped.mjs +1 -1
  21. package/dist/src/executors/cargo-check/executor.mjs +1 -1
  22. package/dist/src/executors/cargo-check/untyped.mjs +1 -1
  23. package/dist/src/executors/cargo-clippy/executor.mjs +1 -1
  24. package/dist/src/executors/cargo-clippy/untyped.mjs +1 -1
  25. package/dist/src/executors/cargo-doc/executor.mjs +1 -1
  26. package/dist/src/executors/cargo-doc/untyped.mjs +1 -1
  27. package/dist/src/executors/cargo-format/executor.mjs +1 -1
  28. package/dist/src/executors/cargo-format/untyped.mjs +1 -1
  29. package/dist/src/executors/cargo-publish/executor.mjs +1 -1
  30. package/dist/src/executors/cargo-publish/untyped.mjs +1 -1
  31. package/dist/src/executors/clean-package/executor.mjs +1 -1
  32. package/dist/src/executors/clean-package/untyped.mjs +1 -1
  33. package/dist/src/executors/command-publish/executor.mjs +1 -1
  34. package/dist/src/executors/command-publish/untyped.mjs +1 -1
  35. package/dist/src/executors/esbuild/executor.mjs +1 -1
  36. package/dist/src/executors/esbuild/untyped.mjs +1 -1
  37. package/dist/src/executors/napi/executor.mjs +1 -1
  38. package/dist/src/executors/napi/untyped.mjs +1 -1
  39. package/dist/src/executors/npm-publish/executor.mjs +1 -1
  40. package/dist/src/executors/npm-publish/untyped.mjs +1 -1
  41. package/dist/src/executors/size-limit/executor.mjs +1 -1
  42. package/dist/src/executors/size-limit/untyped.mjs +1 -1
  43. package/dist/src/executors/tsdown/executor.mjs +1 -1
  44. package/dist/src/executors/tsdown/untyped.mjs +1 -1
  45. package/dist/src/executors/typia/executor.mjs +1 -1
  46. package/dist/src/executors/typia/untyped.mjs +1 -1
  47. package/dist/src/executors/unbuild/executor.mjs +1 -1
  48. package/dist/src/executors/unbuild/untyped.mjs +1 -1
  49. package/dist/src/generators/browser-library/generator.mjs +2 -2
  50. package/dist/src/generators/browser-library/untyped.mjs +1 -1
  51. package/dist/src/generators/config-schema/generator.mjs +1 -1
  52. package/dist/src/generators/config-schema/untyped.mjs +1 -1
  53. package/dist/src/generators/init/init.mjs +1 -1
  54. package/dist/src/generators/init/untyped.mjs +1 -1
  55. package/dist/src/generators/neutral-library/generator.mjs +2 -2
  56. package/dist/src/generators/neutral-library/untyped.mjs +1 -1
  57. package/dist/src/generators/node-library/generator.mjs +2 -2
  58. package/dist/src/generators/node-library/untyped.mjs +1 -1
  59. package/dist/src/generators/preset/generator.mjs +2 -2
  60. package/dist/src/generators/preset/untyped.mjs +1 -1
  61. package/dist/src/plugins/rust/cargo-toml.mjs +1 -1
  62. package/dist/src/plugins/rust/index.mjs +1 -1
  63. package/dist/src/plugins/typescript/index.mjs +1 -1
  64. package/dist/src/plugins/typescript/tsdown.mjs +1 -1
  65. package/dist/src/plugins/typescript/tsup.mjs +1 -1
  66. package/dist/src/plugins/typescript/untyped-schema.mjs +1 -1
  67. package/dist/src/release/index.mjs +1 -1
  68. package/dist/src/release/js-version-actions.mjs +1 -1
  69. package/dist/src/release/rust-version-actions.mjs +1 -1
  70. package/dist/src/types.mjs +1 -1
  71. package/dist/src/utils/apply-workspace-tokens.mjs +1 -1
  72. package/dist/src/utils/cargo.mjs +1 -1
  73. package/dist/src/utils/create-cli-options.mjs +1 -1
  74. package/dist/src/utils/get-project-configurations.mjs +1 -1
  75. package/dist/src/utils/github.mjs +1 -1
  76. package/dist/src/utils/index.mjs +1 -1
  77. package/dist/src/utils/lock-file.mjs +1 -1
  78. package/dist/src/utils/nx-json.mjs +1 -1
  79. package/dist/src/utils/package-helpers.mjs +1 -1
  80. package/dist/src/utils/package-manager.mjs +1 -1
  81. package/dist/src/utils/plugin-helpers.mjs +1 -1
  82. package/dist/src/utils/project-tags.mjs +1 -1
  83. package/dist/src/utils/registry-helpers.mjs +1 -1
  84. package/dist/src/utils/typia-transform.mjs +1 -1
  85. package/dist/src/utils/versions.mjs +1 -1
  86. package/package.json +16 -16
@@ -0,0 +1,328 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunkP5OQBBN3js = require('./chunk-P5OQBBN3.js');
4
+
5
+
6
+
7
+ var _chunkVXOPWQTJjs = require('./chunk-VXOPWQTJ.js');
8
+
9
+
10
+ var _chunk3MXZ2RJFjs = require('./chunk-3MXZ2RJF.js');
11
+
12
+
13
+ var _chunkIMY2BU43js = require('./chunk-IMY2BU43.js');
14
+
15
+
16
+ var _chunkCQDBLKPFjs = require('./chunk-CQDBLKPF.js');
17
+
18
+ // src/executors/npm-publish/executor.ts
19
+ var _jiti = require('jiti');
20
+ var _child_process = require('child_process');
21
+ var _promises = require('fs/promises');
22
+ var _prettier = require('prettier');
23
+ var _prettierpluginpackagejson = require('prettier-plugin-packagejson'); var _prettierpluginpackagejson2 = _interopRequireDefault(_prettierpluginpackagejson);
24
+ var LARGE_BUFFER = 1024 * 1e6;
25
+ async function replaceDepsAliases(jiti, packageRoot, workspaceRoot, packageManager) {
26
+ if (packageManager === "bun") {
27
+ const { replaceDepsAliases: replaceBunDepsAliases } = await jiti.import(jiti.esmResolve("@storm-software/bun-tools"));
28
+ return replaceBunDepsAliases(packageRoot, workspaceRoot);
29
+ }
30
+ if (packageManager === "pnpm") {
31
+ const { replaceDepsAliases: replacePnpmDepsAliases } = await jiti.import(jiti.esmResolve("@storm-software/pnpm-tools"));
32
+ return replacePnpmDepsAliases(packageRoot, workspaceRoot);
33
+ }
34
+ }
35
+ async function npmPublishExecutorFn(options, context) {
36
+ const workspaceConfig = await _chunkIMY2BU43js.getConfig.call(void 0, context.root);
37
+ const packageManager = await _chunk3MXZ2RJFjs.getWorkspacePackageManager.call(void 0,
38
+ context.root,
39
+ workspaceConfig
40
+ );
41
+ const github = await _chunkP5OQBBN3js.getGitHubTools.call(void 0, workspaceConfig);
42
+ const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
43
+ if (!context.projectName) {
44
+ github.error("The `npm-publish` executor requires a `projectName`.");
45
+ return { success: false };
46
+ }
47
+ const projectConfig = _optionalChain([context, 'access', _ => _.projectsConfigurations, 'optionalAccess', _2 => _2.projects, 'optionalAccess', _3 => _3[context.projectName]]);
48
+ if (!projectConfig) {
49
+ github.error(
50
+ `Could not find project configuration for \`${context.projectName}\``
51
+ );
52
+ return { success: false };
53
+ }
54
+ const packageRoot = _chunkCQDBLKPFjs.joinPaths.call(void 0,
55
+ context.root,
56
+ options.packageRoot || _chunkCQDBLKPFjs.joinPaths.call(void 0, "dist", projectConfig.root)
57
+ );
58
+ const projectRoot = _optionalChain([context, 'access', _4 => _4.projectsConfigurations, 'access', _5 => _5.projects, 'access', _6 => _6[context.projectName], 'optionalAccess', _7 => _7.root]) ? _chunkCQDBLKPFjs.joinPaths.call(void 0,
59
+ context.root,
60
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
61
+ context.projectsConfigurations.projects[context.projectName].root
62
+ ) : packageRoot;
63
+ const jiti = _jiti.createJiti.call(void 0, context.root, {
64
+ fsCache: _chunkCQDBLKPFjs.joinPaths.call(void 0, context.root, "node_modules/.cache/storm", "jiti"),
65
+ interopDefault: true
66
+ });
67
+ const { getNpmRegistry, getRegistry } = await jiti.import(jiti.esmResolve("@storm-software/npm-tools/helpers"));
68
+ const packageJsonPath = _chunkCQDBLKPFjs.joinPaths.call(void 0, packageRoot, "package.json");
69
+ const packageJsonFile = await _promises.readFile.call(void 0, packageJsonPath, "utf8");
70
+ if (!packageJsonFile) {
71
+ github.error(`Could not find \`package.json\` at ${packageJsonPath}`);
72
+ return { success: false };
73
+ }
74
+ const packageJson = JSON.parse(packageJsonFile);
75
+ const projectPackageJsonPath = _chunkCQDBLKPFjs.joinPaths.call(void 0, projectRoot, "package.json");
76
+ const projectPackageJsonFile = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
77
+ if (!projectPackageJsonFile) {
78
+ github.error(
79
+ `Could not find \`package.json\` at ${projectPackageJsonPath}`
80
+ );
81
+ return { success: false };
82
+ }
83
+ const projectPackageJson = JSON.parse(projectPackageJsonFile);
84
+ if (packageJson.version !== projectPackageJson.version) {
85
+ console.warn(
86
+ `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.`
87
+ );
88
+ if (projectPackageJson.version) {
89
+ packageJson.version = projectPackageJson.version;
90
+ await _promises.writeFile.call(void 0,
91
+ packageJsonPath,
92
+ await _prettier.format.call(void 0, JSON.stringify(packageJson), {
93
+ parser: "json",
94
+ proseWrap: "preserve",
95
+ trailingComma: "none",
96
+ tabWidth: 2,
97
+ semi: true,
98
+ singleQuote: false,
99
+ quoteProps: "as-needed",
100
+ insertPragma: false,
101
+ bracketSameLine: true,
102
+ printWidth: 80,
103
+ bracketSpacing: true,
104
+ arrowParens: "avoid",
105
+ endOfLine: "lf",
106
+ plugins: [_prettierpluginpackagejson2.default]
107
+ })
108
+ );
109
+ }
110
+ }
111
+ const packageName = packageJson.name;
112
+ console.info(
113
+ `\u{1F680} Running Storm NPM Publish executor on the ${packageName} package`
114
+ );
115
+ const packageTxt = packageName === context.projectName ? `package "${packageName}"` : `package "${packageName}" from project "${context.projectName}"`;
116
+ if (packageJson.private === true) {
117
+ console.warn(
118
+ `Skipped ${packageTxt}, because it has \`"private": true\` in ${packageJsonPath}`
119
+ );
120
+ return { success: true };
121
+ }
122
+ const removedPrivateWorkspaceDeps = await _chunkVXOPWQTJjs.stripPrivateWorkspaceDeps.call(void 0,
123
+ packageRoot,
124
+ context.root
125
+ );
126
+ if (removedPrivateWorkspaceDeps.length > 0) {
127
+ console.info(
128
+ `Removed private workspace dependencies from ${packageJsonPath}: ${removedPrivateWorkspaceDeps.join(", ")}`
129
+ );
130
+ }
131
+ await replaceDepsAliases(jiti, packageRoot, context.root, packageManager);
132
+ await _chunkVXOPWQTJjs.addPackageJsonGitHead.call(void 0, packageRoot);
133
+ const npmPublishCommandSegments = [`npm publish --json`];
134
+ const npmViewCommandSegments = [
135
+ `npm view ${packageName} versions dist-tags --json`
136
+ ];
137
+ const registry = await Promise.resolve(
138
+ await _asyncNullishCoalesce(options.registry, async () => ( (await getRegistry() || getNpmRegistry())))
139
+ );
140
+ if (registry) {
141
+ npmPublishCommandSegments.push(`--registry="${registry}" `);
142
+ npmViewCommandSegments.push(`--registry="${registry}" `);
143
+ }
144
+ if (options.otp) {
145
+ npmPublishCommandSegments.push(`--otp="${options.otp}" `);
146
+ }
147
+ let token;
148
+ if (!options.otp && registry) {
149
+ token = await github.getIDToken(
150
+ `npm:${registry.replace(/^https?:\/\//, "")}`
151
+ );
152
+ if (!token) {
153
+ github.warning(
154
+ `Either a One time password (OTP) or an OpenID Connect (OIDC) token is generally required to publish ${packageTxt} to NPM. Usually the OIDC token should be provided automatically via GitHub Actions (see: https://github.com/actions/toolkit/tree/main/packages/core#oidc-token); however, the release process was unable to retrieve it. Please provide a \`otp\` executor option, or investigate why the OIDC token could not be retrieved.`
155
+ );
156
+ }
157
+ }
158
+ npmPublishCommandSegments.push("--provenance --access=public ");
159
+ if (isDryRun) {
160
+ npmPublishCommandSegments.push("--dry-run");
161
+ }
162
+ const tag = options.tag || _child_process.execSync.call(void 0, "npm config get tag", {
163
+ cwd: packageRoot,
164
+ env: {
165
+ NPM_ID_TOKEN: token ? token : void 0,
166
+ ...process.env,
167
+ FORCE_COLOR: "true"
168
+ },
169
+ maxBuffer: LARGE_BUFFER,
170
+ killSignal: "SIGTERM"
171
+ }).toString().trim();
172
+ if (tag) {
173
+ npmPublishCommandSegments.push(`--tag="${tag}" `);
174
+ }
175
+ if (!isDryRun) {
176
+ const currentVersion = options.version || packageJson.version;
177
+ try {
178
+ try {
179
+ const result = _child_process.execSync.call(void 0, npmViewCommandSegments.join(" "), {
180
+ cwd: packageRoot,
181
+ env: {
182
+ NPM_ID_TOKEN: token,
183
+ ...process.env,
184
+ FORCE_COLOR: "true"
185
+ },
186
+ maxBuffer: LARGE_BUFFER,
187
+ killSignal: "SIGTERM"
188
+ });
189
+ const resultJson = JSON.parse(result.toString());
190
+ const distTags = resultJson["dist-tags"] || {};
191
+ if (distTags[tag] === currentVersion) {
192
+ console.warn(
193
+ `Skipped ${packageTxt} because v${currentVersion} already exists in ${registry} with tag "${tag}"`
194
+ );
195
+ return { success: true };
196
+ }
197
+ } catch (err) {
198
+ console.debug(
199
+ `An error occurred while checking for existing dist-tags. Please note: if this is the first time this package has been published to npm, this can be ignored.
200
+
201
+ Error: ${JSON.stringify(
202
+ err,
203
+ null,
204
+ 2
205
+ )}`
206
+ );
207
+ }
208
+ try {
209
+ if (!isDryRun) {
210
+ const command = `npm dist-tag add ${packageName}@${currentVersion} ${tag} --registry="${registry}" `;
211
+ console.debug(
212
+ `Adding the dist-tag ${tag} - preparing to run the following: ${command}`
213
+ );
214
+ const result = _child_process.execSync.call(void 0, command, {
215
+ cwd: packageRoot,
216
+ env: {
217
+ NPM_ID_TOKEN: token,
218
+ ...process.env,
219
+ FORCE_COLOR: "true"
220
+ },
221
+ maxBuffer: LARGE_BUFFER,
222
+ killSignal: "SIGTERM"
223
+ });
224
+ console.info(
225
+ `Added the dist-tag ${tag} to v${currentVersion} for registry "${registry}".
226
+
227
+ Execution response: ${result.toString()}`
228
+ );
229
+ } else {
230
+ console.info(
231
+ `Would have added the dist-tag ${tag} to v${currentVersion} for registry "${registry}", but [dry-run] was set.
232
+ `
233
+ );
234
+ }
235
+ return { success: true };
236
+ } catch (err) {
237
+ try {
238
+ const stdoutData = JSON.parse(_optionalChain([err, 'access', _8 => _8.stdout, 'optionalAccess', _9 => _9.toString, 'call', _10 => _10()]) || "{}");
239
+ if (_optionalChain([stdoutData, 'optionalAccess', _11 => _11.error]) && !(_optionalChain([stdoutData, 'access', _12 => _12.error, 'optionalAccess', _13 => _13.code, 'optionalAccess', _14 => _14.includes, 'call', _15 => _15("E404")]) && _optionalChain([stdoutData, 'access', _16 => _16.error, 'optionalAccess', _17 => _17.summary, 'optionalAccess', _18 => _18.includes, 'call', _19 => _19("no such package available")])) && !(_optionalChain([err, 'access', _20 => _20.stderr, 'optionalAccess', _21 => _21.toString, 'call', _22 => _22(), 'access', _23 => _23.includes, 'call', _24 => _24("E404")]) && _optionalChain([err, 'access', _25 => _25.stderr, 'optionalAccess', _26 => _26.toString, 'call', _27 => _27(), 'access', _28 => _28.includes, 'call', _29 => _29("no such package available")]))) {
240
+ const errorMessage = `An unexpected error occured while running the npm dist-tag add command:
241
+
242
+ ${_optionalChain([stdoutData, 'optionalAccess', _30 => _30.error, 'optionalAccess', _31 => _31.summary]) ? `Summary: ${_optionalChain([stdoutData, 'optionalAccess', _32 => _32.error, 'optionalAccess', _33 => _33.summary])}${_optionalChain([stdoutData, 'optionalAccess', _34 => _34.error, 'optionalAccess', _35 => _35.code]) ? ` (${_optionalChain([stdoutData, 'optionalAccess', _36 => _36.error, 'optionalAccess', _37 => _37.code])})` : ""}
243
+ ` : ""}${_optionalChain([stdoutData, 'optionalAccess', _38 => _38.error, 'optionalAccess', _39 => _39.detail]) ? `Detail: ${_optionalChain([stdoutData, 'optionalAccess', _40 => _40.error, 'optionalAccess', _41 => _41.detail])}
244
+ ` : ""}`;
245
+ github.error(errorMessage);
246
+ return { success: false };
247
+ }
248
+ } catch (err2) {
249
+ const stdoutData = JSON.parse(_optionalChain([err2, 'access', _42 => _42.stdout, 'optionalAccess', _43 => _43.toString, 'call', _44 => _44()]) || "{}");
250
+ const errorMessage = `An unexpected error occured while processing the npm dist-tag add output:
251
+
252
+ ${_optionalChain([stdoutData, 'optionalAccess', _45 => _45.error, 'optionalAccess', _46 => _46.summary]) ? `Summary: ${_optionalChain([stdoutData, 'optionalAccess', _47 => _47.error, 'optionalAccess', _48 => _48.summary])}${_optionalChain([stdoutData, 'optionalAccess', _49 => _49.error, 'optionalAccess', _50 => _50.code]) ? ` (${_optionalChain([stdoutData, 'optionalAccess', _51 => _51.error, 'optionalAccess', _52 => _52.code])})` : ""}
253
+ ` : ""}${_optionalChain([stdoutData, 'optionalAccess', _53 => _53.error, 'optionalAccess', _54 => _54.detail]) ? `Detail: ${_optionalChain([stdoutData, 'optionalAccess', _55 => _55.error, 'optionalAccess', _56 => _56.detail])}
254
+ ` : ""}`;
255
+ github.error(errorMessage);
256
+ return { success: false };
257
+ }
258
+ }
259
+ } catch (err) {
260
+ const stdoutData = JSON.parse(_optionalChain([err, 'access', _57 => _57.stdout, 'optionalAccess', _58 => _58.toString, 'call', _59 => _59()]) || "{}");
261
+ if (!(_optionalChain([stdoutData, 'access', _60 => _60.error, 'optionalAccess', _61 => _61.code, 'optionalAccess', _62 => _62.includes, 'call', _63 => _63("E404")]) && _optionalChain([stdoutData, 'access', _64 => _64.error, 'optionalAccess', _65 => _65.summary, 'optionalAccess', _66 => _66.toLowerCase, 'call', _67 => _67(), 'access', _68 => _68.includes, 'call', _69 => _69("not found")])) && !(_optionalChain([err, 'access', _70 => _70.stderr, 'optionalAccess', _71 => _71.toString, 'call', _72 => _72(), 'access', _73 => _73.includes, 'call', _74 => _74("E404")]) && _optionalChain([err, 'access', _75 => _75.stderr, 'optionalAccess', _76 => _76.toString, 'call', _77 => _77(), 'access', _78 => _78.toLowerCase, 'call', _79 => _79(), 'access', _80 => _80.includes, 'call', _81 => _81("not found")]))) {
262
+ const errorMessage = `An unexpected error occured while checking for existing dist-tags:
263
+
264
+ ${_optionalChain([stdoutData, 'optionalAccess', _82 => _82.error, 'optionalAccess', _83 => _83.summary]) ? `Summary: ${_optionalChain([stdoutData, 'optionalAccess', _84 => _84.error, 'optionalAccess', _85 => _85.summary])}${_optionalChain([stdoutData, 'optionalAccess', _86 => _86.error, 'optionalAccess', _87 => _87.code]) ? ` (${_optionalChain([stdoutData, 'optionalAccess', _88 => _88.error, 'optionalAccess', _89 => _89.code])})` : ""}
265
+ ` : ""}${_optionalChain([stdoutData, 'optionalAccess', _90 => _90.error, 'optionalAccess', _91 => _91.detail]) ? `Detail: ${_optionalChain([stdoutData, 'optionalAccess', _92 => _92.error, 'optionalAccess', _93 => _93.detail])}
266
+ ` : ""}`;
267
+ github.error(errorMessage);
268
+ return { success: false };
269
+ }
270
+ }
271
+ }
272
+ try {
273
+ const cwd = packageRoot;
274
+ const command = npmPublishCommandSegments.join(" ");
275
+ console.info(
276
+ `Running publish command "${command}" in current working directory: "${cwd}" `
277
+ );
278
+ const result = _child_process.execSync.call(void 0, command, {
279
+ cwd,
280
+ env: {
281
+ NPM_ID_TOKEN: token,
282
+ ...process.env,
283
+ FORCE_COLOR: "true"
284
+ },
285
+ maxBuffer: LARGE_BUFFER,
286
+ killSignal: "SIGTERM"
287
+ });
288
+ if (isDryRun) {
289
+ console.info(
290
+ `Would publish tag "${tag}" to ${registry}, but [dry-run] was set. ${result ? `
291
+
292
+ Execution response: ${result.toString()}` : ""}`
293
+ );
294
+ } else {
295
+ console.info(
296
+ `Published tag "${tag}" to ${registry}. ${result ? `
297
+
298
+ Execution response: ${result.toString()}` : ""}`
299
+ );
300
+ }
301
+ return { success: true };
302
+ } catch (err) {
303
+ try {
304
+ const stdoutData = JSON.parse(_optionalChain([err, 'access', _94 => _94.stdout, 'optionalAccess', _95 => _95.toString, 'call', _96 => _96()]) || "{}");
305
+ const errorMessage = `An error occurred while publishing the npm package:
306
+
307
+ ${_optionalChain([stdoutData, 'optionalAccess', _97 => _97.error, 'optionalAccess', _98 => _98.summary]) ? `Summary: ${_optionalChain([stdoutData, 'optionalAccess', _99 => _99.error, 'optionalAccess', _100 => _100.summary])}${_optionalChain([stdoutData, 'optionalAccess', _101 => _101.error, 'optionalAccess', _102 => _102.code]) ? ` (${_optionalChain([stdoutData, 'optionalAccess', _103 => _103.error, 'optionalAccess', _104 => _104.code])})` : ""}
308
+ ` : ""}${_optionalChain([stdoutData, 'optionalAccess', _105 => _105.error, 'optionalAccess', _106 => _106.detail]) ? `Detail: ${_optionalChain([stdoutData, 'optionalAccess', _107 => _107.error, 'optionalAccess', _108 => _108.detail])}
309
+ ` : ""}`;
310
+ github.error(errorMessage);
311
+ return { success: false };
312
+ } catch (err2) {
313
+ const errorMessage = `Something unexpected went wrong when processing the npm publish output.
314
+
315
+ Error: ${JSON.stringify(
316
+ Buffer.isBuffer(err2) ? err2.toString() : err2,
317
+ null,
318
+ 2
319
+ )}`;
320
+ github.error(errorMessage);
321
+ return { success: false };
322
+ }
323
+ }
324
+ }
325
+
326
+
327
+
328
+ exports.npmPublishExecutorFn = npmPublishExecutorFn;
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-TBW5MCN6.mjs";
11
11
  import {
12
12
  __dirname
13
- } from "./chunk-7MP6UB5O.mjs";
13
+ } from "./chunk-66BSGJ2T.mjs";
14
14
 
15
15
  // src/generators/neutral-library/generator.ts
16
16
  import {
@@ -49,7 +49,7 @@ import "./chunk-I4KVL3GR.mjs";
49
49
  import "./chunk-45CW7OJB.mjs";
50
50
  import "./chunk-JUJWJXED.mjs";
51
51
  import "./chunk-TBW5MCN6.mjs";
52
- import "./chunk-7MP6UB5O.mjs";
52
+ import "./chunk-66BSGJ2T.mjs";
53
53
  export {
54
54
  cargoBuildExecutor,
55
55
  cargoCheckExecutor,
@@ -4,16 +4,16 @@ import {
4
4
  } from "./chunk-437WGH2M.mjs";
5
5
  import {
6
6
  neutralLibraryGeneratorFn
7
- } from "./chunk-4HSMRKXL.mjs";
7
+ } from "./chunk-Y3Q7HHA7.mjs";
8
8
  import {
9
9
  nodeLibraryGeneratorFn
10
- } from "./chunk-MUPYJTR5.mjs";
10
+ } from "./chunk-QEFQEGLM.mjs";
11
11
  import {
12
12
  presetGeneratorFn
13
- } from "./chunk-BWQQDCFP.mjs";
13
+ } from "./chunk-QLBSUHOH.mjs";
14
14
  import {
15
15
  browserLibraryGeneratorFn
16
- } from "./chunk-J2GBJI2Q.mjs";
16
+ } from "./chunk-7MEFG7DB.mjs";
17
17
  import {
18
18
  configSchemaGeneratorFn
19
19
  } from "./chunk-EYIUJSGD.mjs";
@@ -27,7 +27,7 @@ import "./chunk-I4KVL3GR.mjs";
27
27
  import "./chunk-45CW7OJB.mjs";
28
28
  import "./chunk-JUJWJXED.mjs";
29
29
  import "./chunk-TBW5MCN6.mjs";
30
- import "./chunk-7MP6UB5O.mjs";
30
+ import "./chunk-66BSGJ2T.mjs";
31
31
  export {
32
32
  browserLibraryGeneratorFn,
33
33
  configSchemaGeneratorFn,
package/dist/index.mjs CHANGED
@@ -113,16 +113,16 @@ import {
113
113
  } from "./chunk-437WGH2M.mjs";
114
114
  import {
115
115
  neutralLibraryGeneratorFn
116
- } from "./chunk-4HSMRKXL.mjs";
116
+ } from "./chunk-Y3Q7HHA7.mjs";
117
117
  import {
118
118
  nodeLibraryGeneratorFn
119
- } from "./chunk-MUPYJTR5.mjs";
119
+ } from "./chunk-QEFQEGLM.mjs";
120
120
  import {
121
121
  presetGeneratorFn
122
- } from "./chunk-BWQQDCFP.mjs";
122
+ } from "./chunk-QLBSUHOH.mjs";
123
123
  import {
124
124
  browserLibraryGeneratorFn
125
- } from "./chunk-J2GBJI2Q.mjs";
125
+ } from "./chunk-7MEFG7DB.mjs";
126
126
  import {
127
127
  configSchemaGeneratorFn
128
128
  } from "./chunk-EYIUJSGD.mjs";
@@ -210,7 +210,7 @@ import "./chunk-TBW5MCN6.mjs";
210
210
  import {
211
211
  base_generator_untyped_default
212
212
  } from "./chunk-34LSWMWV.mjs";
213
- import "./chunk-7MP6UB5O.mjs";
213
+ import "./chunk-66BSGJ2T.mjs";
214
214
  export {
215
215
  BUN_LOCK_FILE,
216
216
  BUN_LOCK_PATH,
@@ -6,7 +6,7 @@ import "../../chunk-I4KVL3GR.mjs";
6
6
  import "../../chunk-45CW7OJB.mjs";
7
7
  import "../../chunk-JUJWJXED.mjs";
8
8
  import "../../chunk-TBW5MCN6.mjs";
9
- import "../../chunk-7MP6UB5O.mjs";
9
+ import "../../chunk-66BSGJ2T.mjs";
10
10
  export {
11
11
  withRunExecutor
12
12
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  base_executor_untyped_default
3
3
  } from "../../chunk-ZCTECGQS.mjs";
4
- import "../../chunk-7MP6UB5O.mjs";
4
+ import "../../chunk-66BSGJ2T.mjs";
5
5
  export {
6
6
  base_executor_untyped_default as default
7
7
  };
@@ -6,7 +6,7 @@ import "../../chunk-I4KVL3GR.mjs";
6
6
  import "../../chunk-45CW7OJB.mjs";
7
7
  import "../../chunk-JUJWJXED.mjs";
8
8
  import "../../chunk-TBW5MCN6.mjs";
9
- import "../../chunk-7MP6UB5O.mjs";
9
+ import "../../chunk-66BSGJ2T.mjs";
10
10
  export {
11
11
  withRunGenerator
12
12
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  base_generator_untyped_default
3
3
  } from "../../chunk-34LSWMWV.mjs";
4
- import "../../chunk-7MP6UB5O.mjs";
4
+ import "../../chunk-66BSGJ2T.mjs";
5
5
  export {
6
6
  base_generator_untyped_default as default
7
7
  };
@@ -2,7 +2,7 @@ import {
2
2
  cargo_base_executor_untyped_default
3
3
  } from "../../chunk-QQB6GFYM.mjs";
4
4
  import "../../chunk-ZCTECGQS.mjs";
5
- import "../../chunk-7MP6UB5O.mjs";
5
+ import "../../chunk-66BSGJ2T.mjs";
6
6
  export {
7
7
  cargo_base_executor_untyped_default as default
8
8
  };
@@ -33,7 +33,7 @@ import "../../chunk-TBW5MCN6.mjs";
33
33
  import {
34
34
  base_generator_untyped_default
35
35
  } from "../../chunk-34LSWMWV.mjs";
36
- import "../../chunk-7MP6UB5O.mjs";
36
+ import "../../chunk-66BSGJ2T.mjs";
37
37
  export {
38
38
  base_executor_untyped_default as baseExecutorSchema,
39
39
  base_generator_untyped_default as baseGeneratorSchema,
@@ -2,7 +2,7 @@ import {
2
2
  typescript_build_executor_untyped_default
3
3
  } from "../../chunk-LZ3H2OH5.mjs";
4
4
  import "../../chunk-ZCTECGQS.mjs";
5
- import "../../chunk-7MP6UB5O.mjs";
5
+ import "../../chunk-66BSGJ2T.mjs";
6
6
  export {
7
7
  typescript_build_executor_untyped_default as default
8
8
  };
@@ -2,7 +2,7 @@ import {
2
2
  typescript_library_generator_untyped_default
3
3
  } from "../../chunk-SW2E5MQJ.mjs";
4
4
  import "../../chunk-34LSWMWV.mjs";
5
- import "../../chunk-7MP6UB5O.mjs";
5
+ import "../../chunk-66BSGJ2T.mjs";
6
6
  export {
7
7
  typescript_library_generator_untyped_default as default
8
8
  };
@@ -10,7 +10,7 @@ import "../../../chunk-I4KVL3GR.mjs";
10
10
  import "../../../chunk-45CW7OJB.mjs";
11
11
  import "../../../chunk-JUJWJXED.mjs";
12
12
  import "../../../chunk-TBW5MCN6.mjs";
13
- import "../../../chunk-7MP6UB5O.mjs";
13
+ import "../../../chunk-66BSGJ2T.mjs";
14
14
  export {
15
15
  cargoBuildExecutor,
16
16
  executor_default as default
@@ -2,7 +2,7 @@ import {
2
2
  cargo_base_executor_untyped_default
3
3
  } from "../../../chunk-QQB6GFYM.mjs";
4
4
  import "../../../chunk-ZCTECGQS.mjs";
5
- import "../../../chunk-7MP6UB5O.mjs";
5
+ import "../../../chunk-66BSGJ2T.mjs";
6
6
 
7
7
  // src/executors/cargo-build/untyped.ts
8
8
  import { defineUntypedSchema } from "untyped";
@@ -10,7 +10,7 @@ import "../../../chunk-I4KVL3GR.mjs";
10
10
  import "../../../chunk-45CW7OJB.mjs";
11
11
  import "../../../chunk-JUJWJXED.mjs";
12
12
  import "../../../chunk-TBW5MCN6.mjs";
13
- import "../../../chunk-7MP6UB5O.mjs";
13
+ import "../../../chunk-66BSGJ2T.mjs";
14
14
  export {
15
15
  cargoCheckExecutor,
16
16
  executor_default as default
@@ -2,7 +2,7 @@ import {
2
2
  cargo_base_executor_untyped_default
3
3
  } from "../../../chunk-QQB6GFYM.mjs";
4
4
  import "../../../chunk-ZCTECGQS.mjs";
5
- import "../../../chunk-7MP6UB5O.mjs";
5
+ import "../../../chunk-66BSGJ2T.mjs";
6
6
 
7
7
  // src/executors/cargo-check/untyped.ts
8
8
  import { defineUntypedSchema } from "untyped";
@@ -10,7 +10,7 @@ import "../../../chunk-I4KVL3GR.mjs";
10
10
  import "../../../chunk-45CW7OJB.mjs";
11
11
  import "../../../chunk-JUJWJXED.mjs";
12
12
  import "../../../chunk-TBW5MCN6.mjs";
13
- import "../../../chunk-7MP6UB5O.mjs";
13
+ import "../../../chunk-66BSGJ2T.mjs";
14
14
  export {
15
15
  cargoClippyExecutor,
16
16
  executor_default as default
@@ -2,7 +2,7 @@ import {
2
2
  cargo_base_executor_untyped_default
3
3
  } from "../../../chunk-QQB6GFYM.mjs";
4
4
  import "../../../chunk-ZCTECGQS.mjs";
5
- import "../../../chunk-7MP6UB5O.mjs";
5
+ import "../../../chunk-66BSGJ2T.mjs";
6
6
 
7
7
  // src/executors/cargo-clippy/untyped.ts
8
8
  import { defineUntypedSchema } from "untyped";
@@ -10,7 +10,7 @@ import "../../../chunk-I4KVL3GR.mjs";
10
10
  import "../../../chunk-45CW7OJB.mjs";
11
11
  import "../../../chunk-JUJWJXED.mjs";
12
12
  import "../../../chunk-TBW5MCN6.mjs";
13
- import "../../../chunk-7MP6UB5O.mjs";
13
+ import "../../../chunk-66BSGJ2T.mjs";
14
14
  export {
15
15
  cargoDocExecutor,
16
16
  executor_default as default
@@ -2,7 +2,7 @@ import {
2
2
  cargo_base_executor_untyped_default
3
3
  } from "../../../chunk-QQB6GFYM.mjs";
4
4
  import "../../../chunk-ZCTECGQS.mjs";
5
- import "../../../chunk-7MP6UB5O.mjs";
5
+ import "../../../chunk-66BSGJ2T.mjs";
6
6
 
7
7
  // src/executors/cargo-doc/untyped.ts
8
8
  import { defineUntypedSchema } from "untyped";
@@ -10,7 +10,7 @@ import "../../../chunk-I4KVL3GR.mjs";
10
10
  import "../../../chunk-45CW7OJB.mjs";
11
11
  import "../../../chunk-JUJWJXED.mjs";
12
12
  import "../../../chunk-TBW5MCN6.mjs";
13
- import "../../../chunk-7MP6UB5O.mjs";
13
+ import "../../../chunk-66BSGJ2T.mjs";
14
14
  export {
15
15
  cargoFormatExecutor,
16
16
  executor_default as default
@@ -2,7 +2,7 @@ import {
2
2
  cargo_base_executor_untyped_default
3
3
  } from "../../../chunk-QQB6GFYM.mjs";
4
4
  import "../../../chunk-ZCTECGQS.mjs";
5
- import "../../../chunk-7MP6UB5O.mjs";
5
+ import "../../../chunk-66BSGJ2T.mjs";
6
6
 
7
7
  // src/executors/cargo-format/untyped.ts
8
8
  import { defineUntypedSchema } from "untyped";
@@ -4,7 +4,7 @@ import {
4
4
  } from "../../../chunk-QQ64FCAP.mjs";
5
5
  import "../../../chunk-UA33NH5O.mjs";
6
6
  import "../../../chunk-45CW7OJB.mjs";
7
- import "../../../chunk-7MP6UB5O.mjs";
7
+ import "../../../chunk-66BSGJ2T.mjs";
8
8
  export {
9
9
  runExecutor as default,
10
10
  getRegistryVersion
@@ -2,7 +2,7 @@ import {
2
2
  cargo_base_executor_untyped_default
3
3
  } from "../../../chunk-QQB6GFYM.mjs";
4
4
  import "../../../chunk-ZCTECGQS.mjs";
5
- import "../../../chunk-7MP6UB5O.mjs";
5
+ import "../../../chunk-66BSGJ2T.mjs";
6
6
 
7
7
  // src/executors/cargo-publish/untyped.ts
8
8
  import { defineUntypedSchema } from "untyped";
@@ -10,7 +10,7 @@ import "../../../chunk-JUJWJXED.mjs";
10
10
  import {
11
11
  joinPaths
12
12
  } from "../../../chunk-TBW5MCN6.mjs";
13
- import "../../../chunk-7MP6UB5O.mjs";
13
+ import "../../../chunk-66BSGJ2T.mjs";
14
14
 
15
15
  // src/executors/clean-package/executor.ts
16
16
  import { joinPathFragments } from "@nx/devkit";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  base_executor_untyped_default
3
3
  } from "../../../chunk-ZCTECGQS.mjs";
4
- import "../../../chunk-7MP6UB5O.mjs";
4
+ import "../../../chunk-66BSGJ2T.mjs";
5
5
 
6
6
  // src/executors/clean-package/untyped.ts
7
7
  import { defineUntypedSchema } from "untyped";
@@ -2,7 +2,7 @@ import {
2
2
  commandPublishExecutorFn
3
3
  } from "../../../chunk-52ZDVDIY.mjs";
4
4
  import "../../../chunk-TBW5MCN6.mjs";
5
- import "../../../chunk-7MP6UB5O.mjs";
5
+ import "../../../chunk-66BSGJ2T.mjs";
6
6
  export {
7
7
  commandPublishExecutorFn as default
8
8
  };