Skip to content

Conversation

@sriramveeraghanta
Copy link
Member

@sriramveeraghanta sriramveeraghanta commented Sep 17, 2025

Description

  • Export ESM build scripts for the packages

Type of Change

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

Summary by CodeRabbit

  • New Features

    • Refreshed translations and accessibility labels for English, German, Spanish, and Czech; migrated locale resources to typed modules for improved consistency.
  • Refactor

    • Standardized package exports and module formats across multiple packages.
    • Updated build configurations (declarations, exports, cleaning, sourcemaps; ESM-only for one app).
  • Chores

    • Cleaned up dev dependencies (removed @types/uuid in several apps/packages).
    • Aligned dependency sources (moved Atlaskit to catalog, pinned Vite).
    • Added build-time dependency configuration and Node version in tooling.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 17, 2025

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • packages/propel/package.json
⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Updates toolchain and build configs, restructures package exports, and migrates i18n locale data from JSON to TypeScript across multiple languages. Cleans devDependencies and adjusts app package metadata. Tweaks editor TypeScript config and hook return type. Consolidates tsdown options and modifies dependency resolution and overrides.

Changes

Cohort / File(s) Summary
Tooling & root config
\.mise.toml, package.json
Add Node 22.18.0 to mise tools; set pnpm override for vite to 7.0.7; add pnpm onlyBuiltDependencies.
Apps config cleanups
apps/admin/package.json, apps/space/package.json
Remove devDependency @types/uuid.
Apps metadata & build
apps/live/package.json, apps/live/tsdown.config.ts, apps/web/package.json
live: update author/keywords; switch tsdown to ESM-only, add dts:false, clean:true, sourcemap:false; web: move Atlaskit deps to catalog:, remove @types/uuid.
Editor source & configs
packages/editor/src/.../use-floating-menu.ts, packages/editor/tsconfig.json, packages/editor/tsdown.config.ts
use-floating-menu: add explicit return type and type-only imports; tsconfig: extend shared config, set module ES2022/Bundler; tsdown: enable clean, add custom exports for styles, drop sourcemap/minify.
Package exports restructuring
packages/constants/package.json, packages/decorators/package.json, packages/editor/package.json, packages/hooks/package.json, packages/i18n/package.json
Rework exports maps; add/adjust main/module/types; add type:"module" where applicable; expose ./package.json; adjust entry points to ESM/CJS and CTS types.
Library build configs
packages/constants/tsdown.config.ts, packages/decorators/tsdown.config.ts, packages/hooks/tsdown.config.ts
Add exports, dts, clean, and sourcemap:false (where specified); remove externals in hooks; keep dts:true, clean:true.
i18n locale migration (JSON → TS)
packages/i18n/src/locales/en/*.{json,ts}, packages/i18n/src/locales/de/*.{json,ts}, packages/i18n/src/locales/es/*.{json,ts}, packages/i18n/src/locales/cs/*.{json,ts}, packages/i18n/src/locales/fr/*.{json,ts}
Delete JSON files (accessibility, core/translations, editor placeholders); add equivalent TypeScript modules exporting translation objects with as const (accessibility, core, translations, editor placeholders).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

🛠️refactor, 🌟improvement

Poem

A rabbit taps its build with glee,
Exports aligned from CJS to E,
JSONs hop to TS, “as const” decree,
Sidebars whisper: aria, accessibility.
Clean builds sprout like parsley new—
Dependencies trimmed, swift to review.
Thump-thump: the locales grew! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description Check ❓ Inconclusive The description provides a brief summary and correct change type, but it is overly generic and omits several template sections such as Test Scenarios, References, and any details on verification or media. Please expand the Description with more detail on what was changed and how, add Test Scenarios describing how the changes were verified, and include any relevant References or media to ensure completeness.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “[WEB-5048] chore: implements esm exports for all packages” clearly states the primary change and follows a concise, conventional-commit style without extraneous details. It accurately summarizes the main objective of the pull request.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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.

@sriramveeraghanta sriramveeraghanta changed the title chore: implements esm exports for all packages [WEB-5048] chore: implements esm exports for all packages Sep 29, 2025
@makeplane
Copy link

makeplane bot commented Sep 29, 2025

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@sriramveeraghanta sriramveeraghanta marked this pull request as ready for review October 6, 2025 11:15
Copilot AI review requested due to automatic review settings October 6, 2025 11:15
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

This pull request implements ESM exports for all packages in the i18n package by converting JSON translation files to TypeScript files with the export default pattern. This change enables proper ESM module support while maintaining type safety.

Key changes:

  • Converted JSON translation files to TypeScript .ts files with proper ESM exports
  • Added as const assertions to maintain type safety and literal types
  • Removed corresponding JSON files that are no longer needed

Reviewed Changes

Copilot reviewed 50 out of 162 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/i18n/src/locales/*/editor.ts Created empty TS export files replacing JSON files
packages/i18n/src/locales/*/accessibility.ts Converted accessibility translations from JSON to TS with ESM exports
packages/i18n/src/locales/es/translations.ts Converted Spanish translations from JSON to TS with ESM exports
packages/i18n/src/locales/en/translations.ts Converted English translations from JSON to TS with ESM exports
packages/i18n/src/locales/en/core.ts Converted English core translations from JSON to TS with ESM exports
packages/i18n/src/locales/*/*.json Removed original JSON files that have been replaced by TS files

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/hooks/tsdown.config.ts (1)

3-11: Restore externalization of peer dependencies.

The removal of external: ["react", "react-dom"] (as mentioned in the AI summary) will cause these peer dependencies to be bundled into the output, leading to:

  • Increased bundle size
  • Potential React version conflicts
  • Multiple React instances in consuming applications

Libraries should externalize peer dependencies to ensure they're provided by the consuming application.

Add the external field back to the configuration:

 export default defineConfig({
   entry: ["src/index.ts"],
   outDir: "dist",
   format: ["esm", "cjs"],
+  external: ["react", "react-dom"],
   exports: true,
   dts: true,
   clean: true,
   sourcemap: true,
 });
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4c8f515 and 760cc9d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (50)
  • .mise.toml (1 hunks)
  • apps/admin/next.config.js (1 hunks)
  • apps/admin/package.json (0 hunks)
  • apps/live/package.json (1 hunks)
  • apps/live/tsdown.config.ts (1 hunks)
  • apps/space/next.config.js (1 hunks)
  • apps/space/package.json (0 hunks)
  • apps/web/next.config.js (1 hunks)
  • apps/web/package.json (1 hunks)
  • package.json (1 hunks)
  • packages/constants/package.json (1 hunks)
  • packages/constants/tsdown.config.ts (1 hunks)
  • packages/decorators/package.json (2 hunks)
  • packages/decorators/tsdown.config.ts (1 hunks)
  • packages/editor/package.json (2 hunks)
  • packages/editor/src/core/components/menus/floating-menu/use-floating-menu.ts (1 hunks)
  • packages/editor/tsconfig.json (1 hunks)
  • packages/editor/tsdown.config.ts (1 hunks)
  • packages/hooks/package.json (2 hunks)
  • packages/hooks/tsdown.config.ts (1 hunks)
  • packages/i18n/package.json (2 hunks)
  • packages/i18n/src/locales/cs/accessibility.json (0 hunks)
  • packages/i18n/src/locales/cs/accessibility.ts (1 hunks)
  • packages/i18n/src/locales/cs/editor.json (0 hunks)
  • packages/i18n/src/locales/cs/editor.ts (1 hunks)
  • packages/i18n/src/locales/cs/translations.json (0 hunks)
  • packages/i18n/src/locales/cs/translations.ts (1 hunks)
  • packages/i18n/src/locales/de/accessibility.json (0 hunks)
  • packages/i18n/src/locales/de/accessibility.ts (1 hunks)
  • packages/i18n/src/locales/de/editor.json (0 hunks)
  • packages/i18n/src/locales/de/editor.ts (1 hunks)
  • packages/i18n/src/locales/de/translations.json (0 hunks)
  • packages/i18n/src/locales/de/translations.ts (1 hunks)
  • packages/i18n/src/locales/en/accessibility.json (0 hunks)
  • packages/i18n/src/locales/en/accessibility.ts (1 hunks)
  • packages/i18n/src/locales/en/core.json (0 hunks)
  • packages/i18n/src/locales/en/core.ts (1 hunks)
  • packages/i18n/src/locales/en/editor.json (0 hunks)
  • packages/i18n/src/locales/en/editor.ts (1 hunks)
  • packages/i18n/src/locales/en/translations.json (0 hunks)
  • packages/i18n/src/locales/en/translations.ts (1 hunks)
  • packages/i18n/src/locales/es/accessibility.json (0 hunks)
  • packages/i18n/src/locales/es/accessibility.ts (1 hunks)
  • packages/i18n/src/locales/es/editor.json (0 hunks)
  • packages/i18n/src/locales/es/editor.ts (1 hunks)
  • packages/i18n/src/locales/es/translations.ts (1 hunks)
  • packages/i18n/src/locales/fr/accessibility.json (0 hunks)
  • packages/i18n/src/locales/fr/accessibility.ts (1 hunks)
  • packages/i18n/src/locales/fr/editor.json (0 hunks)
  • packages/i18n/src/locales/fr/editor.ts (1 hunks)
💤 Files with no reviewable changes (16)
  • apps/space/package.json
  • packages/i18n/src/locales/fr/accessibility.json
  • packages/i18n/src/locales/fr/editor.json
  • packages/i18n/src/locales/cs/translations.json
  • packages/i18n/src/locales/cs/accessibility.json
  • apps/admin/package.json
  • packages/i18n/src/locales/de/translations.json
  • packages/i18n/src/locales/de/editor.json
  • packages/i18n/src/locales/en/accessibility.json
  • packages/i18n/src/locales/en/core.json
  • packages/i18n/src/locales/de/accessibility.json
  • packages/i18n/src/locales/es/accessibility.json
  • packages/i18n/src/locales/es/editor.json
  • packages/i18n/src/locales/cs/editor.json
  • packages/i18n/src/locales/en/translations.json
  • packages/i18n/src/locales/en/editor.json
🔇 Additional comments (19)
packages/editor/src/core/components/menus/floating-menu/use-floating-menu.ts (2)

10-11: LGTM! Type-only imports support ESM tree-shaking.

The type keyword ensures these imports are stripped at compile time, improving ESM bundle optimization.


19-25: Explicit return type improves ESM compatibility and type safety.

The TReturn type definition and explicit function return type provide:

  • Clearer API contract for consumers
  • Better type checking and IDE support
  • Improved ESM export resolution

The type definition accurately matches the implementation.

.mise.toml (1)

1-2: LGTM!

The Node version specification aligns with the engines requirement in the root package.json and ensures consistent tooling across the development environment.

package.json (2)

39-46: Correctly configured onlyBuiltDependencies.

The onlyBuiltDependencies field properly lists native/compiled packages that require building from source. This configuration is appropriate for the listed dependencies.


37-37: Confirm Vite version pinning: Vite 7.0.7 is a valid release but lags the current stable (7.1.9). Verify that pinning to 7.0.7 aligns with your stability and security requirements.

apps/live/package.json (1)

20-20: LGTM!

The author metadata has been properly populated. This is a straightforward metadata improvement with no functional impact.

packages/i18n/src/locales/fr/editor.ts (1)

1-1: LGTM!

The empty const object serves as a type-safe placeholder for French editor locale resources. This pattern is consistent with the migration from JSON to TypeScript modules across all locales.

packages/i18n/src/locales/en/editor.ts (1)

1-1: LGTM!

Consistent with the other locale modules. The empty const object provides a type-safe placeholder for English editor locale resources during the JSON-to-TypeScript migration.

packages/i18n/src/locales/de/editor.ts (1)

1-1: LGTM!

The German editor locale placeholder follows the established pattern and provides a type-safe foundation for future translation additions.

packages/i18n/src/locales/es/editor.ts (1)

1-1: LGTM!

The Spanish editor locale placeholder completes the consistent migration pattern across all locale modules (en, de, es, fr), providing a unified type-safe approach for future locale content.

packages/i18n/package.json (2)

7-13: LGTM! Clean ESM/CJS dual export setup.

The exports field correctly maps ESM (import) to .mjs and CJS (require) to .js, with an explicit package.json export for tooling compatibility.


41-43: LGTM! Bottom-level declarations provide legacy compatibility.

The bottom-level main/module/types fields align with the exports field and provide fallback support for older tooling.

packages/i18n/src/locales/en/accessibility.ts (1)

1-34: LGTM! Well-structured accessibility labels.

The migration from JSON to TypeScript with as const provides better type safety and IDE support while maintaining the same data structure.

packages/i18n/src/locales/en/core.ts (1)

1-172: LGTM! Comprehensive core translations with type safety.

The TypeScript module approach with as const provides better maintainability and type checking compared to the previous JSON format.

packages/i18n/src/locales/fr/accessibility.ts (1)

1-34: LGTM! French accessibility labels follow the established pattern.

The structure mirrors the English version, maintaining consistency across locales.

packages/constants/package.json (1)

27-36: LGTM! Consistent ESM/CJS export structure.

The exports field and bottom-level declarations follow the same pattern as the i18n package, providing clean dual-format support.

packages/editor/tsconfig.json (1)

2-7: LGTM! Modern TypeScript configuration for bundler consumers.

The "moduleResolution": "Bundler" setting is appropriate for a library package that will be consumed by modern bundlers, and ES2022 provides a current module target.

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

15-15: Clean flag enabled—verify CI and build workflows.

Switching clean from false to true will delete the output directory before each build. This is generally good practice, but ensure that CI pipelines or local development workflows don't rely on incremental builds or persistent artifacts in the dist directory.

Additionally, the AI summary indicates that minify: true was removed. If minification is still desired for production builds, consider re-enabling it or documenting the rationale for its removal.


7-13: Verify copied styles output After running the build, confirm that dist/styles/index.css exists (not dist/src/styles/index.css) to ensure the "./styles": "./dist/styles/index.css" export is valid.

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

♻️ Duplicate comments (1)
packages/editor/package.json (1)

13-18: Add explicit types conditions to exports.

The exports for "." and "./lib" lack explicit types conditions. With "type": "module" and a top-level "types": "./dist/index.d.cts" (line 10), TypeScript will fall back to CJS type declarations even for ESM consumers, causing module resolution mismatches.

This issue was already flagged in a previous review. The recommended fix is to add nested types conditions to both "import" and "require" entries, ensuring ESM consumers get .d.ts and CJS consumers get .d.cts.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 760cc9d and 2c39122.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • packages/editor/package.json (1 hunks)
  • packages/editor/tsdown.config.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build and lint web apps
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
packages/editor/tsdown.config.ts (2)

8-13: LGTM!

The exports configuration correctly adds the styles export, matching the package.json export at line 21 in packages/editor/package.json.


15-15: LGTM!

Setting clean: true ensures the dist directory is cleaned before each build, preventing stale artifacts.

packages/editor/package.json (2)

7-7: LGTM!

Adding "type": "module" correctly declares this as an ESM package, which aligns with the dual ESM/CJS output strategy (.js for ESM, .cjs for CommonJS).


20-20: LGTM!

Adding the "./package.json" export is a best practice that allows consumers to explicitly access package metadata.

@lifeiscontent lifeiscontent self-requested a review October 6, 2025 15:21
@sriramveeraghanta sriramveeraghanta merged commit 0589ac5 into preview Oct 6, 2025
6 of 7 checks passed
@sriramveeraghanta sriramveeraghanta deleted the feat-package-exports branch October 6, 2025 15:31
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.

3 participants