@storm-software/workspace-tools 1.296.100 → 1.296.102

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 (164) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-CSH4G6YP.js → chunk-2CUG3SS2.js} +2 -2
  3. package/dist/{chunk-RQTILTHD.js → chunk-2VQ55YPW.js} +2 -2
  4. package/dist/{chunk-KTRUDBKV.js → chunk-32MOOPKK.js} +5 -5
  5. package/dist/{chunk-OYAGJAJC.mjs → chunk-36N55IVK.mjs} +1 -1
  6. package/dist/{chunk-Y5BPWYHW.mjs → chunk-3G7TXYW2.mjs} +1 -1
  7. package/dist/{chunk-OGB3BDE5.js → chunk-3MXZ2RJF.js} +2 -2
  8. package/dist/{chunk-CZIX33ET.mjs → chunk-4TGI6IUX.mjs} +2 -2
  9. package/dist/{chunk-LLSSYWDG.js → chunk-65C6CGV3.js} +2 -2
  10. package/dist/{chunk-5E753H52.js → chunk-6W7UEKUN.js} +2 -2
  11. package/dist/{chunk-ZO6ZPXB7.js → chunk-AETRB5I7.js} +2 -2
  12. package/dist/{chunk-B37LR2KQ.mjs → chunk-B2MF67R6.mjs} +1 -1
  13. package/dist/{chunk-E2PVUX2W.mjs → chunk-BJ4RLCNC.mjs} +2 -2
  14. package/dist/{chunk-KSEB2U7B.js → chunk-CBTNZPVD.js} +6 -6
  15. package/dist/{chunk-AEDI2SBN.js → chunk-EFJ2PGGV.js} +2 -2
  16. package/dist/{chunk-5BGCA73V.mjs → chunk-EXRSULNO.mjs} +1 -1
  17. package/dist/{chunk-FX6ULQZH.mjs → chunk-EYIUJSGD.mjs} +2 -2
  18. package/dist/{chunk-XELY5YI7.js → chunk-GCYJYDE3.js} +2 -2
  19. package/dist/{chunk-D5MRSAIQ.mjs → chunk-HGU4RMLB.mjs} +1 -1
  20. package/dist/{chunk-VO3QUJGP.mjs → chunk-I4KVL3GR.mjs} +18 -20
  21. package/dist/{chunk-FEHSLYPB.mjs → chunk-I7RM7R7C.mjs} +1 -1
  22. package/dist/{chunk-4ARF5MP2.js → chunk-IMY2BU43.js} +18 -20
  23. package/dist/{chunk-OTF4YRBO.js → chunk-IV2QQRXO.js} +2 -2
  24. package/dist/{chunk-QSTZP7MX.js → chunk-IZLEVS44.js} +2 -2
  25. package/dist/{chunk-D5LTDKKX.mjs → chunk-KDZGNUBS.mjs} +1 -1
  26. package/dist/{chunk-YRVFGD7F.js → chunk-KDZH66U5.js} +2 -2
  27. package/dist/{chunk-WCSC75SR.mjs → chunk-LKCN5IIO.mjs} +2 -2
  28. package/dist/{chunk-WU2HALDD.mjs → chunk-LWDUD7G6.mjs} +1 -1
  29. package/dist/{chunk-ZRSFSLQE.mjs → chunk-LYZ5ACPN.mjs} +1 -1
  30. package/dist/{chunk-RKOR32KU.mjs → chunk-MOIGXVIF.mjs} +2 -2
  31. package/dist/{chunk-6S6QE7OG.mjs → chunk-N2PEIA6H.mjs} +1 -1
  32. package/dist/{chunk-KGLVCKYK.js → chunk-N5LZIOWW.js} +2 -2
  33. package/dist/{chunk-3S7IQWT7.mjs → chunk-P6AKIT3J.mjs} +1 -1
  34. package/dist/{chunk-PDNVE5TM.mjs → chunk-POHCCCR5.mjs} +2 -2
  35. package/dist/{chunk-FETI3TYM.js → chunk-RJ6FZTSI.js} +2 -2
  36. package/dist/chunk-SIU2RWSD.js +318 -0
  37. package/dist/{chunk-63IIWMRM.mjs → chunk-U6J67ZUE.mjs} +1 -1
  38. package/dist/{chunk-GYOKIIB3.js → chunk-UEDAT7SJ.js} +2 -2
  39. package/dist/{chunk-RHOYX45B.js → chunk-ULONYXYF.js} +4 -4
  40. package/dist/{chunk-GJ35IQWQ.mjs → chunk-UZ25NC7M.mjs} +1 -1
  41. package/dist/{chunk-5PC3QVAF.js → chunk-VKLLVYQ5.js} +2 -2
  42. package/dist/{chunk-MYALGFOC.js → chunk-W4JSEGT2.js} +2 -2
  43. package/dist/{chunk-NECG6355.js → chunk-WKCSKEFY.js} +2 -2
  44. package/dist/{chunk-VLALGAEO.mjs → chunk-XLOJK63P.mjs} +1 -1
  45. package/dist/{chunk-N2SWGQYO.mjs → chunk-XMATGAG4.mjs} +1 -1
  46. package/dist/chunk-XNPPL6DM.mjs +318 -0
  47. package/dist/{chunk-ZM4LIWD4.js → chunk-XV4FCARJ.js} +2 -2
  48. package/dist/{chunk-WYXSJWM4.js → chunk-XXCBFZB6.js} +2 -2
  49. package/dist/{chunk-CWE3LKLU.mjs → chunk-Y3CN5O3K.mjs} +1 -1
  50. package/dist/{chunk-JU6WU2TC.mjs → chunk-YKCMKHXT.mjs} +1 -1
  51. package/dist/{chunk-2AQ2UMKU.mjs → chunk-ZQVMKLN3.mjs} +2 -2
  52. package/dist/{chunk-HQUL4XZI.js → chunk-ZWUGCEBZ.js} +2 -2
  53. package/dist/executors.js +16 -16
  54. package/dist/executors.mjs +18 -18
  55. package/dist/generators.js +8 -8
  56. package/dist/generators.mjs +8 -8
  57. package/dist/index.js +24 -24
  58. package/dist/index.mjs +26 -26
  59. package/dist/src/base/base-executor.js +3 -3
  60. package/dist/src/base/base-executor.mjs +3 -3
  61. package/dist/src/base/base-executor.untyped.mjs +1 -1
  62. package/dist/src/base/base-generator.js +3 -3
  63. package/dist/src/base/base-generator.mjs +3 -3
  64. package/dist/src/base/base-generator.untyped.mjs +1 -1
  65. package/dist/src/base/cargo-base-executor.untyped.mjs +1 -1
  66. package/dist/src/base/index.js +4 -4
  67. package/dist/src/base/index.mjs +4 -4
  68. package/dist/src/base/typescript-build-executor.untyped.mjs +1 -1
  69. package/dist/src/base/typescript-library-generator.untyped.mjs +1 -1
  70. package/dist/src/executors/cargo-build/executor.js +4 -4
  71. package/dist/src/executors/cargo-build/executor.mjs +4 -4
  72. package/dist/src/executors/cargo-build/untyped.mjs +1 -1
  73. package/dist/src/executors/cargo-check/executor.js +4 -4
  74. package/dist/src/executors/cargo-check/executor.mjs +4 -4
  75. package/dist/src/executors/cargo-check/untyped.mjs +1 -1
  76. package/dist/src/executors/cargo-clippy/executor.js +4 -4
  77. package/dist/src/executors/cargo-clippy/executor.mjs +4 -4
  78. package/dist/src/executors/cargo-clippy/untyped.mjs +1 -1
  79. package/dist/src/executors/cargo-doc/executor.js +4 -4
  80. package/dist/src/executors/cargo-doc/executor.mjs +4 -4
  81. package/dist/src/executors/cargo-doc/untyped.mjs +1 -1
  82. package/dist/src/executors/cargo-format/executor.js +4 -4
  83. package/dist/src/executors/cargo-format/executor.mjs +4 -4
  84. package/dist/src/executors/cargo-format/untyped.mjs +1 -1
  85. package/dist/src/executors/cargo-publish/executor.mjs +1 -1
  86. package/dist/src/executors/cargo-publish/untyped.mjs +1 -1
  87. package/dist/src/executors/clean-package/executor.js +3 -3
  88. package/dist/src/executors/clean-package/executor.mjs +3 -3
  89. package/dist/src/executors/clean-package/untyped.mjs +1 -1
  90. package/dist/src/executors/esbuild/executor.js +4 -4
  91. package/dist/src/executors/esbuild/executor.mjs +4 -4
  92. package/dist/src/executors/esbuild/untyped.mjs +1 -1
  93. package/dist/src/executors/napi/executor.js +4 -4
  94. package/dist/src/executors/napi/executor.mjs +4 -4
  95. package/dist/src/executors/napi/untyped.mjs +1 -1
  96. package/dist/src/executors/npm-publish/executor.js +4 -4
  97. package/dist/src/executors/npm-publish/executor.mjs +4 -4
  98. package/dist/src/executors/npm-publish/untyped.mjs +1 -1
  99. package/dist/src/executors/size-limit/executor.js +4 -4
  100. package/dist/src/executors/size-limit/executor.mjs +4 -4
  101. package/dist/src/executors/size-limit/untyped.mjs +1 -1
  102. package/dist/src/executors/tsdown/executor.js +4 -4
  103. package/dist/src/executors/tsdown/executor.mjs +4 -4
  104. package/dist/src/executors/tsdown/untyped.mjs +1 -1
  105. package/dist/src/executors/typia/executor.js +4 -4
  106. package/dist/src/executors/typia/executor.mjs +4 -4
  107. package/dist/src/executors/typia/untyped.mjs +1 -1
  108. package/dist/src/executors/unbuild/executor.js +4 -4
  109. package/dist/src/executors/unbuild/executor.mjs +4 -4
  110. package/dist/src/executors/unbuild/untyped.mjs +1 -1
  111. package/dist/src/generators/browser-library/generator.js +4 -4
  112. package/dist/src/generators/browser-library/generator.mjs +4 -4
  113. package/dist/src/generators/browser-library/untyped.mjs +1 -1
  114. package/dist/src/generators/config-schema/generator.js +4 -4
  115. package/dist/src/generators/config-schema/generator.mjs +4 -4
  116. package/dist/src/generators/config-schema/untyped.mjs +1 -1
  117. package/dist/src/generators/init/init.mjs +1 -1
  118. package/dist/src/generators/init/untyped.mjs +1 -1
  119. package/dist/src/generators/neutral-library/generator.js +4 -4
  120. package/dist/src/generators/neutral-library/generator.mjs +4 -4
  121. package/dist/src/generators/neutral-library/untyped.mjs +1 -1
  122. package/dist/src/generators/node-library/generator.js +4 -4
  123. package/dist/src/generators/node-library/generator.mjs +4 -4
  124. package/dist/src/generators/node-library/untyped.mjs +1 -1
  125. package/dist/src/generators/preset/generator.js +4 -4
  126. package/dist/src/generators/preset/generator.mjs +4 -4
  127. package/dist/src/generators/preset/untyped.mjs +1 -1
  128. package/dist/src/plugins/rust/cargo-toml.js +4 -4
  129. package/dist/src/plugins/rust/cargo-toml.mjs +4 -4
  130. package/dist/src/plugins/rust/index.js +4 -4
  131. package/dist/src/plugins/rust/index.mjs +4 -4
  132. package/dist/src/plugins/typescript/index.js +3 -3
  133. package/dist/src/plugins/typescript/index.mjs +3 -3
  134. package/dist/src/plugins/typescript/tsdown.js +3 -3
  135. package/dist/src/plugins/typescript/tsdown.mjs +3 -3
  136. package/dist/src/plugins/typescript/tsup.js +3 -3
  137. package/dist/src/plugins/typescript/tsup.mjs +3 -3
  138. package/dist/src/plugins/typescript/untyped-schema.js +4 -4
  139. package/dist/src/plugins/typescript/untyped-schema.mjs +3 -3
  140. package/dist/src/release/index.js +4 -4
  141. package/dist/src/release/index.mjs +4 -4
  142. package/dist/src/release/js-version-actions.js +3 -3
  143. package/dist/src/release/js-version-actions.mjs +3 -3
  144. package/dist/src/release/rust-version-actions.js +3 -3
  145. package/dist/src/release/rust-version-actions.mjs +3 -3
  146. package/dist/src/types.mjs +1 -1
  147. package/dist/src/utils/apply-workspace-tokens.mjs +1 -1
  148. package/dist/src/utils/cargo.mjs +1 -1
  149. package/dist/src/utils/create-cli-options.mjs +1 -1
  150. package/dist/src/utils/get-project-configurations.mjs +1 -1
  151. package/dist/src/utils/github.mjs +1 -1
  152. package/dist/src/utils/index.js +3 -3
  153. package/dist/src/utils/index.mjs +3 -3
  154. package/dist/src/utils/lock-file.mjs +1 -1
  155. package/dist/src/utils/nx-json.mjs +1 -1
  156. package/dist/src/utils/package-helpers.mjs +1 -1
  157. package/dist/src/utils/package-manager.js +3 -3
  158. package/dist/src/utils/package-manager.mjs +3 -3
  159. package/dist/src/utils/plugin-helpers.mjs +1 -1
  160. package/dist/src/utils/project-tags.mjs +1 -1
  161. package/dist/src/utils/registry-helpers.mjs +1 -1
  162. package/dist/src/utils/typia-transform.mjs +1 -1
  163. package/dist/src/utils/versions.mjs +1 -1
  164. package/package.json +14 -13
@@ -0,0 +1,318 @@
1
+ import {
2
+ getGitHubTools
3
+ } from "./chunk-54BBSJHK.mjs";
4
+ import {
5
+ addPackageJsonGitHead
6
+ } from "./chunk-IDSDBOWW.mjs";
7
+ import {
8
+ getWorkspacePackageManager
9
+ } from "./chunk-EXRSULNO.mjs";
10
+ import {
11
+ getConfig
12
+ } from "./chunk-I4KVL3GR.mjs";
13
+ import {
14
+ joinPaths
15
+ } from "./chunk-TBW5MCN6.mjs";
16
+
17
+ // src/executors/npm-publish/executor.ts
18
+ import { createJiti } from "jiti";
19
+ import { execSync } from "node:child_process";
20
+ import { readFile, writeFile } from "node:fs/promises";
21
+ import { format } from "prettier";
22
+ var LARGE_BUFFER = 1024 * 1e6;
23
+ async function replaceDepsAliases(jiti, packageRoot, workspaceRoot, packageManager) {
24
+ if (packageManager === "bun") {
25
+ const { replaceDepsAliases: replaceBunDepsAliases } = await jiti.import(jiti.esmResolve("@storm-software/bun-tools"));
26
+ return replaceBunDepsAliases(packageRoot, workspaceRoot);
27
+ }
28
+ if (packageManager === "pnpm") {
29
+ const { replaceDepsAliases: replacePnpmDepsAliases } = await jiti.import(jiti.esmResolve("@storm-software/pnpm-tools"));
30
+ return replacePnpmDepsAliases(packageRoot, workspaceRoot);
31
+ }
32
+ }
33
+ async function npmPublishExecutorFn(options, context) {
34
+ const workspaceConfig = await getConfig(context.root);
35
+ const packageManager = await getWorkspacePackageManager(
36
+ context.root,
37
+ workspaceConfig
38
+ );
39
+ const github = await getGitHubTools(workspaceConfig);
40
+ const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
41
+ if (!context.projectName) {
42
+ github.error("The `npm-publish` executor requires a `projectName`.");
43
+ return { success: false };
44
+ }
45
+ const projectConfig = context.projectsConfigurations?.projects?.[context.projectName];
46
+ if (!projectConfig) {
47
+ github.error(
48
+ `Could not find project configuration for \`${context.projectName}\``
49
+ );
50
+ return { success: false };
51
+ }
52
+ const packageRoot = joinPaths(
53
+ context.root,
54
+ options.packageRoot || joinPaths("dist", projectConfig.root)
55
+ );
56
+ const projectRoot = context.projectsConfigurations.projects[context.projectName]?.root ? joinPaths(
57
+ context.root,
58
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
59
+ context.projectsConfigurations.projects[context.projectName].root
60
+ ) : packageRoot;
61
+ const jiti = createJiti(context.root, {
62
+ fsCache: joinPaths(context.root, "node_modules/.cache/storm", "jiti"),
63
+ interopDefault: true
64
+ });
65
+ const { getNpmRegistry, getRegistry } = await jiti.import(jiti.esmResolve("@storm-software/npm-tools/helpers"));
66
+ const packageJsonPath = joinPaths(packageRoot, "package.json");
67
+ const packageJsonFile = await readFile(packageJsonPath, "utf8");
68
+ if (!packageJsonFile) {
69
+ github.error(`Could not find \`package.json\` at ${packageJsonPath}`);
70
+ return { success: false };
71
+ }
72
+ const packageJson = JSON.parse(packageJsonFile);
73
+ const projectPackageJsonPath = joinPaths(projectRoot, "package.json");
74
+ const projectPackageJsonFile = await readFile(projectPackageJsonPath, "utf8");
75
+ if (!projectPackageJsonFile) {
76
+ github.error(
77
+ `Could not find \`package.json\` at ${projectPackageJsonPath}`
78
+ );
79
+ return { success: false };
80
+ }
81
+ const projectPackageJson = JSON.parse(projectPackageJsonFile);
82
+ if (packageJson.version !== projectPackageJson.version) {
83
+ console.warn(
84
+ `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.`
85
+ );
86
+ if (projectPackageJson.version) {
87
+ packageJson.version = projectPackageJson.version;
88
+ await writeFile(
89
+ packageJsonPath,
90
+ await format(JSON.stringify(packageJson), {
91
+ parser: "json",
92
+ proseWrap: "preserve",
93
+ trailingComma: "none",
94
+ tabWidth: 2,
95
+ semi: true,
96
+ singleQuote: false,
97
+ quoteProps: "as-needed",
98
+ insertPragma: false,
99
+ bracketSameLine: true,
100
+ printWidth: 80,
101
+ bracketSpacing: true,
102
+ arrowParens: "avoid",
103
+ endOfLine: "lf",
104
+ plugins: ["prettier-plugin-packagejson"]
105
+ })
106
+ );
107
+ }
108
+ }
109
+ const packageName = packageJson.name;
110
+ console.info(
111
+ `\u{1F680} Running Storm NPM Publish executor on the ${packageName} package`
112
+ );
113
+ const packageTxt = packageName === context.projectName ? `package "${packageName}"` : `package "${packageName}" from project "${context.projectName}"`;
114
+ if (packageJson.private === true) {
115
+ console.warn(
116
+ `Skipped ${packageTxt}, because it has \`"private": true\` in ${packageJsonPath}`
117
+ );
118
+ return { success: true };
119
+ }
120
+ await replaceDepsAliases(jiti, packageRoot, context.root, packageManager);
121
+ await addPackageJsonGitHead(packageRoot);
122
+ const npmPublishCommandSegments = [`npm publish --json`];
123
+ const npmViewCommandSegments = [
124
+ `npm view ${packageName} versions dist-tags --json`
125
+ ];
126
+ const registry = await Promise.resolve(
127
+ options.registry ?? (await getRegistry() || getNpmRegistry())
128
+ );
129
+ if (registry) {
130
+ npmPublishCommandSegments.push(`--registry="${registry}" `);
131
+ npmViewCommandSegments.push(`--registry="${registry}" `);
132
+ }
133
+ if (options.otp) {
134
+ npmPublishCommandSegments.push(`--otp="${options.otp}" `);
135
+ }
136
+ let token;
137
+ if (!options.otp && registry) {
138
+ token = await github.getIDToken(
139
+ `npm:${registry.replace(/^https?:\/\//, "")}`
140
+ );
141
+ if (!token) {
142
+ github.warning(
143
+ `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.`
144
+ );
145
+ }
146
+ }
147
+ npmPublishCommandSegments.push("--provenance --access=public ");
148
+ if (isDryRun) {
149
+ npmPublishCommandSegments.push("--dry-run");
150
+ }
151
+ const tag = options.tag || execSync("npm config get tag", {
152
+ cwd: packageRoot,
153
+ env: {
154
+ NPM_ID_TOKEN: token,
155
+ ...process.env,
156
+ FORCE_COLOR: "true"
157
+ },
158
+ maxBuffer: LARGE_BUFFER,
159
+ killSignal: "SIGTERM"
160
+ }).toString().trim();
161
+ if (tag) {
162
+ npmPublishCommandSegments.push(`--tag="${tag}" `);
163
+ }
164
+ if (!isDryRun) {
165
+ const currentVersion = options.version || packageJson.version;
166
+ try {
167
+ try {
168
+ const result = execSync(npmViewCommandSegments.join(" "), {
169
+ cwd: packageRoot,
170
+ env: {
171
+ NPM_ID_TOKEN: token,
172
+ ...process.env,
173
+ FORCE_COLOR: "true"
174
+ },
175
+ maxBuffer: LARGE_BUFFER,
176
+ killSignal: "SIGTERM"
177
+ });
178
+ const resultJson = JSON.parse(result.toString());
179
+ const distTags = resultJson["dist-tags"] || {};
180
+ if (distTags[tag] === currentVersion) {
181
+ console.warn(
182
+ `Skipped ${packageTxt} because v${currentVersion} already exists in ${registry} with tag "${tag}"`
183
+ );
184
+ return { success: true };
185
+ }
186
+ } catch (err) {
187
+ console.debug(
188
+ `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.
189
+
190
+ Error: ${JSON.stringify(
191
+ err,
192
+ null,
193
+ 2
194
+ )}`
195
+ );
196
+ }
197
+ try {
198
+ if (!isDryRun) {
199
+ const command = `npm dist-tag add ${packageName}@${currentVersion} ${tag} --registry="${registry}" `;
200
+ console.debug(
201
+ `Adding the dist-tag ${tag} - preparing to run the following: ${command}`
202
+ );
203
+ const result = execSync(command, {
204
+ cwd: packageRoot,
205
+ env: {
206
+ NPM_ID_TOKEN: token,
207
+ ...process.env,
208
+ FORCE_COLOR: "true"
209
+ },
210
+ maxBuffer: LARGE_BUFFER,
211
+ killSignal: "SIGTERM"
212
+ });
213
+ console.info(
214
+ `Added the dist-tag ${tag} to v${currentVersion} for registry "${registry}".
215
+
216
+ Execution response: ${result.toString()}`
217
+ );
218
+ } else {
219
+ console.info(
220
+ `Would have added the dist-tag ${tag} to v${currentVersion} for registry "${registry}", but [dry-run] was set.
221
+ `
222
+ );
223
+ }
224
+ return { success: true };
225
+ } catch (err) {
226
+ try {
227
+ const stdoutData = JSON.parse(err.stdout?.toString() || "{}");
228
+ if (stdoutData?.error && !(stdoutData.error?.code?.includes("E404") && stdoutData.error?.summary?.includes("no such package available")) && !(err.stderr?.toString().includes("E404") && err.stderr?.toString().includes("no such package available"))) {
229
+ const errorMessage = `An unexpected error occured while running the npm dist-tag add command:
230
+
231
+ ${stdoutData?.error?.summary ? `Summary: ${stdoutData?.error?.summary}${stdoutData?.error?.code ? ` (${stdoutData?.error?.code})` : ""}
232
+ ` : ""}${stdoutData?.error?.detail ? `Detail: ${stdoutData?.error?.detail}
233
+ ` : ""}`;
234
+ github.error(errorMessage);
235
+ return { success: false };
236
+ }
237
+ } catch (err2) {
238
+ const stdoutData = JSON.parse(err2.stdout?.toString() || "{}");
239
+ const errorMessage = `An unexpected error occured while processing the npm dist-tag add output:
240
+
241
+ ${stdoutData?.error?.summary ? `Summary: ${stdoutData?.error?.summary}${stdoutData?.error?.code ? ` (${stdoutData?.error?.code})` : ""}
242
+ ` : ""}${stdoutData?.error?.detail ? `Detail: ${stdoutData?.error?.detail}
243
+ ` : ""}`;
244
+ github.error(errorMessage);
245
+ return { success: false };
246
+ }
247
+ }
248
+ } catch (err) {
249
+ const stdoutData = JSON.parse(err.stdout?.toString() || "{}");
250
+ if (!(stdoutData.error?.code?.includes("E404") && stdoutData.error?.summary?.toLowerCase().includes("not found")) && !(err.stderr?.toString().includes("E404") && err.stderr?.toString().toLowerCase().includes("not found"))) {
251
+ const errorMessage = `An unexpected error occured while checking for existing dist-tags:
252
+
253
+ ${stdoutData?.error?.summary ? `Summary: ${stdoutData?.error?.summary}${stdoutData?.error?.code ? ` (${stdoutData?.error?.code})` : ""}
254
+ ` : ""}${stdoutData?.error?.detail ? `Detail: ${stdoutData?.error?.detail}
255
+ ` : ""}`;
256
+ github.error(errorMessage);
257
+ return { success: false };
258
+ }
259
+ }
260
+ }
261
+ try {
262
+ const cwd = packageRoot;
263
+ const command = npmPublishCommandSegments.join(" ");
264
+ console.info(
265
+ `Running publish command "${command}" in current working directory: "${cwd}" `
266
+ );
267
+ const result = execSync(command, {
268
+ cwd,
269
+ env: {
270
+ NPM_ID_TOKEN: token,
271
+ ...process.env,
272
+ FORCE_COLOR: "true"
273
+ },
274
+ maxBuffer: LARGE_BUFFER,
275
+ killSignal: "SIGTERM"
276
+ });
277
+ if (isDryRun) {
278
+ console.info(
279
+ `Would publish tag "${tag}" to ${registry}, but [dry-run] was set. ${result ? `
280
+
281
+ Execution response: ${result.toString()}` : ""}`
282
+ );
283
+ } else {
284
+ console.info(
285
+ `Published tag "${tag}" to ${registry}. ${result ? `
286
+
287
+ Execution response: ${result.toString()}` : ""}`
288
+ );
289
+ }
290
+ return { success: true };
291
+ } catch (err) {
292
+ try {
293
+ const stdoutData = JSON.parse(err.stdout?.toString() || "{}");
294
+ const errorMessage = `An error occurred while publishing the npm package:
295
+
296
+ ${stdoutData?.error?.summary ? `Summary: ${stdoutData?.error?.summary}${stdoutData?.error?.code ? ` (${stdoutData?.error?.code})` : ""}
297
+ ` : ""}${stdoutData?.error?.detail ? `Detail: ${stdoutData?.error?.detail}
298
+ ` : ""}`;
299
+ github.error(errorMessage);
300
+ return { success: false };
301
+ } catch (err2) {
302
+ const errorMessage = `Something unexpected went wrong when processing the npm publish output.
303
+
304
+ Error: ${JSON.stringify(
305
+ Buffer.isBuffer(err2) ? err2.toString() : err2,
306
+ null,
307
+ 2
308
+ )}`;
309
+ github.error(errorMessage);
310
+ return { success: false };
311
+ }
312
+ }
313
+ }
314
+
315
+ export {
316
+ LARGE_BUFFER,
317
+ npmPublishExecutorFn
318
+ };
@@ -4,7 +4,7 @@
4
4
  var _chunkILSI74FWjs = require('./chunk-ILSI74FW.js');
5
5
 
6
6
 
7
- var _chunkQSTZP7MXjs = require('./chunk-QSTZP7MX.js');
7
+ var _chunkIZLEVS44js = require('./chunk-IZLEVS44.js');
8
8
 
9
9
 
10
10
  var _chunkCQDBLKPFjs = require('./chunk-CQDBLKPF.js');
@@ -82,7 +82,7 @@ async function browserLibraryGeneratorFn(tree, schema, config) {
82
82
  await _devkit.formatFiles.call(void 0, tree);
83
83
  return null;
84
84
  }
85
- var generator_default = _chunkQSTZP7MXjs.withRunGenerator.call(void 0,
85
+ var generator_default = _chunkIZLEVS44js.withRunGenerator.call(void 0,
86
86
  "TypeScript Library Creator (Browser Platform)",
87
87
  browserLibraryGeneratorFn,
88
88
  {
@@ -4,14 +4,14 @@
4
4
  var _chunkHYK7OVZ3js = require('./chunk-HYK7OVZ3.js');
5
5
 
6
6
 
7
- var _chunkRQTILTHDjs = require('./chunk-RQTILTHD.js');
7
+ var _chunk2VQ55YPWjs = require('./chunk-2VQ55YPW.js');
8
8
 
9
9
  // src/executors/cargo-format/executor.ts
10
10
  async function cargoFormatExecutor(options, context) {
11
11
  const command = _chunkHYK7OVZ3js.buildCargoCommand.call(void 0, "fmt", options, context);
12
12
  return await _chunkHYK7OVZ3js.cargoCommand.call(void 0, context.root, ...command);
13
13
  }
14
- var executor_default = _chunkRQTILTHDjs.withRunExecutor.call(void 0,
14
+ var executor_default = _chunk2VQ55YPWjs.withRunExecutor.call(void 0,
15
15
  "Cargo - Format",
16
16
  cargoFormatExecutor,
17
17
  {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-6YP444OR.mjs";
5
5
  import {
6
6
  getConfig
7
- } from "./chunk-VO3QUJGP.mjs";
7
+ } from "./chunk-I4KVL3GR.mjs";
8
8
  import {
9
9
  brandIcon,
10
10
  formatLogMessage,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getWorkspaceConfig
3
- } from "./chunk-VO3QUJGP.mjs";
3
+ } from "./chunk-I4KVL3GR.mjs";
4
4
 
5
5
  // src/release/js-version-actions.ts
6
6
  import JsVersionActions from "@nx/js/src/release/version-actions";
@@ -4,13 +4,13 @@ import {
4
4
  } from "./chunk-XSHN3XHD.mjs";
5
5
  import {
6
6
  withRunGenerator
7
- } from "./chunk-Y5BPWYHW.mjs";
7
+ } from "./chunk-3G7TXYW2.mjs";
8
8
  import {
9
9
  joinPaths
10
10
  } from "./chunk-TBW5MCN6.mjs";
11
11
  import {
12
12
  __dirname
13
- } from "./chunk-D5LTDKKX.mjs";
13
+ } from "./chunk-KDZGNUBS.mjs";
14
14
 
15
15
  // src/generators/browser-library/generator.ts
16
16
  import {
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkRQTILTHDjs = require('./chunk-RQTILTHD.js');
3
+ var _chunk2VQ55YPWjs = require('./chunk-2VQ55YPW.js');
4
4
 
5
5
 
6
6
  var _chunkCLKU7UMGjs = require('./chunk-CLKU7UMG.js');
@@ -80,7 +80,7 @@ async function unbuildExecutorFn(options, context, config) {
80
80
  success: true
81
81
  };
82
82
  }
83
- var executor_default = _chunkRQTILTHDjs.withRunExecutor.call(void 0,
83
+ var executor_default = _chunk2VQ55YPWjs.withRunExecutor.call(void 0,
84
84
  "TypeScript Unbuild build",
85
85
  unbuildExecutorFn,
86
86
  {
package/dist/executors.js CHANGED
@@ -1,52 +1,52 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-P6HSE7LH.js');
2
2
 
3
3
 
4
- var _chunkHQUL4XZIjs = require('./chunk-HQUL4XZI.js');
4
+ var _chunkZWUGCEBZjs = require('./chunk-ZWUGCEBZ.js');
5
5
 
6
6
 
7
- var _chunkKSEB2U7Bjs = require('./chunk-KSEB2U7B.js');
7
+ var _chunkSIU2RWSDjs = require('./chunk-SIU2RWSD.js');
8
8
 
9
9
 
10
- var _chunkLLSSYWDGjs = require('./chunk-LLSSYWDG.js');
10
+ var _chunk65C6CGV3js = require('./chunk-65C6CGV3.js');
11
11
 
12
12
 
13
- var _chunkRHOYX45Bjs = require('./chunk-RHOYX45B.js');
13
+ var _chunkULONYXYFjs = require('./chunk-ULONYXYF.js');
14
14
 
15
15
 
16
- var _chunkGYOKIIB3js = require('./chunk-GYOKIIB3.js');
16
+ var _chunkUEDAT7SJjs = require('./chunk-UEDAT7SJ.js');
17
17
 
18
18
 
19
19
  var _chunkRU4TNHFGjs = require('./chunk-RU4TNHFG.js');
20
20
 
21
21
 
22
- var _chunkKGLVCKYKjs = require('./chunk-KGLVCKYK.js');
22
+ var _chunkN5LZIOWWjs = require('./chunk-N5LZIOWW.js');
23
23
 
24
24
 
25
- var _chunk5PC3QVAFjs = require('./chunk-5PC3QVAF.js');
25
+ var _chunkVKLLVYQ5js = require('./chunk-VKLLVYQ5.js');
26
26
 
27
27
 
28
- var _chunkOTF4YRBOjs = require('./chunk-OTF4YRBO.js');
28
+ var _chunkIV2QQRXOjs = require('./chunk-IV2QQRXO.js');
29
29
 
30
30
 
31
- var _chunk5E753H52js = require('./chunk-5E753H52.js');
31
+ var _chunkKDZH66U5js = require('./chunk-KDZH66U5.js');
32
32
 
33
33
 
34
- var _chunkYRVFGD7Fjs = require('./chunk-YRVFGD7F.js');
34
+ var _chunk6W7UEKUNjs = require('./chunk-6W7UEKUN.js');
35
35
 
36
36
 
37
- var _chunkWYXSJWM4js = require('./chunk-WYXSJWM4.js');
37
+ var _chunkXXCBFZB6js = require('./chunk-XXCBFZB6.js');
38
38
 
39
39
 
40
- var _chunkNECG6355js = require('./chunk-NECG6355.js');
41
- require('./chunk-OGB3BDE5.js');
40
+ var _chunkWKCSKEFYjs = require('./chunk-WKCSKEFY.js');
41
+ require('./chunk-3MXZ2RJF.js');
42
42
  require('./chunk-HYK7OVZ3.js');
43
43
  require('./chunk-MKJITWLN.js');
44
44
  require('./chunk-46OIJVV3.js');
45
45
  require('./chunk-N2365RCI.js');
46
46
  require('./chunk-TAP26ZJQ.js');
47
- require('./chunk-RQTILTHD.js');
47
+ require('./chunk-2VQ55YPW.js');
48
48
  require('./chunk-3PMAVAFI.js');
49
- require('./chunk-4ARF5MP2.js');
49
+ require('./chunk-IMY2BU43.js');
50
50
  require('./chunk-CLKU7UMG.js');
51
51
  require('./chunk-GUI4USIO.js');
52
52
  require('./chunk-CQDBLKPF.js');
@@ -64,4 +64,4 @@ require('./chunk-CQDBLKPF.js');
64
64
 
65
65
 
66
66
 
67
- exports.LARGE_BUFFER = _chunkKSEB2U7Bjs.LARGE_BUFFER; exports.cargoBuildExecutor = _chunkNECG6355js.cargoBuildExecutor; exports.cargoCheckExecutor = _chunkOTF4YRBOjs.cargoCheckExecutor; exports.cargoClippyExecutor = _chunkYRVFGD7Fjs.cargoClippyExecutor; exports.cargoDocExecutor = _chunk5E753H52js.cargoDocExecutor; exports.cargoFormatExecutor = _chunkWYXSJWM4js.cargoFormatExecutor; exports.esbuildExecutorFn = _chunkKGLVCKYKjs.esbuildExecutorFn; exports.getRegistryVersion = _chunkRU4TNHFGjs.getRegistryVersion; exports.napiExecutor = _chunk5PC3QVAFjs.napiExecutor; exports.sizeLimitExecutorFn = _chunkLLSSYWDGjs.sizeLimitExecutorFn; exports.tsdownExecutorFn = _chunkRHOYX45Bjs.tsdownExecutorFn; exports.typiaExecutorFn = _chunkGYOKIIB3js.typiaExecutorFn; exports.unbuildExecutorFn = _chunkHQUL4XZIjs.unbuildExecutorFn;
67
+ exports.LARGE_BUFFER = _chunkSIU2RWSDjs.LARGE_BUFFER; exports.cargoBuildExecutor = _chunkWKCSKEFYjs.cargoBuildExecutor; exports.cargoCheckExecutor = _chunkIV2QQRXOjs.cargoCheckExecutor; exports.cargoClippyExecutor = _chunkKDZH66U5js.cargoClippyExecutor; exports.cargoDocExecutor = _chunk6W7UEKUNjs.cargoDocExecutor; exports.cargoFormatExecutor = _chunkXXCBFZB6js.cargoFormatExecutor; exports.esbuildExecutorFn = _chunkN5LZIOWWjs.esbuildExecutorFn; exports.getRegistryVersion = _chunkRU4TNHFGjs.getRegistryVersion; exports.napiExecutor = _chunkVKLLVYQ5js.napiExecutor; exports.sizeLimitExecutorFn = _chunk65C6CGV3js.sizeLimitExecutorFn; exports.tsdownExecutorFn = _chunkULONYXYFjs.tsdownExecutorFn; exports.typiaExecutorFn = _chunkUEDAT7SJjs.typiaExecutorFn; exports.unbuildExecutorFn = _chunkZWUGCEBZjs.unbuildExecutorFn;
@@ -1,56 +1,56 @@
1
1
  import "./chunk-GHQJKIMQ.mjs";
2
2
  import {
3
3
  unbuildExecutorFn
4
- } from "./chunk-6S6QE7OG.mjs";
4
+ } from "./chunk-N2PEIA6H.mjs";
5
5
  import {
6
6
  LARGE_BUFFER
7
- } from "./chunk-E2PVUX2W.mjs";
7
+ } from "./chunk-BJ4RLCNC.mjs";
8
8
  import {
9
9
  sizeLimitExecutorFn
10
- } from "./chunk-FEHSLYPB.mjs";
10
+ } from "./chunk-I7RM7R7C.mjs";
11
11
  import {
12
12
  tsdownExecutorFn
13
- } from "./chunk-RKOR32KU.mjs";
13
+ } from "./chunk-MOIGXVIF.mjs";
14
14
  import {
15
15
  typiaExecutorFn
16
- } from "./chunk-B37LR2KQ.mjs";
16
+ } from "./chunk-B2MF67R6.mjs";
17
17
  import {
18
18
  getRegistryVersion
19
19
  } from "./chunk-K6UOPTIZ.mjs";
20
20
  import {
21
21
  esbuildExecutorFn
22
- } from "./chunk-VLALGAEO.mjs";
22
+ } from "./chunk-XLOJK63P.mjs";
23
23
  import {
24
24
  napiExecutor
25
- } from "./chunk-63IIWMRM.mjs";
25
+ } from "./chunk-U6J67ZUE.mjs";
26
26
  import {
27
27
  cargoCheckExecutor
28
- } from "./chunk-OYAGJAJC.mjs";
29
- import {
30
- cargoDocExecutor
31
- } from "./chunk-D5MRSAIQ.mjs";
28
+ } from "./chunk-36N55IVK.mjs";
32
29
  import {
33
30
  cargoClippyExecutor
34
- } from "./chunk-GJ35IQWQ.mjs";
31
+ } from "./chunk-UZ25NC7M.mjs";
32
+ import {
33
+ cargoDocExecutor
34
+ } from "./chunk-HGU4RMLB.mjs";
35
35
  import {
36
36
  cargoFormatExecutor
37
- } from "./chunk-ZRSFSLQE.mjs";
37
+ } from "./chunk-LYZ5ACPN.mjs";
38
38
  import {
39
39
  cargoBuildExecutor
40
- } from "./chunk-N2SWGQYO.mjs";
41
- import "./chunk-5BGCA73V.mjs";
40
+ } from "./chunk-XMATGAG4.mjs";
41
+ import "./chunk-EXRSULNO.mjs";
42
42
  import "./chunk-C3G4MZGP.mjs";
43
43
  import "./chunk-54BBSJHK.mjs";
44
44
  import "./chunk-IDSDBOWW.mjs";
45
45
  import "./chunk-UA33NH5O.mjs";
46
46
  import "./chunk-2GQSCZ3J.mjs";
47
- import "./chunk-CWE3LKLU.mjs";
47
+ import "./chunk-Y3CN5O3K.mjs";
48
48
  import "./chunk-6YP444OR.mjs";
49
- import "./chunk-VO3QUJGP.mjs";
49
+ import "./chunk-I4KVL3GR.mjs";
50
50
  import "./chunk-45CW7OJB.mjs";
51
51
  import "./chunk-JUJWJXED.mjs";
52
52
  import "./chunk-TBW5MCN6.mjs";
53
- import "./chunk-D5LTDKKX.mjs";
53
+ import "./chunk-KDZGNUBS.mjs";
54
54
  export {
55
55
  LARGE_BUFFER,
56
56
  cargoBuildExecutor,
@@ -1,19 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-C3TC7AUW.js');
2
2
 
3
3
 
4
- var _chunkMYALGFOCjs = require('./chunk-MYALGFOC.js');
4
+ var _chunkW4JSEGT2js = require('./chunk-W4JSEGT2.js');
5
5
 
6
6
 
7
- var _chunkZO6ZPXB7js = require('./chunk-ZO6ZPXB7.js');
7
+ var _chunkAETRB5I7js = require('./chunk-AETRB5I7.js');
8
8
 
9
9
 
10
- var _chunkFETI3TYMjs = require('./chunk-FETI3TYM.js');
10
+ var _chunkRJ6FZTSIjs = require('./chunk-RJ6FZTSI.js');
11
11
 
12
12
 
13
- var _chunkZM4LIWD4js = require('./chunk-ZM4LIWD4.js');
13
+ var _chunkXV4FCARJjs = require('./chunk-XV4FCARJ.js');
14
14
 
15
15
 
16
- var _chunkKTRUDBKVjs = require('./chunk-KTRUDBKV.js');
16
+ var _chunk32MOOPKKjs = require('./chunk-32MOOPKK.js');
17
17
 
18
18
 
19
19
  var _chunkOKSECMVKjs = require('./chunk-OKSECMVK.js');
@@ -21,9 +21,9 @@ require('./chunk-HN5UXNLM.js');
21
21
  require('./chunk-ILSI74FW.js');
22
22
  require('./chunk-3G7PNDZ5.js');
23
23
  require('./chunk-TAP26ZJQ.js');
24
- require('./chunk-QSTZP7MX.js');
24
+ require('./chunk-IZLEVS44.js');
25
25
  require('./chunk-3PMAVAFI.js');
26
- require('./chunk-4ARF5MP2.js');
26
+ require('./chunk-IMY2BU43.js');
27
27
  require('./chunk-CLKU7UMG.js');
28
28
  require('./chunk-GUI4USIO.js');
29
29
  require('./chunk-CQDBLKPF.js');
@@ -34,4 +34,4 @@ require('./chunk-CQDBLKPF.js');
34
34
 
35
35
 
36
36
 
37
- exports.browserLibraryGeneratorFn = _chunkZM4LIWD4js.browserLibraryGeneratorFn; exports.configSchemaGeneratorFn = _chunkKTRUDBKVjs.configSchemaGeneratorFn; exports.initGenerator = _chunkOKSECMVKjs.initGenerator; exports.neutralLibraryGeneratorFn = _chunkMYALGFOCjs.neutralLibraryGeneratorFn; exports.nodeLibraryGeneratorFn = _chunkZO6ZPXB7js.nodeLibraryGeneratorFn; exports.presetGeneratorFn = _chunkFETI3TYMjs.presetGeneratorFn;
37
+ exports.browserLibraryGeneratorFn = _chunkXV4FCARJjs.browserLibraryGeneratorFn; exports.configSchemaGeneratorFn = _chunk32MOOPKKjs.configSchemaGeneratorFn; exports.initGenerator = _chunkOKSECMVKjs.initGenerator; exports.neutralLibraryGeneratorFn = _chunkW4JSEGT2js.neutralLibraryGeneratorFn; exports.nodeLibraryGeneratorFn = _chunkAETRB5I7js.nodeLibraryGeneratorFn; exports.presetGeneratorFn = _chunkRJ6FZTSIjs.presetGeneratorFn;
@@ -1,19 +1,19 @@
1
1
  import "./chunk-SAIDGUHG.mjs";
2
2
  import {
3
3
  neutralLibraryGeneratorFn
4
- } from "./chunk-WCSC75SR.mjs";
4
+ } from "./chunk-LKCN5IIO.mjs";
5
5
  import {
6
6
  nodeLibraryGeneratorFn
7
- } from "./chunk-CZIX33ET.mjs";
7
+ } from "./chunk-4TGI6IUX.mjs";
8
8
  import {
9
9
  presetGeneratorFn
10
- } from "./chunk-PDNVE5TM.mjs";
10
+ } from "./chunk-POHCCCR5.mjs";
11
11
  import {
12
12
  browserLibraryGeneratorFn
13
- } from "./chunk-2AQ2UMKU.mjs";
13
+ } from "./chunk-ZQVMKLN3.mjs";
14
14
  import {
15
15
  configSchemaGeneratorFn
16
- } from "./chunk-FX6ULQZH.mjs";
16
+ } from "./chunk-EYIUJSGD.mjs";
17
17
  import {
18
18
  initGenerator
19
19
  } from "./chunk-437WGH2M.mjs";
@@ -21,13 +21,13 @@ import "./chunk-VQYZG5YE.mjs";
21
21
  import "./chunk-XSHN3XHD.mjs";
22
22
  import "./chunk-DEHA5C77.mjs";
23
23
  import "./chunk-2GQSCZ3J.mjs";
24
- import "./chunk-Y5BPWYHW.mjs";
24
+ import "./chunk-3G7TXYW2.mjs";
25
25
  import "./chunk-6YP444OR.mjs";
26
- import "./chunk-VO3QUJGP.mjs";
26
+ 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-D5LTDKKX.mjs";
30
+ import "./chunk-KDZGNUBS.mjs";
31
31
  export {
32
32
  browserLibraryGeneratorFn,
33
33
  configSchemaGeneratorFn,