@bensandee/tooling 0.11.0 → 0.12.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.
Files changed (2) hide show
  1. package/dist/bin.mjs +33 -8
  2. package/package.json +1 -1
package/dist/bin.mjs CHANGED
@@ -528,6 +528,11 @@ const STANDARD_SCRIPTS_MONOREPO = {
528
528
  check: "pnpm exec tooling repo:run-checks",
529
529
  "tooling:check": "pnpm exec tooling repo:check"
530
530
  };
531
+ /** Scripts that tooling owns — map from script name to keyword that must appear in the value. */
532
+ const MANAGED_SCRIPTS = {
533
+ check: "repo:run-checks",
534
+ "tooling:check": "repo:check"
535
+ };
531
536
  /** DevDeps that belong in every project (single repo) or per-package (monorepo). */
532
537
  const PER_PACKAGE_DEV_DEPS = {
533
538
  "@types/node": "25.3.2",
@@ -583,7 +588,7 @@ function getAddedDevDepNames(config) {
583
588
  const deps = { ...ROOT_DEV_DEPS };
584
589
  if (config.structure !== "monorepo") Object.assign(deps, PER_PACKAGE_DEV_DEPS);
585
590
  deps["@bensandee/config"] = "0.7.1";
586
- deps["@bensandee/tooling"] = "0.11.0";
591
+ deps["@bensandee/tooling"] = "0.12.0";
587
592
  if (config.formatter === "oxfmt") deps["oxfmt"] = "0.35.0";
588
593
  if (config.formatter === "prettier") deps["prettier"] = "3.8.1";
589
594
  addReleaseDeps(deps, config);
@@ -604,7 +609,7 @@ async function generatePackageJson(ctx) {
604
609
  const devDeps = { ...ROOT_DEV_DEPS };
605
610
  if (!isMonorepo) Object.assign(devDeps, PER_PACKAGE_DEV_DEPS);
606
611
  devDeps["@bensandee/config"] = isWorkspacePackage(ctx, "@bensandee/config") ? "workspace:*" : "0.7.1";
607
- devDeps["@bensandee/tooling"] = isWorkspacePackage(ctx, "@bensandee/tooling") ? "workspace:*" : "0.11.0";
612
+ devDeps["@bensandee/tooling"] = isWorkspacePackage(ctx, "@bensandee/tooling") ? "workspace:*" : "0.12.0";
608
613
  if (ctx.config.useEslintPlugin) devDeps["@bensandee/eslint-plugin"] = isWorkspacePackage(ctx, "@bensandee/eslint-plugin") ? "workspace:*" : "0.9.0";
609
614
  if (ctx.config.formatter === "oxfmt") devDeps["oxfmt"] = "0.35.0";
610
615
  if (ctx.config.formatter === "prettier") devDeps["prettier"] = "3.8.1";
@@ -625,6 +630,9 @@ async function generatePackageJson(ctx) {
625
630
  for (const [key, value] of Object.entries(allScripts)) if (!(key in existingScripts)) {
626
631
  existingScripts[key] = value;
627
632
  changes.push(`added script: ${key}`);
633
+ } else if (key in MANAGED_SCRIPTS && !existingScripts[key]?.includes(MANAGED_SCRIPTS[key])) {
634
+ existingScripts[key] = value;
635
+ changes.push(`updated script: ${key}`);
628
636
  }
629
637
  pkg.scripts = existingScripts;
630
638
  const existingDevDeps = pkg.devDependencies ?? {};
@@ -3431,6 +3439,10 @@ const CHECKS = [
3431
3439
  {
3432
3440
  name: "tooling:check",
3433
3441
  cmd: "pnpm run --if-present tooling:check"
3442
+ },
3443
+ {
3444
+ name: "image:check",
3445
+ cmd: "pnpm run --if-present image:check"
3434
3446
  }
3435
3447
  ];
3436
3448
  function defaultExecCommand(cmd, cwd) {
@@ -3449,9 +3461,14 @@ const ciLog = (msg) => console.log(msg);
3449
3461
  function runRunChecks(targetDir, options = {}) {
3450
3462
  const exec = options.execCommand ?? defaultExecCommand;
3451
3463
  const skip = options.skip ?? /* @__PURE__ */ new Set();
3464
+ const add = options.add ?? [];
3452
3465
  const isCI = Boolean(process.env["CI"]);
3466
+ const allChecks = [...CHECKS, ...add.map((name) => ({
3467
+ name,
3468
+ cmd: `pnpm run --if-present ${name}`
3469
+ }))];
3453
3470
  const failures = [];
3454
- for (const check of CHECKS) {
3471
+ for (const check of allChecks) {
3455
3472
  if (skip.has(check.name)) {
3456
3473
  p.log.info(`${check.name} (skipped)`);
3457
3474
  continue;
@@ -3476,7 +3493,7 @@ function runRunChecks(targetDir, options = {}) {
3476
3493
  const runChecksCommand = defineCommand({
3477
3494
  meta: {
3478
3495
  name: "repo:run-checks",
3479
- description: "Run all standard checks (build, typecheck, lint, test, format, knip, tooling:check)"
3496
+ description: "Run all standard checks (build, typecheck, lint, test, format, knip, tooling:check, image:check)"
3480
3497
  },
3481
3498
  args: {
3482
3499
  dir: {
@@ -3486,12 +3503,20 @@ const runChecksCommand = defineCommand({
3486
3503
  },
3487
3504
  skip: {
3488
3505
  type: "string",
3489
- description: "Comma-separated list of checks to skip (build, typecheck, lint, test, format, knip, tooling:check)",
3506
+ description: "Comma-separated list of checks to skip (build, typecheck, lint, test, format, knip, tooling:check, image:check)",
3507
+ required: false
3508
+ },
3509
+ add: {
3510
+ type: "string",
3511
+ description: "Comma-separated list of additional check names to run (uses pnpm run --if-present <name>)",
3490
3512
  required: false
3491
3513
  }
3492
3514
  },
3493
3515
  run({ args }) {
3494
- const exitCode = runRunChecks(path.resolve(args.dir ?? "."), { skip: args.skip ? new Set(args.skip.split(",").map((s) => s.trim())) : void 0 });
3516
+ const exitCode = runRunChecks(path.resolve(args.dir ?? "."), {
3517
+ skip: args.skip ? new Set(args.skip.split(",").map((s) => s.trim())) : void 0,
3518
+ add: args.add ? args.add.split(",").map((s) => s.trim()) : void 0
3519
+ });
3495
3520
  process.exitCode = exitCode;
3496
3521
  }
3497
3522
  });
@@ -3500,7 +3525,7 @@ const runChecksCommand = defineCommand({
3500
3525
  const main = defineCommand({
3501
3526
  meta: {
3502
3527
  name: "tooling",
3503
- version: "0.11.0",
3528
+ version: "0.12.0",
3504
3529
  description: "Bootstrap and maintain standardized TypeScript project tooling"
3505
3530
  },
3506
3531
  subCommands: {
@@ -3514,7 +3539,7 @@ const main = defineCommand({
3514
3539
  "release:merge": releaseMergeCommand
3515
3540
  }
3516
3541
  });
3517
- console.log(`@bensandee/tooling v0.11.0`);
3542
+ console.log(`@bensandee/tooling v0.12.0`);
3518
3543
  runMain(main);
3519
3544
  //#endregion
3520
3545
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bensandee/tooling",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "CLI tool to bootstrap and maintain standardized TypeScript project tooling",
5
5
  "bin": {
6
6
  "tooling": "./dist/bin.mjs"