Skip to content

feat: migrate unbuild to tsdown - #712

Merged
Brentlok merged 2 commits into
mainfrom
feat/tsdown
Oct 5, 2026
Merged

Brentlok merged 2 commits into
mainfrom
feat/tsdown

Conversation

@Brentlok

@Brentlok Brentlok commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Metro now applies Uniwind initialization to React Native Web modules in both ESM and CommonJS formats.
    • Improved Vite compatibility with the package’s updated web component and configuration files.
  • Chores
    • Updated the package build and TypeScript tooling. ESM and CommonJS package entry points and type declarations are now provided.
  • Documentation
    • Updated workspace and build guidance to reflect the current Node.js and TypeScript requirements, package exports, and build outputs.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (2)
AGENTS.md — auto-discovered
CONTEXT.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e8ae3df-5309-4c27-ada2-e3f9dbc1cfef
📥 Commits

Reviewing files that changed from the base of the PR and between 20bcb9e and 599eb23.

📒 Files selected for processing (6)
  • CONTEXT.md
  • packages/uniwind/src/bundler/adapters/vite/vite.ts
  • packages/uniwind/tests/type-test/commonjs.cts
  • packages/uniwind/tests/type-test/getCSSVariable.ts
  • packages/uniwind/tests/type-test/theme.ts
  • packages/uniwind/tests/type-test/tsconfig.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • CONTEXT.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The package build changes from unbuild to tsdown. Package entry points and build outputs use ESM and CommonJS extensions. Metro and Vite adapter paths and tests are updated for those outputs.

Changes

Build and bundler migration

Layer / File(s) Summary
Build outputs and package mappings
packages/uniwind/tsdown.config.ts, packages/uniwind/package.json, packages/uniwind/build.config.ts, package.json, CONTEXT.md, packages/uniwind/tests/type-test/*
The build switches to tsdown and configures ESM, CommonJS, declaration, and adapter outputs. Package entry points and NodeNext type tests use the updated package exports. The workspace TypeScript version and build documentation are updated.
Bundler adapter paths and tests
packages/uniwind/src/bundler/adapters/metro/*, packages/uniwind/src/bundler/adapters/vite/vite.ts, packages/uniwind/tests/native/bundler/transformer.test.ts, packages/uniwind/tests/web/vite.test.ts
Metro recognizes injected .mjs and .cjs modules and imports FileStore from metro-cache. Vite resolves .mjs component and stylesheet paths and matches config.mjs. Tests cover transformer initialization and the updated Vite paths.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to 599eb

No actionable migration defect is established; the change is mergeable after normal build and test checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 599eb

The migration preserves public entrypoint names and existing initialization authority. No introduced security vulnerability was established. Risk remains low rather than minimal because published outputs and some format-specific initialization behavior could not be verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The supported exposure is downstream package consumers and their Metro/Vite build processes. The changed exports preserve the same package-owned subpaths rather than adding new public capabilities.

Trust Boundaries and Controls

  • observed — Vite retains fixed internal replacement paths and existing source/importer checks. Metro retains the configured CSS-entry comparison and existing reinitialization sink. The changed filename matching does not itself introduce an arbitrary target path or a new authority source.

Resilience and Maintainability Implications

  • observed — Native initialization and store recovery blocks are unchanged. Successful fingerprints still suppress identical repetitions, while failed store initialization does not record the fingerprint and remains retryable. This does not verify concurrency or interruption behavior in the generated distribution.
🚥 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 clearly describes the main change: migrating the build from unbuild to tsdown.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 9…
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 docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High risk] Replaces build tooling and changes output paths.

The PR appears safe to merge based on the reviewed changes.

What we checked:

  • Type tests run before the build: The type-test task depends on the build. The old test also pointed at a built declaration file.

Summary

Uniwind replaces unbuild with tsdown and publishes matching ESM and CommonJS files with format-specific types. Metro and Vite now follow the new output paths and initialize configured themes in their emitted modules.

  • Package exports and type checks now cover both module formats.
  • Bundler adapters recognize the new .mjs and .cjs output names.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Source files] --> B[tsdown build]
  B --> C[ESM files and declarations]
  B --> D[CommonJS files and declarations]
  C --> E[ESM type tests]
  D --> F[CommonJS type test]
Loading

Reviews (2) · Last reviewed commit: "chore: code review"

Comment thread packages/uniwind/package.json
Comment thread packages/uniwind/tests/type-test/tsconfig.json Outdated
@Brentlok
Brentlok merged commit 26af57d into main Oct 5, 2026
3 checks passed
@Brentlok
Brentlok deleted the feat/tsdown branch October 5, 2026 07:01
Brentlok added a commit that referenced this pull request Oct 5, 2026
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.

1 participant