Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,11 @@ plans/local/
# Plugin build output is committed: a release is the plugin's tree at its
# `<plugin>@<version>` tag, so the bundle users install has to be in it. The
# build stamp travels with it so `plugins check` can verify it against src/.

# Compiled Lingui catalogs. Generated from messages.po by `lingui compile`
# (packages/i18n `build`), which every dependent's build/typecheck/test runs
# via turbo `^build`. Committing them is what Lingui's docs warn against, and
# it cost us a guaranteed conflict on all 17 files whenever two branches added
# a string: compile emits one minified line per locale, and git cannot
# three-way merge a single-line file.
packages/i18n/locales/*/messages.ts

Copy link
Copy Markdown
Contributor

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/typecheck commands still bypass Turbo and cannot resolve the now-ignored messages.ts files. Wire the direct package entry points to generate @superset/i18n first (or make them delegate to Turbo), rather than relying only on a successful postinstall.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .gitignore, line 107:

<comment>When scripts are skipped or the best-effort postinstall compile fails, direct package `bun test`/`typecheck` commands still bypass Turbo and cannot resolve the now-ignored `messages.ts` files. Wire the direct package entry points to generate `@superset/i18n` first (or make them delegate to Turbo), rather than relying only on a successful postinstall.</comment>

<file context>
@@ -97,3 +97,11 @@ superset-dev-data/
+# it cost us a guaranteed conflict on all 17 files whenever two branches added
+# a string: compile emits one minified line per locale, and git cannot
+# three-way merge a single-line file.
+packages/i18n/locales/*/messages.ts
</file context>

1 change: 1 addition & 0 deletions apps/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"build": "next build",
"clean": "git clean -xdf .cache .next .turbo node_modules",
"predev": "bun run --filter=@superset/i18n build",
"dev": "dotenv -e ../../.env -- sh -c 'exec next dev --port ${ADMIN_PORT:-3003}'",
"start": "next start",
"typecheck": "tsc --noEmit"
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: predev runs bun run --filter=@superset/i18n build, which is lingui compile --strict. Any untranslated message (the normal state right after check:i18n regenerates .po files mid-translation) makes compile exit non-zero, and because it is the first step of the && chain, bun run dev never starts. This contradicts the PR's own non-fatal approach: scripts/postinstall.sh wraps this same build in a non-fatal guard so a missing translation surfaces as a hint rather than blocking. Blocking all direct dev starts on an untranslated message is more aggressive than the design intended. Guard the compile in predev the same way postinstall does (e.g. bun run --filter=@superset/i18n build || { echo 'run bun run check:i18n'; exit 1; } is still fatal; use a non-fatal || true or drop --strict if dev should not hard-fail).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/desktop/package.json, line 21:

<comment>`predev` runs `bun run --filter=@superset/i18n build`, which is `lingui compile --strict`. Any untranslated message (the normal state right after `check:i18n` regenerates `.po` files mid-translation) makes compile exit non-zero, and because it is the first step of the `&&` chain, `bun run dev` never starts. This contradicts the PR's own non-fatal approach: `scripts/postinstall.sh` wraps this same build in a non-fatal guard so a missing translation surfaces as a hint rather than blocking. Blocking all direct dev starts on an untranslated message is more aggressive than the design intended. Guard the compile in `predev` the same way postinstall does (e.g. `bun run --filter=@superset/i18n build || { echo 'run bun run check:i18n'; exit 1; }` is still fatal; use a non-fatal `|| true` or drop `--strict` if dev should not hard-fail).</comment>

<file context>
@@ -18,7 +18,7 @@
 		"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",
 		"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",
</file context>
Suggested change
"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",
bun run --filter=@superset/i18n build || true && cross-env NODE_ENV=development bun run clean:dev && ...

"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",
Expand Down
1 change: 1 addition & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"type": "module",
"scripts": {
"build": "fumadocs-mdx && next build",
"predev": "bun run --filter=@superset/i18n build",
"dev": "dotenv -e ../../.env -- sh -c 'exec next dev --port ${DOCS_PORT:-3004}'",
"start": "next start",
"typecheck": "next typegen && fumadocs-mdx && tsc --noEmit",
Expand Down
1 change: 1 addition & 0 deletions apps/marketing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"build": "next build",
"clean": "git clean -xdf .cache .next .turbo node_modules",
"predev": "bun run --filter=@superset/i18n build",
"dev": "dotenv -e ../../.env -- sh -c 'exec next dev --port ${MARKETING_PORT:-3002}'",
"lint:prose": "vale --config=vale.ini content \"src/app/[lang]/layout.tsx\" src/components/JsonLd/JsonLd.tsx src/lib/product-facts.ts src/lib/llms.ts \"src/app/[lang]/components/Header/constants.tsx\" \"src/app/[lang]/components/HeroSection/HeroSection.tsx\" \"src/app/[lang]/components/HowItWorksSection\" \"src/app/[lang]/components/FeaturesSection/constants.ts\" \"src/app/[lang]/components/FAQSection/constants.ts\" \"src/app/[lang]/components/CTASection/CTASection.tsx\" \"src/app/[lang]/components/SecuritySection/SecuritySection.tsx\"",
"start": "next start",
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"main": "expo-router/entry",
"scripts": {
"predev": "bun run --filter=@superset/i18n build",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Only dev gets a predev compile; the other direct-start scripts in this same package (ios, android, web, storybook) also run Expo and statically import @superset/i18n, whose packages/i18n/locales/*/messages.ts are no longer committed. After a pull that changes .po files, running bun run ios (the primary direct start for this iOS-only app) won't regenerate catalogs and shows stale translations or fails with module-not-found. Apply the same compile step to the other direct-start scripts, e.g. prefix each with bun run --filter=@superset/i18n build &&, or route them through a shared pre-start hook.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/mobile/package.json, line 6:

<comment>Only `dev` gets a predev compile; the other direct-start scripts in this same package (`ios`, `android`, `web`, `storybook`) also run Expo and statically import `@superset/i18n`, whose `packages/i18n/locales/*/messages.ts` are no longer committed. After a pull that changes `.po` files, running `bun run ios` (the primary direct start for this iOS-only app) won't regenerate catalogs and shows stale translations or fails with module-not-found. Apply the same compile step to the other direct-start scripts, e.g. prefix each with `bun run --filter=@superset/i18n build &&`, or route them through a shared pre-start hook.</comment>

<file context>
@@ -3,6 +3,7 @@
 	"version": "1.0.0",
 	"main": "expo-router/entry",
 	"scripts": {
+		"predev": "bun run --filter=@superset/i18n build",
 		"dev": "EXPO_UNSTABLE_MCP_SERVER=1 expo start",
 		"android": "expo run:android",
</file context>

"dev": "EXPO_UNSTABLE_MCP_SERVER=1 expo start",
"android": "expo run:android",
"ios": "expo run:ios",
Expand Down
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"test": "bun test src",
"build": "next build",
"clean": "git clean -xdf .cache .next .turbo node_modules",
"predev": "bun run --filter=@superset/i18n build",
"dev": "dotenv -e ../../.env -- sh -c 'exec next dev --port ${WEB_PORT:-3000}'",
"start": "next start",
"typecheck": "tsc --noEmit"
Expand Down
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"build:darwin-arm64": "cli-framework build --target=bun-darwin-arm64 --outfile=./dist/superset-darwin-arm64",
"build:linux-x64": "cli-framework build --target=bun-linux-x64 --outfile=./dist/superset-linux-x64",
"build:all": "bun run build:darwin-arm64 && bun run build:linux-x64",
"prebuild:dist": "bun run --filter=@superset/i18n build",
"build:dist": "bun run scripts/build-dist.ts",
"typecheck": "tsc --noEmit",
"test": "bun test"
Expand Down
1 change: 0 additions & 1 deletion packages/i18n/locales/cs/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/de/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/en/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/es/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/fr/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/id/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/it/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/ja/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/ko/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/nl/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/pl/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/pt-BR/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/ru/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/tr/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/vi/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/zh-CN/messages.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/i18n/locales/zh-TW/messages.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
}
},
"scripts": {
"build": "bun run compile",
"extract": "bunx --bun lingui extract --clean --overwrite --workers 1",
"compile": "bunx --bun lingui compile --strict --verbose --workers 1",
"check": "bun run extract && bun run compile",
Expand Down
20 changes: 20 additions & 0 deletions packages/i18n/turbo.json
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"]
}
}
}
9 changes: 9 additions & 0 deletions scripts/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Prompt To Fix With AI
This 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.
Expand Down
8 changes: 8 additions & 0 deletions turbo.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand All @@ -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"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The build:types task now depends on ^build so i18n's compiled catalogs exist before declarations are emitted, but turbo will not actually preserve those catalogs across cache hits. @superset/i18n's build writes locales/*/messages.ts (confirmed: scripts.build = bun run compile, and those files are gitignored), yet the build task in this turbo.jsonc only declares outputs of .next/**, dist/**, dist-electron/**, release/**, and .cache/tsbuildinfo.json — locales/*/messages.ts is absent. On a turbo cache hit the script is skipped and only declared outputs are restored, so the catalogs are neither regenerated nor restored, and a dependent build:types/typecheck fails with "Cannot find module". This contradicts the PR description's claim that turbo.json declares outputs (locales/*/messages.ts). Add locales/*/messages.ts to the build task's outputs so cached builds carry the catalogs.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At turbo.jsonc, line 62:

<comment>The build:types task now depends on `^build` so i18n's compiled catalogs exist before declarations are emitted, but turbo will not actually preserve those catalogs across cache hits. @superset/i18n's `build` writes `locales/*/messages.ts` (confirmed: scripts.build = `bun run compile`, and those files are gitignored), yet the `build` task in this turbo.jsonc only declares `outputs` of `.next/**`, `dist/**`, `dist-electron/**`, `release/**`, and `.cache/tsbuildinfo.json` — `locales/*/messages.ts` is absent. On a turbo cache hit the script is skipped and only declared outputs are restored, so the catalogs are neither regenerated nor restored, and a dependent build:types/typecheck fails with "Cannot find module". This contradicts the PR description's claim that turbo.json declares `outputs (locales/*/messages.ts)`. Add `locales/*/messages.ts` to the `build` task's `outputs` so cached builds carry the catalogs.</comment>

<file context>
@@ -56,6 +56,10 @@
+			// 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"],
 			"outputs": ["dist-types/**"]
 		},
</file context>

"outputs": ["dist-types/**"]
},
"typecheck": {
Expand Down
Loading