@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.
- 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-SGI4JCLV.js → chunk-A74N7OF2.js} +81 -97
- 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-VY3EJCTI.mjs} +76 -92
- 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,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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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.
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
${JSON.stringify(
|
|
373
|
-
|
|
374
|
-
|
|
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.
|
|
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
|
|
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
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
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
|
-
|
|
440
|
-
|
|
441
|
-
|
|
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
|
-
|
|
448
|
-
if (
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
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
|
-
|
|
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(
|
|
530
|
-
|
|
531
|
-
|
|
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=
|
|
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;
|