@dbx-tools/cli 0.1.103 → 0.1.104

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @dbx-tools/dbxtools
1
+ # @dbx-tools/cli
2
2
 
3
3
  Scaffold, formatting, codegen, verification, build, and release helpers for Bun +
4
4
  workspaces monorepos. It wraps the shared `tsdown` config for building and a
@@ -8,7 +8,7 @@ orthogonal to writing package code.
8
8
  ## Installation
9
9
 
10
10
  ```bash
11
- bun add -d @dbx-tools/dbxtools
11
+ bun add -d @dbx-tools/cli
12
12
  ```
13
13
 
14
14
  Then point your root `package.json` scripts at the `dbxtools` bin for the helper
@@ -35,7 +35,7 @@ commands you want:
35
35
  | `dbxtools format` | `syncpack format`, regroup lifecycle hooks, then `prettier --write`. |
36
36
  | `dbxtools build` | Compile every publishable package with the shared `tsdown` config. |
37
37
  | `dbxtools codegen` | Regenerate each package's `generated/` zod tree from the `.d.ts` inputs its `package.json` declares. |
38
- | `dbxtools verify` | Fail on imports of sibling packages not declared as dependencies. |
38
+ | `dbxtools verify [--workspace-deps]` | Workspace verify pass; `--workspace-deps` fails on undeclared sibling imports. |
39
39
  | `dbxtools create [--plugin\|--shared] <slug>` | Scaffold a new package under `packages/<slug>/`. |
40
40
  | `dbxtools release [--dry-run]` | Build, then publish each package with a stamped (complete) manifest. |
41
41
  | `dbxtools tag [patch\|minor\|major]` | Version bump, commit, tag, push, and create a GitHub Release. `--notes-since v0.1.75` widens the notes baseline; default is the previous tag. `--no-ai-notes` skips Codex release notes. |
@@ -69,7 +69,7 @@ The same commands are exported as functions for projects that want to compose
69
69
  their own automation:
70
70
 
71
71
  ```ts
72
- import { build, codegen, create, release, tag, verify } from "@dbx-tools/dbxtools";
72
+ import { build, codegen, create, release, tag, verify } from "@dbx-tools/cli";
73
73
 
74
74
  await build();
75
75
  await codegen();
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bun
2
- import { C as codegen, S as build, b as resolveAgentPrompt, d as release, f as format, g as agent, l as notesSinceRequested, n as forwardedUpdateArgs, p as create, s as update, t as verify, u as tag } from "../verify-CTCK1U-t.js";
2
+ import { C as codegen, S as build, b as resolveAgentPrompt, d as release, f as format, g as agent, l as notesSinceRequested, n as forwardedUpdateArgs, p as create, s as update, t as verify, u as tag } from "../verify-C3bNbiXe.js";
3
3
  import { Command, InvalidArgumentError } from "commander";
4
4
 
5
5
  //#region packages/cli/bin/dbxtools.ts
@@ -10,7 +10,9 @@ program.command("release").description("Build, then publish each package with a
10
10
  await release({ dryRun: opts.dryRun });
11
11
  });
12
12
  program.command("codegen").description("Regenerate each package's `generated/` zod tree from its inputs.").action(codegen);
13
- program.command("verify").description("Fail on imports of sibling packages not declared as dependencies.").action(verify);
13
+ program.command("verify").description("Workspace verify pass (optional sibling dependency scan).").option("--workspace-deps", "fail on imports of sibling packages not declared as dependencies", false).action(async (opts) => {
14
+ await verify({ workspaceDeps: opts.workspaceDeps });
15
+ });
14
16
  program.command("update").description("Pin root catalog entries to latest stable versions, then bun update at the repo root.").allowUnknownOption().action(async () => {
15
17
  await update(forwardedUpdateArgs());
16
18
  });
package/dist/index.d.ts CHANGED
@@ -242,7 +242,15 @@ declare function update(forwardArgs?: string[]): Promise<void>;
242
242
  declare function forwardedUpdateArgs(argv?: string[]): string[];
243
243
  //#endregion
244
244
  //#region packages/cli/src/verify.d.ts
245
- /** Fail when any workspace imports a sibling it doesn't declare as a dependency. */
246
- declare function verify(): Promise<void>;
245
+ /** Options for {@link verify}. */
246
+ interface VerifyOptions {
247
+ /**
248
+ * When true, fail on imports of sibling workspace packages not declared
249
+ * as dependencies. Off by default.
250
+ */
251
+ workspaceDeps?: boolean;
252
+ }
253
+ /** Workspace verify pass (optional implicit-dependency scan). */
254
+ declare function verify(options?: VerifyOptions): Promise<void>;
247
255
  //#endregion
248
- export { AGENT_DEFAULT_TIMEOUT_MS, type AgentCommandOptions, type AgentOptions, type AgentResult, type Bump, type CreateOptions, type DbxtoolsConfig, type PackageJson, type ReleaseOptions, type ShellResult, type TagOptions, WorkspacePackage, agent, agentAvailable, agentTimedOut, build, bunx, codegen, create, discoverPackageJsons, discoverPackages, errorMessage, fail, format, forwardedUpdateArgs, getDbxtoolsConfig, getProject, git, isStableVersion, latestStableInRange, nonEmptyLines, parseCodexStdout, release, resolveAgentPrompt, runAgent, runBunUpdate, sh, stableCaretRange, tag, toAbsolute, toRelative, update, updateCatalog, verify, writeJson };
256
+ export { AGENT_DEFAULT_TIMEOUT_MS, type AgentCommandOptions, type AgentOptions, type AgentResult, type Bump, type CreateOptions, type DbxtoolsConfig, type PackageJson, type ReleaseOptions, type ShellResult, type TagOptions, type VerifyOptions, WorkspacePackage, agent, agentAvailable, agentTimedOut, build, bunx, codegen, create, discoverPackageJsons, discoverPackages, errorMessage, fail, format, forwardedUpdateArgs, getDbxtoolsConfig, getProject, git, isStableVersion, latestStableInRange, nonEmptyLines, parseCodexStdout, release, resolveAgentPrompt, runAgent, runBunUpdate, sh, stableCaretRange, tag, toAbsolute, toRelative, update, updateCatalog, verify, writeJson };
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { A as git, C as codegen, D as toAbsolute, E as discoverPackages, F as nonEmptyLines, I as getProject, M as sh, N as errorMessage, O as toRelative, P as fail, S as build, T as discoverPackageJsons, _ as agentAvailable, a as runBunUpdate, b as resolveAgentPrompt, c as updateCatalog, d as release, f as format, g as agent, h as AGENT_DEFAULT_TIMEOUT_MS, i as latestStableInRange, j as bunx, k as writeJson, m as getDbxtoolsConfig, n as forwardedUpdateArgs, o as stableCaretRange, p as create, r as isStableVersion, s as update, t as verify, u as tag, v as agentTimedOut, w as WorkspacePackage, x as runAgent, y as parseCodexStdout } from "./verify-CTCK1U-t.js";
1
+ import { A as git, C as codegen, D as toAbsolute, E as discoverPackages, F as nonEmptyLines, I as getProject, M as sh, N as errorMessage, O as toRelative, P as fail, S as build, T as discoverPackageJsons, _ as agentAvailable, a as runBunUpdate, b as resolveAgentPrompt, c as updateCatalog, d as release, f as format, g as agent, h as AGENT_DEFAULT_TIMEOUT_MS, i as latestStableInRange, j as bunx, k as writeJson, m as getDbxtoolsConfig, n as forwardedUpdateArgs, o as stableCaretRange, p as create, r as isStableVersion, s as update, t as verify, u as tag, v as agentTimedOut, w as WorkspacePackage, x as runAgent, y as parseCodexStdout } from "./verify-C3bNbiXe.js";
2
2
 
3
3
  export { AGENT_DEFAULT_TIMEOUT_MS, WorkspacePackage, agent, agentAvailable, agentTimedOut, build, bunx, codegen, create, discoverPackageJsons, discoverPackages, errorMessage, fail, format, forwardedUpdateArgs, getDbxtoolsConfig, getProject, git, isStableVersion, latestStableInRange, nonEmptyLines, parseCodexStdout, release, resolveAgentPrompt, runAgent, runBunUpdate, sh, stableCaretRange, tag, toAbsolute, toRelative, update, updateCatalog, verify, writeJson };
@@ -902,6 +902,22 @@ function resolveWorkspaceDeps(deps, siblingVersions) {
902
902
  }
903
903
  return next;
904
904
  }
905
+ /** Rewrite dev `bin` pointers (`./bin/foo.ts`) to built `dist` targets. */
906
+ function stampBin(meta) {
907
+ const bin = meta.bin;
908
+ if (!bin) return meta;
909
+ const stampTarget = (target) => /^\.\/bin\/[^/]+\.[cm]?tsx?$/.test(target) ? target.replace(/^\.\/bin\/(.+)\.[cm]?tsx?$/, "./dist/bin/$1.js") : target;
910
+ if (typeof bin === "string") return {
911
+ ...meta,
912
+ bin: stampTarget(bin)
913
+ };
914
+ const next = {};
915
+ for (const [name, target] of Object.entries(bin)) next[name] = stampTarget(target);
916
+ return {
917
+ ...meta,
918
+ bin: next
919
+ };
920
+ }
905
921
  /**
906
922
  * Return a publishable copy of `meta`: resolve `workspace:` sibling
907
923
  * pins to concrete versions (via `siblingVersions`), expand any source
@@ -941,7 +957,7 @@ function stampManifest(meta, siblingVersions) {
941
957
  stamped.license ??= DEFAULT_LICENSE;
942
958
  stamped.type ??= "module";
943
959
  if (typeof stamped.name === "string" && stamped.name.startsWith("@") && !stamped.publishConfig) stamped.publishConfig = { access: "public" };
944
- return stamped;
960
+ return stampBin(stamped);
945
961
  }
946
962
  /**
947
963
  * Build every publishable package, then publish each with a stamped
@@ -1476,9 +1492,13 @@ function forwardedUpdateArgs(argv = process.argv) {
1476
1492
 
1477
1493
  //#endregion
1478
1494
  //#region packages/cli/src/verify.ts
1479
- /** Fail when any workspace imports a sibling it doesn't declare as a dependency. */
1480
- async function verify() {
1495
+ /** Workspace verify pass (optional implicit-dependency scan). */
1496
+ async function verify(options = {}) {
1481
1497
  const project = await getProject();
1498
+ if (!options.workspaceDeps) {
1499
+ consola.log(`verify: ${project.workspaces.length} workspace(s) OK (skipped workspace dependency scan; pass --workspace-deps to enable)`);
1500
+ return;
1501
+ }
1482
1502
  const result = await project.verify({ strict: true });
1483
1503
  for (const issue of [...result.errors, ...result.warnings]) if (issue.level === "error") consola.error(issue.message);
1484
1504
  else consola.warn(issue.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbx-tools/cli",
3
- "version": "0.1.103",
3
+ "version": "0.1.104",
4
4
  "bin": {
5
5
  "dbxtools": "./dist/bin/dbxtools.js"
6
6
  },