Repository navigation
build(ccusage): ship launcher without tsdown - #1310
Conversation
Rewrite the npm bin launcher as checked ESM JavaScript so the package can ship src/cli.js directly instead of compiling src/cli.ts into dist/cli.js with tsdown. Point package metadata and tests at the source launcher, keep the native binary and publint checks in the build script, and remove the now-unused tsdown build catalog entries from the workspace lockfile.
|
no API key found — this repo is configured to use To fix: add the key as a GitHub Actions secret (referenced from your workflow's Open repo secrets → · Configure model → · Setup docs → · Ask in Discord →
|
|
@coderabbitai review |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe PR migrates the ccusage CLI from TypeScript-based bundling with Changesccusage CLI: TypeScript to JavaScript and direct source publication
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
@ryoppippi I have started the AI code review. It will take a few minutes to complete. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ccusage-guide | cbf7217 | Commit Preview URL Branch Preview URL |
Jun 13 2026, 11:52 AM |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== PR Details ==="
gh pr view 1310 --repo ccusage/ccusage --json title,body,files,baseRefName,headRefName
echo ""
echo "=== PR Files ==="
gh pr diff 1310 --repo ccusage/ccusageLength of output: 43752
SummaryThe PR removes the tsdown build step and ships What looks good ✅TypeScript → JSDoc migration (
Build ordering
Lockfile / workspace catalog cleanup
Test updates
Minor observationThe size increase (976B → 1,572B gzip, +0.6KiB in the tarball) is well within acceptable range for a CLI launcher, and the PR description already calls it out. The trade-off of dropping the entire rolldown/tsdown dependency tree for ~596B of extra gzip is clearly worth it. No issues found. The change is straightforward and all the pieces are consistent with each other. [approve] |
ccusage
@ccusage/ccusage-darwin-arm64
@ccusage/ccusage-darwin-x64
@ccusage/ccusage-linux-arm64
@ccusage/ccusage-linux-x64
@ccusage/ccusage-win32-x64
commit: |
ccusage performance comparisonPR SHA: This compares the PR package against the configured base package on the same CI runner. Package runtime diagnosticsCompares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself. Fixtures: Claude
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures. Fixtures: Claude
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
ccusage performance comparisonPR SHA: This compares the Rust PR release binary against the configured base package on the same CI runner. Package runtime diagnosticsCompares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself. Fixtures: Claude
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures. Fixtures: Claude
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
Make the root check recipe delegate directly to nix flake check now that oxlint and the other repository checks are already modeled as flake checks. Drop the extra CI just typecheck invocation from the check job so pull requests do not run the same oxlint pass twice.
|
@coderabbitai review |
@ryoppippi I have started the AI code review. It will take a few minutes to complete. |
|
✅ Action performedReview finished.
|
ccusage performance comparisonPR SHA: This compares the Rust PR release binary against the configured base package on the same CI runner. Package runtime diagnosticsCompares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself. Fixtures: Claude
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures. Fixtures: Claude
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
ccusage performance comparisonPR SHA: This compares the PR package against the configured base package on the same CI runner. Package runtime diagnosticsCompares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself. Fixtures: Claude
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures. Fixtures: Claude
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |

Removes the tsdown build step from the published ccusage package by shipping the npm launcher as checked ESM JavaScript at src/cli.js.
The package bin now points directly at src/cli.js, package checks still verify the native binary glue with Nushell and publint, and the unused tsdown build catalog/lockfile entries are removed.
Size note: the launcher grows from 2,146 B minified / 976 B gzip to 5,330 B source / 1,572 B gzip. The packed npm tarball measured 18,390 B, about +0.6 KiB versus the previous PR measurement.
Testing:
Need help on this PR? Tag
/codesmithwith what you need. Autofix is enabled.Summary by cubic
Publish the
ccusageCLI withouttsdownby shipping a checked ESM launcher atsrc/cli.jsand pointingbinto it. Also route the root check through Nix flake and drop the extra CI typecheck.src/cli.js); updated tests and docs to.js.package.json:bin→src/cli.js,filesincludesrc/cli.js; removedpublishConfig.tsdown, addedpublint; build now only verifies the native binary. Removedtsdownconfig and catalog/lockfile entries.just checknow callsnix flake check; removed duplicate CI typecheck step.Written for commit cbf7217. Summary will update on new commits.
Summary by CodeRabbit
Documentation
Chores