From 8a10f22e9f896536e39d7c3659befeaa12965716 Mon Sep 17 00:00:00 2001 From: slorber Date: Tue, 12 Jan 2021 15:44:48 +0100 Subject: [PATCH] Use the Crowdin cli through the brand new npm package --- package.json | 2 +- website/package.json | 9 ++++----- yarn.lock | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 9deae82df296..7f5db36a9b6a 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "serve:v2:ssl:message": "echo '\n\n\nServing Docusaurus with HTTPS on localhost requires to disable the Chrome security: chrome://flags/#allow-insecure-localhost\n\n\n'", "serve:v2:ssl:serve": "serve website/build --ssl-cert ./website/.docusaurus/selfsigned.crt --ssl-key ./website/.docusaurus/selfsigned.key", "crowdin:upload:v2": "crowdin upload sources --config ./crowdin-v2.yaml", - "crowdin:uploadTranslations:v2": "crowdin upload translations --config ./crowdin-v2.yaml", "crowdin:download:v2": "crowdin download --config ./crowdin-v2.yaml", "canary": "yarn canary:bumpVersion && yarn canary:publish", "canary:bumpVersion": "yarn lerna version 2.0.0-alpha.`git rev-parse --short HEAD` --exact --no-push --yes", @@ -69,6 +68,7 @@ "@babel/plugin-proposal-optional-chaining": "^7.12.1", "@babel/plugin-transform-modules-commonjs": "^7.12.1", "@babel/preset-typescript": "^7.12.1", + "@crowdin/cli": "^3.5.2", "@types/express": "^4.17.2", "@types/fs-extra": "^9.0.4", "@types/inquirer": "^6.5.0", diff --git a/website/package.json b/website/package.json index 8968435d5b18..6c1cecdffdc1 100644 --- a/website/package.json +++ b/website/package.json @@ -16,16 +16,15 @@ "build:bootstrap": "cross-env DOCUSAURUS_PRESET=bootstrap yarn build", "start:blogOnly": "cross-env DOCUSAURUS_CONFIG='docusaurus.config-blog-only.js' yarn start", "build:blogOnly": "cross-env DOCUSAURUS_CONFIG='docusaurus.config-blog-only.js' yarn build", - "netlify:build:production": "yarn docusaurus write-translations && yarn netlify:crowdin:install && yarn netlify:crowdin:uploadSources && yarn netlify:crowdin:downloadTranslations && yarn build", + "netlify:build:production": "yarn docusaurus write-translations && yarn netlify:crowdin:uploadSources && yarn netlify:crowdin:downloadTranslations && yarn build", "netlify:build:deployPreview": "yarn docusaurus write-translations --locale fr --messagePrefix '(fr) ' && yarn netlify:build:deployPreview:v1:all && yarn netlify:build:deployPreview:classic && yarn netlify:build:deployPreview:bootstrap && yarn netlify:build:deployPreview:blogOnly", "netlify:build:deployPreview:classic": "cross-env BASE_URL='/classic/' yarn build --out-dir netlifyDeployPreview/classic", "netlify:build:deployPreview:bootstrap": "echo 'netlify:build:deployPreview:bootstrap temporarily disabled' || cross-env BASE_URL='/bootstrap/' DOCUSAURUS_PRESET=bootstrap DISABLE_VERSIONING=true yarn build --out-dir netlifyDeployPreview/bootstrap", "netlify:build:deployPreview:blogOnly": "yarn build:blogOnly --out-dir netlifyDeployPreview/blog-only", "netlify:build:deployPreview:v1:all": "yarn --cwd .. netlify:deployPreview:v1 && yarn --cwd .. netlify:deployPreview:v1-migrated", - "netlify:crowdin:install": "cd .. && java -version && curl -L https://github.com/crowdin/crowdin-cli/releases/download/3.5.1/crowdin-cli.zip --output crowdin-cli.zip && unzip crowdin-cli.zip && cp 3.5.1/crowdin-cli.jar crowdin-cli.jar && java -jar crowdin-cli.jar --version", - "netlify:crowdin:downloadTranslations": "cd .. && java -jar crowdin-cli.jar download --config ./crowdin-v2.yaml", - "netlify:crowdin:downloadTranslationsFailSafe": "yarn netlify:crowdin:downloadTranslations || echo 'Crowdin translation download failure (only internal PRs have access to the Crowdin env token)'", - "netlify:crowdin:uploadSources": "cd .. && java -jar crowdin-cli.jar upload sources --config ./crowdin-v2.yaml", + "netlify:crowdin:downloadTranslations": "yarn --cwd .. crowdin:download:v2", + "netlify:crowdin:downloadTranslationsFailSafe": "yarn --cwd .. crowdin:download:v2 || echo 'Crowdin translation download failure (only internal PRs have access to the Crowdin env token)'", + "netlify:crowdin:uploadSources": "yarn --cwd .. crowdin:upload:v2", "netlify:test": "yarn netlify:build:deployPreview && yarn netlify dev --debug" }, "dependencies": { diff --git a/yarn.lock b/yarn.lock index 6ce2ba1192c6..fb0506d666cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1272,6 +1272,13 @@ exec-sh "^0.3.2" minimist "^1.2.0" +"@crowdin/cli@^3.5.2": + version "3.5.2" + resolved "https://registry.yarnpkg.com/@crowdin/cli/-/cli-3.5.2.tgz#97782a5e72d97bf841032e555deae2838f8de206" + integrity sha512-zoZKQM6RPnRq8UVfGrSY+QxOc4pya4HzgAabVG/bVPxL2v4H1Q258XWysQxmnW0/3GJaO73SJyG5+Y7cRdF+wQ== + dependencies: + shelljs "^0.7.5" + "@csstools/convert-colors@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7" @@ -18185,6 +18192,15 @@ shell-quote@1.7.2: resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== +shelljs@^0.7.5: + version "0.7.8" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" + integrity sha1-3svPh0sNHl+3LhSxZKloMEjprLM= + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + shelljs@^0.8.4: version "0.8.4" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"