pubm 0.2.10 → 0.2.12

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/bin/cli.js CHANGED
@@ -6797,6 +6797,9 @@ var NpmRegistry = class extends Registry {
6797
6797
  if (error instanceof NonZeroExitError4 && error.output?.stderr.includes("EOTP")) {
6798
6798
  return false;
6799
6799
  }
6800
+ if (this.isProvenanceError(error)) {
6801
+ return this.publish();
6802
+ }
6800
6803
  throw this.classifyPublishError(error);
6801
6804
  }
6802
6805
  }
@@ -6850,6 +6853,11 @@ ${stderr}` : ""}`,
6850
6853
  requiredManifest: "package.json"
6851
6854
  };
6852
6855
  }
6856
+ isProvenanceError(error) {
6857
+ if (!(error instanceof NonZeroExitError4)) return false;
6858
+ const stderr = error.output?.stderr ?? "";
6859
+ return stderr.includes("verifying sigstore provenance") || stderr.includes("provenance bundle");
6860
+ }
6853
6861
  classifyPublishError(error) {
6854
6862
  if (error instanceof NonZeroExitError4) {
6855
6863
  const stderr = error.output?.stderr ?? "";
@@ -6858,16 +6866,23 @@ ${stderr}` : ""}`,
6858
6866
  }
6859
6867
  if (stderr.includes("403") || stderr.includes("Forbidden")) {
6860
6868
  return new NpmError(
6861
- "Permission denied (403 Forbidden). Check your npm access token permissions.",
6869
+ `Permission denied (403 Forbidden). Check your npm access token permissions.${stderr ? `
6870
+ ${stderr}` : ""}`,
6862
6871
  { cause: error }
6863
6872
  );
6864
6873
  }
6865
6874
  if (stderr.includes("429") || stderr.includes("Too Many Requests")) {
6866
6875
  return new NpmError(
6867
- "Rate limited by npm registry. Please wait and try again.",
6876
+ `Rate limited by npm registry. Please wait and try again.${stderr ? `
6877
+ ${stderr}` : ""}`,
6868
6878
  { cause: error }
6869
6879
  );
6870
6880
  }
6881
+ return new NpmError(
6882
+ `Failed to publish to npm${stderr ? `
6883
+ ${stderr}` : ""}`,
6884
+ { cause: error }
6885
+ );
6871
6886
  }
6872
6887
  return new NpmError("Failed to publish to npm", { cause: error });
6873
6888
  }
package/dist/index.cjs CHANGED
@@ -6253,6 +6253,9 @@ var NpmRegistry = class extends Registry {
6253
6253
  if (error instanceof import_tinyexec6.NonZeroExitError && error.output?.stderr.includes("EOTP")) {
6254
6254
  return false;
6255
6255
  }
6256
+ if (this.isProvenanceError(error)) {
6257
+ return this.publish();
6258
+ }
6256
6259
  throw this.classifyPublishError(error);
6257
6260
  }
6258
6261
  }
@@ -6306,6 +6309,11 @@ ${stderr}` : ""}`,
6306
6309
  requiredManifest: "package.json"
6307
6310
  };
6308
6311
  }
6312
+ isProvenanceError(error) {
6313
+ if (!(error instanceof import_tinyexec6.NonZeroExitError)) return false;
6314
+ const stderr = error.output?.stderr ?? "";
6315
+ return stderr.includes("verifying sigstore provenance") || stderr.includes("provenance bundle");
6316
+ }
6309
6317
  classifyPublishError(error) {
6310
6318
  if (error instanceof import_tinyexec6.NonZeroExitError) {
6311
6319
  const stderr = error.output?.stderr ?? "";
@@ -6314,16 +6322,23 @@ ${stderr}` : ""}`,
6314
6322
  }
6315
6323
  if (stderr.includes("403") || stderr.includes("Forbidden")) {
6316
6324
  return new NpmError(
6317
- "Permission denied (403 Forbidden). Check your npm access token permissions.",
6325
+ `Permission denied (403 Forbidden). Check your npm access token permissions.${stderr ? `
6326
+ ${stderr}` : ""}`,
6318
6327
  { cause: error }
6319
6328
  );
6320
6329
  }
6321
6330
  if (stderr.includes("429") || stderr.includes("Too Many Requests")) {
6322
6331
  return new NpmError(
6323
- "Rate limited by npm registry. Please wait and try again.",
6332
+ `Rate limited by npm registry. Please wait and try again.${stderr ? `
6333
+ ${stderr}` : ""}`,
6324
6334
  { cause: error }
6325
6335
  );
6326
6336
  }
6337
+ return new NpmError(
6338
+ `Failed to publish to npm${stderr ? `
6339
+ ${stderr}` : ""}`,
6340
+ { cause: error }
6341
+ );
6327
6342
  }
6328
6343
  return new NpmError("Failed to publish to npm", { cause: error });
6329
6344
  }
package/dist/index.js CHANGED
@@ -6218,6 +6218,9 @@ var NpmRegistry = class extends Registry {
6218
6218
  if (error instanceof NonZeroExitError4 && error.output?.stderr.includes("EOTP")) {
6219
6219
  return false;
6220
6220
  }
6221
+ if (this.isProvenanceError(error)) {
6222
+ return this.publish();
6223
+ }
6221
6224
  throw this.classifyPublishError(error);
6222
6225
  }
6223
6226
  }
@@ -6271,6 +6274,11 @@ ${stderr}` : ""}`,
6271
6274
  requiredManifest: "package.json"
6272
6275
  };
6273
6276
  }
6277
+ isProvenanceError(error) {
6278
+ if (!(error instanceof NonZeroExitError4)) return false;
6279
+ const stderr = error.output?.stderr ?? "";
6280
+ return stderr.includes("verifying sigstore provenance") || stderr.includes("provenance bundle");
6281
+ }
6274
6282
  classifyPublishError(error) {
6275
6283
  if (error instanceof NonZeroExitError4) {
6276
6284
  const stderr = error.output?.stderr ?? "";
@@ -6279,16 +6287,23 @@ ${stderr}` : ""}`,
6279
6287
  }
6280
6288
  if (stderr.includes("403") || stderr.includes("Forbidden")) {
6281
6289
  return new NpmError(
6282
- "Permission denied (403 Forbidden). Check your npm access token permissions.",
6290
+ `Permission denied (403 Forbidden). Check your npm access token permissions.${stderr ? `
6291
+ ${stderr}` : ""}`,
6283
6292
  { cause: error }
6284
6293
  );
6285
6294
  }
6286
6295
  if (stderr.includes("429") || stderr.includes("Too Many Requests")) {
6287
6296
  return new NpmError(
6288
- "Rate limited by npm registry. Please wait and try again.",
6297
+ `Rate limited by npm registry. Please wait and try again.${stderr ? `
6298
+ ${stderr}` : ""}`,
6289
6299
  { cause: error }
6290
6300
  );
6291
6301
  }
6302
+ return new NpmError(
6303
+ `Failed to publish to npm${stderr ? `
6304
+ ${stderr}` : ""}`,
6305
+ { cause: error }
6306
+ );
6292
6307
  }
6293
6308
  return new NpmError("Failed to publish to npm", { cause: error });
6294
6309
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pubm",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "engines": {
5
5
  "node": ">=18",
6
6
  "git": ">=2.11.0"