Skip to content

Commit 9f7d444

Browse files
committed
Rename CLI binary to 'cants'; keep codeanalyzer-typescript package name
The invoked executable is now 'cants' (CodeANalyzer TypeScript): CLI program name (commander), package.json bin, the bun --compile outfile, the bundled wheel binary (__init__.py _BINARY_NAME), the GitHub Release asset name, and all README usage examples. The PyPI distribution and Python import stay 'codeanalyzer-typescript' / codeanalyzer_typescript -- consistent with the codeanalyzer-python/-java siblings, and avoiding the 'cants' name collision on npm. Distribution name and binary name are independent, so no PyPI rename, retire, or sdk-pin-name change. Bump to 0.2.0 for the user-visible command rename.
1 parent f74a472 commit 9f7d444

7 files changed

Lines changed: 34 additions & 34 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Release (binaries + Python wheels)
22

3-
# Builds the self-contained codeanalyzer-typescript binary for every supported
3+
# Builds the self-contained cants binary for every supported
44
# platform and publishes:
55
# 1. the raw binaries as GitHub Release assets (for analysis_backend_path /
66
# $CODEANALYZER_TS_BIN / download-on-first-use use cases), and
@@ -100,7 +100,7 @@ jobs:
100100
python -m zipfile -e "$whl" "$tmp"
101101
bin="$(find "$tmp/codeanalyzer_typescript/_bin" -type f ! -name '.gitignore')"
102102
ext=""; [[ "$bin" == *.exe ]] && ext=".exe"
103-
cp "$bin" "../../release-bins/codeanalyzer-typescript-${plat}${ext}"
103+
cp "$bin" "../../release-bins/cants-${plat}${ext}"
104104
done
105105
ls -lh ../../release-bins
106106

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ be resolved as phantom (external) nodes; pass `--no-build` to reuse an already-p
2525
curl -fsSL https://bun.sh/install | bash
2626
```
2727

28-
## Building `codeanalyzer-typescript`
28+
## Building `cants`
2929

3030
Clone the repository and install dependencies:
3131

@@ -38,7 +38,7 @@ bun install
3838
Compile a standalone native binary (no Bun/Node required to run it afterward):
3939

4040
```bash
41-
bun run build # → dist/codeanalyzer-typescript
41+
bun run build # → dist/cants
4242
```
4343

4444
You can also run the analyzer directly from source without compiling:
@@ -55,15 +55,15 @@ TypeScript/JavaScript projects.
5555
### Basic Usage
5656

5757
```bash
58-
codeanalyzer-typescript --input /path/to/typescript/project
58+
cants --input /path/to/typescript/project
5959
```
6060

6161
### Command Line Options
6262

63-
To view the available options, run `codeanalyzer-typescript --help`:
63+
To view the available options, run `cants --help`:
6464

6565
```text
66-
Usage: codeanalyzer-typescript [options]
66+
Usage: cants [options]
6767
6868
CLDK TypeScript analyzer — emits the canonical analysis.json
6969
(symbol table + resolver call graph).
@@ -93,28 +93,28 @@ Options:
9393

9494
1. **Basic analysis (symbol table + call graph):**
9595
```bash
96-
codeanalyzer-typescript --input ./my-ts-project
96+
cants --input ./my-ts-project
9797
```
9898

9999
This prints the analysis to stdout as compact JSON. To save it instead, use `--output`:
100100

101101
```bash
102-
codeanalyzer-typescript --input ./my-ts-project --output /path/to/analysis-results
102+
cants --input ./my-ts-project --output /path/to/analysis-results
103103
```
104104

105105
The results are written to `analysis.json` in the specified directory.
106106

107107
2. **Change output format to msgpack:**
108108
```bash
109-
codeanalyzer-typescript --input ./my-ts-project --output /path/to/analysis-results --format msgpack
109+
cants --input ./my-ts-project --output /path/to/analysis-results --format msgpack
110110
```
111111

112112
This saves the results to `analysis.msgpack`, a binary format that is more compact for
113113
storage and transmission.
114114

115115
3. **Deeper analysis with CodeQL enrichment (experimental):**
116116
```bash
117-
codeanalyzer-typescript --input ./my-ts-project --analysis-level 2
117+
cants --input ./my-ts-project --analysis-level 2
118118
```
119119

120120
Every run produces a symbol table **and** a call graph. At level 1, edges come from the
@@ -123,15 +123,15 @@ Options:
123123

124124
4. **Incremental analysis of specific files:**
125125
```bash
126-
codeanalyzer-typescript --input ./my-ts-project --target-files src/a.ts src/b.ts
126+
cants --input ./my-ts-project --target-files src/a.ts src/b.ts
127127
```
128128

129129
Restricts the analysis to the named files, reusing the cached analysis for the rest of
130130
the project.
131131

132132
5. **Force a clean rebuild with a custom cache directory:**
133133
```bash
134-
codeanalyzer-typescript --input ./my-ts-project --eager --cache-dir /path/to/custom-cache
134+
cants --input ./my-ts-project --eager --cache-dir /path/to/custom-cache
135135
```
136136

137137
`--eager` rebuilds the analysis cache from scratch. If `--cache-dir` is omitted, the cache

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"name": "codeanalyzer-typescript",
3-
"version": "0.1.1",
3+
"version": "0.2.0",
44
"description": "CLDK TypeScript analyzer — emits the canonical CLDK analysis.json (symbol table + resolver-based call graph) via ts-morph.",
55
"type": "module",
66
"module": "src/index.ts",
77
"bin": {
8-
"codeanalyzer-typescript": "dist/codeanalyzer-typescript"
8+
"cants": "dist/cants"
99
},
1010
"scripts": {
1111
"start": "bun run src/index.ts",
12-
"build": "bun build ./src/index.ts --compile --outfile dist/codeanalyzer-typescript",
12+
"build": "bun build ./src/index.ts --compile --outfile dist/cants",
1313
"typecheck": "tsc --noEmit"
1414
},
1515
"license": "Apache-2.0",

packaging/python/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ TypeScript/JavaScript projects.
1717
### Basic Usage
1818

1919
```bash
20-
codeanalyzer-typescript --input /path/to/typescript/project
20+
cants --input /path/to/typescript/project
2121
```
2222

2323
### Command Line Options
2424

25-
To view the available options, run `codeanalyzer-typescript --help`:
25+
To view the available options, run `cants --help`:
2626

2727
```text
28-
Usage: codeanalyzer-typescript [options]
28+
Usage: cants [options]
2929
3030
CLDK TypeScript analyzer — emits the canonical analysis.json
3131
(symbol table + resolver call graph).
@@ -55,28 +55,28 @@ Options:
5555

5656
1. **Basic analysis (symbol table + call graph):**
5757
```bash
58-
codeanalyzer-typescript --input ./my-ts-project
58+
cants --input ./my-ts-project
5959
```
6060

6161
This prints the analysis to stdout as compact JSON. To save it instead, use `--output`:
6262

6363
```bash
64-
codeanalyzer-typescript --input ./my-ts-project --output /path/to/analysis-results
64+
cants --input ./my-ts-project --output /path/to/analysis-results
6565
```
6666

6767
The results are written to `analysis.json` in the specified directory.
6868

6969
2. **Change output format to msgpack:**
7070
```bash
71-
codeanalyzer-typescript --input ./my-ts-project --output /path/to/analysis-results --format msgpack
71+
cants --input ./my-ts-project --output /path/to/analysis-results --format msgpack
7272
```
7373

7474
This saves the results to `analysis.msgpack`, a binary format that is more compact for
7575
storage and transmission.
7676

7777
3. **Deeper analysis with CodeQL enrichment (experimental):**
7878
```bash
79-
codeanalyzer-typescript --input ./my-ts-project --analysis-level 2
79+
cants --input ./my-ts-project --analysis-level 2
8080
```
8181

8282
Every run produces a symbol table **and** a call graph. At level 1, edges come from the
@@ -85,15 +85,15 @@ Options:
8585

8686
4. **Incremental analysis of specific files:**
8787
```bash
88-
codeanalyzer-typescript --input ./my-ts-project --target-files src/a.ts src/b.ts
88+
cants --input ./my-ts-project --target-files src/a.ts src/b.ts
8989
```
9090

9191
Restricts the analysis to the named files, reusing the cached analysis for the rest of
9292
the project.
9393

9494
5. **Force a clean rebuild with a custom cache directory:**
9595
```bash
96-
codeanalyzer-typescript --input ./my-ts-project --eager --cache-dir /path/to/custom-cache
96+
cants --input ./my-ts-project --eager --cache-dir /path/to/custom-cache
9797
```
9898

9999
`--eager` rebuilds the analysis cache from scratch. If `--cache-dir` is omitted, the cache
@@ -134,7 +134,7 @@ Apache 2.0 — see [LICENSE](./LICENSE).
134134

135135
## About this package
136136

137-
This distributes the compiled `codeanalyzer-typescript` binary as a set of
137+
This distributes the compiled `cants` binary as a set of
138138
platform-specific Python wheels, published to PyPI as **`codeanalyzer-typescript`**.
139139
The CLDK Python SDK depends on this package and calls
140140
`codeanalyzer_typescript.bin_path()` to locate the analyzer binary. The binary is

packaging/python/build_wheels.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
#
3-
# Build platform-tagged Python wheels for the codeanalyzer-typescript binary.
3+
# Build platform-tagged Python wheels for the cants (codeanalyzer-typescript) binary.
44
#
55
# For each target: cross-compile the binary with Bun, build a (pure) wheel with
66
# hatchling, then retag it from `py3-none-any` to the matching platform tag with
@@ -74,7 +74,7 @@ for entry in "${TARGETS[@]}"; do
7474
clean_bin
7575

7676
( cd "$REPO_ROOT" && bun build ./src/index.ts --compile --target="$target" \
77-
--outfile "$BIN_DIR/codeanalyzer-typescript$ext" )
77+
--outfile "$BIN_DIR/cants$ext" )
7878

7979
# Build a pure wheel (py3-none-any), then retag to the platform.
8080
python -m build --wheel --no-isolation -o "$HERE/dist" "$HERE"

packaging/python/src/codeanalyzer_typescript/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
"""Prebuilt ``codeanalyzer-typescript`` backend binary for CLDK.
1+
"""Prebuilt ``cants`` (codeanalyzer-typescript) backend binary for CLDK.
22
3-
This package carries the platform-specific, self-contained ``codeanalyzer-typescript``
3+
This package carries the platform-specific, self-contained ``cants``
44
executable (built from this repo with ``bun build --compile``) and exposes its
55
filesystem path. CLDK's Python SDK depends on this package and calls
66
:func:`bin_path` to locate the analyzer, exactly as it imports ``codeanalyzer-python``
@@ -22,11 +22,11 @@
2222

2323
__all__ = ["bin_path", "__version__"]
2424

25-
_BINARY_NAME = "codeanalyzer-typescript" + (".exe" if sys.platform == "win32" else "")
25+
_BINARY_NAME = "cants" + (".exe" if sys.platform == "win32" else "")
2626

2727

2828
def bin_path() -> Path:
29-
"""Return the absolute path to the bundled ``codeanalyzer-typescript`` binary.
29+
"""Return the absolute path to the bundled ``cants`` binary.
3030
3131
Raises:
3232
FileNotFoundError: if the wheel for this platform did not include a binary
@@ -38,7 +38,7 @@ def bin_path() -> Path:
3838

3939
if not path.exists():
4040
raise FileNotFoundError(
41-
f"Bundled codeanalyzer-typescript binary not found at {path}. "
41+
f"Bundled cants binary not found at {path}. "
4242
"This usually means there is no prebuilt wheel for your platform; "
4343
"build the binary with `bun build --compile` and point CLDK at it via "
4444
"analysis_backend_path or $CODEANALYZER_TS_BIN."

src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { AnalysisOptions, OutputFormat } from "./options";
66
export function parseArgs(argv: string[]): AnalysisOptions {
77
const program = new Command();
88
program
9-
.name("codeanalyzer-typescript")
9+
.name("cants")
1010
.description("CLDK TypeScript analyzer — emits the canonical analysis.json (symbol table + resolver call graph).")
1111
.requiredOption("-i, --input <path>", "project root to analyze")
1212
.option("-o, --output <dir>", "output directory for analysis.json (omit ⇒ compact JSON to stdout)")

0 commit comments

Comments
 (0)