@dbx-tools/cli 0.3.19 → 0.3.21

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/.projen/deps.json CHANGED
@@ -5,11 +5,6 @@
5
5
  "version": "catalog:",
6
6
  "type": "build"
7
7
  },
8
- {
9
- "name": "tsx",
10
- "version": "^4.23.0",
11
- "type": "build"
12
- },
13
8
  {
14
9
  "name": "typescript",
15
10
  "type": "build"
@@ -37,6 +32,11 @@
37
32
  {
38
33
  "name": "pnpm",
39
34
  "type": "runtime"
35
+ },
36
+ {
37
+ "name": "tsx",
38
+ "version": "catalog:",
39
+ "type": "runtime"
40
40
  }
41
41
  ],
42
42
  "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"."
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "files": [
3
+ ".gitignore",
3
4
  ".projen/deps.json",
4
5
  ".projen/files.json",
5
6
  ".projen/tasks.json",
7
+ "bin/dbx-tools.mjs",
6
8
  "test/tsconfig.json",
7
9
  "tsconfig.json"
8
10
  ],
package/README.md CHANGED
@@ -1,59 +1,54 @@
1
- # dbx-tools
1
+ # @dbx-tools/cli
2
2
 
3
- CLI package for the dbx-tools projen workspace engine.
3
+ Bootstrap CLI for the dbx-tools projen workspace engine.
4
4
 
5
- Run the `dbxtools` command to bootstrap a repo, synthesize generated files,
6
- rebuild barrels, generate OpenAPI clients, or clean generated output. Import the
7
- package modules when custom tooling needs the same root detection, pnpm
5
+ Run the `dbx-tools` command (aliased `dbxt`) to turn a folder that has no
6
+ `.projenrc.ts` or toolchain yet into a working dbx-tools workspace. Once that
7
+ workspace exists, everything else is a projen task you run with
8
+ `pnpm run <task>` - the CLI only forwards to projen from that point on. Import
9
+ the package modules when custom tooling needs the same root detection, pnpm
8
10
  delegation, or CLI program behavior.
9
11
 
10
12
  Key features:
11
13
 
12
- - `sync` bootstrap path for empty folders plus normal projen synthesis for
13
- existing workspaces.
14
- - Focused `--watch` loop for projenrc changes, barrel generation, and OpenAPI
15
- generation.
16
- - Standalone barrel and OpenAPI commands for post-synth workflows.
17
- - Generated-file cleanup with an interactive or non-interactive mode.
14
+ - Bootstrap path that scaffolds pnpm/projen into an empty or partially-set-up
15
+ folder, including the initial install and synth.
16
+ - Toolchain repair for a cloned repo whose generated files and `node_modules`
17
+ are gitignored.
18
+ - Transparent forwarding to projen for any task once the workspace is ready.
18
19
  - Importable CLI/root/pnpm helpers for tests and thin wrapper commands.
19
20
 
20
- ## Bootstrap Or Sync A Workspace
21
+ ## Bootstrap A Workspace
21
22
 
22
23
  ```sh
23
- dbxtools sync
24
- dbxtools sync --watch
24
+ dbx-tools sync
25
25
  ```
26
26
 
27
- In an empty folder, `sync` creates the minimum pnpm/projen structure needed for
28
- `@dbx-tools/projen`. In an existing workspace, it runs projen and the post-synth
29
- generators. `--watch` starts focused watchers for structural changes, barrels,
30
- and OpenAPI generation.
27
+ In an empty folder this creates the minimum pnpm/projen structure needed for
28
+ `@dbx-tools/projen`, installs the toolchain, and runs the first synth. In a
29
+ freshly cloned repo it seeds the missing toolchain and synthesizes. This is the
30
+ case projen cannot handle on its own, because there are no tasks to run yet.
31
31
 
32
- ## Generate Barrels And OpenAPI Clients
32
+ ## After Bootstrap, Use The Projen Tasks
33
33
 
34
- ```sh
35
- dbxtools barrels
36
- dbxtools openapi
37
- ```
38
-
39
- `barrels` rebuilds package-root `index.ts` files from exported modules under
40
- `src/`. `openapi` scans tsoa controllers and writes generated OpenAPI packages.
41
-
42
- ## Clean Generated Output
34
+ The engine registers its commands as projen tasks on the workspace root, so run
35
+ them directly instead of going through this CLI:
43
36
 
44
37
  ```sh
45
- dbxtools clean
46
- dbxtools clean -y
38
+ pnpm run sync # one-shot full synth
39
+ pnpm run sync --watch # projenrc + barrels + openapi watchers
40
+ pnpm run barrels # rebuild every package-root index.ts barrel
41
+ pnpm run openapi # generate the openapi packages from tsoa controllers
42
+ pnpm run clean # remove generated (read-only) files; -y to skip the picker
47
43
  ```
48
44
 
49
- `clean` removes generated read-only files and can also remove install output. Use
50
- it before debugging synthesis drift or validating that the repo can regenerate
51
- from source.
45
+ `dbx-tools <task>` still works and forwards to the same projen task, but the
46
+ `pnpm run` form is the documented one for an established workspace.
52
47
 
53
48
  ## Use The CLI Internals
54
49
 
55
50
  ```ts
56
- import { cli, root, pnpm } from "dbx-tools";
51
+ import { cli, root, pnpm } from "@dbx-tools/cli";
57
52
 
58
53
  await cli.runCli(["sync"]);
59
54
  const workspaceRoot = await root.findWorkspaceRoot();
@@ -61,7 +56,7 @@ pnpm.runProjen(["barrels"], workspaceRoot);
61
56
  ```
62
57
 
63
58
  Importing internals is mainly useful for tests or wrapper scripts; most users
64
- should run the `dbxtools` bin.
59
+ should run the `dbx-tools` bin.
65
60
 
66
61
  ## Modules
67
62
 
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ // GENERATED by projen synth (cli tag) - DO NOT EDIT.
3
+ // Regenerated from ./dbx-tools.ts.
4
+ // Hand edits are overwritten on the next watch; this file is read-only.
5
+
6
+ // Resolved as a bare specifier so Node looks in THIS file's package rather than the
7
+ // caller's cwd - the only way a globally installed CLI finds its own tsx.
8
+ import { register } from "tsx/esm/api";
9
+
10
+ register();
11
+ await import(new URL("./dbx-tools.ts", import.meta.url).href);
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env -S npx tsx
2
2
  /**
3
- * `dbxtools` bootstraps uninitialized workspaces, then forwards to projen.
3
+ * `dbx-tools` bootstraps uninitialized workspaces, then forwards to projen.
4
4
  */
5
5
  import { runCli } from "../src/cli";
6
6
 
package/package.json CHANGED
@@ -6,31 +6,35 @@
6
6
  "directory": "workspaces/cli/dbx-tools"
7
7
  },
8
8
  "bin": {
9
- "dbxtools": "./bin/dbxtools.ts"
9
+ "dbx-tools": "./bin/dbx-tools.mjs",
10
+ "dbxt": "./bin/dbx-tools.mjs"
10
11
  },
11
12
  "devDependencies": {
12
13
  "@types/node": "^24.6.0",
13
- "tsx": "^4.23.0",
14
14
  "typescript": "^5.9.3"
15
15
  },
16
16
  "dependencies": {
17
17
  "@clack/prompts": "^1.7.0",
18
18
  "commander": "^15.0.0",
19
19
  "pnpm": "^11.0.6",
20
- "@dbx-tools/core": "0.3.19",
21
- "@dbx-tools/shared-core": "0.3.19"
20
+ "tsx": "^4.23.0",
21
+ "@dbx-tools/core": "0.3.21",
22
+ "@dbx-tools/shared-core": "0.3.21"
22
23
  },
23
24
  "main": "index.ts",
24
25
  "license": "UNLICENSED",
25
26
  "publishConfig": {
26
27
  "access": "public"
27
28
  },
28
- "version": "0.3.19",
29
+ "version": "0.3.21",
29
30
  "types": "index.ts",
30
31
  "type": "module",
31
32
  "exports": {
32
33
  ".": "./index.ts",
34
+ "./bootstrap": "./src/bootstrap.ts",
35
+ "./cli": "./src/cli.ts",
33
36
  "./pnpm": "./src/pnpm.ts",
37
+ "./root": "./src/root.ts",
34
38
  "./package.json": "./package.json"
35
39
  },
36
40
  "dbxToolsConfig": {
package/src/bootstrap.ts CHANGED
@@ -31,7 +31,7 @@ allowBuilds:
31
31
  * Turn a folder into a functioning dbx-tools workspace: `pnpm init`, seed
32
32
  * `pnpm-workspace.yaml`, add `projen`/`typescript`/`tsx` + the engine package,
33
33
  * write a minimal `.projenrc.ts`, synth once (with `PROJEN_DISABLE_POST`), then
34
- * install. Does not run barrels - run `dbxtools barrels` or a full projen synth
34
+ * install. Does not run barrels - run `pnpm run barrels` or a full projen synth
35
35
  * post-install to generate package barrels.
36
36
  *
37
37
  * Every step is idempotent and self-guarded, so this is safe to run against a
@@ -58,7 +58,7 @@ export function bootstrapWorkspace(
58
58
  runInitialSynth(root);
59
59
 
60
60
  runPnpm(["install", "--no-frozen-lockfile", "--force"], root);
61
- outro("Workspace ready - re-run dbxtools or add packages under workspaces/");
61
+ outro("Workspace ready - re-run dbx-tools or add packages under workspaces/");
62
62
  }
63
63
 
64
64
  /**
package/src/cli.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `dbxtools` commander entry: detect root, bootstrap or install, forward to projen.
2
+ * `dbx-tools` commander entry: detect root, bootstrap or install, forward to projen.
3
3
  *
4
4
  * @module
5
5
  */
@@ -40,12 +40,12 @@ async function prepareAndRunProjen(projenArgs: string[], startDir?: string): Pro
40
40
  /** Parse `argv` with commander and forward remaining args to projen. */
41
41
  export async function runCli(argv: string[]): Promise<void> {
42
42
  const program = new Command()
43
- .name("dbxtools")
43
+ .name("dbx-tools")
44
44
  .description("Bootstrap dbx-tools workspaces and forward to projen")
45
45
  .allowUnknownOption()
46
46
  .allowExcessArguments()
47
47
  .showHelpAfterError()
48
- .helpOption("-h, --help", "Show dbxtools help");
48
+ .helpOption("-h, --help", "Show dbx-tools help");
49
49
 
50
50
  program.parse(argv);
51
51
  await prepareAndRunProjen(program.args);
package/src/pnpm.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * pnpm discovery, workspace install, and projen forwarding for the `dbxtools` CLI.
2
+ * pnpm discovery, workspace install, and projen forwarding for the `dbx-tools` CLI.
3
3
  *
4
4
  * @module
5
5
  */
package/src/root.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Workspace root detection for the `dbxtools` CLI.
2
+ * Workspace root detection for the `dbx-tools` CLI.
3
3
  *
4
4
  * @module
5
5
  */