fix: update tsup build packages#7438
Conversation
WalkthroughThis update increases the development concurrency in the root configuration and standardizes build and packaging configurations across multiple packages. Changes include updates to Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Turbo as Turbo CLI
participant Package as Package Scripts
participant Tsup as tsup
participant TSC as TypeScript
Dev->>Turbo: Run "dev" script (concurrency: 18)
Turbo->>Package: Invoke package build/dev scripts
Package->>TSC: Type-check (tsc --noEmit)
TSC-->>Package: TypeScript validation
Package->>Tsup: Build with minify, splitting, treeshake, esm/cjs
Tsup-->>Package: Outputs to dist/
Package-->>Turbo: Build complete
Turbo-->>Dev: Dev environment ready
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (21)
package.json(1 hunks)packages/constants/package.json(1 hunks)packages/constants/tsconfig.json(1 hunks)packages/constants/tsup.config.ts(1 hunks)packages/decorators/.eslintrc.js(0 hunks)packages/decorators/tsup.config.ts(1 hunks)packages/editor/package.json(1 hunks)packages/editor/tsup.config.ts(1 hunks)packages/hooks/tsup.config.ts(1 hunks)packages/logger/tsup.config.ts(1 hunks)packages/services/.eslintrc.js(0 hunks)packages/services/package.json(2 hunks)packages/services/tsup.config.ts(1 hunks)packages/types/package.json(2 hunks)packages/types/tsconfig.json(1 hunks)packages/types/tsup.config.ts(1 hunks)packages/ui/.eslintrc.js(0 hunks)packages/ui/package.json(1 hunks)packages/ui/tsup.config.ts(1 hunks)packages/utils/package.json(1 hunks)packages/utils/tsup.config.ts(1 hunks)
💤 Files with no reviewable changes (3)
- packages/services/.eslintrc.js
- packages/ui/.eslintrc.js
- packages/decorators/.eslintrc.js
🧰 Additional context used
🧠 Learnings (8)
packages/hooks/tsup.config.ts (1)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
packages/ui/package.json (1)
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7061
File: web/core/components/workspace-notifications/root.tsx:18-18
Timestamp: 2025-05-14T13:16:23.323Z
Learning: In the Plane project codebase, the path alias `@/plane-web` resolves to the `ce` directory, making imports like `@/plane-web/hooks/use-notification-preview` correctly resolve to files in `web/ce/hooks/`.
packages/decorators/tsup.config.ts (1)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
packages/constants/tsup.config.ts (1)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
packages/editor/tsup.config.ts (1)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
packages/services/tsup.config.ts (1)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
packages/ui/tsup.config.ts (1)
Learnt from: lifeiscontent
PR: makeplane/plane#7164
File: packages/ui/.storybook/main.ts:24-47
Timestamp: 2025-06-04T16:22:44.344Z
Learning: In packages/ui/.storybook/main.ts, the webpackFinal function intentionally overrides the CSS loader strategy by finding and replacing existing CSS rules. This is a temporary workaround for a known upstream issue in Storybook's CSS handling that has been communicated to the Storybook maintainers. The current implementation should not be changed until the upstream issue is resolved.
packages/services/package.json (2)
Learnt from: vamsikrishnamathala
PR: makeplane/plane#7061
File: web/core/components/workspace-notifications/root.tsx:18-18
Timestamp: 2025-05-14T13:16:23.323Z
Learning: In the Plane project codebase, the path alias `@/plane-web` resolves to the `ce` directory, making imports like `@/plane-web/hooks/use-notification-preview` correctly resolve to files in `web/ce/hooks/`.
Learnt from: janreges
PR: makeplane/plane#6743
File: packages/i18n/src/store/index.ts:160-161
Timestamp: 2025-03-11T19:42:41.769Z
Learning: In the Plane project, the file 'packages/i18n/src/store/index.ts' already includes support for Polish language translations with the case "pl".
🔇 Additional comments (29)
package.json (1)
14-14: LGTM! Reasonable concurrency increase for development performance.The increase from 13 to 18 concurrent tasks should improve development build times, especially given the monorepo's growth. This aligns well with the standardized build configurations being applied across packages.
packages/decorators/tsup.config.ts (2)
5-5: Good addition of explicit output directory.Explicitly setting
outDir: "dist"improves configuration clarity and ensures consistency across the monorepo's build outputs.
9-9: Beneficial addition of minification.Adding
minify: truewill reduce bundle size for production builds, which is a good optimization for the decorators package.packages/utils/package.json (1)
10-12: Good simplification of file inclusion pattern.Changing from
"dist/**"to"dist"simplifies the packaging configuration while maintaining the same functionality. This standardization across packages improves consistency.packages/editor/package.json (1)
7-9: Consistent file inclusion pattern simplification.The change from
"dist/**/*"to"dist"aligns with the monorepo-wide standardization effort and simplifies the configuration without affecting functionality.packages/types/tsconfig.json (1)
4-5: Good path normalization.Removing the
"./" prefix fromoutDirandrootDirnormalizes the path format while maintaining the same functionality. This improves consistency across TypeScript configurations.packages/ui/package.json (1)
8-13: LGTM! Package.json standardization looks good.The changes properly standardize the package metadata:
- Simplified
filesarray from"dist/**"to"dist"(both work equivalently)- Reordered
main,module, andtypesfields for consistency across packagesThese changes align well with the PR objective of standardizing build configurations across the monorepo.
packages/types/package.json (2)
6-8: LGTM! Files array standardization is consistent.The simplification from
"dist/**/*"to"dist"aligns with the standardization effort across other packages in the monorepo.
21-21: Good addition of minification to the build process.Adding the
--minifyflag optimizes the build output size, which is beneficial for package distribution.packages/hooks/tsup.config.ts (1)
5-11: Excellent build optimizations added.The new configuration options significantly improve the build output:
outDir: "dist"- explicit output directory for clarityminify: true- reduces bundle sizesplitting: true- enables code splitting for better chunkingtreeshake: true- removes unused code during bundlingThese optimizations align with modern build practices and the standardization effort across packages.
packages/constants/tsconfig.json (1)
4-5: Good simplification of TypeScript paths.Removing the
./prefix fromoutDirandrootDirpaths is a clean simplification while maintaining the same functionality. This aligns with the standardization effort across the monorepo.packages/types/tsup.config.ts (1)
6-6: Good addition of CommonJS output format.Adding
"cjs"alongside"esm"provides dual module format support, improving compatibility with different module systems. This aligns with the standardization effort across other packages in the monorepo.packages/logger/tsup.config.ts (3)
5-5: Good standardization: explicit output directory.Setting
outDir: "dist"explicitly aligns with the standardization effort across all packages in the monorepo.
9-10: Excellent build optimizations enabled.Enabling
minify: trueandsplitting: trueprovides better bundle optimization and is consistent with the standardization across other packages.
12-12: Appropriate external dependencies for logger package.Correctly marking
winstonandwinston-daily-rotate-fileas external dependencies prevents bundling these heavy logging libraries.packages/constants/tsup.config.ts (3)
6-6: Good dual format support.Adding both
"esm"and"cjs"formats improves compatibility across different module systems while maintaining the standardized approach.
10-11: Excellent build optimizations added.Enabling
splitting: trueandtreeshake: trueprovides better code splitting and dead code elimination, consistent with the standardization effort.
12-12: Appropriate external dependency configuration.Marking
@plane/typesas external prevents potential circular dependencies and reduces bundle size for the constants package.packages/utils/tsup.config.ts (3)
5-5: Good explicit output directory.Setting
outDir: "dist"explicitly maintains consistency with the standardization effort across all packages.
8-11: Excellent comprehensive build optimizations.Enabling
clean: true,minify: true,splitting: true, andtreeshake: trueprovides a complete set of build optimizations that align perfectly with the standardization goals.
12-12: Appropriate React external dependency.Marking
reactas external is correct since it should be a peer dependency for a utils package, preventing bundling issues.packages/services/tsup.config.ts (1)
1-14: Excellent new tsup configuration following standardization.This new configuration file perfectly implements the standardized tsup setup with:
- Explicit output directory (
outDir: "dist")- Dual format support (
["esm", "cjs"])- Comprehensive build optimizations (
minify,splitting,treeshake,clean)- Appropriate external dependency (
axios)- TypeScript declaration generation (
dts: true)The configuration is consistent with the standardization effort across all packages.
packages/editor/tsup.config.ts (4)
1-3: Good simplification from dynamic to static configuration.Changing from a dynamic function to a static configuration object makes the build setup more predictable and easier to maintain while aligning with the standardization effort.
5-6: Excellent explicit output directory and format ordering.Setting
outDir: "dist"explicitly and reordering formats to["esm", "cjs"]maintains consistency with the standardization across other packages.
8-9: Good build cleanup and external dependencies.Enabling
clean: trueand expanding external dependencies to include both"react"and"react-dom"improves the build process and prevents peer dependency bundling issues.
11-13: Excellent build optimizations added.Enabling
splitting: true,treeshake: true, andminify: trueprovides comprehensive build optimizations that align perfectly with the standardization goals across all packages.packages/ui/tsup.config.ts (1)
1-14: Excellent modernization of tsup configuration!The changes effectively modernize the build configuration by:
- Converting from function-based to static config (cleaner approach)
- Prioritizing ESM output format (modern standard)
- Adding essential build optimizations (clean, minify, splitting, treeshake)
- Properly externalizing dependencies to avoid bundling conflicts
packages/services/package.json (2)
8-9: Well-structured build and development workflow.The addition of proper build and development scripts creates a solid foundation:
buildscript properly validates types before building with minificationdevscript enables efficient development with watch mode- Consistent with other packages in the monorepo
21-26: Appropriate dev dependencies for the build pipeline.The dev dependencies are well-chosen and consistent with the standardization effort:
- Shared ESLint and TypeScript configs promote consistency
- tsup version 8.4.0 aligns with other packages
- TypeScript 5.8.3 is a modern, stable version
Description
Type of Change
Summary by CodeRabbit
Chores
Refactor