50 Commits

Author SHA1 Message Date
Joey Perrott
1bc807c81a style(common): enforce format on newly included files ()
Historically files to be formatted were added to a listing (via matchers)
to be included in formatting.  Instead, this change begins efforts to
instead include all files in format enforcement, relying instead on an
opt out methodology.

PR Close 
2020-06-12 15:06:41 -07:00
Joey Perrott
d1ea1f4c7f build: update license headers to reference Google LLC ()
Update the license headers throughout the repository to reference Google LLC
rather than Google Inc, for the required license headers.

PR Close 
2020-05-26 14:26:58 -04:00
Misko Hevery
cb6ddfc215 Revert "fix(common): locales/global/*.js are not ES5 compliant ()" ()
This reverts commit 078b0be4dc69ef4a8cdf4eb15caedde1114950c7.

The original commit was a work around for a bug in CLI. That bug was fixed in the CLI, as a result this change is no longer needed and is being reverted.

PR Close 
2020-05-12 13:11:57 -07:00
Terence D. Honles
078b0be4dc fix(common): locales/global/*.js are not ES5 compliant ()
Although this code has been part of Angular 9.x I only noticed this
error when upgrading to Angular 9.1.x because historically the source
locale data was not injected when localizing, but as of
angular/angular-cli#16394 (9.1.0) it is now included. This tipped me off
that my other bundles were not being built properly, and this change
allows me to build a valid ES5 bundle (I have also added a verification
step to my build pipeline to alert me if this error appears again in any
of my bundles).

I found the `locales/global/*.js` file paths being referenced by the
`I18nOptions` in
@angular-devkit/build-angular/src/utils/i18n-options.ts,
and following that it looks like it is actually loaded and used in
@angular-devkit/build-angular/src/utils/process-bundle.ts. I saw the
function `terserMangle` does appear that it is likely aware of the build
being ES5, but I'm not sure why this is not producing a valid ES5
bundle.

This change updates `tools/gulp-tasks/cldr/extract.js` to produce ES5
compliant `locales/global/*.js` and that fixes my issue. However, I am
not sure if @angular-devkit/build-angular should be modified to produce
a valid ES5 bundle instead or if the files could be TypeScript rather
than JavaScript files.

A test that a valid ES5 bundle is produced would be helpful, and I hope
this is reproducible and not some issue with my config.

PR Close 
2020-04-09 11:30:32 -07:00
Greg Magolan
93c2df23bf build: upgrade to rules_nodejs 1.0.0 (first stable release) ()
Brings in the fix for stamping which was preventing many targets from getting cached.

PR Close 
2020-01-15 14:58:07 -05:00
Pete Bacon Darwin
2f31ceca47 refactor: update locales with extracted currency codes ()
The locale data extraction has been modified to include the default
currency code in the generated locale data. This commit updates these
generated files accordingly.

PR Close 
2020-01-13 09:57:06 -08:00
atscott
e88d652f2a Revert "build: upgrade to rules_nodejs 1.0.0 (first stable release) ()" ()
This reverts commit cb6ffa1211bafe35debf6f74f0caee0e2efc420a.

PR Close 
2020-01-10 14:12:15 -08:00
Greg Magolan
cb6ffa1211 build: upgrade to rules_nodejs 1.0.0 (first stable release) ()
Brings in the fix for stamping which was preventing many targets from getting cached.

PR Close 
2020-01-10 08:31:58 -08:00
Joey Perrott
f9e959e098 fix(common): update closure locales to include directionality data ()
When directionality data was added to @angular/common locales, only
the externally used locales were updated.  We need to additionally
update the closure locales which are synced into google3.

PR Close 
2019-12-04 15:04:17 -08:00
Feliks Khantsis
15d3e741e9 feat: update the locale files ()
PR Close 
2019-12-03 15:58:09 -08:00
Pete Bacon Darwin
2f0b8bc541 build(common): generate correct "global" locale files ()
PR Close 
2019-11-12 11:39:19 -08:00
Ephraim
942e2ebe44 fix: generate the new locale files ()
PR Close 
2019-11-11 15:55:13 -08:00
Joey Perrott
1527ac6c47 fix(common): rerun cldr to remove � characters ()
PR Close 
2019-11-11 09:38:58 -08:00
Joey Perrott
c77faf566e fix(common): update CLDR generated files to 36.0.0 ()
PR Close 
2019-11-07 22:11:33 +00:00
Joey Perrott
68a1edd4cc fix(common): update CLDR generated files after change to npm sources ()
PR Close 
2019-11-07 17:49:19 +00:00
Pete Bacon Darwin
cd6ab209b6 build: generate global locale files ()
This commit contains the global locale files generated by the change to
the CLDR `extract.js` tool, from the previous commit.

PR Close 
2019-11-05 17:26:59 +00:00
Pete Bacon Darwin
a3c44124ab build: support generating global locale files from CLDR data ()
In order to support adding locales during compile-time
inlining of translations (i.e. after the TS build has completed),
we need to be able to attach the locale to the global scope.

This commit modifies CLDR extraction to emit additional "global"
locale files that appear in the `@angular/common/locales/global` folder.

These files are of the form:

```
(function() {
  const root = typeof globalThis !== 'undefined' && globalThis ||
      typeof global !== 'undefined' && global || typeof window !== 'undefined' && window;
  root.ng = root.ng || {};
  root.ng.common = root.ng.common || {};
  root.ng.common.locale = root.ng.common.locale || {};
  const u = undefined;
  function plural(n) {
    if (n === 1) return 1;
    return 5;
  }
  root.ng.common.locale['xx-yy'] = [...];
})();
```

The IIFE will ensure that `ng.common.locale` exists and attach the
given locale (and its "extras") to it using it "normalized" locale
name.

* "extras": in the UMD module locale files the "extra" locale data,
currently the day period rules, and extended day period data, are
stored in separate files under the "common/locales/extra" folder.

* "normalized": Angular references locales using a normalized form,
which is lower case with `_` replaced by `-`. For example:
`en_UK` => `en-uk`.

PR Close 
2019-11-05 17:26:59 +00:00
Alex Eagle
337b6fe003 build: remove unreferenced tsconfig-build.json files ()
These are no longer needed since Bazel generates a tsconfig for each compilation

PR Close 
2019-06-05 09:03:36 -07:00
Wassim Chegham
ce68b4d839 style: enforce buildifier lint on CI ()
PR Close 
2019-02-26 16:57:41 -08:00
Alex Eagle
38343a2388 build: set a default module_name for ts_library rules ()
PR Close 
2019-01-18 10:16:39 -08:00
Vikram Subramanian
d83f9d432a fix(common): register locale data for all equivalent closure locales ()
This fix is for the issue below when compiling I18N Angular apps using closure.

For certain locales closure converts the input locale id to a different equivalent locale string. For example if the input locale is 'id'(for Indonesia) goog.LOCALE is set to 'in' and the closure locale data is registered only for 'in'. The Angular compiler uses the original input locale string, 'id' to set the LOCALE_ID token and there is a mismatch of locale used to register and locale used when requesting the locale data.

The fix is for the closure-locale.ts code to register the locale data for all equivalent locales names so that it doesn't matter what goog.LOCALE is actually set to.

PR Close 
2018-09-10 13:59:56 -07:00
Olivier Combe
dcabb05102 fix(common): use correct currency format for locale de-AT ()
Fixes 
PR Close 
2018-07-09 15:10:06 -07:00
Igor Minar
e3064d5432 feat: typescript 2.9 support ()
PR Close 
2018-07-03 13:32:06 -07:00
Olivier Combe
39c8baea31 fix(common): use correct ICU plural for locale mk ()
PR Close 
2018-06-27 15:03:34 -07:00
Alex Eagle
c2b5ebfa24 build: update buildifier to latest ()
this matches the version in ngcontainer:0.3.1

PR Close 
2018-06-12 11:42:35 -07:00
Olivier Combe
06c0d9666f build(common): mark locales files as side-effect-full ()
Fixes https://github.com/angular/angular-cli/issues/10322
PR Close 
2018-04-24 11:14:52 -07:00
Olivier Combe
d1177c75f8 refactor: update CLDR data for closure locale & use a const for undefined ()
PR Close 
2018-04-13 16:30:23 -07:00
Igor Minar
aa27155618 build(common): mark locales files as side-effect-full ()
These files are in the UMD format for greater portablity, and as such
can't be marked as side-effect-free by webpack/build-optimizer/uglify.

PR Close 
2018-04-13 13:09:13 -07:00
Olivier Combe
ce40e85cbb refactor(common): update CLDR data to v33.0.0 ()
PR Close 
2018-04-11 15:34:46 -07:00
Olivier Combe
5706810af2 fix(common): replace i18n locale undefined values by a const ()
Fixes 
PR Close 
2018-04-11 15:34:46 -07:00
Alex Eagle
5a298b1c5e fix(common): workaround UMD/webpack limitation ()
Fixes 

PR Close 
2018-04-09 15:16:12 -07:00
Alex Eagle
46eadb5cfb build: fix common locales in npm package ()
PR Close 
2018-04-04 08:23:07 -07:00
Olivier Combe
78167915ee build(common): export locale data as commonjs instead of es2015 ()
PR Close 
2018-03-07 14:33:45 -08:00
Olivier Combe
0b2f7d13d0 fix(common): regenerate i18n locale data files ()
PR Close 
2018-02-09 14:42:23 -08:00
Olivier Combe
b62739a989 fix(common): generate closure-locale data file with exported plural functions ()
Fixes 
PR Close 
2018-01-30 11:42:31 -08:00
Olivier Combe
97b18b2a5c fix(common): extract plural function from i18n locale data files for TS 2.6 ()
Fixes 

PR Close 
2018-01-19 13:23:34 -08:00
Olivier Combe
135a2822ea fix(common): don't remove special characters when extracting CLDR data ()
PR Close 
2018-01-19 13:23:34 -08:00
Alex Eagle
c4f02e21dd build: move repeated tsconfig attributes to a macro ()
This helps ensure we use the same tsconfig.json file for all compilations.
Next steps are to make it the same tsconfig.json file used by the editor

PR Close 
2018-01-10 12:30:19 -08:00
Olivier Combe
a0ffdf1ef2 build(common): generate ts declarations for i18n locale files ()
Fixes 
PR Close 
2017-12-22 21:34:03 -08:00
Misko Hevery
cc1058f6e1 build: add bazel test rules for more packages ()
PR Close 
2017-12-22 13:10:51 -08:00
Olivier Combe
cbe7e39bbe build(common): don't generate .d.ts & .metadata.json files for i18n locales
Fixes 
2017-12-14 08:29:36 -08:00
Olivier Combe
3ce3b4d2af refactor(common): update i18n locale data to CLDR v32 ()
List of changes between v31.0.1 and v32: http://cldr.unicode.org/index/downloads/cldr-32
PR Close 
2017-12-08 10:24:33 -08:00
Olivier Combe
24bf3e2a25 feat(common): add locale id parameter to registerLocaleData ()
PR Close 
2017-11-27 17:00:06 -06:00
Chuck Jazdzewski
f96142cd7c build: remove references to tsc-wrapped ()
With this commit `ngc` is used instead of `tsc-wrapped` for
collecting metadata and tsickle rewriting and `tsc-wrapped`
is removed from the repository.

`@angular/tsc-wrapped@5` is now deprecated and is no longer
used, updated, or maintained as part as of Angular 5.x.x.

`@angular/tsc-wrapped@4` is still maintained and required by
Angular 4.x.x and will be maintained as long as 4.x.x is in
LTS.

PR Close 
2017-09-21 13:55:52 -07:00
Olivier Combe
57abe8d078 refactor(common): export locale data from closure-locale ()
PR Close 
2017-08-31 11:23:12 -07:00
Victor Berchet
fdd5010832 fix(common): fix a duplicate case in the locale switch () 2017-08-29 17:02:20 -07:00
Olivier Combe
946e5bda22 fix(common): update closure-locale generation for tree shaking () 2017-08-29 15:29:21 -07:00
Olivier Combe
90bd984ff7 refactor(common): simplify closure-locale by removing imports () 2017-08-29 11:54:43 -07:00
Olivier Combe
48789360b1 feat(common): generate closure-locale.ts to tree shake locale data ()
Closure will only keep the data for the locale defined in `goog.LOCALE`

PR Close 
2017-08-29 11:26:10 -05:00
Victor Berchet
4c5aac8cd5 refactor(common): move generated locale files ()
PR Close 
2017-08-29 11:26:10 -05:00