fix(i18n): include locale assets in package builds - #9587
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe i18n package build copies locale assets and loads them from the bundled path. Tests compare source and built locale files and verify dynamic locale imports in the built entry. Changesi18n locale asset handling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/i18n/scripts/__tests__/locale-assets.test.ts`:
- Around line 12-19: Update the scripts TypeScript configuration to include the
ES2023 library definition so listJsonAssets can use toSorted without type
errors; preserve the existing Node runtime configuration and implementation.
🪄 Autofix
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 Plus
Run ID: 83b0543f-7999-49d7-aaa4-1cb373ac137d
📒 Files selected for processing (4)
packages/i18n/package.jsonpackages/i18n/scripts/__tests__/locale-assets.test.tspackages/i18n/src/core/instance.tspackages/i18n/tsdown.config.ts
Description
The built
@plane/i18npackage currently emits its JavaScript and declaration files without the JSON locale resources consumed by the runtime loader. In addition, the emitted loader resolves../locales/..., which points outside the package'sdistdirectory. Consumers that run against the packaged build can therefore fail to load non-English resources even though the source locale files exist.This PR fixes the packaging boundary for every supported locale by:
src/localestodist/localesas part of thetsdownbuild;./locales/...in the emitted entry;createInstanceimport while touching the loader, which keeps the changed file lint-clean without changing behavior.This is deliberately limited to the i18n package runtime and build output. It does not change translations, application UI copy, database content, or deployment configuration.
Type of Change
Screenshots and Media (if applicable)
Not applicable. This fixes package build output rather than a visual component.
Test Scenarios
pnpm --filter @plane/i18n testdist/locales; and./locales/${language}/${namespace}.json.pnpm --filter @plane/i18n check:typespnpm --filter @plane/i18n check:sync--deny-warningspnpm turbo run build --filter=web --output-logs=errors-onlygit diff --checkReferences
Summary by CodeRabbit
Bug Fixes
Tests