@storm-software/workspace-tools 1.295.87 → 1.296.3

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 (109) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-OBATTMGC.mjs → chunk-3WCWA5OH.mjs} +1 -1
  3. package/dist/chunk-54BBSJHK.mjs +40 -0
  4. package/dist/{chunk-SGI4JCLV.js → chunk-A74N7OF2.js} +81 -97
  5. package/dist/{chunk-GTBTSMUH.mjs → chunk-C3NYIWL4.mjs} +1 -1
  6. package/dist/{chunk-FPNWNZUL.mjs → chunk-J4MHHL63.mjs} +1 -1
  7. package/dist/{chunk-RCSUK5YZ.mjs → chunk-JIWQM3MH.mjs} +1 -1
  8. package/dist/chunk-MKJITWLN.js +40 -0
  9. package/dist/{chunk-HECOVC7R.mjs → chunk-NIETCJS4.mjs} +1 -1
  10. package/dist/{chunk-GCDDSEDG.mjs → chunk-VY3EJCTI.mjs} +76 -92
  11. package/dist/{executor-0ivVjqma.d.mts → executor-BF7_LjrR.d.mts} +4 -4
  12. package/dist/{executor-0ivVjqma.d.ts → executor-BF7_LjrR.d.ts} +4 -4
  13. package/dist/executors.d.mts +1 -1
  14. package/dist/executors.d.ts +1 -1
  15. package/dist/executors.js +3 -2
  16. package/dist/executors.mjs +3 -2
  17. package/dist/generators.mjs +5 -5
  18. package/dist/index.d.mts +2 -1
  19. package/dist/index.d.ts +2 -1
  20. package/dist/index.js +13 -9
  21. package/dist/index.mjs +18 -14
  22. package/dist/src/base/base-executor.mjs +1 -1
  23. package/dist/src/base/base-executor.untyped.mjs +1 -1
  24. package/dist/src/base/base-generator.mjs +1 -1
  25. package/dist/src/base/base-generator.untyped.mjs +1 -1
  26. package/dist/src/base/cargo-base-executor.untyped.mjs +1 -1
  27. package/dist/src/base/index.mjs +1 -1
  28. package/dist/src/base/typescript-build-executor.untyped.mjs +1 -1
  29. package/dist/src/base/typescript-library-generator.untyped.mjs +1 -1
  30. package/dist/src/executors/cargo-build/executor.mjs +1 -1
  31. package/dist/src/executors/cargo-build/untyped.mjs +1 -1
  32. package/dist/src/executors/cargo-check/executor.mjs +1 -1
  33. package/dist/src/executors/cargo-check/untyped.mjs +1 -1
  34. package/dist/src/executors/cargo-clippy/executor.mjs +1 -1
  35. package/dist/src/executors/cargo-clippy/untyped.mjs +1 -1
  36. package/dist/src/executors/cargo-doc/executor.mjs +1 -1
  37. package/dist/src/executors/cargo-doc/untyped.mjs +1 -1
  38. package/dist/src/executors/cargo-format/executor.mjs +1 -1
  39. package/dist/src/executors/cargo-format/untyped.mjs +1 -1
  40. package/dist/src/executors/cargo-publish/executor.mjs +1 -1
  41. package/dist/src/executors/cargo-publish/untyped.mjs +1 -1
  42. package/dist/src/executors/clean-package/executor.mjs +1 -1
  43. package/dist/src/executors/clean-package/untyped.mjs +1 -1
  44. package/dist/src/executors/esbuild/executor.mjs +1 -1
  45. package/dist/src/executors/esbuild/untyped.mjs +1 -1
  46. package/dist/src/executors/napi/executor.mjs +1 -1
  47. package/dist/src/executors/napi/untyped.mjs +1 -1
  48. package/dist/src/executors/npm-publish/executor.d.mts +1 -1
  49. package/dist/src/executors/npm-publish/executor.d.ts +1 -1
  50. package/dist/src/executors/npm-publish/executor.js +3 -2
  51. package/dist/src/executors/npm-publish/executor.mjs +3 -2
  52. package/dist/src/executors/npm-publish/schema.d.ts +4 -4
  53. package/dist/src/executors/npm-publish/schema.json +4 -4
  54. package/dist/src/executors/npm-publish/untyped.js +4 -4
  55. package/dist/src/executors/npm-publish/untyped.mjs +5 -5
  56. package/dist/src/executors/size-limit/executor.mjs +1 -1
  57. package/dist/src/executors/size-limit/untyped.mjs +1 -1
  58. package/dist/src/executors/tsdown/executor.mjs +1 -1
  59. package/dist/src/executors/tsdown/untyped.mjs +1 -1
  60. package/dist/src/executors/typia/executor.mjs +1 -1
  61. package/dist/src/executors/typia/untyped.mjs +1 -1
  62. package/dist/src/executors/unbuild/executor.mjs +1 -1
  63. package/dist/src/executors/unbuild/untyped.mjs +1 -1
  64. package/dist/src/generators/browser-library/generator.mjs +2 -2
  65. package/dist/src/generators/browser-library/untyped.mjs +1 -1
  66. package/dist/src/generators/config-schema/generator.mjs +1 -1
  67. package/dist/src/generators/config-schema/untyped.mjs +1 -1
  68. package/dist/src/generators/init/init.mjs +1 -1
  69. package/dist/src/generators/init/untyped.mjs +1 -1
  70. package/dist/src/generators/neutral-library/generator.mjs +2 -2
  71. package/dist/src/generators/neutral-library/untyped.mjs +1 -1
  72. package/dist/src/generators/node-library/generator.mjs +2 -2
  73. package/dist/src/generators/node-library/untyped.mjs +1 -1
  74. package/dist/src/generators/preset/generator.mjs +2 -2
  75. package/dist/src/generators/preset/untyped.mjs +1 -1
  76. package/dist/src/plugins/rust/cargo-toml.mjs +1 -1
  77. package/dist/src/plugins/rust/index.mjs +1 -1
  78. package/dist/src/plugins/typescript/index.mjs +1 -1
  79. package/dist/src/plugins/typescript/tsdown.mjs +1 -1
  80. package/dist/src/plugins/typescript/tsup.mjs +1 -1
  81. package/dist/src/plugins/typescript/untyped-schema.mjs +1 -1
  82. package/dist/src/release/index.mjs +1 -1
  83. package/dist/src/release/js-version-actions.mjs +1 -1
  84. package/dist/src/release/rust-version-actions.mjs +1 -1
  85. package/dist/src/types.mjs +1 -1
  86. package/dist/src/utils/apply-workspace-tokens.mjs +1 -1
  87. package/dist/src/utils/cargo.mjs +1 -1
  88. package/dist/src/utils/create-cli-options.mjs +1 -1
  89. package/dist/src/utils/get-project-configurations.mjs +1 -1
  90. package/dist/src/utils/github.d.mts +19 -0
  91. package/dist/src/utils/github.d.ts +19 -0
  92. package/dist/src/utils/github.js +7 -0
  93. package/dist/src/utils/github.mjs +8 -0
  94. package/dist/src/utils/index.d.mts +4 -0
  95. package/dist/src/utils/index.d.ts +4 -0
  96. package/dist/src/utils/index.js +12 -8
  97. package/dist/src/utils/index.mjs +13 -9
  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/docs/api/executors/npm-publish/schema.md +4 -4
  107. package/package.json +16 -15
  108. /package/dist/{chunk-JGP4YWZY.js → chunk-DO2X7OZO.js} +0 -0
  109. /package/dist/{chunk-6YZ3OUJB.mjs → chunk-XCVH63OO.mjs} +0 -0
package/README.md CHANGED
@@ -27,7 +27,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
27
27
 
28
28
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
29
29
 
30
- [![Version](https://img.shields.io/badge/version-1.295.84-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
30
+ [![Version](https://img.shields.io/badge/version-1.295.87-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
31
 
32
32
  <!-- prettier-ignore-start -->
33
33
  <!-- markdownlint-disable -->
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-TBW5MCN6.mjs";
11
11
  import {
12
12
  __dirname
13
- } from "./chunk-GTBTSMUH.mjs";
13
+ } from "./chunk-C3NYIWL4.mjs";
14
14
 
15
15
  // src/generators/browser-library/generator.ts
16
16
  import {
@@ -0,0 +1,40 @@
1
+ import {
2
+ joinPaths
3
+ } from "./chunk-TBW5MCN6.mjs";
4
+
5
+ // src/utils/github.ts
6
+ import { createJiti } from "jiti";
7
+ async function getGitHubTools(workspaceConfig) {
8
+ try {
9
+ const jiti = createJiti(workspaceConfig.workspaceRoot, {
10
+ fsCache: workspaceConfig.skipCache ? false : joinPaths(
11
+ workspaceConfig.workspaceRoot,
12
+ workspaceConfig.directories.cache || "node_modules/.cache/storm",
13
+ "jiti"
14
+ ),
15
+ interopDefault: true
16
+ });
17
+ const core = await jiti.import(
18
+ jiti.esmResolve("@actions/core")
19
+ );
20
+ return {
21
+ error: core.error,
22
+ warning: core.warning,
23
+ info: core.info,
24
+ getIDToken: core.getIDToken
25
+ };
26
+ } catch {
27
+ return {
28
+ error: (message) => console.error(message),
29
+ warning: (message) => console.warn(message),
30
+ info: (message) => console.log(message),
31
+ getIDToken: async () => {
32
+ throw new Error("getIDToken is not supported in this environment");
33
+ }
34
+ };
35
+ }
36
+ }
37
+
38
+ export {
39
+ getGitHubTools
40
+ };
@@ -1,5 +1,8 @@
1
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
2
 
3
+ var _chunkMKJITWLNjs = require('./chunk-MKJITWLN.js');
4
+
5
+
3
6
  var _chunk6IXJEWJRjs = require('./chunk-6IXJEWJR.js');
4
7
 
5
8
 
@@ -243,15 +246,19 @@ async function replaceDepsAliases(packageRoot = process.cwd(), workspaceRoot = _
243
246
 
244
247
  var LARGE_BUFFER = 1024 * 1e6;
245
248
  async function npmPublishExecutorFn(options, context) {
249
+ const workspaceConfig = await _chunkCQIILJEFjs.getConfig.call(void 0, context.root);
250
+ const github = await _chunkMKJITWLNjs.getGitHubTools.call(void 0, workspaceConfig);
246
251
  const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
247
252
  if (!context.projectName) {
248
- throw new Error("The `npm-publish` executor requires a `projectName`.");
253
+ github.error("The `npm-publish` executor requires a `projectName`.");
254
+ return { success: false };
249
255
  }
250
256
  const projectConfig = _optionalChain([context, 'access', _8 => _8.projectsConfigurations, 'optionalAccess', _9 => _9.projects, 'optionalAccess', _10 => _10[context.projectName]]);
251
257
  if (!projectConfig) {
252
- throw new Error(
258
+ github.error(
253
259
  `Could not find project configuration for \`${context.projectName}\``
254
260
  );
261
+ return { success: false };
255
262
  }
256
263
  const packageRoot = _chunkCQDBLKPFjs.joinPaths.call(void 0,
257
264
  context.root,
@@ -265,15 +272,17 @@ async function npmPublishExecutorFn(options, context) {
265
272
  const packageJsonPath = _chunkCQDBLKPFjs.joinPaths.call(void 0, packageRoot, "package.json");
266
273
  const packageJsonFile = await _promises.readFile.call(void 0, packageJsonPath, "utf8");
267
274
  if (!packageJsonFile) {
268
- throw new Error(`Could not find \`package.json\` at ${packageJsonPath}`);
275
+ github.error(`Could not find \`package.json\` at ${packageJsonPath}`);
276
+ return { success: false };
269
277
  }
270
278
  const packageJson = JSON.parse(packageJsonFile);
271
279
  const projectPackageJsonPath = _chunkCQDBLKPFjs.joinPaths.call(void 0, projectRoot, "package.json");
272
280
  const projectPackageJsonFile = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
273
281
  if (!projectPackageJsonFile) {
274
- throw new Error(
282
+ github.error(
275
283
  `Could not find \`package.json\` at ${projectPackageJsonPath}`
276
284
  );
285
+ return { success: false };
277
286
  }
278
287
  const projectPackageJson = JSON.parse(projectPackageJsonFile);
279
288
  if (packageJson.version !== projectPackageJson.version) {
@@ -320,7 +329,9 @@ async function npmPublishExecutorFn(options, context) {
320
329
  const npmViewCommandSegments = [
321
330
  `npm view ${packageName} versions dist-tags --json`
322
331
  ];
323
- const registry = await _asyncNullishCoalesce(options.registry, async () => ( (await getRegistry() || getNpmRegistry())));
332
+ const registry = await Promise.resolve(
333
+ await _asyncNullishCoalesce(options.registry, async () => ( (await getRegistry() || getNpmRegistry())))
334
+ );
324
335
  if (registry) {
325
336
  npmPublishCommandSegments.push(`--registry="${registry}" `);
326
337
  npmViewCommandSegments.push(`--registry="${registry}" `);
@@ -328,13 +339,25 @@ async function npmPublishExecutorFn(options, context) {
328
339
  if (options.otp) {
329
340
  npmPublishCommandSegments.push(`--otp="${options.otp}" `);
330
341
  }
342
+ let token;
343
+ if (!options.otp) {
344
+ token = await github.getIDToken(
345
+ `npm:${registry.replace(/^https?:\/\//, "")}`
346
+ );
347
+ if (!token) {
348
+ github.warning(
349
+ `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.`
350
+ );
351
+ }
352
+ }
353
+ npmPublishCommandSegments.push("--provenance --access=public ");
331
354
  if (isDryRun) {
332
355
  npmPublishCommandSegments.push("--dry-run");
333
356
  }
334
- npmPublishCommandSegments.push("--provenance --access=public ");
335
357
  const tag = options.tag || _child_process.execSync.call(void 0, "npm config get tag", {
336
358
  cwd: packageRoot,
337
359
  env: {
360
+ NPM_ID_TOKEN: token,
338
361
  ...process.env,
339
362
  FORCE_COLOR: "true"
340
363
  },
@@ -351,6 +374,7 @@ async function npmPublishExecutorFn(options, context) {
351
374
  const result = _child_process.execSync.call(void 0, npmViewCommandSegments.join(" "), {
352
375
  cwd: packageRoot,
353
376
  env: {
377
+ NPM_ID_TOKEN: token,
354
378
  ...process.env,
355
379
  FORCE_COLOR: "true"
356
380
  },
@@ -366,25 +390,26 @@ async function npmPublishExecutorFn(options, context) {
366
390
  return { success: true };
367
391
  }
368
392
  } 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.`
393
+ console.debug(
394
+ `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.
395
+
396
+ Error: ${JSON.stringify(
397
+ err,
398
+ null,
399
+ 2
400
+ )}`
375
401
  );
376
- console.info("");
377
402
  }
378
403
  try {
379
404
  if (!isDryRun) {
380
405
  const command = `npm dist-tag add ${packageName}@${currentVersion} ${tag} --registry="${registry}" `;
381
- console.info(
382
- `Adding the dist-tag ${tag} - preparing to run the following:
383
- ${command}`
406
+ console.debug(
407
+ `Adding the dist-tag ${tag} - preparing to run the following: ${command}`
384
408
  );
385
409
  const result = _child_process.execSync.call(void 0, command, {
386
410
  cwd: packageRoot,
387
411
  env: {
412
+ NPM_ID_TOKEN: token,
388
413
  ...process.env,
389
414
  FORCE_COLOR: "true"
390
415
  },
@@ -392,76 +417,49 @@ ${command}`
392
417
  killSignal: "SIGTERM"
393
418
  });
394
419
  console.info(
395
- `Added the dist-tag ${tag} to v${currentVersion} for registry "${registry}"
420
+ `Added the dist-tag ${tag} to v${currentVersion} for registry "${registry}".
396
421
 
397
422
  Execution response: ${result.toString()}`
398
423
  );
399
424
  } else {
400
425
  console.info(
401
- `Would add the dist-tag ${tag} to v${currentVersion} for registry "${registry}", but [dry-run] was set.
426
+ `Would have added the dist-tag ${tag} to v${currentVersion} for registry "${registry}", but [dry-run] was set.
402
427
  `
403
428
  );
404
429
  }
405
430
  return { success: true };
406
431
  } catch (err) {
407
432
  try {
408
- console.warn("\n ********************** \n");
409
- let error = err;
410
- if (Buffer.isBuffer(error)) {
411
- error = error.toString();
412
- }
413
- console.warn(
414
- `An error occurred while adding dist-tags:
415
- ${error}
416
-
417
- Note: If this is the first time this package has been published to NPM, this can be ignored.`
418
- );
419
- console.info("");
420
433
  const stdoutData = JSON.parse(_optionalChain([err, 'access', _15 => _15.stdout, 'optionalAccess', _16 => _16.toString, 'call', _17 => _17()]) || "{}");
421
434
  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")]))) {
422
- console.error(
423
- "npm dist-tag add error please see below for more information:"
424
- );
425
- if (stdoutData.error.summary) {
426
- console.error(_optionalChain([stdoutData, 'access', _37 => _37.error, 'optionalAccess', _38 => _38.summary]));
427
- }
428
- if (stdoutData.error.detail) {
429
- console.error(_optionalChain([stdoutData, 'access', _39 => _39.error, 'optionalAccess', _40 => _40.detail]));
430
- }
431
- if (context.isVerbose) {
432
- console.error(
433
- `npm dist-tag add stdout: ${JSON.stringify(stdoutData, null, 2)}`
434
- );
435
- }
435
+ const errorMessage = `An unexpected error occured while running the npm dist-tag add command:
436
+
437
+ ${_optionalChain([stdoutData, 'optionalAccess', _37 => _37.error, 'optionalAccess', _38 => _38.summary]) ? `Summary: ${_optionalChain([stdoutData, 'optionalAccess', _39 => _39.error, 'optionalAccess', _40 => _40.summary])}${_optionalChain([stdoutData, 'optionalAccess', _41 => _41.error, 'optionalAccess', _42 => _42.code]) ? ` (${_optionalChain([stdoutData, 'optionalAccess', _43 => _43.error, 'optionalAccess', _44 => _44.code])})` : ""}
438
+ ` : ""}${_optionalChain([stdoutData, 'optionalAccess', _45 => _45.error, 'optionalAccess', _46 => _46.detail]) ? `Detail: ${_optionalChain([stdoutData, 'optionalAccess', _47 => _47.error, 'optionalAccess', _48 => _48.detail])}
439
+ ` : ""}`;
440
+ github.error(errorMessage);
436
441
  return { success: false };
437
442
  }
438
443
  } catch (err2) {
439
- console.error(
440
- `Something unexpected went wrong when processing the npm dist-tag add output
441
- ${JSON.stringify(err2)}`
442
- );
444
+ const stdoutData = JSON.parse(_optionalChain([err2, 'access', _49 => _49.stdout, 'optionalAccess', _50 => _50.toString, 'call', _51 => _51()]) || "{}");
445
+ const errorMessage = `An unexpected error occured while processing the npm dist-tag add output:
446
+
447
+ ${_optionalChain([stdoutData, 'optionalAccess', _52 => _52.error, 'optionalAccess', _53 => _53.summary]) ? `Summary: ${_optionalChain([stdoutData, 'optionalAccess', _54 => _54.error, 'optionalAccess', _55 => _55.summary])}${_optionalChain([stdoutData, 'optionalAccess', _56 => _56.error, 'optionalAccess', _57 => _57.code]) ? ` (${_optionalChain([stdoutData, 'optionalAccess', _58 => _58.error, 'optionalAccess', _59 => _59.code])})` : ""}
448
+ ` : ""}${_optionalChain([stdoutData, 'optionalAccess', _60 => _60.error, 'optionalAccess', _61 => _61.detail]) ? `Detail: ${_optionalChain([stdoutData, 'optionalAccess', _62 => _62.error, 'optionalAccess', _63 => _63.detail])}
449
+ ` : ""}`;
450
+ github.error(errorMessage);
443
451
  return { success: false };
444
452
  }
445
453
  }
446
454
  } catch (err) {
447
- let error = err;
448
- if (Buffer.isBuffer(error)) {
449
- error = error.toString();
450
- }
451
- console.error("\n ********************** \n");
452
- console.info("");
453
- console.error(
454
- "An error occured trying to run the npm dist-tag add command."
455
- );
456
- console.error(error);
457
- console.info("");
458
- const stdoutData = JSON.parse(_optionalChain([err, 'access', _41 => _41.stdout, 'optionalAccess', _42 => _42.toString, 'call', _43 => _43()]) || "{}");
459
- 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")]))) {
460
- console.error(
461
- `Something unexpected went wrong when checking for existing dist-tags.
462
-
463
- Error: ${JSON.stringify(err, null, 2)}`
464
- );
455
+ const stdoutData = JSON.parse(_optionalChain([err, 'access', _64 => _64.stdout, 'optionalAccess', _65 => _65.toString, 'call', _66 => _66()]) || "{}");
456
+ if (!(_optionalChain([stdoutData, 'access', _67 => _67.error, 'optionalAccess', _68 => _68.code, 'optionalAccess', _69 => _69.includes, 'call', _70 => _70("E404")]) && _optionalChain([stdoutData, 'access', _71 => _71.error, 'optionalAccess', _72 => _72.summary, 'optionalAccess', _73 => _73.toLowerCase, 'call', _74 => _74(), 'access', _75 => _75.includes, 'call', _76 => _76("not found")])) && !(_optionalChain([err, 'access', _77 => _77.stderr, 'optionalAccess', _78 => _78.toString, 'call', _79 => _79(), 'access', _80 => _80.includes, 'call', _81 => _81("E404")]) && _optionalChain([err, 'access', _82 => _82.stderr, 'optionalAccess', _83 => _83.toString, 'call', _84 => _84(), 'access', _85 => _85.toLowerCase, 'call', _86 => _86(), 'access', _87 => _87.includes, 'call', _88 => _88("not found")]))) {
457
+ const errorMessage = `An unexpected error occured while checking for existing dist-tags:
458
+
459
+ ${_optionalChain([stdoutData, 'optionalAccess', _89 => _89.error, 'optionalAccess', _90 => _90.summary]) ? `Summary: ${_optionalChain([stdoutData, 'optionalAccess', _91 => _91.error, 'optionalAccess', _92 => _92.summary])}${_optionalChain([stdoutData, 'optionalAccess', _93 => _93.error, 'optionalAccess', _94 => _94.code]) ? ` (${_optionalChain([stdoutData, 'optionalAccess', _95 => _95.error, 'optionalAccess', _96 => _96.code])})` : ""}
460
+ ` : ""}${_optionalChain([stdoutData, 'optionalAccess', _97 => _97.error, 'optionalAccess', _98 => _98.detail]) ? `Detail: ${_optionalChain([stdoutData, 'optionalAccess', _99 => _99.error, 'optionalAccess', _100 => _100.detail])}
461
+ ` : ""}`;
462
+ github.error(errorMessage);
465
463
  return { success: false };
466
464
  }
467
465
  }
@@ -475,6 +473,7 @@ Error: ${JSON.stringify(err, null, 2)}`
475
473
  const result = _child_process.execSync.call(void 0, command, {
476
474
  cwd,
477
475
  env: {
476
+ NPM_ID_TOKEN: token,
478
477
  ...process.env,
479
478
  FORCE_COLOR: "true"
480
479
  },
@@ -483,13 +482,13 @@ Error: ${JSON.stringify(err, null, 2)}`
483
482
  });
484
483
  if (isDryRun) {
485
484
  console.info(
486
- `Would publish to ${registry} with tag "${tag}", but [dry-run] was set ${result ? `
485
+ `Would publish tag "${tag}" to ${registry}, but [dry-run] was set. ${result ? `
487
486
 
488
487
  Execution response: ${result.toString()}` : ""}`
489
488
  );
490
489
  } else {
491
490
  console.info(
492
- `Published to ${registry} with tag "${tag}" ${result ? `
491
+ `Published tag "${tag}" to ${registry}. ${result ? `
493
492
 
494
493
  Execution response: ${result.toString()}` : ""}`
495
494
  );
@@ -497,38 +496,23 @@ Execution response: ${result.toString()}` : ""}`
497
496
  return { success: true };
498
497
  } catch (err) {
499
498
  try {
500
- console.error("\n ********************** \n");
501
- console.info("");
502
- console.error("An error occured running npm publish.");
503
- console.error("Please see below for more information:");
504
- console.info("");
505
- const stdoutData = JSON.parse(_optionalChain([err, 'access', _66 => _66.stdout, 'optionalAccess', _67 => _67.toString, 'call', _68 => _68()]) || "{}");
506
- if (stdoutData.error.summary) {
507
- console.error(stdoutData.error.summary);
508
- console.error(stdoutData.error.summary);
509
- }
510
- if (stdoutData.error.detail) {
511
- console.error(stdoutData.error.detail);
512
- }
513
- if (context.isVerbose) {
514
- console.error(
515
- `npm publish stdout:
516
- ${JSON.stringify(stdoutData, null, 2)}`
517
- );
518
- }
519
- console.error("\n ********************** \n");
499
+ const stdoutData = JSON.parse(_optionalChain([err, 'access', _101 => _101.stdout, 'optionalAccess', _102 => _102.toString, 'call', _103 => _103()]) || "{}");
500
+ const errorMessage = `An error occurred while publishing the npm package:
501
+
502
+ ${_optionalChain([stdoutData, 'optionalAccess', _104 => _104.error, 'optionalAccess', _105 => _105.summary]) ? `Summary: ${_optionalChain([stdoutData, 'optionalAccess', _106 => _106.error, 'optionalAccess', _107 => _107.summary])}${_optionalChain([stdoutData, 'optionalAccess', _108 => _108.error, 'optionalAccess', _109 => _109.code]) ? ` (${_optionalChain([stdoutData, 'optionalAccess', _110 => _110.error, 'optionalAccess', _111 => _111.code])})` : ""}
503
+ ` : ""}${_optionalChain([stdoutData, 'optionalAccess', _112 => _112.error, 'optionalAccess', _113 => _113.detail]) ? `Detail: ${_optionalChain([stdoutData, 'optionalAccess', _114 => _114.error, 'optionalAccess', _115 => _115.detail])}
504
+ ` : ""}`;
505
+ github.error(errorMessage);
520
506
  return { success: false };
521
507
  } catch (err2) {
522
- let error = err2;
523
- if (Buffer.isBuffer(error)) {
524
- error = error.toString();
525
- }
526
- console.error(
527
- `Something unexpected went wrong when processing the npm publish output
508
+ const errorMessage = `Something unexpected went wrong when processing the npm publish output.
528
509
 
529
- Error: ${JSON.stringify(error, null, 2)}`
530
- );
531
- console.error("\n ********************** \n");
510
+ Error: ${JSON.stringify(
511
+ Buffer.isBuffer(err2) ? err2.toString() : err2,
512
+ null,
513
+ 2
514
+ )}`;
515
+ github.error(errorMessage);
532
516
  return { success: false };
533
517
  }
534
518
  }
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__c57ea7b126adfa5c204aaea33b08d818/node_modules/tsup/assets/esm_shims.js
1
+ // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__b287391bfb89dd26f0e4843187079e1f/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-ALL63TSY.mjs";
8
8
  import {
9
9
  __dirname
10
- } from "./chunk-GTBTSMUH.mjs";
10
+ } from "./chunk-C3NYIWL4.mjs";
11
11
 
12
12
  // src/generators/preset/generator.ts
13
13
  import {
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-TBW5MCN6.mjs";
11
11
  import {
12
12
  __dirname
13
- } from "./chunk-GTBTSMUH.mjs";
13
+ } from "./chunk-C3NYIWL4.mjs";
14
14
 
15
15
  // src/generators/neutral-library/generator.ts
16
16
  import {
@@ -0,0 +1,40 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkCQDBLKPFjs = require('./chunk-CQDBLKPF.js');
4
+
5
+ // src/utils/github.ts
6
+ var _jiti = require('jiti');
7
+ async function getGitHubTools(workspaceConfig) {
8
+ try {
9
+ const jiti = _jiti.createJiti.call(void 0, workspaceConfig.workspaceRoot, {
10
+ fsCache: workspaceConfig.skipCache ? false : _chunkCQDBLKPFjs.joinPaths.call(void 0,
11
+ workspaceConfig.workspaceRoot,
12
+ workspaceConfig.directories.cache || "node_modules/.cache/storm",
13
+ "jiti"
14
+ ),
15
+ interopDefault: true
16
+ });
17
+ const core = await jiti.import(
18
+ jiti.esmResolve("@actions/core")
19
+ );
20
+ return {
21
+ error: core.error,
22
+ warning: core.warning,
23
+ info: core.info,
24
+ getIDToken: core.getIDToken
25
+ };
26
+ } catch (e) {
27
+ return {
28
+ error: (message) => console.error(message),
29
+ warning: (message) => console.warn(message),
30
+ info: (message) => console.log(message),
31
+ getIDToken: async () => {
32
+ throw new Error("getIDToken is not supported in this environment");
33
+ }
34
+ };
35
+ }
36
+ }
37
+
38
+
39
+
40
+ exports.getGitHubTools = getGitHubTools;
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-TBW5MCN6.mjs";
14
14
  import {
15
15
  __dirname
16
- } from "./chunk-GTBTSMUH.mjs";
16
+ } from "./chunk-C3NYIWL4.mjs";
17
17
 
18
18
  // src/generators/node-library/generator.ts
19
19
  import {