0c0a88a02e
Set `i18nMissingTranslation: "error"` on the production build
configuration. The Angular CLI checks every `<source>` extracted
from `i18n` markers and `$localize` calls against the loaded
translation file (`messages.fr.xlf`), and now fails the build if a
target is missing instead of silently falling back to the source
text in the FR bundle.
Gates automatically through CI: `pnpm ci:check` runs `nx affected -t
... build`, which uses the production configuration by default. A PR
that adds an `i18n` marker without updating `messages.fr.xlf` fails
its build job and blocks the merge.
Verified locally by temporarily inserting an unmarked-in-fr string,
running the prod build, observing the explicit error message:
ERROR: No translation found for "sanity.test.missingTranslation"
("A string with no FR translation").
Closes the loop on ADR-0019 §"Confirmation" — the final piece of
the i18n track before the BFF route + cookie work (deferred to the
auth-flow chantier).
121 lines
3.1 KiB
JSON
121 lines
3.1 KiB
JSON
{
|
|
"name": "portal-shell",
|
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
"projectType": "application",
|
|
"prefix": "app",
|
|
"sourceRoot": "apps/portal-shell/src",
|
|
"tags": ["scope:portal-shell", "type:app"],
|
|
"i18n": {
|
|
"sourceLocale": {
|
|
"code": "en",
|
|
"baseHref": "/en/"
|
|
},
|
|
"locales": {
|
|
"fr": {
|
|
"translation": "apps/portal-shell/src/locale/messages.fr.xlf",
|
|
"baseHref": "/fr/"
|
|
}
|
|
}
|
|
},
|
|
"targets": {
|
|
"build": {
|
|
"executor": "@angular/build:application",
|
|
"outputs": ["{options.outputPath}"],
|
|
"options": {
|
|
"outputPath": "dist/apps/portal-shell",
|
|
"browser": "apps/portal-shell/src/main.ts",
|
|
"polyfills": ["@angular/localize/init"],
|
|
"tsConfig": "apps/portal-shell/tsconfig.app.json",
|
|
"inlineStyleLanguage": "scss",
|
|
"assets": [
|
|
{
|
|
"glob": "**/*",
|
|
"input": "apps/portal-shell/public"
|
|
}
|
|
],
|
|
"styles": ["apps/portal-shell/src/styles.css"]
|
|
},
|
|
"configurations": {
|
|
"production": {
|
|
"localize": ["en", "fr"],
|
|
"i18nMissingTranslation": "error",
|
|
"budgets": [
|
|
{
|
|
"type": "initial",
|
|
"maximumWarning": "1mb",
|
|
"maximumError": "1mb"
|
|
},
|
|
{
|
|
"type": "anyScript",
|
|
"maximumWarning": "300kb",
|
|
"maximumError": "300kb"
|
|
},
|
|
{
|
|
"type": "anyComponentStyle",
|
|
"maximumWarning": "5kb",
|
|
"maximumError": "6kb"
|
|
},
|
|
{
|
|
"type": "bundle",
|
|
"name": "styles",
|
|
"maximumWarning": "150kb",
|
|
"maximumError": "150kb"
|
|
}
|
|
],
|
|
"outputHashing": "all"
|
|
},
|
|
"development": {
|
|
"optimization": false,
|
|
"extractLicenses": false,
|
|
"sourceMap": true
|
|
}
|
|
},
|
|
"defaultConfiguration": "production"
|
|
},
|
|
"extract-i18n": {
|
|
"executor": "@angular/build:extract-i18n",
|
|
"options": {
|
|
"buildTarget": "portal-shell:build",
|
|
"outputPath": "apps/portal-shell/src/locale",
|
|
"outFile": "messages.xlf"
|
|
}
|
|
},
|
|
"serve": {
|
|
"continuous": true,
|
|
"executor": "@angular/build:dev-server",
|
|
"configurations": {
|
|
"production": {
|
|
"buildTarget": "portal-shell:build:production"
|
|
},
|
|
"development": {
|
|
"buildTarget": "portal-shell:build:development"
|
|
}
|
|
},
|
|
"defaultConfiguration": "development"
|
|
},
|
|
"lint": {
|
|
"executor": "@nx/eslint:lint"
|
|
},
|
|
"test": {
|
|
"executor": "@angular/build:unit-test",
|
|
"options": {
|
|
"watch": false
|
|
},
|
|
"configurations": {
|
|
"watch": {
|
|
"watch": true
|
|
}
|
|
}
|
|
},
|
|
"serve-static": {
|
|
"continuous": true,
|
|
"executor": "@nx/web:file-server",
|
|
"options": {
|
|
"buildTarget": "portal-shell:build",
|
|
"port": 4200,
|
|
"staticFilePath": "dist/apps/portal-shell/browser"
|
|
}
|
|
}
|
|
}
|
|
}
|