@bensandee/tooling 0.52.1 → 0.52.2

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.
Files changed (2) hide show
  1. package/dist/bin.mjs +36 -7
  2. package/package.json +1 -1
package/dist/bin.mjs CHANGED
@@ -1596,7 +1596,7 @@ async function generatePackageJson(ctx) {
1596
1596
  const devDeps = { ...ROOT_DEV_DEPS };
1597
1597
  if (!isMonorepo) Object.assign(devDeps, PER_PACKAGE_DEV_DEPS);
1598
1598
  devDeps["@bensandee/config"] = isWorkspacePackage(ctx, "@bensandee/config") ? "workspace:*" : "0.10.2";
1599
- devDeps["@bensandee/tooling"] = isWorkspacePackage(ctx, "@bensandee/tooling") ? "workspace:*" : "0.52.1";
1599
+ devDeps["@bensandee/tooling"] = isWorkspacePackage(ctx, "@bensandee/tooling") ? "workspace:*" : "0.52.2";
1600
1600
  if (ctx.config.useEslintPlugin) devDeps["@bensandee/eslint-plugin"] = isWorkspacePackage(ctx, "@bensandee/eslint-plugin") ? "workspace:*" : "0.12.0";
1601
1601
  if (ctx.config.formatter === "oxfmt") devDeps["oxfmt"] = {
1602
1602
  "@changesets/cli": "2.30.0",
@@ -3368,7 +3368,7 @@ async function runGenerators(ctx) {
3368
3368
  function generateMigratePrompt(results, config, detected) {
3369
3369
  const sections = [];
3370
3370
  const timestamp = (/* @__PURE__ */ new Date()).toISOString();
3371
- sections.push(`# Migration Prompt\n\n_Generated by \`@bensandee/tooling@0.52.1 repo:sync\` on ${timestamp}_\n`);
3371
+ sections.push(`# Migration Prompt\n\n_Generated by \`@bensandee/tooling@0.52.2 repo:sync\` on ${timestamp}_\n`);
3372
3372
  const changed = results.filter((r) => r.action === "created" || r.action === "updated" || r.action === "archived");
3373
3373
  if (changed.length > 0) {
3374
3374
  const items = changed.map((r) => {
@@ -6620,11 +6620,39 @@ async function sendWebhook(options) {
6620
6620
  } catch (error) {
6621
6621
  return {
6622
6622
  ok: false,
6623
- error: error instanceof Error ? error.message : String(error)
6623
+ error: formatError(error)
6624
6624
  };
6625
6625
  }
6626
6626
  }
6627
6627
  /**
6628
+ * Flatten an error and its `cause` chain into a single message.
6629
+ * Node's `fetch` wraps the real network error (ENOTFOUND, ECONNREFUSED, TLS
6630
+ * issues) inside a generic `TypeError: fetch failed`, with the actual cause
6631
+ * on `error.cause` — walking the chain surfaces the useful diagnostic.
6632
+ */
6633
+ function formatError(error) {
6634
+ if (!(error instanceof Error)) return String(error);
6635
+ const parts = [error.message];
6636
+ let cause = error.cause;
6637
+ while (cause instanceof Error) {
6638
+ parts.push(cause.message);
6639
+ cause = cause.cause;
6640
+ }
6641
+ return parts.join(": ");
6642
+ }
6643
+ /**
6644
+ * Mask a secret for diagnostic output: reveal the first/last 3 chars and the
6645
+ * length so misconfiguration (wrong secret, truncated env var) is visible
6646
+ * without leaking the actual value. Short secrets are replaced entirely.
6647
+ */
6648
+ function maskSecret(secret) {
6649
+ if (secret === void 0) return "<none>";
6650
+ const len = secret.length;
6651
+ if (len === 0) return "<empty>";
6652
+ if (len <= 8) return `<${String(len)} chars>`;
6653
+ return `${secret.slice(0, 3)}…${secret.slice(-3)} (${String(len)} chars)`;
6654
+ }
6655
+ /**
6628
6656
  * Send a webhook and log the result. Intended for CLI usage.
6629
6657
  * Never throws.
6630
6658
  */
@@ -6634,15 +6662,16 @@ async function sendWebhookWithLogging(url, secret, payload) {
6634
6662
  secret,
6635
6663
  payload
6636
6664
  });
6637
- if (result.ok) log.info("Post-release hook completed successfully");
6638
- else log.warn(`Post-release hook failed: ${result.error ?? "unknown error"}`);
6665
+ const context = `url=${url}, secret=${maskSecret(secret)}`;
6666
+ if (result.ok) log.info(`Post-release hook completed successfully (${context})`);
6667
+ else log.warn(`Post-release hook failed: ${result.error ?? "unknown error"} (${context})`);
6639
6668
  }
6640
6669
  //#endregion
6641
6670
  //#region src/bin.ts
6642
6671
  const main = defineCommand({
6643
6672
  meta: {
6644
6673
  name: "bst",
6645
- version: "0.52.1",
6674
+ version: "0.52.2",
6646
6675
  description: "Bootstrap and maintain standardized TypeScript project tooling"
6647
6676
  },
6648
6677
  subCommands: {
@@ -6710,7 +6739,7 @@ const main = defineCommand({
6710
6739
  })
6711
6740
  }
6712
6741
  });
6713
- console.log(`@bensandee/tooling v0.52.1`);
6742
+ console.log(`@bensandee/tooling v0.52.2`);
6714
6743
  async function run() {
6715
6744
  await runMain(main);
6716
6745
  process.exit(process.exitCode ?? 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bensandee/tooling",
3
- "version": "0.52.1",
3
+ "version": "0.52.2",
4
4
  "description": "CLI tool to bootstrap and maintain standardized TypeScript project tooling",
5
5
  "license": "MIT",
6
6
  "repository": {