plane icon indicating copy to clipboard operation
plane copied to clipboard

refactor: tsconfig of all libraries

Open aaryan610 opened this issue 4 months ago • 3 comments

Description

This PR refactors the tsconfig of all the react libraries by-

  1. Adding all the common options to the base config file.
  2. Removing redundant flags from the package.json file.

Type of Change

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

Summary by CodeRabbit

  • New Features

    • i18n and services now ship compiled artifacts (ESM/CJS) for improved packaging and compatibility.
  • Bug Fixes

    • Editor file restoration made more robust to avoid errors with invalid node types.
  • Refactor

    • Callout attribute enum and related types renamed, and bubble menu component props typed more strictly (public signatures updated).
  • Chores

    • Standardized build pipeline across packages (compile then bundle), removed forced minification, aligned type-check scripts, consolidated TS configs, added cleanup scripts, and added missing type definitions dependency.

aaryan610 avatar Aug 27 '25 12:08 aaryan610

[!NOTE]

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Repository-wide TypeScript/build standardization and targeted editor typing refactors: package build/check scripts unified to run tsc and tsup, several packages switched to dist-based publishing and added tsup configs, many tsconfig files simplified to rely on shared presets, and numerous editor-source type-only/import and typing adjustments (including renames for callout enums and EditorBubbleMenu API change).

Changes

Cohort / File(s) Summary
Build scripts & package.json updates
packages/editor/package.json, packages/hooks/package.json, packages/propel/package.json, packages/services/package.json, packages/shared-state/package.json, packages/ui/package.json, packages/utils/package.json
Standardized build to tsc && tsup (removed explicit --minify), changed check:types from tsc --noEmittsc, added/updated clean scripts where present; editor added @types/uuid devDependency.
Dist-based publishing & i18n bundling
packages/i18n/package.json, packages/services/package.json, packages/i18n/tsup.config.ts
Switched package entrypoints to dist (main, module, types), added files: ["dist/**"], introduced build/dev scripts and tsup config for i18n (esm/cjs, dts, minify, splitting, external react).
Per-package tsconfig updates
packages/editor/tsconfig.json, packages/hooks/tsconfig.json, packages/i18n/tsconfig.json, packages/propel/tsconfig.json, packages/services/tsconfig.json, packages/shared-state/tsconfig.json, packages/ui/tsconfig.json, packages/utils/tsconfig.json
Removed local jsx/lib overrides and exclude entries in favor of shared presets; many configs added noEmit: true or now extend @plane/typescript-config/react-library.json; include scopes preserved/adjusted.
Shared TypeScript presets
packages/typescript-config/base.json, packages/typescript-config/react-library.json
base.json adds strictNullChecks: true; react-library.json adds allowSyntheticDefaultImports, sourceMap, and top-level exclude.
Editor typing, enums & small runtime-safe tweaks
packages/editor/src/core/extensions/code/code-block.ts, packages/editor/src/core/extensions/emoji/suggestion.ts, packages/editor/src/core/hooks/use-file-upload.ts, packages/editor/src/core/plugins/file/restore.ts, packages/editor/src/core/components/menus/bubble-menu/node-selector.tsx, packages/editor/src/core/components/menus/menu-items.ts, packages/editor/src/core/extensions/callout/utils.ts, packages/editor/src/core/extensions/callout/types.ts, packages/editor/src/core/extensions/callout/block.tsx, packages/editor/src/core/extensions/emoji/extension.ts, packages/editor/src/core/extensions/mentions/utils.ts, packages/editor/src/core/extensions/slash-commands/root.tsx, packages/editor/src/core/components/menus/bubble-menu/root.tsx
Many type-only imports, removal of // @ts-expect-error suppressions, explicit casts/assertions (e.g., node.type.name as CORE_EXTENSIONS, catch (errPayload: any), items typed as EditorMenuItem[]), rename EAttributeNames → ECalloutAttributeNames and switch to computed attribute keys, capture of extension options for serializer, widened popup types and stabilized clientRect handling, and EditorBubbleMenu prop/API signature change to require editor in props. No deliberate runtime behavior changes beyond safer typings/guards.

Sequence Diagram(s)

sequenceDiagram
  participant Parent as Host Component
  participant EditorBubbleMenu as EditorBubbleMenu
  participant Child as Menu Child Components

  Note over Parent,EditorBubbleMenu: New explicit prop-based editor flow
  Parent->>EditorBubbleMenu: render(editor)
  EditorBubbleMenu->>EditorBubbleMenu: store local editor variable
  EditorBubbleMenu->>Child: pass `editor` prop to children
  Child-->>EditorBubbleMenu: query state / isActive using editor

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • makeplane/plane#7364 — touches EditorBubbleMenu/file UI; likely overlaps with the EditorBubbleMenu API/type changes.
  • makeplane/plane#7438 — related to package build/tsup and tsconfig standardization across packages.
  • makeplane/plane#7074 — modifies file restoration logic in the editor plugin similar to restore.ts edits.

Suggested labels

🛠️refactor

Suggested reviewers

  • sriramveeraghanta
  • prateekshourya29
  • lifeiscontent

Poem

Hop hop—tsc hums, tsup takes flight,
Types snugged, enums renamed just right.
Editor props now passed with care,
A rabbit tidies imports there.
Cheers to builds that run at night! 🐇✨

✨ Finishing Touches
  • [ ] 📝 Generate Docstrings
🧪 Generate unit tests
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment
  • [ ] Commit unit tests in branch refactor/library-tsconfig

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.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit 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:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

coderabbitai[bot] avatar Aug 27 '25 12:08 coderabbitai[bot]

@aaryan610 just a thought, but since you're already upgrading tsup, might be worth taking a look at tsdown it would potentially improve our build times substantially.

lifeiscontent avatar Aug 27 '25 15:08 lifeiscontent

@aaryan610 just a thought, but since you're already upgrading tsup, might be worth taking a look at tsdown it would potentially improve our build times substantially.

We are already working on switching to tsdown on a separate branch.

aaryan610 avatar Aug 29 '25 08:08 aaryan610