Skip to content

fix(cli): bundle patched diff parser dependency#2957

Merged
juliusmarminge merged 2 commits into
mainfrom
codex/fix-npm-launch-pierre-diffs
Jun 4, 2026
Merged

fix(cli): bundle patched diff parser dependency#2957
juliusmarminge merged 2 commits into
mainfrom
codex/fix-npm-launch-pierre-diffs

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Jun 4, 2026

Summary

  • bundle @pierre/diffs into the published t3 CLI bundle
  • expose and test the server pack dependency predicate so the patched Pierre subpath stays bundled

Why

The workspace uses a pnpm patch to add @pierre/diffs/utils/parsePatchFiles to the package exports map. Local builds work because that patch is applied. Published npm users install vanilla @pierre/diffs, so the current t3@nightly bundle crashes immediately with ERR_PACKAGE_PATH_NOT_EXPORTED when Node resolves the external subpath import.

Bundling @pierre/diffs keeps the source subpath import, preserves the React Native-compatible import strategy, and removes the external runtime dependency on the patched exports map.

Validation

  • vp test apps/server/src/packageConfig.test.ts apps/server/src/checkpointing/Diffs.test.ts
  • vp run --filter t3 build:bundle
  • node apps/server/dist/bin.mjs --help
  • checked apps/server/dist/bin.mjs has no external @pierre/diffs import
  • vp check
  • vp install to repair a partial local install from filtered deploy probes
  • vp run typecheck

Note

Low Risk
Packaging-only change to dependency bundling; reduces runtime failure risk for published CLI users without touching auth or data paths.

Overview
The published t3 CLI was resolving @pierre/diffs at runtime using a pnpm-patched subpath that npm installs do not export, causing immediate ERR_PACKAGE_PATH_NOT_EXPORTED crashes.

This change always bundles @pierre/diffs into the server pack output alongside existing internal prefixes, and replaces the inline alwaysBundle predicate with an exported shouldBundleCliDependency helper backed by bundledPackagePrefixes so the bundling rule is explicit and testable.

Reviewed by Cursor Bugbot for commit 5bd69e2. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Bundle @pierre/diffs dependency in CLI packaging

Adds @pierre/diffs to the list of prefixes in vite.config.ts that are always bundled during CLI packaging. Extracts the prefix list into a bundledPackagePrefixes constant and a shouldBundleCliDependency helper, replacing the previous inline predicate.

Macroscope summarized 5bd69e2.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 019bb221-d11b-4b59-a009-42d9c3c14529

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-npm-launch-pierre-diffs

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Jun 4, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Jun 4, 2026

Approvability

Verdict: Approved

Build configuration change that adds @pierre/diffs to the list of bundled CLI dependencies and extracts a helper function. Low-risk, self-contained modification to Vite config with no runtime behavior changes.

You can customize Macroscope's approvability policy. Learn more.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

🚀 Expo continuous deployment is ready!

  • Project → t3-code
  • Platforms → android, ios
  • Scheme → t3code-preview
  🤖 Android 🍎 iOS
Fingerprint 251694208975e82c56bd5289d014d27db782d79c 88f9ec34318a3522ac20299028ec60ca0080a665
Build Details Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: 251694208975e82c56bd5289d014d27db782d79c
App version: 0.1.0
Git commit: fff460b4abc01f29f5b2cdb5bf25d955066816ee
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: 88f9ec34318a3522ac20299028ec60ca0080a665
App version: 0.1.0
Git commit: fff460b4abc01f29f5b2cdb5bf25d955066816ee
Update Details Update Permalink
DetailsBranch: pr-2957
Runtime version: 251694208975e82c56bd5289d014d27db782d79c
Git commit: c34193b272d8a02e52e5d7e64d6fde9872ac1d67
Update Permalink
DetailsBranch: pr-2957
Runtime version: 88f9ec34318a3522ac20299028ec60ca0080a665
Git commit: c34193b272d8a02e52e5d7e64d6fde9872ac1d67
Update QR

@macroscopeapp macroscopeapp Bot dismissed their stale review June 4, 2026 18:51

Dismissing prior approval to re-evaluate 5bd69e2

@juliusmarminge juliusmarminge enabled auto-merge (squash) June 4, 2026 18:51
@juliusmarminge juliusmarminge merged commit 348a914 into main Jun 4, 2026
16 checks passed
@juliusmarminge juliusmarminge deleted the codex/fix-npm-launch-pierre-diffs branch June 4, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant