onreza-release 2.1.1 → 2.2.0

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/index.js CHANGED
@@ -2453,6 +2453,9 @@ function compareVersions(a, b) {
2453
2453
  return 0;
2454
2454
  }
2455
2455
 
2456
+ // src/binaries.ts
2457
+ import { spawn } from "node:child_process";
2458
+
2456
2459
  // src/utils/binary-distribution-provider.ts
2457
2460
  import { stat as stat3 } from "node:fs/promises";
2458
2461
  import { basename, extname } from "node:path";
@@ -2937,6 +2940,21 @@ async function updatePackageJsonForBinaries(options) {
2937
2940
  function sleep2(ms) {
2938
2941
  return new Promise((resolve3) => setTimeout(resolve3, ms));
2939
2942
  }
2943
+ function runCommand(command) {
2944
+ return new Promise((resolve3) => {
2945
+ const child = spawn(command, { shell: true, stdio: "inherit" });
2946
+ child.on("close", (code) => {
2947
+ if (code === 0) {
2948
+ resolve3({ output: "", success: true });
2949
+ } else {
2950
+ resolve3({ error: `Exit code: ${code}`, output: "", success: false });
2951
+ }
2952
+ });
2953
+ child.on("error", (err) => {
2954
+ resolve3({ error: err.message, output: "", success: false });
2955
+ });
2956
+ });
2957
+ }
2940
2958
  function calculateDelay2(attempt, initialDelay = 2000, maxDelay = 30000) {
2941
2959
  const delay = initialDelay * 2 ** attempt;
2942
2960
  return Math.min(delay, maxDelay);
@@ -3082,11 +3100,22 @@ async function publishBinaries(options = {}) {
3082
3100
  manifest,
3083
3101
  npmConfig
3084
3102
  });
3085
- console.log(`
3103
+ if (options.npmPublish) {
3104
+ console.log(`
3105
+ \uD83D\uDCE4 Publishing to npm: ${options.npmPublish}`);
3106
+ const publishResult = await runCommand(options.npmPublish);
3107
+ if (!publishResult.success) {
3108
+ result.errors.push(`npm publish failed: ${publishResult.error}`);
3109
+ return result;
3110
+ }
3111
+ console.log("✅ npm package published successfully!");
3112
+ } else {
3113
+ console.log(`
3086
3114
  \uD83D\uDCA1 Next steps:`);
3087
- console.log(" 1. Review generated files in scripts/ and bin/");
3088
- console.log(" 2. Run: npm publish (or bun publish)");
3089
- console.log(` 3. Users install with: npm install ${binariesConfig.name}`);
3115
+ console.log(" 1. Review generated files in scripts/ and bin/");
3116
+ console.log(" 2. Run: npm publish (or bun publish)");
3117
+ console.log(` 3. Users install with: npm install ${binariesConfig.name}`);
3118
+ }
3090
3119
  } else {
3091
3120
  console.log(`
3092
3121
  \uD83D\uDCDD Generated manifest:`);
@@ -3556,4 +3585,4 @@ export {
3556
3585
  ALL_PLATFORMS
3557
3586
  };
3558
3587
 
3559
- //# debugId=746BDA0A2FEA846A64756E2164756E21
3588
+ //# debugId=038F785E00B790EF64756E2164756E21