зеркало из https://github.com/mozilla/fxa.git
feat(l10n): update l10n ftl scripts for nx apps v2
Because: * Fluent ftl files need to be added to apps in the nx apps/ directory. This commit: * Updates bundle and prime scripts to support the apps/ directory, without affecting existing packages apps. Closes #FXA-8823
This commit is contained in:
Родитель
b781bc59a0
Коммит
f80ba7ff45
|
@ -154,6 +154,9 @@ packages/fxa-settings/legal-docs/
|
|||
packages/fxa-settings/public/legal-docs
|
||||
packages/fxa-settings/test/
|
||||
|
||||
# payments-next
|
||||
apps/payments/next/public/locales
|
||||
|
||||
Library
|
||||
.node
|
||||
process.yml
|
||||
|
|
|
@ -18,12 +18,18 @@ if [ -z "$BUNDLES" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
#Split PACKAGE by /
|
||||
PACKAGE_FOLDER_ARR=(${PACKAGE//\// })
|
||||
|
||||
# Move to monorepo root
|
||||
cd "$(dirname "$0")/../.."
|
||||
# No cd necessary for apps/*
|
||||
# Applications in apps/* should already be in monorepo root
|
||||
if [[ "${PACKAGE_FOLDER_ARR[0]}" == "packages" ]]; then
|
||||
# Move to monorepo root
|
||||
cd "$(dirname "$0")/../.."
|
||||
fi
|
||||
|
||||
# Check path is valid
|
||||
target_folder="packages/$PACKAGE/$FOLDER"
|
||||
target_folder="$PACKAGE/$FOLDER"
|
||||
if [ ! -d "$target_folder" ]; then
|
||||
echo "$PREFIX: Invalid location! The path $target_folder must exist. Did a yarn l10n:prime command get called."
|
||||
exit 1
|
||||
|
|
|
@ -11,9 +11,18 @@ if [ -z "$PACKAGE" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Move to monorepo root
|
||||
cd "$(dirname "$0")/../.."
|
||||
#Split PACKAGE by /
|
||||
PACKAGE_FOLDER_ARR=(${PACKAGE//\// })
|
||||
|
||||
# No cd necessary for apps/*
|
||||
# Applications in apps/* should already be in monorepo root
|
||||
if [[ "${PACKAGE_FOLDER_ARR[0]}" == "packages" ]]; then
|
||||
# Move to monorepo root
|
||||
cd "$(dirname "$0")/../.."
|
||||
fi
|
||||
|
||||
ROOT_FOLDER=$(pwd)
|
||||
echo $ROOT_FOLDER
|
||||
|
||||
if [ ! -d "$ROOT_FOLDER/external/l10n/locale" ]; then
|
||||
echo "$PREFIX: No external/l10n folder exists! Run yarn l10n:clone script first."
|
||||
|
@ -21,7 +30,7 @@ if [ ! -d "$ROOT_FOLDER/external/l10n/locale" ]; then
|
|||
fi
|
||||
|
||||
# Check path is valid
|
||||
TARGET_FOLDER="packages/$PACKAGE/$FOLDER"
|
||||
TARGET_FOLDER="$PACKAGE/$FOLDER"
|
||||
rm -rf "$TARGET_FOLDER"
|
||||
mkdir -p "$TARGET_FOLDER"
|
||||
|
||||
|
|
|
@ -82,6 +82,12 @@
|
|||
"l10n-merge": {
|
||||
"command": "yarn grunt --gruntfile='apps/payments/next/Gruntfile.js' merge-ftl"
|
||||
},
|
||||
"l10n-prime": {
|
||||
"command": "./_scripts/l10n/prime.sh apps/payments/next"
|
||||
},
|
||||
"l10n-bundle": {
|
||||
"command": "./_scripts/l10n/bundle.sh apps/payments/next branding,react,payments"
|
||||
},
|
||||
"storybook": {
|
||||
"executor": "@nx/storybook:storybook",
|
||||
"options": {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"audit": "npm audit --json | audit-filter --nsp-config=.nsprc --audit=-",
|
||||
"glean-generate": "yarn glean translate ../fxa-shared/metrics/glean/fxa-backend-pings.yaml ../fxa-shared/metrics/glean/fxa-backend-metrics.yaml -f typescript_server -o lib/metrics/glean",
|
||||
"glean-lint": "yarn glean glinter ../fxa-shared/metrics/glean/fxa-backend-pings.yaml ../fxa-shared/metrics/glean/fxa-backend-metrics.yaml",
|
||||
"l10n-prime": "yarn l10n:prime fxa-auth-server",
|
||||
"l10n-prime": "yarn l10n:prime packages/fxa-auth-server",
|
||||
"l10n-merge": "yarn grunt merge-ftl",
|
||||
"l10n-merge-test": "yarn grunt merge-ftl:test",
|
||||
"l10n-watch": "yarn grunt watch-ftl",
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"glean-generate": "yarn glean translate ../fxa-shared/metrics/glean/fxa-ui-pings.yaml ../fxa-shared/metrics/glean/fxa-ui-metrics.yaml -f javascript -o app/scripts/lib/glean",
|
||||
"audit": "npm audit --json | audit-filter --nsp-config=.nsprc --audit=-",
|
||||
"l10n-create-json": "NODE_OPTIONS=--openssl-legacy-provider grunt l10n-create-json",
|
||||
"l10n-prime": "yarn l10n:prime fxa-content-server",
|
||||
"l10n-prime": "yarn l10n:prime packages/fxa-content-server",
|
||||
"lint": "yarn lint-glean && eslint app server tests --cache",
|
||||
"lint-glean": "yarn glean glinter ../fxa-shared/metrics/glean/fxa-ui-pings.yaml ../fxa-shared/metrics/glean/fxa-ui-metrics.yaml",
|
||||
"start": "pm2 start pm2.config.js && yarn check:url localhost:3030/bundle/app.bundle.js",
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
"clean": "rimraf dist",
|
||||
"l10n-merge": "yarn grunt merge-ftl",
|
||||
"l10n-merge-test": "yarn grunt merge-ftl:test",
|
||||
"l10n-prime": "yarn l10n:prime fxa-payments-server",
|
||||
"l10n-bundle": "yarn l10n:bundle fxa-payments-server branding,react,payments",
|
||||
"l10n-prime": "yarn l10n:prime packages/fxa-payments-server",
|
||||
"l10n-bundle": "yarn l10n:bundle packages/fxa-payments-server branding,react,payments",
|
||||
"l10n-watch": "yarn grunt watch-ftl",
|
||||
"audit": "npm audit --json | audit-filter --nsp-config=.nsprc --audit=-",
|
||||
"start": "pm2 start pm2.config.js && yarn check:url localhost:3031/__lbheartbeat__",
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"build-l10n": "nx l10n-merge && nx l10n-merge-test",
|
||||
"compile": "nx build-ts",
|
||||
"clean": "rimraf dist",
|
||||
"l10n-prime": "yarn l10n:prime fxa-react",
|
||||
"l10n-prime": "yarn l10n:prime packages/fxa-react",
|
||||
"l10n-merge": "yarn grunt merge-ftl",
|
||||
"l10n-merge-test": "yarn grunt merge-ftl:test",
|
||||
"l10n-watch": "yarn grunt watch-ftl",
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
"clean": "rimraf dist",
|
||||
"compile": "tsc --noEmit",
|
||||
"gql-extract": "persistgraphql src ../../configs/gql/allowlist/fxa-settings.json --js --extension=ts ",
|
||||
"l10n-bundle": "yarn l10n:bundle fxa-settings branding,react,settings",
|
||||
"l10n-prime": "yarn l10n:prime fxa-settings",
|
||||
"l10n-bundle": "yarn l10n:bundle packages/fxa-settings branding,react,settings",
|
||||
"l10n-prime": "yarn l10n:prime packages/fxa-settings",
|
||||
"l10n-merge": "yarn grunt merge-ftl",
|
||||
"l10n-merge-test": "yarn grunt merge-ftl:test",
|
||||
"legal-prime": "yarn legal:clone fxa-settings",
|
||||
|
|
Загрузка…
Ссылка в новой задаче