@storm-software/workspace-tools 1.297.19 → 1.297.20
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/dist/{chunk-QNA6DMYD.mjs → chunk-2SBG5C7W.mjs} +1 -1
- package/dist/{chunk-7CXXQ3KC.js → chunk-I2HFAJPK.js} +118 -17
- package/dist/{chunk-22IAVE2Q.mjs → chunk-JBSWEDCZ.mjs} +1 -1
- package/dist/{chunk-HTBDZHCG.mjs → chunk-JZYF4DSL.mjs} +1 -1
- package/dist/{chunk-SQRDAISM.mjs → chunk-LGXT7X2B.mjs} +103 -2
- package/dist/{chunk-Q65223V2.mjs → chunk-MCLHT3FA.mjs} +1 -1
- package/dist/{chunk-ITYGFAJE.mjs → chunk-V4SED27K.mjs} +1 -1
- package/dist/{chunk-XZCDM7U7.mjs → chunk-YYQN5FVN.mjs} +1 -1
- package/dist/executors.js +7 -7
- package/dist/executors.mjs +12 -12
- package/dist/generators.js +3 -3
- package/dist/generators.mjs +8 -8
- package/dist/index.js +10 -10
- package/dist/index.mjs +19 -19
- 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/command-publish/executor.mjs +1 -1
- package/dist/src/executors/command-publish/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.js +2 -2
- package/dist/src/executors/npm-publish/executor.mjs +3 -3
- package/dist/src/executors/npm-publish/untyped.mjs +1 -1
- 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.mjs +2 -2
- package/dist/src/utils/index.mjs +2 -2
- 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/package-manager.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/package.json +13 -13
|
@@ -21,6 +21,59 @@ var _child_process = require('child_process');
|
|
|
21
21
|
var _promises = require('fs/promises');
|
|
22
22
|
var _prettier = require('prettier');
|
|
23
23
|
var _prettierpluginpackagejson = require('prettier-plugin-packagejson'); var _prettierpluginpackagejson2 = _interopRequireDefault(_prettierpluginpackagejson);
|
|
24
|
+
|
|
25
|
+
// src/executors/npm-publish/publish-status.ts
|
|
26
|
+
var PUBLISH_VISIBILITY_ATTEMPTS = 60;
|
|
27
|
+
var PUBLISH_VISIBILITY_INTERVAL_MS = 5e3;
|
|
28
|
+
function commandOutputToString(output) {
|
|
29
|
+
if (Buffer.isBuffer(output)) {
|
|
30
|
+
return output.toString();
|
|
31
|
+
}
|
|
32
|
+
return typeof output === "string" ? output : "";
|
|
33
|
+
}
|
|
34
|
+
function isPreviouslyStagedVersionError(error, version) {
|
|
35
|
+
const commandError = error;
|
|
36
|
+
const stdout = commandOutputToString(_optionalChain([commandError, 'optionalAccess', _ => _.stdout]));
|
|
37
|
+
const stderr = commandOutputToString(_optionalChain([commandError, 'optionalAccess', _2 => _2.stderr]));
|
|
38
|
+
let code = "";
|
|
39
|
+
let summary = "";
|
|
40
|
+
try {
|
|
41
|
+
const parsed = JSON.parse(stdout);
|
|
42
|
+
code = _optionalChain([parsed, 'optionalAccess', _3 => _3.error, 'optionalAccess', _4 => _4.code]) || "";
|
|
43
|
+
summary = _optionalChain([parsed, 'optionalAccess', _5 => _5.error, 'optionalAccess', _6 => _6.summary]) || "";
|
|
44
|
+
} catch (e) {
|
|
45
|
+
}
|
|
46
|
+
const output = `${code}
|
|
47
|
+
${summary}
|
|
48
|
+
${stdout}
|
|
49
|
+
${stderr}`;
|
|
50
|
+
return output.includes("E409") && output.includes(`previously staged version "${version}"`);
|
|
51
|
+
}
|
|
52
|
+
async function waitForPublishedVersion({
|
|
53
|
+
version,
|
|
54
|
+
tag,
|
|
55
|
+
gitHead,
|
|
56
|
+
attempts = PUBLISH_VISIBILITY_ATTEMPTS,
|
|
57
|
+
intervalMs = PUBLISH_VISIBILITY_INTERVAL_MS,
|
|
58
|
+
getMetadata,
|
|
59
|
+
wait = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds))
|
|
60
|
+
}) {
|
|
61
|
+
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
62
|
+
try {
|
|
63
|
+
const metadata = await getMetadata();
|
|
64
|
+
if (metadata.version === version && _optionalChain([metadata, 'access', _7 => _7["dist-tags"], 'optionalAccess', _8 => _8[tag]]) === version && metadata.gitHead === gitHead) {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
} catch (e2) {
|
|
68
|
+
}
|
|
69
|
+
if (attempt < attempts - 1) {
|
|
70
|
+
await wait(intervalMs);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// src/executors/npm-publish/executor.ts
|
|
24
77
|
var LARGE_BUFFER = 1024 * 1e6;
|
|
25
78
|
async function replaceDepsAliases(jiti, packageRoot, workspaceRoot, packageManager) {
|
|
26
79
|
if (packageManager === "bun") {
|
|
@@ -44,7 +97,7 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
44
97
|
github.error("The `npm-publish` executor requires a `projectName`.");
|
|
45
98
|
return { success: false };
|
|
46
99
|
}
|
|
47
|
-
const projectConfig = _optionalChain([context, 'access',
|
|
100
|
+
const projectConfig = _optionalChain([context, 'access', _9 => _9.projectsConfigurations, 'optionalAccess', _10 => _10.projects, 'optionalAccess', _11 => _11[context.projectName]]);
|
|
48
101
|
if (!projectConfig) {
|
|
49
102
|
github.error(
|
|
50
103
|
`Could not find project configuration for \`${context.projectName}\``
|
|
@@ -55,7 +108,7 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
55
108
|
context.root,
|
|
56
109
|
options.packageRoot || _chunkCQDBLKPFjs.joinPaths.call(void 0, "dist", projectConfig.root)
|
|
57
110
|
);
|
|
58
|
-
const projectRoot = _optionalChain([context, 'access',
|
|
111
|
+
const projectRoot = _optionalChain([context, 'access', _12 => _12.projectsConfigurations, 'access', _13 => _13.projects, 'access', _14 => _14[context.projectName], 'optionalAccess', _15 => _15.root]) ? _chunkCQDBLKPFjs.joinPaths.call(void 0,
|
|
59
112
|
context.root,
|
|
60
113
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
61
114
|
context.projectsConfigurations.projects[context.projectName].root
|
|
@@ -130,6 +183,10 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
130
183
|
}
|
|
131
184
|
await replaceDepsAliases(jiti, packageRoot, context.root, packageManager);
|
|
132
185
|
await _chunkVXOPWQTJjs.addPackageJsonGitHead.call(void 0, packageRoot);
|
|
186
|
+
const publishPackageJson = JSON.parse(
|
|
187
|
+
await _promises.readFile.call(void 0, packageJsonPath, "utf8")
|
|
188
|
+
);
|
|
189
|
+
const currentVersion = options.version || packageJson.version;
|
|
133
190
|
const npmPublishCommandSegments = [`npm publish --json`];
|
|
134
191
|
const npmViewCommandSegments = [
|
|
135
192
|
`npm view ${packageName} versions dist-tags --json`
|
|
@@ -172,8 +229,35 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
172
229
|
if (tag) {
|
|
173
230
|
npmPublishCommandSegments.push(`--tag="${tag}" `);
|
|
174
231
|
}
|
|
232
|
+
const npmViewPublishedVersionCommandSegments = [
|
|
233
|
+
`npm view ${packageName}@${currentVersion} version dist-tags gitHead --json`
|
|
234
|
+
];
|
|
235
|
+
if (registry) {
|
|
236
|
+
npmViewPublishedVersionCommandSegments.push(`--registry="${registry}" `);
|
|
237
|
+
}
|
|
238
|
+
const waitForRegistryVisibility = () => waitForPublishedVersion({
|
|
239
|
+
version: currentVersion,
|
|
240
|
+
tag,
|
|
241
|
+
gitHead: publishPackageJson.gitHead,
|
|
242
|
+
getMetadata: () => {
|
|
243
|
+
const result = _child_process.execSync.call(void 0,
|
|
244
|
+
npmViewPublishedVersionCommandSegments.join(" "),
|
|
245
|
+
{
|
|
246
|
+
cwd: packageRoot,
|
|
247
|
+
env: {
|
|
248
|
+
NPM_ID_TOKEN: token,
|
|
249
|
+
...process.env,
|
|
250
|
+
FORCE_COLOR: "true"
|
|
251
|
+
},
|
|
252
|
+
maxBuffer: LARGE_BUFFER,
|
|
253
|
+
killSignal: "SIGTERM"
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
const parsed = JSON.parse(result.toString());
|
|
257
|
+
return Array.isArray(parsed) ? parsed[parsed.length - 1] || {} : parsed;
|
|
258
|
+
}
|
|
259
|
+
});
|
|
175
260
|
if (!isDryRun) {
|
|
176
|
-
const currentVersion = options.version || packageJson.version;
|
|
177
261
|
try {
|
|
178
262
|
try {
|
|
179
263
|
const result = _child_process.execSync.call(void 0, npmViewCommandSegments.join(" "), {
|
|
@@ -235,34 +319,34 @@ Execution response: ${result.toString()}`
|
|
|
235
319
|
return { success: true };
|
|
236
320
|
} catch (err) {
|
|
237
321
|
try {
|
|
238
|
-
const stdoutData = JSON.parse(_optionalChain([err, 'access',
|
|
239
|
-
if (_optionalChain([stdoutData, 'optionalAccess',
|
|
322
|
+
const stdoutData = JSON.parse(_optionalChain([err, 'access', _16 => _16.stdout, 'optionalAccess', _17 => _17.toString, 'call', _18 => _18()]) || "{}");
|
|
323
|
+
if (_optionalChain([stdoutData, 'optionalAccess', _19 => _19.error]) && !(_optionalChain([stdoutData, 'access', _20 => _20.error, 'optionalAccess', _21 => _21.code, 'optionalAccess', _22 => _22.includes, 'call', _23 => _23("E404")]) && _optionalChain([stdoutData, 'access', _24 => _24.error, 'optionalAccess', _25 => _25.summary, 'optionalAccess', _26 => _26.includes, 'call', _27 => _27("no such package available")])) && !(_optionalChain([err, 'access', _28 => _28.stderr, 'optionalAccess', _29 => _29.toString, 'call', _30 => _30(), 'access', _31 => _31.includes, 'call', _32 => _32("E404")]) && _optionalChain([err, 'access', _33 => _33.stderr, 'optionalAccess', _34 => _34.toString, 'call', _35 => _35(), 'access', _36 => _36.includes, 'call', _37 => _37("no such package available")]))) {
|
|
240
324
|
const errorMessage = `An unexpected error occured while running the npm dist-tag add command:
|
|
241
325
|
|
|
242
|
-
${_optionalChain([stdoutData, 'optionalAccess',
|
|
243
|
-
` : ""}${_optionalChain([stdoutData, 'optionalAccess',
|
|
326
|
+
${_optionalChain([stdoutData, 'optionalAccess', _38 => _38.error, 'optionalAccess', _39 => _39.summary]) ? `Summary: ${_optionalChain([stdoutData, 'optionalAccess', _40 => _40.error, 'optionalAccess', _41 => _41.summary])}${_optionalChain([stdoutData, 'optionalAccess', _42 => _42.error, 'optionalAccess', _43 => _43.code]) ? ` (${_optionalChain([stdoutData, 'optionalAccess', _44 => _44.error, 'optionalAccess', _45 => _45.code])})` : ""}
|
|
327
|
+
` : ""}${_optionalChain([stdoutData, 'optionalAccess', _46 => _46.error, 'optionalAccess', _47 => _47.detail]) ? `Detail: ${_optionalChain([stdoutData, 'optionalAccess', _48 => _48.error, 'optionalAccess', _49 => _49.detail])}
|
|
244
328
|
` : ""}`;
|
|
245
329
|
github.error(errorMessage);
|
|
246
330
|
return { success: false };
|
|
247
331
|
}
|
|
248
332
|
} catch (err2) {
|
|
249
|
-
const stdoutData = JSON.parse(_optionalChain([err2, 'access',
|
|
333
|
+
const stdoutData = JSON.parse(_optionalChain([err2, 'access', _50 => _50.stdout, 'optionalAccess', _51 => _51.toString, 'call', _52 => _52()]) || "{}");
|
|
250
334
|
const errorMessage = `An unexpected error occured while processing the npm dist-tag add output:
|
|
251
335
|
|
|
252
|
-
${_optionalChain([stdoutData, 'optionalAccess',
|
|
253
|
-
` : ""}${_optionalChain([stdoutData, 'optionalAccess',
|
|
336
|
+
${_optionalChain([stdoutData, 'optionalAccess', _53 => _53.error, 'optionalAccess', _54 => _54.summary]) ? `Summary: ${_optionalChain([stdoutData, 'optionalAccess', _55 => _55.error, 'optionalAccess', _56 => _56.summary])}${_optionalChain([stdoutData, 'optionalAccess', _57 => _57.error, 'optionalAccess', _58 => _58.code]) ? ` (${_optionalChain([stdoutData, 'optionalAccess', _59 => _59.error, 'optionalAccess', _60 => _60.code])})` : ""}
|
|
337
|
+
` : ""}${_optionalChain([stdoutData, 'optionalAccess', _61 => _61.error, 'optionalAccess', _62 => _62.detail]) ? `Detail: ${_optionalChain([stdoutData, 'optionalAccess', _63 => _63.error, 'optionalAccess', _64 => _64.detail])}
|
|
254
338
|
` : ""}`;
|
|
255
339
|
github.error(errorMessage);
|
|
256
340
|
return { success: false };
|
|
257
341
|
}
|
|
258
342
|
}
|
|
259
343
|
} catch (err) {
|
|
260
|
-
const stdoutData = JSON.parse(_optionalChain([err, 'access',
|
|
261
|
-
if (!(_optionalChain([stdoutData, 'access',
|
|
344
|
+
const stdoutData = JSON.parse(_optionalChain([err, 'access', _65 => _65.stdout, 'optionalAccess', _66 => _66.toString, 'call', _67 => _67()]) || "{}");
|
|
345
|
+
if (!(_optionalChain([stdoutData, 'access', _68 => _68.error, 'optionalAccess', _69 => _69.code, 'optionalAccess', _70 => _70.includes, 'call', _71 => _71("E404")]) && _optionalChain([stdoutData, 'access', _72 => _72.error, 'optionalAccess', _73 => _73.summary, 'optionalAccess', _74 => _74.toLowerCase, 'call', _75 => _75(), 'access', _76 => _76.includes, 'call', _77 => _77("not found")])) && !(_optionalChain([err, 'access', _78 => _78.stderr, 'optionalAccess', _79 => _79.toString, 'call', _80 => _80(), 'access', _81 => _81.includes, 'call', _82 => _82("E404")]) && _optionalChain([err, 'access', _83 => _83.stderr, 'optionalAccess', _84 => _84.toString, 'call', _85 => _85(), 'access', _86 => _86.toLowerCase, 'call', _87 => _87(), 'access', _88 => _88.includes, 'call', _89 => _89("not found")]))) {
|
|
262
346
|
const errorMessage = `An unexpected error occured while checking for existing dist-tags:
|
|
263
347
|
|
|
264
|
-
${_optionalChain([stdoutData, 'optionalAccess',
|
|
265
|
-
` : ""}${_optionalChain([stdoutData, 'optionalAccess',
|
|
348
|
+
${_optionalChain([stdoutData, 'optionalAccess', _90 => _90.error, 'optionalAccess', _91 => _91.summary]) ? `Summary: ${_optionalChain([stdoutData, 'optionalAccess', _92 => _92.error, 'optionalAccess', _93 => _93.summary])}${_optionalChain([stdoutData, 'optionalAccess', _94 => _94.error, 'optionalAccess', _95 => _95.code]) ? ` (${_optionalChain([stdoutData, 'optionalAccess', _96 => _96.error, 'optionalAccess', _97 => _97.code])})` : ""}
|
|
349
|
+
` : ""}${_optionalChain([stdoutData, 'optionalAccess', _98 => _98.error, 'optionalAccess', _99 => _99.detail]) ? `Detail: ${_optionalChain([stdoutData, 'optionalAccess', _100 => _100.error, 'optionalAccess', _101 => _101.detail])}
|
|
266
350
|
` : ""}`;
|
|
267
351
|
github.error(errorMessage);
|
|
268
352
|
return { success: false };
|
|
@@ -297,15 +381,32 @@ Execution response: ${result.toString()}` : ""}`
|
|
|
297
381
|
|
|
298
382
|
Execution response: ${result.toString()}` : ""}`
|
|
299
383
|
);
|
|
384
|
+
if (!await waitForRegistryVisibility()) {
|
|
385
|
+
github.error(
|
|
386
|
+
`npm publish completed, but ${packageName}@${currentVersion} did not become visible in ${registry} with tag "${tag}" before the processing timeout.`
|
|
387
|
+
);
|
|
388
|
+
return { success: false };
|
|
389
|
+
}
|
|
300
390
|
}
|
|
301
391
|
return { success: true };
|
|
302
392
|
} catch (err) {
|
|
393
|
+
if (!isDryRun && isPreviouslyStagedVersionError(err, currentVersion)) {
|
|
394
|
+
console.warn(
|
|
395
|
+
`npm reported that ${packageName}@${currentVersion} was previously staged. Waiting for npm to finish processing the package.`
|
|
396
|
+
);
|
|
397
|
+
if (await waitForRegistryVisibility()) {
|
|
398
|
+
console.info(
|
|
399
|
+
`Confirmed ${packageName}@${currentVersion} is available in ${registry} with tag "${tag}" and the expected gitHead.`
|
|
400
|
+
);
|
|
401
|
+
return { success: true };
|
|
402
|
+
}
|
|
403
|
+
}
|
|
303
404
|
try {
|
|
304
|
-
const stdoutData = JSON.parse(_optionalChain([err, 'access',
|
|
405
|
+
const stdoutData = JSON.parse(_optionalChain([err, 'access', _102 => _102.stdout, 'optionalAccess', _103 => _103.toString, 'call', _104 => _104()]) || "{}");
|
|
305
406
|
const errorMessage = `An error occurred while publishing the npm package:
|
|
306
407
|
|
|
307
|
-
${_optionalChain([stdoutData, 'optionalAccess',
|
|
308
|
-
` : ""}${_optionalChain([stdoutData, 'optionalAccess',
|
|
408
|
+
${_optionalChain([stdoutData, 'optionalAccess', _105 => _105.error, 'optionalAccess', _106 => _106.summary]) ? `Summary: ${_optionalChain([stdoutData, 'optionalAccess', _107 => _107.error, 'optionalAccess', _108 => _108.summary])}${_optionalChain([stdoutData, 'optionalAccess', _109 => _109.error, 'optionalAccess', _110 => _110.code]) ? ` (${_optionalChain([stdoutData, 'optionalAccess', _111 => _111.error, 'optionalAccess', _112 => _112.code])})` : ""}
|
|
409
|
+
` : ""}${_optionalChain([stdoutData, 'optionalAccess', _113 => _113.error, 'optionalAccess', _114 => _114.detail]) ? `Detail: ${_optionalChain([stdoutData, 'optionalAccess', _115 => _115.error, 'optionalAccess', _116 => _116.detail])}
|
|
309
410
|
` : ""}`;
|
|
310
411
|
github.error(errorMessage);
|
|
311
412
|
return { success: false };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=
|
|
1
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=a9def7e06ce25c19654987ab91979289197bf4d3e7e124c514a4487c3e8d68c6__c2d17e3c915408e362a43028bd1d170e/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);
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-EXRSULNO.mjs";
|
|
4
4
|
import {
|
|
5
5
|
getGitHubTools
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JZYF4DSL.mjs";
|
|
7
7
|
import {
|
|
8
8
|
addPackageJsonGitHead,
|
|
9
9
|
stripPrivateWorkspaceDeps
|
|
@@ -21,6 +21,59 @@ import { execSync } from "node:child_process";
|
|
|
21
21
|
import { readFile, writeFile } from "node:fs/promises";
|
|
22
22
|
import { format } from "prettier";
|
|
23
23
|
import prettierPlugin from "prettier-plugin-packagejson";
|
|
24
|
+
|
|
25
|
+
// src/executors/npm-publish/publish-status.ts
|
|
26
|
+
var PUBLISH_VISIBILITY_ATTEMPTS = 60;
|
|
27
|
+
var PUBLISH_VISIBILITY_INTERVAL_MS = 5e3;
|
|
28
|
+
function commandOutputToString(output) {
|
|
29
|
+
if (Buffer.isBuffer(output)) {
|
|
30
|
+
return output.toString();
|
|
31
|
+
}
|
|
32
|
+
return typeof output === "string" ? output : "";
|
|
33
|
+
}
|
|
34
|
+
function isPreviouslyStagedVersionError(error, version) {
|
|
35
|
+
const commandError = error;
|
|
36
|
+
const stdout = commandOutputToString(commandError?.stdout);
|
|
37
|
+
const stderr = commandOutputToString(commandError?.stderr);
|
|
38
|
+
let code = "";
|
|
39
|
+
let summary = "";
|
|
40
|
+
try {
|
|
41
|
+
const parsed = JSON.parse(stdout);
|
|
42
|
+
code = parsed?.error?.code || "";
|
|
43
|
+
summary = parsed?.error?.summary || "";
|
|
44
|
+
} catch {
|
|
45
|
+
}
|
|
46
|
+
const output = `${code}
|
|
47
|
+
${summary}
|
|
48
|
+
${stdout}
|
|
49
|
+
${stderr}`;
|
|
50
|
+
return output.includes("E409") && output.includes(`previously staged version "${version}"`);
|
|
51
|
+
}
|
|
52
|
+
async function waitForPublishedVersion({
|
|
53
|
+
version,
|
|
54
|
+
tag,
|
|
55
|
+
gitHead,
|
|
56
|
+
attempts = PUBLISH_VISIBILITY_ATTEMPTS,
|
|
57
|
+
intervalMs = PUBLISH_VISIBILITY_INTERVAL_MS,
|
|
58
|
+
getMetadata,
|
|
59
|
+
wait = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds))
|
|
60
|
+
}) {
|
|
61
|
+
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
62
|
+
try {
|
|
63
|
+
const metadata = await getMetadata();
|
|
64
|
+
if (metadata.version === version && metadata["dist-tags"]?.[tag] === version && metadata.gitHead === gitHead) {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
} catch {
|
|
68
|
+
}
|
|
69
|
+
if (attempt < attempts - 1) {
|
|
70
|
+
await wait(intervalMs);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// src/executors/npm-publish/executor.ts
|
|
24
77
|
var LARGE_BUFFER = 1024 * 1e6;
|
|
25
78
|
async function replaceDepsAliases(jiti, packageRoot, workspaceRoot, packageManager) {
|
|
26
79
|
if (packageManager === "bun") {
|
|
@@ -130,6 +183,10 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
130
183
|
}
|
|
131
184
|
await replaceDepsAliases(jiti, packageRoot, context.root, packageManager);
|
|
132
185
|
await addPackageJsonGitHead(packageRoot);
|
|
186
|
+
const publishPackageJson = JSON.parse(
|
|
187
|
+
await readFile(packageJsonPath, "utf8")
|
|
188
|
+
);
|
|
189
|
+
const currentVersion = options.version || packageJson.version;
|
|
133
190
|
const npmPublishCommandSegments = [`npm publish --json`];
|
|
134
191
|
const npmViewCommandSegments = [
|
|
135
192
|
`npm view ${packageName} versions dist-tags --json`
|
|
@@ -172,8 +229,35 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
172
229
|
if (tag) {
|
|
173
230
|
npmPublishCommandSegments.push(`--tag="${tag}" `);
|
|
174
231
|
}
|
|
232
|
+
const npmViewPublishedVersionCommandSegments = [
|
|
233
|
+
`npm view ${packageName}@${currentVersion} version dist-tags gitHead --json`
|
|
234
|
+
];
|
|
235
|
+
if (registry) {
|
|
236
|
+
npmViewPublishedVersionCommandSegments.push(`--registry="${registry}" `);
|
|
237
|
+
}
|
|
238
|
+
const waitForRegistryVisibility = () => waitForPublishedVersion({
|
|
239
|
+
version: currentVersion,
|
|
240
|
+
tag,
|
|
241
|
+
gitHead: publishPackageJson.gitHead,
|
|
242
|
+
getMetadata: () => {
|
|
243
|
+
const result = execSync(
|
|
244
|
+
npmViewPublishedVersionCommandSegments.join(" "),
|
|
245
|
+
{
|
|
246
|
+
cwd: packageRoot,
|
|
247
|
+
env: {
|
|
248
|
+
NPM_ID_TOKEN: token,
|
|
249
|
+
...process.env,
|
|
250
|
+
FORCE_COLOR: "true"
|
|
251
|
+
},
|
|
252
|
+
maxBuffer: LARGE_BUFFER,
|
|
253
|
+
killSignal: "SIGTERM"
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
const parsed = JSON.parse(result.toString());
|
|
257
|
+
return Array.isArray(parsed) ? parsed[parsed.length - 1] || {} : parsed;
|
|
258
|
+
}
|
|
259
|
+
});
|
|
175
260
|
if (!isDryRun) {
|
|
176
|
-
const currentVersion = options.version || packageJson.version;
|
|
177
261
|
try {
|
|
178
262
|
try {
|
|
179
263
|
const result = execSync(npmViewCommandSegments.join(" "), {
|
|
@@ -297,9 +381,26 @@ Execution response: ${result.toString()}` : ""}`
|
|
|
297
381
|
|
|
298
382
|
Execution response: ${result.toString()}` : ""}`
|
|
299
383
|
);
|
|
384
|
+
if (!await waitForRegistryVisibility()) {
|
|
385
|
+
github.error(
|
|
386
|
+
`npm publish completed, but ${packageName}@${currentVersion} did not become visible in ${registry} with tag "${tag}" before the processing timeout.`
|
|
387
|
+
);
|
|
388
|
+
return { success: false };
|
|
389
|
+
}
|
|
300
390
|
}
|
|
301
391
|
return { success: true };
|
|
302
392
|
} catch (err) {
|
|
393
|
+
if (!isDryRun && isPreviouslyStagedVersionError(err, currentVersion)) {
|
|
394
|
+
console.warn(
|
|
395
|
+
`npm reported that ${packageName}@${currentVersion} was previously staged. Waiting for npm to finish processing the package.`
|
|
396
|
+
);
|
|
397
|
+
if (await waitForRegistryVisibility()) {
|
|
398
|
+
console.info(
|
|
399
|
+
`Confirmed ${packageName}@${currentVersion} is available in ${registry} with tag "${tag}" and the expected gitHead.`
|
|
400
|
+
);
|
|
401
|
+
return { success: true };
|
|
402
|
+
}
|
|
403
|
+
}
|
|
303
404
|
try {
|
|
304
405
|
const stdoutData = JSON.parse(err.stdout?.toString() || "{}");
|
|
305
406
|
const errorMessage = `An error occurred while publishing the npm package:
|
package/dist/executors.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-TEX5JJNH.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkUEDAT7SJjs = require('./chunk-UEDAT7SJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkZWUGCEBZjs = require('./chunk-ZWUGCEBZ.js');
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkVKLLVYQ5js = require('./chunk-VKLLVYQ5.js');
|
|
11
|
+
require('./chunk-I2HFAJPK.js');
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
var _chunk65C6CGV3js = require('./chunk-65C6CGV3.js');
|
|
@@ -14,14 +17,14 @@ var _chunk65C6CGV3js = require('./chunk-65C6CGV3.js');
|
|
|
14
17
|
var _chunkULONYXYFjs = require('./chunk-ULONYXYF.js');
|
|
15
18
|
|
|
16
19
|
|
|
17
|
-
var
|
|
20
|
+
var _chunk3AHXYCKAjs = require('./chunk-3AHXYCKA.js');
|
|
18
21
|
require('./chunk-KCQIASWP.js');
|
|
19
22
|
|
|
20
23
|
|
|
21
24
|
var _chunkN5LZIOWWjs = require('./chunk-N5LZIOWW.js');
|
|
22
25
|
|
|
23
26
|
|
|
24
|
-
var
|
|
27
|
+
var _chunkIV2QQRXOjs = require('./chunk-IV2QQRXO.js');
|
|
25
28
|
|
|
26
29
|
|
|
27
30
|
var _chunkKDZH66U5js = require('./chunk-KDZH66U5.js');
|
|
@@ -33,9 +36,6 @@ var _chunk6W7UEKUNjs = require('./chunk-6W7UEKUN.js');
|
|
|
33
36
|
var _chunkXXCBFZB6js = require('./chunk-XXCBFZB6.js');
|
|
34
37
|
|
|
35
38
|
|
|
36
|
-
var _chunk3AHXYCKAjs = require('./chunk-3AHXYCKA.js');
|
|
37
|
-
|
|
38
|
-
|
|
39
39
|
var _chunkWKCSKEFYjs = require('./chunk-WKCSKEFY.js');
|
|
40
40
|
require('./chunk-3MXZ2RJF.js');
|
|
41
41
|
require('./chunk-HYK7OVZ3.js');
|
package/dist/executors.mjs
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import "./chunk-OYOYESMB.mjs";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
typiaExecutorFn
|
|
4
|
+
} from "./chunk-B2MF67R6.mjs";
|
|
5
5
|
import {
|
|
6
6
|
unbuildExecutorFn
|
|
7
7
|
} from "./chunk-N2PEIA6H.mjs";
|
|
8
|
-
import
|
|
8
|
+
import {
|
|
9
|
+
napiExecutor
|
|
10
|
+
} from "./chunk-U6J67ZUE.mjs";
|
|
11
|
+
import "./chunk-LGXT7X2B.mjs";
|
|
9
12
|
import {
|
|
10
13
|
sizeLimitExecutorFn
|
|
11
14
|
} from "./chunk-I7RM7R7C.mjs";
|
|
@@ -13,15 +16,15 @@ import {
|
|
|
13
16
|
tsdownExecutorFn
|
|
14
17
|
} from "./chunk-MOIGXVIF.mjs";
|
|
15
18
|
import {
|
|
16
|
-
|
|
17
|
-
} from "./chunk-
|
|
19
|
+
getRegistryVersion
|
|
20
|
+
} from "./chunk-QQ64FCAP.mjs";
|
|
18
21
|
import "./chunk-52ZDVDIY.mjs";
|
|
19
22
|
import {
|
|
20
23
|
esbuildExecutorFn
|
|
21
24
|
} from "./chunk-XLOJK63P.mjs";
|
|
22
25
|
import {
|
|
23
|
-
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
cargoCheckExecutor
|
|
27
|
+
} from "./chunk-36N55IVK.mjs";
|
|
25
28
|
import {
|
|
26
29
|
cargoClippyExecutor
|
|
27
30
|
} from "./chunk-UZ25NC7M.mjs";
|
|
@@ -31,15 +34,12 @@ import {
|
|
|
31
34
|
import {
|
|
32
35
|
cargoFormatExecutor
|
|
33
36
|
} from "./chunk-LYZ5ACPN.mjs";
|
|
34
|
-
import {
|
|
35
|
-
getRegistryVersion
|
|
36
|
-
} from "./chunk-QQ64FCAP.mjs";
|
|
37
37
|
import {
|
|
38
38
|
cargoBuildExecutor
|
|
39
39
|
} from "./chunk-XMATGAG4.mjs";
|
|
40
40
|
import "./chunk-EXRSULNO.mjs";
|
|
41
41
|
import "./chunk-C3G4MZGP.mjs";
|
|
42
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-JZYF4DSL.mjs";
|
|
43
43
|
import "./chunk-G4DPDEL3.mjs";
|
|
44
44
|
import "./chunk-UA33NH5O.mjs";
|
|
45
45
|
import "./chunk-2GQSCZ3J.mjs";
|
|
@@ -49,7 +49,7 @@ import "./chunk-I4KVL3GR.mjs";
|
|
|
49
49
|
import "./chunk-45CW7OJB.mjs";
|
|
50
50
|
import "./chunk-JUJWJXED.mjs";
|
|
51
51
|
import "./chunk-TBW5MCN6.mjs";
|
|
52
|
-
import "./chunk-
|
|
52
|
+
import "./chunk-JBSWEDCZ.mjs";
|
|
53
53
|
export {
|
|
54
54
|
cargoBuildExecutor,
|
|
55
55
|
cargoCheckExecutor,
|
package/dist/generators.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-C3TC7AUW.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
var _chunkOKSECMVKjs = require('./chunk-OKSECMVK.js');
|
|
5
|
+
|
|
6
|
+
|
|
4
7
|
var _chunkW4JSEGT2js = require('./chunk-W4JSEGT2.js');
|
|
5
8
|
|
|
6
9
|
|
|
@@ -14,9 +17,6 @@ var _chunkXV4FCARJjs = require('./chunk-XV4FCARJ.js');
|
|
|
14
17
|
|
|
15
18
|
|
|
16
19
|
var _chunk32MOOPKKjs = require('./chunk-32MOOPKK.js');
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var _chunkOKSECMVKjs = require('./chunk-OKSECMVK.js');
|
|
20
20
|
require('./chunk-HN5UXNLM.js');
|
|
21
21
|
require('./chunk-ILSI74FW.js');
|
|
22
22
|
require('./chunk-3G7PNDZ5.js');
|
package/dist/generators.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import "./chunk-SAIDGUHG.mjs";
|
|
2
|
+
import {
|
|
3
|
+
initGenerator
|
|
4
|
+
} from "./chunk-437WGH2M.mjs";
|
|
2
5
|
import {
|
|
3
6
|
neutralLibraryGeneratorFn
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2SBG5C7W.mjs";
|
|
5
8
|
import {
|
|
6
9
|
nodeLibraryGeneratorFn
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MCLHT3FA.mjs";
|
|
8
11
|
import {
|
|
9
12
|
presetGeneratorFn
|
|
10
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YYQN5FVN.mjs";
|
|
11
14
|
import {
|
|
12
15
|
browserLibraryGeneratorFn
|
|
13
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-V4SED27K.mjs";
|
|
14
17
|
import {
|
|
15
18
|
configSchemaGeneratorFn
|
|
16
19
|
} from "./chunk-EYIUJSGD.mjs";
|
|
17
|
-
import {
|
|
18
|
-
initGenerator
|
|
19
|
-
} from "./chunk-437WGH2M.mjs";
|
|
20
20
|
import "./chunk-VQYZG5YE.mjs";
|
|
21
21
|
import "./chunk-XSHN3XHD.mjs";
|
|
22
22
|
import "./chunk-DEHA5C77.mjs";
|
|
@@ -27,7 +27,7 @@ import "./chunk-I4KVL3GR.mjs";
|
|
|
27
27
|
import "./chunk-45CW7OJB.mjs";
|
|
28
28
|
import "./chunk-JUJWJXED.mjs";
|
|
29
29
|
import "./chunk-TBW5MCN6.mjs";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-JBSWEDCZ.mjs";
|
|
31
31
|
export {
|
|
32
32
|
browserLibraryGeneratorFn,
|
|
33
33
|
configSchemaGeneratorFn,
|
package/dist/index.js
CHANGED
|
@@ -45,11 +45,14 @@ var _chunkDIIMX7QFjs = require('./chunk-DIIMX7QF.js');
|
|
|
45
45
|
require('./chunk-TEX5JJNH.js');
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunkUEDAT7SJjs = require('./chunk-UEDAT7SJ.js');
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
var _chunkZWUGCEBZjs = require('./chunk-ZWUGCEBZ.js');
|
|
52
|
-
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
var _chunkVKLLVYQ5js = require('./chunk-VKLLVYQ5.js');
|
|
55
|
+
require('./chunk-I2HFAJPK.js');
|
|
53
56
|
|
|
54
57
|
|
|
55
58
|
var _chunk65C6CGV3js = require('./chunk-65C6CGV3.js');
|
|
@@ -58,14 +61,14 @@ var _chunk65C6CGV3js = require('./chunk-65C6CGV3.js');
|
|
|
58
61
|
var _chunkULONYXYFjs = require('./chunk-ULONYXYF.js');
|
|
59
62
|
|
|
60
63
|
|
|
61
|
-
var
|
|
64
|
+
var _chunk3AHXYCKAjs = require('./chunk-3AHXYCKA.js');
|
|
62
65
|
require('./chunk-KCQIASWP.js');
|
|
63
66
|
|
|
64
67
|
|
|
65
68
|
var _chunkN5LZIOWWjs = require('./chunk-N5LZIOWW.js');
|
|
66
69
|
|
|
67
70
|
|
|
68
|
-
var
|
|
71
|
+
var _chunkIV2QQRXOjs = require('./chunk-IV2QQRXO.js');
|
|
69
72
|
|
|
70
73
|
|
|
71
74
|
var _chunkKDZH66U5js = require('./chunk-KDZH66U5.js');
|
|
@@ -77,9 +80,6 @@ var _chunk6W7UEKUNjs = require('./chunk-6W7UEKUN.js');
|
|
|
77
80
|
var _chunkXXCBFZB6js = require('./chunk-XXCBFZB6.js');
|
|
78
81
|
|
|
79
82
|
|
|
80
|
-
var _chunk3AHXYCKAjs = require('./chunk-3AHXYCKA.js');
|
|
81
|
-
|
|
82
|
-
|
|
83
83
|
var _chunkWKCSKEFYjs = require('./chunk-WKCSKEFY.js');
|
|
84
84
|
|
|
85
85
|
|
|
@@ -110,6 +110,9 @@ require('./chunk-N2365RCI.js');
|
|
|
110
110
|
require('./chunk-C3TC7AUW.js');
|
|
111
111
|
|
|
112
112
|
|
|
113
|
+
var _chunkOKSECMVKjs = require('./chunk-OKSECMVK.js');
|
|
114
|
+
|
|
115
|
+
|
|
113
116
|
var _chunkW4JSEGT2js = require('./chunk-W4JSEGT2.js');
|
|
114
117
|
|
|
115
118
|
|
|
@@ -125,9 +128,6 @@ var _chunkXV4FCARJjs = require('./chunk-XV4FCARJ.js');
|
|
|
125
128
|
var _chunk32MOOPKKjs = require('./chunk-32MOOPKK.js');
|
|
126
129
|
|
|
127
130
|
|
|
128
|
-
var _chunkOKSECMVKjs = require('./chunk-OKSECMVK.js');
|
|
129
|
-
|
|
130
|
-
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
|