Repository navigation
fix: finish lang loader refactor so front webpack build resolves ./lang - #53
Merged
Merged
Conversation
Commit 48be04e switched the "./lang" export of the *-assets packages from the lang/ directory to ./lib/lang.js, but configureI18n() in dev/prod and desktop still loaded strings with import(`@hcengineering/<pkg>/lang/${lang}.json`). Webpack resolves that template import as a context on "<pkg>/lang", which now maps to a file, so `rushx package` failed with 58 "Package path ./lang is exported ... but no valid target file was found". - use <Pkg>Lang.loadLang for every package that exports ./lang -> lib/lang.js in dev/prod/src/platform.ts and desktop/src/ui/platform.ts - add the missing src/lang.ts to chat-assets (export already pointed at it) - port inbox-assets to the same lang.ts / ./lang export scheme Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014MzfgQXRL2ntDzgvtoSh8Z Signed-off-by: ArtyomSavchenko <armisav@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
rushx packagefordev/prod(and thedist-build/qms-dist-build/uitest*jobs, e.g. run 38197527585 onstaging-new) fails with 58 errors like:Cause
48be04e ("refactor lang usage to make webpack happy", ported from TraceX) changed the
./langexport of the*-assetspackages from thelang/directory to./lib/lang.jsand addedimport * as XLang from '…/lang', but only 3 of theaddStringsLoadercalls were switched toXLang.loadLang. The rest still useimport(`@hcengineering/<pkg>/lang/${lang}.json`); webpack resolves that as a context on<pkg>/lang, which now points at a file, so resolution fails.Fix
dev/prod/src/platform.ts,desktop/src/ui/platform.ts: use<Pkg>Lang.loadLangfor every package whose./langexport is./lib/lang.js(adds the missing namespace imports).presentation,ui,communication-assetshave no./langexport and keep the JSON template import.chat-assets: add the missingsrc/lang.ts(the export already referencedlib/lang.js).inbox-assets: was skipped by the port; switched to the samelang.ts+./langexport.Validation
Linux, Node 22:
rush install --to @hcengineering/prod,rush build --to @hcengineering/prod, thennode ../../common/scripts/bash.js --script packageindev/prod→webpack 5.111.1 compiled successfully,done. Not re-run: desktop build and UI tests.After merge,
developneeds to be merged intostaging-newagain.🤖 Generated with Claude Code
https://claude.ai/code/session_014MzfgQXRL2ntDzgvtoSh8Z
Generated by Claude Code