Skip to content

refactor(deps): make Nix the single source for publint and prune dead catalogs - #1495

Merged
ryoppippi merged 2 commits into
mainfrom
chore/single-source-publint
Jul 27, 2026
Merged

ryoppippi merged 2 commits into
mainfrom
chore/single-source-publint

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Jul 27, 2026 •

Copy link
Copy Markdown
Member

Summary

publint was pinned in two places: the pnpm lint catalog (expanded into the devDependencies of ccusage and all six native packages) and the bun2nix-built nix/tools/publint used by the publint flake check and the dev shell. Nothing kept the two pins in sync. This drops the pnpm copies and keeps the Nix build as the only pin.

While auditing pnpm-workspace.yaml, two more catalogs turned out to have no consumers at all, so they are removed in a follow-up commit.

What Changed

Why

The build/prepack scripts call bare publint, which resolves from PATH — the dev shell and just ccusage::build-package already provided the Nix build, so the pnpm copy only mattered inside the publish jobs. Supplying it there from the flake collapses the two pins into one without changing what runs.

Both publint invocations are kept on purpose: prepack packs a real tarball, while the flake check runs --pack false against stubbed generated files. They cover different failure modes.

Removing the pnpm copy means pnpm publish in a bare non-Nix checkout no longer has publint on PATH. Releases run through Nix, so that path is not exercised.

Testing

  • nix build .#checks.aarch64-darwin.publint — all 7 packages "All good!"
  • nix build .#publint, nix eval .#publint.meta.mainProgram — the attr the CI jobs install resolves
  • pnpm --filter ccusage exec publint --version → publint, 0.3.12, resolved from the Nix store after the devDependency removal
  • pnpm install --frozen-lockfile — lockfile in sync; dropping the dead catalogs left it untouched, confirming they never reached it
  • just fmt, prek run --from-ref main --to-ref HEAD — clean

View with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is enabled.


Summary by cubic

Make Nix the single source of publint to avoid version drift and simplify the workspace. CI now installs flake .#publint so prepack checks keep working.

  • Dependencies
    • Removed publint from apps/ccusage and all native package devDependencies; deleted the lint catalog; lockfile shrinks by 4 packages.
    • Updated ci.yaml and release.yaml to install .#publint with nix profile install (alongside nixpkgs#pnpm and, in CI, nixpkgs#nodejs).
    • Pruned unused runtime and llm-docs catalogs; kept docs and types.

Written for commit 092ab89. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Chores

    • Improved package publishing checks to validate package contents before release.
    • Streamlined development tooling used during package creation and publication.
    • Updated platform-specific package preparation workflows for more consistent releases.
    • Cleaned up outdated documentation-related tooling configuration.
  • Bug Fixes

    • Reduced the risk of publishing incomplete or incorrectly configured packages.
  • User Impact

    • No changes to application functionality or runtime behavior.

publint was pinned twice: once as a pnpm catalog entry expanded into the
devDependencies of `ccusage` and all six native packages, and once as the
bun2nix-built `nix/tools/publint` used by the `publint` flake check and the
dev shell. The two pins could drift silently, and Renovate only ever bumps
one of them at a time.

Keep the Nix build as the single pin and drop the pnpm copies. The
`build`/`prepack` scripts still call bare `publint`, which now always
resolves from PATH: the dev shell and `just ccusage::build-package` already
provided it, and the two publish jobs that install tools with `nix profile
install` instead of entering the dev shell now request `.#publint`
explicitly.

Both publint invocations stay: `prepack` packs a real tarball while the
flake check runs `--pack false` against stubbed generated files, so they
cover different failure modes.
The `runtime` catalog lost its last reference when the TypeScript CLI was
replaced by the Rust binary (#1306), and `llm-docs` lost its only reference
when the gunshi docs dependency was removed. Both blocks stayed behind in
pnpm-workspace.yaml, so Renovate kept opening bumps against specifiers no
package resolves (#1350, #1351) and neither catalog ever reached the
lockfile.

Only `docs` and `types` have consumers, so keep those two.
Copilot AI review requested due to automatic review settings July 27, 2026 10:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: afd25810-75fe-49c8-9414-21f338919912

📥 Commits

Reviewing files that changed from the base of the PR and between df89eb7 and 092ab89.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • .github/workflows/ci.yaml
  • .github/workflows/release.yaml
  • apps/ccusage/package.json
  • packages/ccusage-darwin-arm64/package.json
  • packages/ccusage-darwin-x64/package.json
  • packages/ccusage-linux-arm64/package.json
  • packages/ccusage-linux-x64/package.json
  • packages/ccusage-win32-arm64/package.json
  • packages/ccusage-win32-x64/package.json
  • pnpm-workspace.yaml
💤 Files with no reviewable changes (7)
  • packages/ccusage-win32-arm64/package.json
  • packages/ccusage-darwin-x64/package.json
  • packages/ccusage-darwin-arm64/package.json
  • pnpm-workspace.yaml
  • packages/ccusage-win32-x64/package.json
  • packages/ccusage-linux-x64/package.json
  • packages/ccusage-linux-arm64/package.json

📝 Walkthrough

Walkthrough

Publint is removed from package development dependencies, invoked by native package prepack scripts, and installed directly in publishing workflows. Several obsolete documentation catalog groups are also removed from the workspace configuration.

Changes

Publint packaging workflow

Layer / File(s) Summary
Package publint lifecycle
apps/ccusage/package.json, packages/ccusage-*/package.json
Removes publint development dependencies and adds or retains prepack commands that invoke it for native packages.
Publishing tool provisioning
.github/workflows/ci.yaml, .github/workflows/release.yaml
Installs the flake-pinned publint tool in the CI publishing job and expands related workflow comments.
Workspace catalog cleanup
pnpm-workspace.yaml
Removes the lint, llm-docs, and runtime groups from catalogs.docs.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: copilot, pullfrog

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main dependency consolidation and catalog cleanup changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/single-source-publint

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ccusage-guide 092ab89 Commit Preview URL

Branch Preview URL
Jul 27 2026, 10:31 AM

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — consolidates publint to a single Nix source by dropping the duplicate pnpm catalog:lint pin, and removes two dead catalogs (runtime, llm-docs) with zero consumers.

  • Source publint from Nix flake only — removes the publint devDependencies from apps/ccusage and all 6 native platform packages, adds .#publint to the nix profile install lines in CI and release workflows where the dev shell is intentionally bypassed.
  • Prune dead runtime and llm-docs catalogs — both lost their last consumers in prior refactors; Renovate was bumping specifiers no package resolves.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pkg-pr-new

pkg-pr-new Bot commented Jul 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

ccusage

npx https://pkg.pr.new/ccusage@1495

@ccusage/ccusage-darwin-arm64

npx https://pkg.pr.new/@ccusage/ccusage-darwin-arm64@1495

@ccusage/ccusage-darwin-x64

npx https://pkg.pr.new/@ccusage/ccusage-darwin-x64@1495

@ccusage/ccusage-linux-arm64

npx https://pkg.pr.new/@ccusage/ccusage-linux-arm64@1495

@ccusage/ccusage-linux-x64

npx https://pkg.pr.new/@ccusage/ccusage-linux-x64@1495

@ccusage/ccusage-win32-x64

npx https://pkg.pr.new/@ccusage/ccusage-win32-x64@1495

commit: 092ab89

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 11 files

Re-trigger cubic

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 092ab89a12b5
Base SHA: df89eb712b75

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runtime diagnostics

Compares 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 /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 358.8ms 2.81 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 344.4ms 2.92 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 115.6ms 8.71 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 93.5ms 10.76 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 28.5ms 5.2ms 5.51x 55.00 MiB 12.20 MiB 0.22x 0.05 MiB/s 0.30 MiB/s
claude session --offline --json 0.00 MiB 27.4ms 3.4ms 7.98x 55.25 MiB 12.21 MiB 0.22x 0.06 MiB/s 0.45 MiB/s
codex daily --offline --json 0.00 MiB 25.7ms 2.4ms 10.51x 54.75 MiB 10.45 MiB 0.19x 0.03 MiB/s 0.35 MiB/s
codex session --offline --json 0.00 MiB 24.9ms 2.5ms 10.14x 55.00 MiB 10.45 MiB 0.19x 0.03 MiB/s 0.35 MiB/s

Large real-world-shaped fixture performance

Generated 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 /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 372.4ms 342.8ms 1.09x 944.34 MiB 934.33 MiB 0.99x 2.70 GiB/s 2.94 GiB/s
codex --offline --json 1.01 GiB 116.1ms 104.3ms 1.11x 426.90 MiB 414.90 MiB 0.97x 8.67 GiB/s 9.66 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.70 KiB -0.01 KiB 1.00x
installed native package binary 4141.94 KiB 4141.94 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 092ab89a12b5
Base SHA: df89eb712b75

This compares the PR package against the configured base package on the same CI runner.

Package runtime diagnostics

Compares 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 /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 348.1ms 2.89 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 316.6ms 3.18 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 118.9ms 8.47 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 93.7ms 10.75 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 30.9ms 27.3ms 1.13x 55.00 MiB 55.00 MiB 1.00x 0.05 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 27.2ms 25.5ms 1.07x 55.00 MiB 55.00 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 25.3ms 22.7ms 1.11x 55.00 MiB 55.00 MiB 1.00x 0.03 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 23.4ms 22.6ms 1.03x 55.25 MiB 55.25 MiB 1.00x 0.04 MiB/s 0.04 MiB/s

Large real-world-shaped fixture performance

Generated 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 /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 353.3ms 329.5ms 1.07x 954.33 MiB 924.32 MiB 0.97x 2.85 GiB/s 3.06 GiB/s
codex --offline --json 1.01 GiB 113.9ms 118.7ms 0.96x 414.91 MiB 408.90 MiB 0.99x 8.84 GiB/s 8.48 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 18.71 KiB 18.70 KiB -0.01 KiB 1.00x
installed native package binary 4141.94 KiB 4141.94 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@ryoppippi
ryoppippi merged commit 60f1984 into main Jul 27, 2026
38 checks passed
@ryoppippi
ryoppippi deleted the chore/single-source-publint branch July 27, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants