angular-docs-cn/tools
Paul Gschwendtner 7a3a453072 build: convert CLDR locale extraction from Gulp to Bazel tool (#42230)
Converts the CLDR locale extraction script to a Bazel tool.
This allows us to generate locale files within Bazel, so that
locales don't need to live as sources within the repo. Also
it allows us to get rid of the legacy Gulp tooling.

The migration of the Gulp script to a Bazel tool involved the
following things:

  1. Basic conversion of the `extract.js` script to TypeScript.
     This mostly was about adding explicit types. e.g. adding `locale:
     string` or `localeData: CldrStatic`.

  2. Split-up into separate files. Instead of keeping the large
     `extract.js` file, the tool has been split into separate files.
     The logic remains the same, just that code is more readable and
     maintainable.

  3. Introduction of a new `index.ts` file that is the entry-point
     for the Bazel tool. Previously the Gulp tool just generated
     all locale files, the default locale and base currency files
     at once. The new entry-point accepts a mode to be passed as
     first process argument. based on that argument, either locales
     are generated into a specified directory, or the default locale,
     base currencies or closure file is generated.

     This allows us to generate files with a Bazel genrule where
     we simply run the tool and specify the outputs. Note: It's
     necessary to have multiple modes because files live in separate
     locations. e.g. the default locale in `@angular/core`, but the
     rest in `@angular/common`.

  4. Removal of the `cldr-data-downloader` and custom CLDR resolution
     logic. Within Bazel we cannot run a downloader using network.

     We switch this to something more Bazel idiomatic with better
     caching. For this a new repository rule is introduced that
     downloads the CLDR JSON repository and extracts it. Within
     that rule we determine the supported locales so that they
     can be used to pre-declare outputs (for the locales) within
     Bazel analysis phase. This allows us to add the generated locale
     files to a `ts_library` (which we want to have for better testing,
     and consistent JS transpilation).

     Note that the removal of `cldr-data-downloader` also requires us to
     add logic for detecting locales without data. The CLDR data
     downloader overwrote the `availableLocales.json` file with a file
     that only lists locales that CLDR provides data for. We use the
     official `availableLocales` file CLDR provides, but filter out
     locales for which no data is available. This is needed until we
     update to CLDR 39 where data is available for all such locales
     listed in `availableLocales.json`.

PR Close #42230
2021-07-16 12:44:59 -07:00
..
build build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
circular_dependency_test build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
contributing-stats build: update typed-graphqlify to version 3.1.1 (#41738) 2021-04-21 17:30:28 -07:00
gulp-tasks build: convert CLDR locale extraction from Gulp to Bazel tool (#42230) 2021-07-16 12:44:59 -07:00
npm build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
npm_integration_test build: update to latest version of `rules_nodejs` v3.3.0 (#41599) 2021-04-13 17:37:28 -07:00
rxjs build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
saucelabs build: update to latest version of `rules_nodejs` v3.3.0 (#41599) 2021-04-13 17:37:28 -07:00
size-tracking build: update `chalk` to version 4.0.1 (#41738) 2021-04-21 17:30:28 -07:00
source-map-test build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
symbol-extractor build: update to latest version of `rules_nodejs` v3.3.0 (#41599) 2021-04-13 17:37:28 -07:00
testing refactor(core): remove unused fakeAsyncFallback and asyncFallback (#37879) 2020-11-20 08:34:59 -08:00
ts-api-guardian build: update to rules_nodejs v4.0.0-beta.0 (#42760) 2021-07-09 14:50:15 -07:00
tslint refactor: add override keyword to members implementing abstract declarations (#42512) 2021-07-12 13:11:17 -07:00
BUILD.bazel build: upgrade angular build, integration/bazel and @angular/bazel package to rule_nodejs 2.2.0 (#39182) 2020-10-08 11:54:59 -07:00
defaults.bzl build: no longer ship ecmascript module files within NPM packages (#42809) 2021-07-12 09:42:01 -07:00
inline-package-json-deps.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
jasmine-seed-generator.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
jsconfig.json chore(vscode): add jsconfig.json and remove .settings dir 2015-10-29 13:53:21 +00:00
ng_benchmark.bzl refactor(dev-infra): ng_rollup_bundle rule should leverage `@bazel/rollup` (#37623) 2020-06-22 10:55:28 -07:00
postinstall-patches.js build: update tools directory for latest changes in rules_nodejs (#40710) 2021-02-09 10:48:43 -08:00
tsconfig-test.json build(bazel): use fine-grained npm deps (#26111) (#26488) 2018-10-19 20:59:29 -07:00
tsconfig.json build: ts-api-guardian tsconfig warning with bazel (#27583) 2018-12-13 11:01:48 -08:00
types.d.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
utils.bzl build: create macro for transpiling javascript file to es5 (#36802) 2020-05-04 12:43:50 -07:00
utils.inc feat(bundle): add script to push bundles to code.angularjs.org 2015-04-14 14:50:53 -07:00