Skip to content

fix: update tsup build packages#7438

Merged
sriramveeraghanta merged 1 commit intopreviewfrom
fix-tsup-builds
Jul 18, 2025
Merged

fix: update tsup build packages#7438
sriramveeraghanta merged 1 commit intopreviewfrom
fix-tsup-builds

Conversation

@sriramveeraghanta
Copy link
Member

@sriramveeraghanta sriramveeraghanta commented Jul 18, 2025

Description

  • Update packages builds using common tsup config

Type of Change

  • Improvement (change that would cause existing functionality to not work as expected)

Summary by CodeRabbit

  • Chores

    • Improved build configurations across multiple packages for optimized output, including code splitting, minification, and tree shaking.
    • Standardized and simplified package metadata and file inclusion patterns for more consistent package publishing.
    • Updated development scripts and dependencies to streamline build and development workflows.
    • Simplified ESLint and TypeScript configurations for easier maintenance.
  • Refactor

    • Reorganized configuration files and package fields for better clarity and consistency.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 18, 2025

Walkthrough

This update increases the development concurrency in the root configuration and standardizes build and packaging configurations across multiple packages. Changes include updates to package.json fields, enhancements to tsup build settings (output formats, minification, splitting, treeshaking), and the introduction or adjustment of build scripts and ESLint settings for consistency.

Changes

Files/Group Change Summary
package.json Increased Turbo dev script concurrency from 13 to 18.
packages/constants/package.json,
packages/types/package.json,
packages/ui/package.json,
packages/editor/package.json,
packages/utils/package.json
Standardized/remodeled files arrays; reordered or updated main, module, types fields; removed "type": "module" where present.
packages/constants/tsup.config.ts,
packages/types/tsup.config.ts,
packages/editor/tsup.config.ts,
packages/ui/tsup.config.ts,
packages/hooks/tsup.config.ts,
packages/logger/tsup.config.ts,
packages/utils/tsup.config.ts
Enhanced build configs: explicit outDir, enabled minify, splitting, treeshake; adjusted formats (esm/cjs); updated external dependencies.
packages/decorators/tsup.config.ts Set explicit outDir, enabled minify, removed splitting and sourcemap options.
packages/services/tsup.config.ts Added new tsup config: esm/cjs outputs, minify, splitting, treeshake, externalized axios.
packages/constants/tsconfig.json,
packages/types/tsconfig.json
Removed explicit module, moduleResolution, target; simplified outDir/rootDir paths.
packages/decorators/.eslintrc.js,
packages/services/.eslintrc.js,
packages/ui/.eslintrc.js
Removed parserOptions property for ESLint configs.
packages/services/package.json Added build/dev scripts and devDependencies for TypeScript, tsup, and configs.

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
Loading

Possibly related PRs

  • makeplane/plane#7138: Removes build process and scripts from utils; related as this PR enhances build config for utils, showing opposite intent.
  • makeplane/plane#7149: Also modifies utils/package.json to include only the dist directory and adds tsup build scripts; both PRs adjust utils build and packaging setup.

Suggested labels

🌟improvement, requires approval

Suggested reviewers

  • prateekshourya29

Poem

Hopping through the fields of code,
I tidied builds and lightened the load.
With minify, split, and treeshake in tow,
Now packages build fast—watch them go!
Concurrency up, configs aligned,
This bunny’s work is streamlined and refined.
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 07c80bb and 9f9b612.

📒 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: true will 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 from outDir and rootDir normalizes 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 files array from "dist/**" to "dist" (both work equivalently)
  • Reordered main, module, and types fields for consistency across packages

These 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 --minify flag 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 clarity
  • minify: true - reduces bundle size
  • splitting: true - enables code splitting for better chunking
  • treeshake: true - removes unused code during bundling

These 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 from outDir and rootDir paths 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: true and splitting: true provides better bundle optimization and is consistent with the standardization across other packages.


12-12: Appropriate external dependencies for logger package.

Correctly marking winston and winston-daily-rotate-file as 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: true and treeshake: true provides better code splitting and dead code elimination, consistent with the standardization effort.


12-12: Appropriate external dependency configuration.

Marking @plane/types as 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, and treeshake: true provides a complete set of build optimizations that align perfectly with the standardization goals.


12-12: Appropriate React external dependency.

Marking react as 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: true and 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, and minify: true provides 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:

  • build script properly validates types before building with minification
  • dev script 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

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