mirror of
https://github.com/twentyhq/twenty.git
synced 2026-06-12 09:57:03 -04:00
**1. Shared Lingui factory in `twenty-shared`**
- Extracted `createI18nInstanceFactory` into
`packages/twenty-shared/src/i18n/create-i18n-instance-factory.ts` so
every package gets the same per-render Lingui bootstrap with a
per-locale singleton cache and a `SOURCE_LOCALE` fallback.
- `twenty-emails/src/utils/i18n.utils.ts` now consumes the shared
factory.
**2. `twenty-website-new` Lingui bootstrap + Crowdin wiring**
- `lingui.config.ts`, `src/lib/i18n/*`, `nx run
twenty-website-new:lingui:{extract,compile}`.
- 31 locale PO files generated; minified compiled output kept out of
Prettier and Oxlint.
- `i18n-{push,pull}.yaml` workflows updated to include
`twenty-website-new` in Crowdin sync.
**3. `app/[locale]/...` segment routing with English at the root**
- All marketing routes moved under `src/app/[locale]/`; static
generation preserved (15 routes × 31 locales = 465 prerendered URLs).
- Middleware behavior:
- `/{en}/...` → 301 redirect to unprefixed canonical.
- `/{non-en}/...` → pass through, set `NEXT_LOCALE` cookie.
### What this PR explicitly does not do (deferred)
- Lingui-wrapping the actual marketing copy. Keys, build pipeline, and
runtime are wired; copy migration is a separate, reviewer-friendlier
PR.
81 lines
2.8 KiB
JSON
81 lines
2.8 KiB
JSON
{
|
|
"name": "twenty-shared",
|
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
"sourceRoot": "packages/twenty-shared/src",
|
|
"projectType": "library",
|
|
"tags": ["scope:shared"],
|
|
"targets": {
|
|
"build": {
|
|
"executor": "nx:run-commands",
|
|
"cache": true,
|
|
"inputs": ["production", "^production"],
|
|
"dependsOn": ["generateBarrels", "^build"],
|
|
"outputs": [
|
|
"{projectRoot}/dist",
|
|
"{projectRoot}/ai/package.json",
|
|
"{projectRoot}/ai/dist",
|
|
"{projectRoot}/application/package.json",
|
|
"{projectRoot}/application/dist",
|
|
"{projectRoot}/constants/package.json",
|
|
"{projectRoot}/constants/dist",
|
|
"{projectRoot}/database-events/package.json",
|
|
"{projectRoot}/database-events/dist",
|
|
"{projectRoot}/i18n/package.json",
|
|
"{projectRoot}/i18n/dist",
|
|
"{projectRoot}/logic-function/package.json",
|
|
"{projectRoot}/logic-function/dist",
|
|
"{projectRoot}/metadata/package.json",
|
|
"{projectRoot}/metadata/dist",
|
|
"{projectRoot}/testing/package.json",
|
|
"{projectRoot}/testing/dist",
|
|
"{projectRoot}/translations/package.json",
|
|
"{projectRoot}/translations/dist",
|
|
"{projectRoot}/types/package.json",
|
|
"{projectRoot}/types/dist",
|
|
"{projectRoot}/utils/package.json",
|
|
"{projectRoot}/utils/dist",
|
|
"{projectRoot}/vite/package.json",
|
|
"{projectRoot}/vite/dist",
|
|
"{projectRoot}/workflow/package.json",
|
|
"{projectRoot}/workflow/dist",
|
|
"{projectRoot}/workspace/package.json",
|
|
"{projectRoot}/workspace/dist"
|
|
],
|
|
"options": {
|
|
"cwd": "{projectRoot}",
|
|
"commands": [
|
|
"npx vite build",
|
|
"tsgo -p tsconfig.lib.json --declaration --emitDeclarationOnly --noEmit false --outDir dist --rootDir src && npx tsc-alias -p tsconfig.lib.json --outDir dist"
|
|
],
|
|
"parallel": false
|
|
}
|
|
},
|
|
"build:individual": {
|
|
"executor": "nx:run-commands",
|
|
"cache": true,
|
|
"dependsOn": ["build"],
|
|
"inputs": ["production", "^production"],
|
|
"outputs": ["{projectRoot}/dist/individual"],
|
|
"options": {
|
|
"cwd": "{projectRoot}",
|
|
"command": "npx vite build -c vite.config.individual.ts"
|
|
}
|
|
},
|
|
"generateBarrels": {
|
|
"executor": "nx:run-commands",
|
|
"cache": true,
|
|
"inputs": ["production", "{projectRoot}/scripts/generateBarrels.ts"],
|
|
"outputs": [
|
|
"{projectRoot}/src/index.ts",
|
|
"{projectRoot}/src/*/index.ts",
|
|
"{projectRoot}/package.json"
|
|
],
|
|
"options": { "command": "tsx {projectRoot}/scripts/generateBarrels.ts" }
|
|
},
|
|
"typecheck": {},
|
|
"test": {},
|
|
"lint": { "options": {}, "configurations": { "fix": {} } },
|
|
"fmt": { "options": { "files": "src" }, "configurations": { "fix": {} } }
|
|
}
|
|
}
|