Repository navigation
fix(release): lint native packages before publish - #1073
Conversation
Native optional packages previously only verified that the staged binary existed during prepack. The publish path now also runs clean-pkg-json and publint so the subpackage manifests receive the same cleanup and package validation as the main ccusage package before npm publish. Each native package declares the release and lint CLIs as devDependencies through the existing catalogs so pnpm can resolve the lifecycle commands from the package itself. The manifests also set type=commonjs to keep publint output clean for packages that do not ship JavaScript entrypoints.
|
@coderabbitai please review this PR. This updates the native optional package publish lifecycle so each subpackage runs clean-pkg-json and publint after verifying its staged binary. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
📝 WalkthroughWalkthroughSix native packages for different platforms (darwin-arm64/x64, linux-arm64/x64, win32-arm64/x64) are updated identically to declare CommonJS module type and extend their prepack build pipeline with package cleanup and linting tools. ChangesNative Packages CommonJS and Prepack Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
🚥 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)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ccusage-guide | 484a7da | Commit Preview URL Branch Preview URL |
May 19 2026, 08:00 PM |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chainI'll fetch the PR details and examine the changes before giving a thorough review. 🏁 Script executed: Length of output: 8610 🏁 Script executed: Length of output: 5318
Review SummaryAll 6 native packages ( ✅ What looks good
The order is logical and intentional:
Catalog references are valid
Windows compatibility
Consistent with the main package's pattern No issues found. This is a solid, minimal, and well-reasoned improvement to the release pipeline. ✅ [approve] |
ccusage
@ccusage/ccusage-darwin-arm64
@ccusage/ccusage-darwin-x64
@ccusage/ccusage-linux-arm64
@ccusage/ccusage-linux-x64
@ccusage/ccusage-win32-arm64
@ccusage/ccusage-win32-x64
commit: |
ccusage performance comparisonPR SHA: This compares the Rust PR release binary against the configured base package on the same CI runner. Package runner startupExecution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one
Cached bunx execution performanceRuns the same large fixture through Fixtures: Claude
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 runner startupExecution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one
Cached bunx execution performanceRuns the same large fixture through Fixtures: Claude
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. |
Summary
Testing
Summary by cubic
Lint and clean native
@ccusage/*subpackages during publish to catch manifest issues and match the main package’s checks.prepacknow runsclean-pkg-jsonandpublintafter verifying the native binary, and packages are marked as CommonJS to reduce lint noise.clean-pkg-jsonandpublintin each native subpackageprepackafter binary verification.devDependenciesfor both CLIs so lifecycle scripts resolve per subpackage."type": "commonjs"to avoidpublintwarnings for packages without JS entrypoints.Written for commit 484a7da. Summary will update on new commits. Review in cubic
Summary by CodeRabbit