Repository navigation
build(i18n): generate compiled Lingui catalogs instead of committing them #7180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
85e6302
16a49c9
1027f33
8af8b33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,7 +18,7 @@ | |||||
| "start": "electron-vite preview", | ||||||
| "generate:icons": "bun run scripts/generate-file-icons.ts", | ||||||
| "bundle:cli": "bun run scripts/build-bundled-cli.ts", | ||||||
| "predev": "cross-env NODE_ENV=development bun run clean:dev && bun run generate:icons && bun run bundle:cli && cross-env NODE_ENV=development bun run scripts/clean-launch-services.ts && cross-env NODE_ENV=development bun run scripts/patch-dev-protocol.ts", | ||||||
| "predev": "bun run --filter=@superset/i18n build && cross-env NODE_ENV=development bun run clean:dev && bun run generate:icons && bun run bundle:cli && cross-env NODE_ENV=development bun run scripts/clean-launch-services.ts && cross-env NODE_ENV=development bun run scripts/patch-dev-protocol.ts", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Prompt for AI agents
Suggested change
|
||||||
| "dev": "bun scripts/dev.ts", | ||||||
| "compile:app": "cross-env NODE_OPTIONS=--max-old-space-size=8192 electron-vite build && bun run bundle:cli && bun run scripts/check-pty-daemon-bundle.ts", | ||||||
| "check:pty-daemon-bundle": "bun run scripts/check-pty-daemon-bundle.ts", | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| "version": "1.0.0", | ||
| "main": "expo-router/entry", | ||
| "scripts": { | ||
| "predev": "bun run --filter=@superset/i18n build", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Only Prompt for AI agents |
||
| "dev": "EXPO_UNSTABLE_MCP_SERVER=1 expo start", | ||
| "android": "expo run:android", | ||
| "ios": "expo run:ios", | ||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "$schema": "https://turbo.build/schema.json", | ||
| "extends": ["//"], | ||
| "tasks": { | ||
| // `lingui compile` turns the committed messages.po sources into the | ||
| // runtime catalogs src/index.ts imports. Dependents pick this up through | ||
| // the root pipeline's `^build`; i18n's own typecheck and test need it | ||
| // too, hence the self-dependency below. | ||
| "build": { | ||
| "inputs": ["locales/*/messages.po", "lingui.config.ts", "package.json"], | ||
| "outputs": ["locales/*/messages.ts"] | ||
| }, | ||
| "typecheck": { | ||
| "dependsOn": ["^build", "^build:types", "build"] | ||
| }, | ||
| "test": { | ||
| "dependsOn": ["^build", "build"] | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,15 @@ export SUPERSET_POSTINSTALL_RUNNING=1 | |
| # Run sherif for workspace validation | ||
| sherif | ||
|
|
||
| # Materialize the compiled Lingui catalogs. They are generated, not committed, | ||
| # and turbo builds them for any task that goes through the graph — but a direct | ||
| # `bun run --filter=<pkg> typecheck` bypasses turbo, so a fresh clone would hit | ||
| # "Cannot find module '../locales/en/messages'". Non-fatal: a missing | ||
| # translation must fail a real build, not an install. | ||
| if ! bun run --filter=@superset/i18n build; then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Linux CLI release workflow installs dependencies with Prompt To Fix With AIThis is a comment left during a code review.
Path: scripts/postinstall.sh
Line: 20
Comment:
**Linux CLI Build Breaks**
The Linux CLI release workflow installs dependencies with `--ignore-scripts`, so this postinstall compile does not run. It then invokes `packages/cli`'s `build:dist` directly instead of using Turbo. The CLI bundle reaches `@superset/i18n/errors`, which imports the catalog-dependent index, but the generated English catalog is absent in a clean checkout. As a result, the Linux release job will fail module resolution before producing the CLI distribution. Compile i18n explicitly in that direct build path or workflow.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly. |
||
| echo "postinstall: lingui compile failed; run 'bun run check:i18n' for details" >&2 | ||
| fi | ||
|
|
||
| # GitHub CI runs multiple Bun install jobs that do not need desktop native rebuilds. | ||
| # Running electron-builder here can trigger nested Bun installs while the main | ||
| # install is still materializing packages, which has been flaky with native deps. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,10 @@ | |
| ] | ||
| }, | ||
| "dev": { | ||
| // Compiled Lingui catalogs are generated, not committed, so dev has to | ||
| // build them before anything imports @superset/i18n. Scoped to that one | ||
| // package so starting dev doesn't drag in every other build. | ||
| "dependsOn": ["@superset/i18n#build"], | ||
| "cache": false, | ||
| "persistent": true | ||
| }, | ||
|
|
@@ -52,6 +56,10 @@ | |
| "outputs": ["coverage/**"] | ||
| }, | ||
| "build:types": { | ||
| // Emits declarations from source, so it needs the same upstream | ||
| // generated inputs a build does — the compiled Lingui catalogs in | ||
| // particular, which host-service reaches through @superset/i18n. | ||
| "dependsOn": ["^build"], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The build:types task now depends on Prompt for AI agents |
||
| "outputs": ["dist-types/**"] | ||
| }, | ||
| "typecheck": { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: When scripts are skipped or the best-effort postinstall compile fails, direct package
bun test/typecheckcommands still bypass Turbo and cannot resolve the now-ignoredmessages.tsfiles. Wire the direct package entry points to generate@superset/i18nfirst (or make them delegate to Turbo), rather than relying only on a successful postinstall.Prompt for AI agents