@storm-software/workspace-tools 1.295.87 → 1.296.1
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.
- package/README.md +1 -1
- package/dist/{chunk-OBATTMGC.mjs → chunk-3WCWA5OH.mjs} +1 -1
- package/dist/chunk-54BBSJHK.mjs +40 -0
- package/dist/{chunk-GTBTSMUH.mjs → chunk-C3NYIWL4.mjs} +1 -1
- package/dist/{chunk-FPNWNZUL.mjs → chunk-J4MHHL63.mjs} +1 -1
- package/dist/{chunk-RCSUK5YZ.mjs → chunk-JIWQM3MH.mjs} +1 -1
- package/dist/chunk-MKJITWLN.js +40 -0
- package/dist/{chunk-HECOVC7R.mjs → chunk-NIETCJS4.mjs} +1 -1
- package/dist/{chunk-GCDDSEDG.mjs → chunk-OL6ZWI4R.mjs} +67 -93
- package/dist/{chunk-SGI4JCLV.js → chunk-RLJFRJ2F.js} +72 -98
- package/dist/{executor-0ivVjqma.d.mts → executor-BF7_LjrR.d.mts} +4 -4
- package/dist/{executor-0ivVjqma.d.ts → executor-BF7_LjrR.d.ts} +4 -4
- package/dist/executors.d.mts +1 -1
- package/dist/executors.d.ts +1 -1
- package/dist/executors.js +3 -2
- package/dist/executors.mjs +3 -2
- package/dist/generators.mjs +5 -5
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -9
- package/dist/index.mjs +18 -14
- package/dist/src/base/base-executor.mjs +1 -1
- package/dist/src/base/base-executor.untyped.mjs +1 -1
- package/dist/src/base/base-generator.mjs +1 -1
- package/dist/src/base/base-generator.untyped.mjs +1 -1
- package/dist/src/base/cargo-base-executor.untyped.mjs +1 -1
- package/dist/src/base/index.mjs +1 -1
- package/dist/src/base/typescript-build-executor.untyped.mjs +1 -1
- package/dist/src/base/typescript-library-generator.untyped.mjs +1 -1
- package/dist/src/executors/cargo-build/executor.mjs +1 -1
- package/dist/src/executors/cargo-build/untyped.mjs +1 -1
- package/dist/src/executors/cargo-check/executor.mjs +1 -1
- package/dist/src/executors/cargo-check/untyped.mjs +1 -1
- package/dist/src/executors/cargo-clippy/executor.mjs +1 -1
- package/dist/src/executors/cargo-clippy/untyped.mjs +1 -1
- package/dist/src/executors/cargo-doc/executor.mjs +1 -1
- package/dist/src/executors/cargo-doc/untyped.mjs +1 -1
- package/dist/src/executors/cargo-format/executor.mjs +1 -1
- package/dist/src/executors/cargo-format/untyped.mjs +1 -1
- package/dist/src/executors/cargo-publish/executor.mjs +1 -1
- package/dist/src/executors/cargo-publish/untyped.mjs +1 -1
- package/dist/src/executors/clean-package/executor.mjs +1 -1
- package/dist/src/executors/clean-package/untyped.mjs +1 -1
- package/dist/src/executors/esbuild/executor.mjs +1 -1
- package/dist/src/executors/esbuild/untyped.mjs +1 -1
- package/dist/src/executors/napi/executor.mjs +1 -1
- package/dist/src/executors/napi/untyped.mjs +1 -1
- package/dist/src/executors/npm-publish/executor.d.mts +1 -1
- package/dist/src/executors/npm-publish/executor.d.ts +1 -1
- package/dist/src/executors/npm-publish/executor.js +3 -2
- package/dist/src/executors/npm-publish/executor.mjs +3 -2
- package/dist/src/executors/npm-publish/schema.d.ts +4 -4
- package/dist/src/executors/npm-publish/schema.json +4 -4
- package/dist/src/executors/npm-publish/untyped.js +4 -4
- package/dist/src/executors/npm-publish/untyped.mjs +5 -5
- package/dist/src/executors/size-limit/executor.mjs +1 -1
- package/dist/src/executors/size-limit/untyped.mjs +1 -1
- package/dist/src/executors/tsdown/executor.mjs +1 -1
- package/dist/src/executors/tsdown/untyped.mjs +1 -1
- package/dist/src/executors/typia/executor.mjs +1 -1
- package/dist/src/executors/typia/untyped.mjs +1 -1
- package/dist/src/executors/unbuild/executor.mjs +1 -1
- package/dist/src/executors/unbuild/untyped.mjs +1 -1
- package/dist/src/generators/browser-library/generator.mjs +2 -2
- package/dist/src/generators/browser-library/untyped.mjs +1 -1
- package/dist/src/generators/config-schema/generator.mjs +1 -1
- package/dist/src/generators/config-schema/untyped.mjs +1 -1
- package/dist/src/generators/init/init.mjs +1 -1
- package/dist/src/generators/init/untyped.mjs +1 -1
- package/dist/src/generators/neutral-library/generator.mjs +2 -2
- package/dist/src/generators/neutral-library/untyped.mjs +1 -1
- package/dist/src/generators/node-library/generator.mjs +2 -2
- package/dist/src/generators/node-library/untyped.mjs +1 -1
- package/dist/src/generators/preset/generator.mjs +2 -2
- package/dist/src/generators/preset/untyped.mjs +1 -1
- package/dist/src/plugins/rust/cargo-toml.mjs +1 -1
- package/dist/src/plugins/rust/index.mjs +1 -1
- package/dist/src/plugins/typescript/index.mjs +1 -1
- package/dist/src/plugins/typescript/tsdown.mjs +1 -1
- package/dist/src/plugins/typescript/tsup.mjs +1 -1
- package/dist/src/plugins/typescript/untyped-schema.mjs +1 -1
- package/dist/src/release/index.mjs +1 -1
- package/dist/src/release/js-version-actions.mjs +1 -1
- package/dist/src/release/rust-version-actions.mjs +1 -1
- package/dist/src/types.mjs +1 -1
- package/dist/src/utils/apply-workspace-tokens.mjs +1 -1
- package/dist/src/utils/cargo.mjs +1 -1
- package/dist/src/utils/create-cli-options.mjs +1 -1
- package/dist/src/utils/get-project-configurations.mjs +1 -1
- package/dist/src/utils/github.d.mts +19 -0
- package/dist/src/utils/github.d.ts +19 -0
- package/dist/src/utils/github.js +7 -0
- package/dist/src/utils/github.mjs +8 -0
- package/dist/src/utils/index.d.mts +4 -0
- package/dist/src/utils/index.d.ts +4 -0
- package/dist/src/utils/index.js +12 -8
- package/dist/src/utils/index.mjs +13 -9
- package/dist/src/utils/lock-file.mjs +1 -1
- package/dist/src/utils/nx-json.mjs +1 -1
- package/dist/src/utils/package-helpers.mjs +1 -1
- package/dist/src/utils/plugin-helpers.mjs +1 -1
- package/dist/src/utils/project-tags.mjs +1 -1
- package/dist/src/utils/registry-helpers.mjs +1 -1
- package/dist/src/utils/typia-transform.mjs +1 -1
- package/dist/src/utils/versions.mjs +1 -1
- package/docs/api/executors/npm-publish/schema.md +4 -4
- package/package.json +16 -15
- /package/dist/{chunk-JGP4YWZY.js → chunk-DO2X7OZO.js} +0 -0
- /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
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
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);
|
|
@@ -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;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getGitHubTools
|
|
3
|
+
} from "./chunk-54BBSJHK.mjs";
|
|
1
4
|
import {
|
|
2
5
|
addPackageJsonGitHead
|
|
3
6
|
} from "./chunk-EYO6EPEG.mjs";
|
|
@@ -243,15 +246,19 @@ import { readFile as readFile3, writeFile as writeFile3 } from "node:fs/promises
|
|
|
243
246
|
import { format as format2 } from "prettier";
|
|
244
247
|
var LARGE_BUFFER = 1024 * 1e6;
|
|
245
248
|
async function npmPublishExecutorFn(options, context) {
|
|
249
|
+
const workspaceConfig = await getConfig(context.root);
|
|
250
|
+
const github = await getGitHubTools(workspaceConfig);
|
|
246
251
|
const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
|
|
247
252
|
if (!context.projectName) {
|
|
248
|
-
|
|
253
|
+
github.error("The `npm-publish` executor requires a `projectName`.");
|
|
254
|
+
return { success: false };
|
|
249
255
|
}
|
|
250
256
|
const projectConfig = context.projectsConfigurations?.projects?.[context.projectName];
|
|
251
257
|
if (!projectConfig) {
|
|
252
|
-
|
|
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 = joinPaths(
|
|
257
264
|
context.root,
|
|
@@ -265,15 +272,17 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
265
272
|
const packageJsonPath = joinPaths(packageRoot, "package.json");
|
|
266
273
|
const packageJsonFile = await readFile3(packageJsonPath, "utf8");
|
|
267
274
|
if (!packageJsonFile) {
|
|
268
|
-
|
|
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 = joinPaths(projectRoot, "package.json");
|
|
272
280
|
const projectPackageJsonFile = await readFile3(projectPackageJsonPath, "utf8");
|
|
273
281
|
if (!projectPackageJsonFile) {
|
|
274
|
-
|
|
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) {
|
|
@@ -325,13 +334,20 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
325
334
|
npmPublishCommandSegments.push(`--registry="${registry}" `);
|
|
326
335
|
npmViewCommandSegments.push(`--registry="${registry}" `);
|
|
327
336
|
}
|
|
328
|
-
|
|
329
|
-
|
|
337
|
+
let otp = options.otp;
|
|
338
|
+
if (!otp) {
|
|
339
|
+
otp = await github.getIDToken();
|
|
340
|
+
}
|
|
341
|
+
if (!otp) {
|
|
342
|
+
const errorMessage = `One time password (OTP) is required to publish ${packageTxt} to NPM. Usually this should be provided automatically via the GitHub Actions OIDC token (see: https://github.com/actions/toolkit/tree/main/packages/core#oidc-token); however, the release process was unable to retrieve it. Please provide it via the \`otp\` executor option.`;
|
|
343
|
+
github.error(errorMessage);
|
|
344
|
+
return { success: false };
|
|
330
345
|
}
|
|
346
|
+
npmPublishCommandSegments.push(`--otp="${otp}" `);
|
|
347
|
+
npmPublishCommandSegments.push("--provenance --access=public ");
|
|
331
348
|
if (isDryRun) {
|
|
332
349
|
npmPublishCommandSegments.push("--dry-run");
|
|
333
350
|
}
|
|
334
|
-
npmPublishCommandSegments.push("--provenance --access=public ");
|
|
335
351
|
const tag = options.tag || execSync("npm config get tag", {
|
|
336
352
|
cwd: packageRoot,
|
|
337
353
|
env: {
|
|
@@ -366,21 +382,21 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
366
382
|
return { success: true };
|
|
367
383
|
}
|
|
368
384
|
} catch (err) {
|
|
369
|
-
console.
|
|
370
|
-
|
|
371
|
-
`An error occurred while checking for existing dist-tags
|
|
372
|
-
${JSON.stringify(err)}
|
|
385
|
+
console.debug(
|
|
386
|
+
`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.
|
|
373
387
|
|
|
374
|
-
|
|
388
|
+
Error: ${JSON.stringify(
|
|
389
|
+
err,
|
|
390
|
+
null,
|
|
391
|
+
2
|
|
392
|
+
)}`
|
|
375
393
|
);
|
|
376
|
-
console.info("");
|
|
377
394
|
}
|
|
378
395
|
try {
|
|
379
396
|
if (!isDryRun) {
|
|
380
397
|
const command = `npm dist-tag add ${packageName}@${currentVersion} ${tag} --registry="${registry}" `;
|
|
381
|
-
console.
|
|
382
|
-
`Adding the dist-tag ${tag} - preparing to run the following:
|
|
383
|
-
${command}`
|
|
398
|
+
console.debug(
|
|
399
|
+
`Adding the dist-tag ${tag} - preparing to run the following: ${command}`
|
|
384
400
|
);
|
|
385
401
|
const result = execSync(command, {
|
|
386
402
|
cwd: packageRoot,
|
|
@@ -392,76 +408,49 @@ ${command}`
|
|
|
392
408
|
killSignal: "SIGTERM"
|
|
393
409
|
});
|
|
394
410
|
console.info(
|
|
395
|
-
`Added the dist-tag ${tag} to v${currentVersion} for registry "${registry}"
|
|
411
|
+
`Added the dist-tag ${tag} to v${currentVersion} for registry "${registry}".
|
|
396
412
|
|
|
397
413
|
Execution response: ${result.toString()}`
|
|
398
414
|
);
|
|
399
415
|
} else {
|
|
400
416
|
console.info(
|
|
401
|
-
`Would
|
|
417
|
+
`Would have added the dist-tag ${tag} to v${currentVersion} for registry "${registry}", but [dry-run] was set.
|
|
402
418
|
`
|
|
403
419
|
);
|
|
404
420
|
}
|
|
405
421
|
return { success: true };
|
|
406
422
|
} catch (err) {
|
|
407
423
|
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
424
|
const stdoutData = JSON.parse(err.stdout?.toString() || "{}");
|
|
421
425
|
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"))) {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
if (stdoutData.error.detail) {
|
|
429
|
-
console.error(stdoutData.error?.detail);
|
|
430
|
-
}
|
|
431
|
-
if (context.isVerbose) {
|
|
432
|
-
console.error(
|
|
433
|
-
`npm dist-tag add stdout: ${JSON.stringify(stdoutData, null, 2)}`
|
|
434
|
-
);
|
|
435
|
-
}
|
|
426
|
+
const errorMessage = `An unexpected error occured while running the npm dist-tag add command:
|
|
427
|
+
|
|
428
|
+
${stdoutData?.error?.summary ? `Summary: ${stdoutData?.error?.summary}${stdoutData?.error?.code ? ` (${stdoutData?.error?.code})` : ""}
|
|
429
|
+
` : ""}${stdoutData?.error?.detail ? `Detail: ${stdoutData?.error?.detail}
|
|
430
|
+
` : ""}`;
|
|
431
|
+
github.error(errorMessage);
|
|
436
432
|
return { success: false };
|
|
437
433
|
}
|
|
438
434
|
} catch (err2) {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
435
|
+
const stdoutData = JSON.parse(err2.stdout?.toString() || "{}");
|
|
436
|
+
const errorMessage = `An unexpected error occured while processing the npm dist-tag add output:
|
|
437
|
+
|
|
438
|
+
${stdoutData?.error?.summary ? `Summary: ${stdoutData?.error?.summary}${stdoutData?.error?.code ? ` (${stdoutData?.error?.code})` : ""}
|
|
439
|
+
` : ""}${stdoutData?.error?.detail ? `Detail: ${stdoutData?.error?.detail}
|
|
440
|
+
` : ""}`;
|
|
441
|
+
github.error(errorMessage);
|
|
443
442
|
return { success: false };
|
|
444
443
|
}
|
|
445
444
|
}
|
|
446
445
|
} 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
446
|
const stdoutData = JSON.parse(err.stdout?.toString() || "{}");
|
|
459
447
|
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"))) {
|
|
460
|
-
|
|
461
|
-
`Something unexpected went wrong when checking for existing dist-tags.
|
|
448
|
+
const errorMessage = `An unexpected error occured while checking for existing dist-tags:
|
|
462
449
|
|
|
463
|
-
|
|
464
|
-
|
|
450
|
+
${stdoutData?.error?.summary ? `Summary: ${stdoutData?.error?.summary}${stdoutData?.error?.code ? ` (${stdoutData?.error?.code})` : ""}
|
|
451
|
+
` : ""}${stdoutData?.error?.detail ? `Detail: ${stdoutData?.error?.detail}
|
|
452
|
+
` : ""}`;
|
|
453
|
+
github.error(errorMessage);
|
|
465
454
|
return { success: false };
|
|
466
455
|
}
|
|
467
456
|
}
|
|
@@ -483,13 +472,13 @@ Error: ${JSON.stringify(err, null, 2)}`
|
|
|
483
472
|
});
|
|
484
473
|
if (isDryRun) {
|
|
485
474
|
console.info(
|
|
486
|
-
`Would publish
|
|
475
|
+
`Would publish tag "${tag}" to ${registry}, but [dry-run] was set. ${result ? `
|
|
487
476
|
|
|
488
477
|
Execution response: ${result.toString()}` : ""}`
|
|
489
478
|
);
|
|
490
479
|
} else {
|
|
491
480
|
console.info(
|
|
492
|
-
`Published
|
|
481
|
+
`Published tag "${tag}" to ${registry}. ${result ? `
|
|
493
482
|
|
|
494
483
|
Execution response: ${result.toString()}` : ""}`
|
|
495
484
|
);
|
|
@@ -497,38 +486,23 @@ Execution response: ${result.toString()}` : ""}`
|
|
|
497
486
|
return { success: true };
|
|
498
487
|
} catch (err) {
|
|
499
488
|
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
489
|
const stdoutData = JSON.parse(err.stdout?.toString() || "{}");
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
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");
|
|
490
|
+
const errorMessage = `An error occurred while publishing the npm package:
|
|
491
|
+
|
|
492
|
+
${stdoutData?.error?.summary ? `Summary: ${stdoutData?.error?.summary}${stdoutData?.error?.code ? ` (${stdoutData?.error?.code})` : ""}
|
|
493
|
+
` : ""}${stdoutData?.error?.detail ? `Detail: ${stdoutData?.error?.detail}
|
|
494
|
+
` : ""}`;
|
|
495
|
+
github.error(errorMessage);
|
|
520
496
|
return { success: false };
|
|
521
497
|
} catch (err2) {
|
|
522
|
-
|
|
523
|
-
if (Buffer.isBuffer(error)) {
|
|
524
|
-
error = error.toString();
|
|
525
|
-
}
|
|
526
|
-
console.error(
|
|
527
|
-
`Something unexpected went wrong when processing the npm publish output
|
|
498
|
+
const errorMessage = `Something unexpected went wrong when processing the npm publish output.
|
|
528
499
|
|
|
529
|
-
Error: ${JSON.stringify(
|
|
530
|
-
|
|
531
|
-
|
|
500
|
+
Error: ${JSON.stringify(
|
|
501
|
+
Buffer.isBuffer(err2) ? err2.toString() : err2,
|
|
502
|
+
null,
|
|
503
|
+
2
|
|
504
|
+
)}`;
|
|
505
|
+
github.error(errorMessage);
|
|
532
506
|
return { success: false };
|
|
533
507
|
}
|
|
534
508
|
}
|