102 Commits

Author SHA1 Message Date
Joey Perrott
f40d51733a fix(dev-infra): use commit message validation from @angular/dev-infra-private ()
Prior to this change we manage a local version of commit message validation
in addition to the commit message validation tool contained in the ng-dev
tooling.  By adding the ability to validate a range of commit messages
together, the remaining piece of commit message validation that is in the
local version is replicated.

We use both commands provided by the `ng-dev commit-message` tooling:
- pre-commit-validate: Set to automatically run on an git hook to validate
    commits as they are created locally.
- validate-range: Run by CI for every PR, testing that all of the commits
    added by the PR are valid when considered together.  Ensuring that all
    fixups are matched to another commit in the change.

PR Close 
2020-04-06 09:28:52 -07:00
Joey Perrott
c5c57f6737 build: update to clang 1.4.0 and only run clang format on changed files ()
Update to clang@1.4.0 to gain support for optional changing and nullish
coalescing.  Because this would trigger a change on >1800 files in the
repository, also changes our format enforcement to only be run against
changed files.  This will allow us to incramentally roll out the value
add of the upgraded clang format.

PR Close 
2020-04-01 13:18:09 -07:00
Joey Perrott
b07b6edc2a build: add dev-infra to clang format sources to format ()
PR Close 
2020-03-27 11:13:17 -07:00
Joey Perrott
a73e125c04 feat(dev-infra): add dev-infra to the commit message scopes ()
Adds dev-infra to the commit message scopes.  Also, sets the scope to be ignored
in changelogs.

PR Close 
2020-03-10 13:26:12 -04:00
Paul Gschwendtner
5615928df9 build: no longer run tslint from within gulp task ()
Switches our tslint setup to the standard `tslint.json` linter excludes.
The set of files that need to be linted is specified through a Yarn script.

For IDEs, open files are linted with the closest tslint configuration, if the
tslint IDE extension is set up, and the source file is not excluded.

We cannot use the language service plugin for tslint as we have multiple nested
tsconfig files, and we don't want to add the plugin to each tsconfig. We
could reduce that bloat by just extending from a top-level tsconfig that
defines the language service plugin, but unfortunately the tslint plugin does
not allow the use of tslint configs which are not part of the tsconfig project.

This is problematic since the tslint configuration is at the project root, and we
don't want to copy tslint configurations next to each tsconfig file.

Additionally, linting of `d.ts` files has been re-enabled. This has been
disabled in the past and a TODO has been left. This commit fixes the
lint issues and re-enables linting.

PR Close 
2020-03-03 09:20:49 -08:00
Joey Perrott
f7d4cc9cab ci: properly validate commit messages locally ()
PR Close 
2020-02-04 10:25:01 -08:00
Joey Perrott
8499bbdd17 ci: only lint commit messages in the PR ()
PR Close 
2020-02-04 10:25:01 -08:00
Joey Perrott
c2c4aea97d ci: only lint commit messages on PRs ()
As all commit messages are linted during the PR process, we
do not need to relint these previous commit messages on upstream
branches.

PR Close 
2020-02-04 10:25:01 -08:00
Igor Minar
bd61cd0267 ci: filter out bad commit from the commit message check to green up master ()
the commit causes lint on upstream/master to fail. We need to fix the script to not check too many past commits, but that
will have to wait until a follow up PR.

PR Close 
2020-01-28 15:47:38 -08:00
Paul Gschwendtner
fd3cfbb678 build: create bazel marco to test for circular dependencies ()
Creates a Bazel macro that can be used to test packages for
circular dependencies. We face one limitation with Bazel:

 * Built packages use module imports, and not relative source file
 paths. This means we need custom resolution.

Fortunately, tools like `madge` support custom resolution.

Also removes the outdated `check-cycles` gulp task that
didn't catch circular dependencies. It seems like the test
became broken when we switched the packages-dist output to Bazel. It
breaks because the Bazel output doesn't use relative paths, but uses
the module imports. This will be handled in the new Bazel macro/rule.

PR Close 
2020-01-23 11:36:40 -08:00
Pete Bacon Darwin
ed2f5e0efa feat: i18n - include currency code in locale data ()
PR Close 
2020-01-13 09:57:06 -08:00
Feliks Khantsis
3c2438425b feat: add direction property to locale files ()
PR Close 
2019-12-03 15:58:09 -08:00
Igor Minar
d251f22ebd build: remove obsolete build related tools and helper scripts ()
none of these files are needed any more as they were replaced by Bazel.

PR Close 
2019-12-02 10:52:21 -08:00
Pete Bacon Darwin
db2c606d41 build(common): fix bad root reference in global locale files ()
There was a mistake in the generation of the global
locale files, where `root` was being used instead of
the correctl `global`.

PR Close 
2019-11-12 11:39:19 -08:00
Joey Perrott
6cb9988d63 build: move clang formating out of gulp stream for cldr ()
PR Close 
2019-11-11 09:38:58 -08:00
Joey Perrott
42d394973d build: move cldr dependency to npm ()
PR Close 
2019-11-07 17:49:19 +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
Pete Bacon Darwin
502dd89290 build: reformat (clang) extract.js ()
PR Close 
2019-11-05 17:26:59 +00:00
Pete Bacon Darwin
2cdb3a079d feat(ivy): i18n - implement compile-time inlining ()
This commit implements a tool that will inline translations and generate
a translated copy of a set of application files from a set of translation
files.

PR Close 
2019-10-09 13:19:38 -07:00
Miško Hevery
466f5c67d6 docs(zone.js): update release docs instructions ()
PR Close 
2019-08-13 16:55:03 -07:00
Kara Erickson
48487cb70e ci: add ivy commits to generated CHANGELOG ()
Historically, we've cleaned Ivy commits out of the CHANGELOG because
Ivy was not available except as a preview. Given that Ivy will soon
be the default in 9.0.0, it no longer makes sense to remove the Ivy
commits from the log. This changes the gulp changelog task so that
Ivy commits are included by default.

PR Close 
2019-08-12 16:03:37 -07:00
George Kalpakas
3df54be9e4 build: ensure fixup commits match an earlier, unmerged commit ()
Previously, `validate-commit-message` would treat `fixup! `-prefixed
commits like this:
- It would strip the `fixup! ` prefix.
- It would validate the rest of the commit message header as any other
  commit.

However, fixup commits are special in that they need to exactly match an
earlier commit message header (sans the `fixup! ` prefix) in order for
git to treat them correctly. Otherwise, they will not be squashed into
the original commits and will be merged as is. Fixup commits can end up
not matching their original commit for several reasons (e.g. accidental
typo, changing the original commit message, etc.).

This commit prevents invalid fixup commits to pass validation by
ensuring that they match an earlier (unmerged) commit (i.e. a commit
between the current HEAD and the BASE commit).

NOTE: This new behavior is currently not activated in the pre-commit git
      hook, that is used to validate commit messages (because the
      preceding, unmerged commits are not available there). It _is_
      activated in `gulp validate-commit-message`, which is run as part
      of the `lint` job on CI and thus will detect invalid commits,
      before their getting merged.

PR Close 
2019-08-09 15:12:38 -07:00
George Kalpakas
c0d5684078 fix: do not allow squash! commits when merging ()
While `fixup! ` is fine, `squash! ` means that the commit message needs
tweaking, which cannot be done automatically during merging (i.e. it
should be done by the PR author).

Previously, `validate-commit-message` would always allow
`squash! `-prefixed commits, which would cause problems during merging.

This commit changes `validate-commit-message` to make it configurable
whether such commits are allowed and configures the
`gulp validate-commit-message` task, which is run as part of the `lint`
job on CI, to not allow them.

NOTE: This new check is disabled in the pre-commit git hook that is used
      to validate commit messages, because these commits might still be
      useful during development.

PR Close 
2019-08-09 15:12:37 -07:00
JiaLiPassion
2a6e6c02ed build(zone.js): update gulp task to gen changelog automatically ()
PR Close 
2019-08-02 14:28:49 -07:00
JiaLiPassion
fa4e17082c build(zone.js): update changelog of zone.js ()
PR Close 
2019-08-02 14:28:49 -07:00
JiaLiPassion
30673090ec build(zone.js): add changelog gulptask for zone.js ()
PR Close 
2019-07-26 11:30:08 -07:00
George Kalpakas
6b7b4ee891 build: fix formatting tasks by ignoring the zone.js/ directory ()
This was causing issues, because `zone.js` looks like a JS file (despite
it being a directory). The contents of `zone.js/` are still matched by
the globs (it is only the directory itself that is excluded).

Related to .

PR Close 
2019-06-26 13:29:29 -07:00
George Kalpakas
279e74603e refactor: move negative glob patterns of files to format close to their positive counterparts ()
This makes it easier to identify which files in directory will be
included and which will be ignored.

PR Close 
2019-06-26 13:29:29 -07:00
Paul Gschwendtner
e01d697eed build: filter out changelog entries for zone.js from framework changelog ()
We don't want to show entries for the `zone.js` scope in the main framework
changelog file. The zone.js changelog will be handled separately within the
`packages/zone.js` folder. (see [here](https://github.com/angular/angular/pull/31277#issuecomment-505934681))

PR Close 
2019-06-26 09:23:02 -07:00
JiaLiPassion
5eb7426216 build: move zone.js to angular repo ()
PR Close 
2019-06-20 11:27:39 -07:00
Olivier Combe
5e0f982961 feat(ivy): use i18n locale data to determine the plural form of ICU expressions ()
Plural ICU expressions depend on the locale (different languages have different plural forms). Until now the locale was hard coded as `en-US`.
For compatibility reasons, if you use ivy with AOT and bootstrap your app with `bootstrapModule` then the `LOCALE_ID` token will be set automatically for ivy, which is then used to get the correct plural form.
If you use JIT, you need to define the `LOCALE_ID` provider on the module that you bootstrap.
For `TestBed` you can use either `configureTestingModule` or `overrideProvider` to define that provider.
If you don't use the compat mode and start your app with `renderComponent` you need to call `ɵsetLocaleId` manually to define the `LOCALE_ID` before bootstrap. We expect this to change once we start adding the new i18n APIs, so don't rely on this function (there's a reason why it's a private export).
PR Close 
2019-05-30 15:09:02 -04:00
Alex Rickabaugh
9147092a15 Revert "feat(ivy): use i18n locale data to determine the plural form of ICU expressions ()" ()
This reverts commit 6a8cca797536dc69e18266741d70790eccb2121d.

PR Close 
2019-04-15 16:55:51 -07:00
Olivier Combe
6a8cca7975 feat(ivy): use i18n locale data to determine the plural form of ICU expressions ()
Plural ICU expressions depend on the locale (different languages have different plural forms). Until now the locale was hard coded as `en-US`.
For compatibility reasons, if you use ivy with AOT and bootstrap your app with `bootstrapModule` then the `LOCALE_ID` token will be set automatically for ivy, which is then used to get the correct plural form.
If you use JIT, you need to define the `LOCALE_ID` provider on the module that you bootstrap.
For `TestBed` you can use either `configureTestingModule` or `overrideProvider` to define that provider.
If you don't use the compat mode and start your app with `renderComponent` you need to call `ɵsetLocaleId` manually to define the `LOCALE_ID` before bootstrap. We expect this to change once we start adding the new i18n APIs, so don't rely on this function (there's a reason why it's a private export).
PR Close 
2019-04-15 10:40:26 -07:00
George Kalpakas
6788d86709 build: fix validate-commit-message on Windows ()
Previously, the `validate-commit-message` gulp task was using the
`git log ... ^r1 r2` syntax to list commits between the base branch and
the current head. This didn't work as expected on Windows, because `^`
is the escape character. As a result, the command was equivalent to
`git log ... r1 r2` on Windows, which essentially logs all commits
reachable from either `r1` or `r2`.

This commit fixes it by switching to git's
[double-dot range notation][1] (`r1..r2`), which is an alias for the
`^r1 r2` syntax and works correctly on all platforms.

[1]: https://git-scm.com/docs/gitrevisions#_dotted_range_notations

Fixes 

PR Close 
2019-02-19 12:37:57 -08:00
George Kalpakas
ababc5b4a4 build: stop execution on error in validate-commit-message ()
Stop execution when an error happens in `validate-commit-message` gulp
task and ensure the error message is printed at the bottom.

Fixes 

PR Close 
2019-02-19 12:37:56 -08:00
Paul Gschwendtner
98e5af1480 build: switch example e2e tests to bazel ()
* No longer builds the example e2e tests using "tsc". The examples are now built with Bazel and can therefore be built with Ivy by using the `--define=compile=aot` switch.
* No longer runs the example e2e tests using the protractor CLI. example e2e tests are executed with the Bazel protractor rule and can therefore run incrementally.

NOTE: Unit tests found within the examples are still running within the legacy jobs.

PR Close 
2019-01-28 19:21:09 -08:00
Daniel Ruf
b9854e582f refactor: remove unused parameters ()
PR Close 
2019-01-23 10:58:37 -08:00
Paul Gschwendtner
7de7b7a16a ci: move e2e tests from travis to circleci ()
PR Close 
2019-01-07 15:35:09 -08:00
Igor Minar
fb6a31cbd6 build: exclude ivy commit messages from the release notes ()
there is still too much churn to make this info useful in the release notes, advanced
developers can use git log to find out what's going on with ivy.

PR Close 
2018-12-11 11:22:53 -08:00
Igor Minar
6740d0de74 build: remove obsolete gulp build task ()
PR Close 
2018-12-05 20:55:32 -08:00
Brandon Roberts
4d544bcb46 style: update gulp task to format untracked and diff files separately ()
PR Close 
2018-09-27 12:09:08 -07:00
Brandon Roberts
4c819f79b2 style: add combined task to format from git diff and status commands ()
PR Close 
2018-09-27 12:09:08 -07:00
Brandon Roberts
ac3252a73b style: add gulp task to only format changed files ()
Closes 

PR Close 
2018-09-27 12:09:08 -07:00
George Kalpakas
96ee898cee build: ignore aio/docs-infra commits in changelog gulp task ()
PR Close 
2018-09-18 13:21:26 -07:00
George Kalpakas
2c40a86b61 build: update conventional-changelog and simplify changelog gulp task ()
The version prefix issue has been fixed with
conventional-changelog/conventional-changelog#179.

PR Close 
2018-09-18 13:21:26 -07: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
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
Rafael
639d52fe71 refactor: ensure all 'TODO's are consistent ()
PR Close 
2018-04-13 13:11:01 -07:00
Olivier Combe
ce40e85cbb refactor(common): update CLDR data to v33.0.0 ()
PR Close 
2018-04-11 15:34:46 -07:00