Skip to content

fix: tsdown watch#8813

Merged
sriramveeraghanta merged 1 commit intopreviewfrom
fix/8791
Mar 27, 2026
Merged

fix: tsdown watch#8813
sriramveeraghanta merged 1 commit intopreviewfrom
fix/8791

Conversation

@lifeiscontent
Copy link
Collaborator

@lifeiscontent lifeiscontent commented Mar 27, 2026

closes #8791

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

References

Summary by CodeRabbit

Release Notes

  • Chores
    • Updated development build process configuration across multiple packages
    • Simplified package export configurations
    • Adjusted build tool dependencies and dependency management to include @parcel/watcher, @swc/core, esbuild, and msgpackr-extract
    • Moved Tailwind dependencies to production dependencies

Copilot AI review requested due to automatic review settings March 27, 2026 09:44
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 27, 2026

📝 Walkthrough

Walkthrough

This pull request fixes a race condition in dev mode by adding the --no-clean flag to tsdown --watch commands across packages, preventing the clean step from wiping pre-built outputs from turbo's build pipeline. Additionally, package exports are simplified and tsdown configurations are updated with exports: true.

Changes

Cohort / File(s) Summary
Development script updates
apps/live/package.json, packages/constants/package.json, packages/editor/package.json, packages/propel/package.json, packages/types/package.json
Updated dev script to add --no-clean flag to tsdown --watch, preventing dist directory cleanup during watch mode.
Dev scripts with additional dependencies
packages/decorators/package.json, packages/logger/package.json
Updated dev script with --no-clean flag and added inlinedDependencies section pinning type packages (@types/express, @types/express-serve-static-core, and reflect-metadata).
Services package dev and exports
packages/services/package.json
Updated dev script with --no-clean flag and simplified exports["."] from object form with separate types and import fields to single string pointing to ./dist/index.js.
Exports simplification
packages/hooks/package.json, packages/i18n/package.json, packages/shared-state/package.json, packages/ui/package.json, packages/utils/package.json
Updated dev script with --no-clean flag and simplified exports["."] from conditional object form to direct string export, removing explicit types metadata.
tsdown configuration exports
packages/hooks/tsdown.config.ts, packages/i18n/tsdown.config.ts, packages/services/tsdown.config.ts, packages/shared-state/tsdown.config.ts, packages/ui/tsdown.config.ts, packages/utils/tsdown.config.ts
Added exports: true to build configuration to enable export metadata generation in build output.
Root configuration
package.json
Extended pnpm.onlyBuiltDependencies to include @parcel/watcher, @swc/core, esbuild, and msgpackr-extract alongside turbo, designating additional native build dependencies.
Dependency restructuring
packages/tailwind-config/package.json
Moved @tailwindcss/postcss and postcss from devDependencies to dependencies.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • aaryan610
  • prateekshourya29

Poem

🐰 No more racing through the dist today,
--no-clean keeps the cache at bay,
Turbo builds once, tsdown watches true,
Exports simplified, and packages shiny new! 🎉

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes out-of-scope changes: simplified package exports in 8 packages and added inlinedDependencies in 2 packages, unrelated to the --no-clean flag fix. Remove the exports simplifications and inlinedDependencies additions; focus only on adding --no-clean to dev scripts. Consider moving export/dependency changes to a separate PR.
Description check ❓ Inconclusive The description references the linked issue (#8791) but lacks detailed implementation information about the specific changes made across the 13 affected files. Add more detail about what changes were made (e.g., which files were modified and what the specific updates were) to better document the PR's scope.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding --no-clean flag to tsdown watch commands to fix the race condition in dev mode.
Linked Issues check ✅ Passed The PR successfully addresses all requirements from issue #8791: --no-clean flag added to all 13 tsdown watch dev scripts across packages and apps/live.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/8791

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 and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the tsdown --watch dev workflow in the monorepo by preventing dist/ from being cleaned on watcher startup (avoiding a turbo ^build/dev race), while also aligning several package build/export configurations.

Changes:

  • Add --no-clean to tsdown --watch dev scripts across packages and apps/live.
  • Enable exports: true in several tsdown.config.ts files and simplify package exports maps.
  • Update root pnpm settings and refresh pnpm-lock.yaml resolutions.

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pnpm-lock.yaml Lockfile updates reflecting dependency graph/resolution changes (incl. tsdown/unrun and transitive bumps).
package.json Expands pnpm.onlyBuiltDependencies to include additional native/binary deps.
apps/live/package.json Adds --no-clean to tsdown --watch dev script while keeping --onSuccess behavior.
packages/utils/tsdown.config.ts Enables tsdown exports generation.
packages/utils/package.json Simplifies exports and updates dev script to --no-clean.
packages/ui/tsdown.config.ts Enables tsdown exports generation.
packages/ui/package.json Simplifies exports and updates dev script to --no-clean.
packages/types/package.json Updates dev script to tsdown --watch --no-clean.
packages/tailwind-config/package.json Moves postcss + @tailwindcss/postcss to dependencies.
packages/shared-state/tsdown.config.ts Enables tsdown exports generation.
packages/shared-state/package.json Simplifies exports and updates dev script to --no-clean.
packages/services/tsdown.config.ts Enables tsdown exports generation.
packages/services/package.json Simplifies exports and updates dev script to --no-clean.
packages/propel/package.json Updates dev script to tsdown --watch --no-clean.
packages/logger/package.json Updates dev script and adds inlinedDependencies.
packages/i18n/tsdown.config.ts Enables tsdown exports generation.
packages/i18n/package.json Simplifies exports and updates dev script to --no-clean.
packages/hooks/tsdown.config.ts Enables tsdown exports generation.
packages/hooks/package.json Simplifies exports and updates dev script to --no-clean.
packages/editor/package.json Updates dev script to tsdown --watch --no-clean.
packages/decorators/package.json Updates dev script and adds inlinedDependencies.
packages/constants/package.json Updates dev script to tsdown --watch --no-clean.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Copy link
Contributor

@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: 1

🧹 Nitpick comments (4)
packages/shared-state/package.json (1)

33-33: Consider using catalog: for zod dependency.

This dependency uses a pinned version ^3.22.2 instead of catalog:. As per coding guidelines, external dependencies should use catalog: for consistency.

Suggested change
-    "zod": "^3.22.2"
+    "zod": "catalog:"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/shared-state/package.json` at line 33, The package.json entry for
the zod dependency currently pins a semver version ("zod": "^3.22.2"); update
this dependency to use the catalog specifier instead (replace the semver value
for "zod" with the appropriate "catalog:" reference) so it aligns with the
project's dependency sourcing guideline; locate the "zod" key in
packages/shared-state/package.json and swap the version string to the catalog:
form used elsewhere in the repo.
packages/decorators/package.json (1)

27-27: Consider using catalog: for external devDependencies.

Several devDependencies use pinned versions instead of catalog::

  • @types/express: 4.17.23
  • @types/ws: ^8.5.10
  • reflect-metadata: ^0.2.2

As per coding guidelines, external dependencies should use catalog: for consistency across the monorepo.

Also applies to: 29-30

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/decorators/package.json` at line 27, Update the devDependencies in
package.json to use catalog: references instead of pinned versions for the
external packages mentioned; replace "@types/express": "4.17.23", "@types/ws":
"^8.5.10" and "reflect-metadata": "^0.2.2" with the corresponding "catalog:..."
entries used by the monorepo (ensure the keys match the root catalog names), and
apply the same change for the other two entries noted on lines 29-30 so all
external devDependencies reference the shared catalog.
packages/i18n/package.json (1)

27-27: Consider using catalog: for intl-messageformat dependency.

This dependency uses a pinned version ^10.7.11 instead of catalog:. As per coding guidelines, external dependencies should use catalog: for consistency.

Suggested change
-    "intl-messageformat": "^10.7.11"
+    "intl-messageformat": "catalog:"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/i18n/package.json` at line 27, Replace the pinned version string for
the dependency "intl-messageformat" in packages/i18n's package.json with the
catalog: notation; locate the "intl-messageformat" entry and change its value
from "^10.7.11" to the appropriate "catalog:..." specifier used by your
project's dependency catalog to ensure consistency with other external
dependencies.
packages/services/package.json (1)

28-28: Consider using catalog: for file-type dependency.

This dependency uses a pinned version ^21.3.1 instead of catalog:. As per coding guidelines, external dependencies should use catalog: for consistency across the monorepo.

Suggested change
-    "file-type": "^21.3.1"
+    "file-type": "catalog:"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/services/package.json` at line 28, Replace the pinned version for
the file-type dependency in package.json with the catalog specifier: locate the
"file-type" entry and change its version string from "^21.3.1" to use the
monorepo catalog syntax (e.g., "catalog:file-type") so the package resolves via
the shared catalog; update the dependency entry for "file-type" accordingly and
save package.json.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/logger/package.json`:
- Around line 36-39: Remove the unsupported "inlinedDependencies" section from
package.json and, if you intended to control bundling of specific types, move
that configuration into tsdown.config.ts using the deps.onlyBundle option;
specifically delete the inlinedDependencies object and add an entry like
deps.onlyBundle = ["@types/express", "@types/express-serve-static-core"] (or
equivalent) in tsdown.config.ts so tsdown will actually process those packages.

---

Nitpick comments:
In `@packages/decorators/package.json`:
- Line 27: Update the devDependencies in package.json to use catalog: references
instead of pinned versions for the external packages mentioned; replace
"@types/express": "4.17.23", "@types/ws": "^8.5.10" and "reflect-metadata":
"^0.2.2" with the corresponding "catalog:..." entries used by the monorepo
(ensure the keys match the root catalog names), and apply the same change for
the other two entries noted on lines 29-30 so all external devDependencies
reference the shared catalog.

In `@packages/i18n/package.json`:
- Line 27: Replace the pinned version string for the dependency
"intl-messageformat" in packages/i18n's package.json with the catalog: notation;
locate the "intl-messageformat" entry and change its value from "^10.7.11" to
the appropriate "catalog:..." specifier used by your project's dependency
catalog to ensure consistency with other external dependencies.

In `@packages/services/package.json`:
- Line 28: Replace the pinned version for the file-type dependency in
package.json with the catalog specifier: locate the "file-type" entry and change
its version string from "^21.3.1" to use the monorepo catalog syntax (e.g.,
"catalog:file-type") so the package resolves via the shared catalog; update the
dependency entry for "file-type" accordingly and save package.json.

In `@packages/shared-state/package.json`:
- Line 33: The package.json entry for the zod dependency currently pins a semver
version ("zod": "^3.22.2"); update this dependency to use the catalog specifier
instead (replace the semver value for "zod" with the appropriate "catalog:"
reference) so it aligns with the project's dependency sourcing guideline; locate
the "zod" key in packages/shared-state/package.json and swap the version string
to the catalog: form used elsewhere in the repo.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 488180ed-0a13-4856-a427-a0050d2dca8b

📥 Commits

Reviewing files that changed from the base of the PR and between 130ba5e and 7a3e52e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • apps/live/package.json
  • package.json
  • packages/constants/package.json
  • packages/decorators/package.json
  • packages/editor/package.json
  • packages/hooks/package.json
  • packages/hooks/tsdown.config.ts
  • packages/i18n/package.json
  • packages/i18n/tsdown.config.ts
  • packages/logger/package.json
  • packages/propel/package.json
  • packages/services/package.json
  • packages/services/tsdown.config.ts
  • packages/shared-state/package.json
  • packages/shared-state/tsdown.config.ts
  • packages/tailwind-config/package.json
  • packages/types/package.json
  • packages/ui/package.json
  • packages/ui/tsdown.config.ts
  • packages/utils/package.json
  • packages/utils/tsdown.config.ts

@sriramveeraghanta sriramveeraghanta merged commit 97b4abd into preview Mar 27, 2026
15 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix/8791 branch March 27, 2026 10:29
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.

[bug]: tsdown --watch cleans dist/ on startup causing race condition in dev mode

4 participants