Skip to content

Conversation

@V1RE
Copy link

@V1RE V1RE commented Jun 8, 2025

Replaced the per-package unbuild setup with a single unified tsdown workspace setup. This also fixes the self-importing issue i mentioned in #621.

Summary by CodeRabbit

  • Chores
    • Updated the build process to use a new tool for package builds.
    • Removed redundant build scripts from all package configurations.
    • Added and configured new build tool settings across multiple packages.
    • Updated dependencies to reflect the new build process.
  • New Features
    • Introduced configuration files for the new build tool in several packages.

Replaced the per-package unbuild setup with a single unified tsdown workspace setup.
@vercel
Copy link

vercel bot commented Jun 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
orpc ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 8, 2025 2:23pm

@coderabbitai
Copy link

coderabbitai bot commented Jun 8, 2025

Walkthrough

The build process across the monorepo has been refactored to use tsdown instead of unbuild for package builds. All individual package build scripts were removed, and new tsdown.config.ts files were introduced for several packages to specify entry points. The root build script now orchestrates builds using tsdown, and dependencies were updated accordingly.

Changes

File(s) / Group Change Summary
package.json Updated build scripts to use tsdown, replaced unbuild with tsdown in devDependencies.
packages/*/package.json Removed individual build script entries from all package-level package.json files.
packages/*/tsdown.config.ts Added new tsdown configuration files specifying entry points for relevant packages (client, react, server, standard-server, zod).
tsdown.config.ts Added root tsdown configuration for workspace-wide build/type generation settings.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant RootPkg as Root package.json
    participant Tsdown as tsdown
    participant Pkg as Package

    Dev->>RootPkg: Run "pnpm run build"
    RootPkg->>Tsdown: Run "tsdown" (via build:packages)
    Tsdown->>Pkg: Process entries from tsdown.config.ts in each package
    Tsdown-->>RootPkg: Build output generated
    RootPkg->>Pkg: Run recursive build (pnpm run -r build)
Loading

Poem

In the warren, scripts were trimmed,
Old "builds" are gone, their futures dimmed.
Now tsdown hops from burrow to den,
Building each package again and again.
With configs anew and a streamlined plan,
The codebase leaps—catch it if you can!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea04050 and 873357b.

📒 Files selected for processing (24)
  • package.json (2 hunks)
  • packages/arktype/package.json (0 hunks)
  • packages/client/package.json (0 hunks)
  • packages/contract/package.json (0 hunks)
  • packages/hey-api/package.json (0 hunks)
  • packages/nest/package.json (0 hunks)
  • packages/openapi-client/package.json (0 hunks)
  • packages/openapi/package.json (0 hunks)
  • packages/react-query/package.json (0 hunks)
  • packages/react/package.json (0 hunks)
  • packages/server/package.json (0 hunks)
  • packages/shared/package.json (0 hunks)
  • packages/solid-query/package.json (0 hunks)
  • packages/standard-server-aws-lambda/package.json (0 hunks)
  • packages/standard-server-fetch/package.json (0 hunks)
  • packages/standard-server-node/package.json (0 hunks)
  • packages/standard-server-peer/package.json (0 hunks)
  • packages/standard-server/package.json (0 hunks)
  • packages/svelte-query/package.json (0 hunks)
  • packages/tanstack-query/package.json (0 hunks)
  • packages/valibot/package.json (0 hunks)
  • packages/vue-colada/package.json (0 hunks)
  • packages/vue-query/package.json (0 hunks)
  • packages/zod/package.json (0 hunks)
💤 Files with no reviewable changes (23)
  • packages/standard-server-fetch/package.json
  • packages/tanstack-query/package.json
  • packages/standard-server-aws-lambda/package.json
  • packages/svelte-query/package.json
  • packages/openapi/package.json
  • packages/hey-api/package.json
  • packages/shared/package.json
  • packages/react-query/package.json
  • packages/zod/package.json
  • packages/vue-query/package.json
  • packages/solid-query/package.json
  • packages/client/package.json
  • packages/valibot/package.json
  • packages/vue-colada/package.json
  • packages/server/package.json
  • packages/standard-server-peer/package.json
  • packages/nest/package.json
  • packages/standard-server/package.json
  • packages/openapi-client/package.json
  • packages/arktype/package.json
  • packages/react/package.json
  • packages/standard-server-node/package.json
  • packages/contract/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
tsdown.config.ts (1)

3-8: Consider excluding test and demo files.
To avoid generating outputs for non-production sources, you might add an exclude section, for example:

exclude: ['**/*.test.ts', '**/__tests__/**', 'packages/**/demo/**'],
packages/client/tsdown.config.ts (1)

4-4: Consider deeper glob for adapters.

If adapter modules may be nested beyond one level, change './src/adapters/*/index.ts' to './src/adapters/**/index.ts' to include all subdirectories.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e6490f2 and ea04050.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (30)
  • package.json (2 hunks)
  • packages/arktype/package.json (0 hunks)
  • packages/client/package.json (0 hunks)
  • packages/client/tsdown.config.ts (1 hunks)
  • packages/contract/package.json (0 hunks)
  • packages/hey-api/package.json (0 hunks)
  • packages/nest/package.json (0 hunks)
  • packages/openapi-client/package.json (0 hunks)
  • packages/openapi/package.json (0 hunks)
  • packages/react-query/package.json (0 hunks)
  • packages/react/package.json (0 hunks)
  • packages/react/tsdown.config.ts (1 hunks)
  • packages/server/package.json (0 hunks)
  • packages/server/tsdown.config.ts (1 hunks)
  • packages/shared/package.json (0 hunks)
  • packages/solid-query/package.json (0 hunks)
  • packages/standard-server-aws-lambda/package.json (0 hunks)
  • packages/standard-server-fetch/package.json (0 hunks)
  • packages/standard-server-node/package.json (0 hunks)
  • packages/standard-server-peer/package.json (0 hunks)
  • packages/standard-server/package.json (0 hunks)
  • packages/standard-server/tsdown.config.ts (1 hunks)
  • packages/svelte-query/package.json (0 hunks)
  • packages/tanstack-query/package.json (0 hunks)
  • packages/valibot/package.json (0 hunks)
  • packages/vue-colada/package.json (0 hunks)
  • packages/vue-query/package.json (0 hunks)
  • packages/zod/package.json (0 hunks)
  • packages/zod/tsdown.config.ts (1 hunks)
  • tsdown.config.ts (1 hunks)
💤 Files with no reviewable changes (23)
  • packages/server/package.json
  • packages/hey-api/package.json
  • packages/zod/package.json
  • packages/openapi/package.json
  • packages/standard-server-node/package.json
  • packages/react-query/package.json
  • packages/solid-query/package.json
  • packages/vue-colada/package.json
  • packages/contract/package.json
  • packages/standard-server-aws-lambda/package.json
  • packages/arktype/package.json
  • packages/client/package.json
  • packages/valibot/package.json
  • packages/react/package.json
  • packages/standard-server-fetch/package.json
  • packages/nest/package.json
  • packages/openapi-client/package.json
  • packages/shared/package.json
  • packages/standard-server-peer/package.json
  • packages/standard-server/package.json
  • packages/tanstack-query/package.json
  • packages/vue-query/package.json
  • packages/svelte-query/package.json
🔇 Additional comments (14)
tsdown.config.ts (1)

1-2: Import statement is correct.
The defineConfig import from tsdown matches the expected API for the new unified build setup.

packages/react/tsdown.config.ts (2)

1-5: Ensure entry points align with package.json exports.
Verify that both ./src/index.ts and ./src/hooks/index.ts correspond to paths declared under exports in packages/react/package.json.


1-5: Package-level config is correctly minimal.
This file cleanly defines only the entry points and relies on the root config for shared settings (dts, fixedExtension).

packages/zod/tsdown.config.ts (2)

1-5: Verify entries against package.json.
Make sure ./src/index.ts and ./src/zod4/index.ts are declared in the package’s exports field to avoid missing or extra outputs.


1-5: Config correctly delegates to root settings.
Entry points are concise and will inherit global dts and fixedExtension from the root config.

packages/standard-server/tsdown.config.ts (2)

1-5: Confirm public interface coverage.
Ensure both ./src/index.ts and ./src/batch/index.ts are intended as public entry points and match your package’s exports.


1-5: Minimal and clear package config.
This setup cleanly scopes the build to the main and batch modules, relying on root defaults for other options.

packages/server/tsdown.config.ts (2)

1-5: Validate adapter glob pattern.
The pattern ./src/adapters/*/index.ts only matches one level deep. If you ever nest adapters further, consider ./src/adapters/**/index.ts.


1-5: Entries correctly define package surface.
The combination of main, plugins, and adapters entry points fully captures the server package’s public API.

packages/client/tsdown.config.ts (2)

1-2: Validate import and module resolution.

Importing defineConfig from 'tsdown' is correct. Ensure the version in devDependencies matches this import and that your tooling is configured to load .ts config files.


3-5: Approve tsdown configuration entries.

The specified entry points (index.ts, plugins/index.ts, and adapters/*/index.ts) align with the client package’s public API. This matches the patterns used in other packages.

package.json (3)

9-9: Confirm consolidated build invocation.

The "build" script now runs build:packages before the recursive build. Verify that building package artifacts with tsdown completes successfully before downstream builds.


10-10: Invoke tsdown in build:packages script.

Replacing the old per-package build with the single tsdown invocation centralizes the process. Confirm the CLI is available in CI and local environments.


47-47: Declare tsdown and remove unbuild.

Adding [email protected] is required. Ensure any unbuild entries and related scripts/configs have been removed to avoid legacy tool conflicts.

@codecov
Copy link

codecov bot commented Jun 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 8, 2025

More templates

@orpc/arktype

npm i https://pkg.pr.new/@orpc/arktype@622

@orpc/client

npm i https://pkg.pr.new/@orpc/client@622

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@622

@orpc/hey-api

npm i https://pkg.pr.new/@orpc/hey-api@622

@orpc/nest

npm i https://pkg.pr.new/@orpc/nest@622

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@622

@orpc/openapi-client

npm i https://pkg.pr.new/@orpc/openapi-client@622

@orpc/react

npm i https://pkg.pr.new/@orpc/react@622

@orpc/react-query

npm i https://pkg.pr.new/@orpc/react-query@622

@orpc/server

npm i https://pkg.pr.new/@orpc/server@622

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@622

@orpc/solid-query

npm i https://pkg.pr.new/@orpc/solid-query@622

@orpc/standard-server

npm i https://pkg.pr.new/@orpc/standard-server@622

@orpc/standard-server-aws-lambda

npm i https://pkg.pr.new/@orpc/standard-server-aws-lambda@622

@orpc/standard-server-fetch

npm i https://pkg.pr.new/@orpc/standard-server-fetch@622

@orpc/standard-server-node

npm i https://pkg.pr.new/@orpc/standard-server-node@622

@orpc/standard-server-peer

npm i https://pkg.pr.new/@orpc/standard-server-peer@622

@orpc/svelte-query

npm i https://pkg.pr.new/@orpc/svelte-query@622

@orpc/tanstack-query

npm i https://pkg.pr.new/@orpc/tanstack-query@622

@orpc/valibot

npm i https://pkg.pr.new/@orpc/valibot@622

@orpc/vue-colada

npm i https://pkg.pr.new/@orpc/vue-colada@622

@orpc/vue-query

npm i https://pkg.pr.new/@orpc/vue-query@622

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@622

commit: 873357b

@unnoq
Copy link
Owner

unnoq commented Jun 9, 2025

I will wait until tsdown workspace feature is stable.

Some unbuild features really helpful, but tsdown does support yet.

  • require explicit config if import "devDependencies" or not install packages
  • check package.json "exports" config

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