Commit Graph

10 Commits

Author SHA1 Message Date
George Kalpakas 9746751603 build(zone.js): use `npm_package.pack` to build the Zone.js package (#40592)
Previously, we could not use `npm_package.pack` for building the Zone.js
package due to a bug in Windows. This bug has been fixed in version
2.3.0 of `bazelbuild/rules_nodejs`.

Now that we have updated `bazelbuild/rules_nodejs` to version 2.3.3
(in #40581) we can replace `npm pack` with `npm_package.pack`.

PR Close #40592
2021-01-28 09:01:57 -08:00
George Kalpakas 6724b9e755 build(zone.js): do not error when build `zone.js` on Windows (#40557)
In older versions of `bazelbuild/rules_nodejs`, the `npm_package.pack`
rule does not work on Windows. This has been fixed in
bazelbuild/rules_nodejs#2257, but the fix is not available before
[version 2.3.0][1].

Currently, we use version 2.2.0 (see [WORKSPACE][2]). In order to allow
the `zone-js-builder.js` script to work on Windows, this commit switches
to using `npm pack` directly, intead of relying on `npm_package.pack`.

For reference, the version of `bazelbuild/rules_nodejs` was updated to
2.3.2 in PR #39636, but this was later reverted due to CI flakes
(4e6d69cc85).

[1]: https://github.com/bazelbuild/rules_nodejs/releases/tag/2.3.0
[2]: fc64fa8e1a/WORKSPACE (L12)

PR Close #40557
2021-01-26 10:51:15 -08:00
JiaLiPassion 35a1975697 build: update to use npm_package.pack rule (#39636)
Remove the work around solution for the `npm pack`, we can now
use `npm_package.pack` rule of bazel, since the windows os issue
has been fixed here https://github.com/bazelbuild/rules_nodejs/commit/bc36519

PR Close #39636
2020-12-14 11:29:33 -08:00
Misko Hevery 73e15bd78f Revert "build: update to use npm_package.pack rule (#39636)"
This reverts commit fbfc7dff48.
2020-12-08 11:06:17 -08:00
JiaLiPassion fbfc7dff48 build: update to use npm_package.pack rule (#39636)
Remove the work around solution for the `npm pack`, we can now
use `npm_package.pack` rule of bazel, since the windows os issue
has been fixed here https://github.com/bazelbuild/rules_nodejs/commit/bc36519

PR Close #39636
2020-12-08 09:15:49 -08:00
George Kalpakas 5be0dfdf27 build: ensure script that build the Zone.js package can be run from any directory (#39455)
The scripts that build the Angular and Zone.js NPM packages rely on
absolute paths in order to work correctly regardless of what the current
working directory is when the scripts are invoked. However, the
`npm pack` command executed in the `zone-js-builder.js` script outputs
the generated `.tgz` archive in the current working directory. This
causes the script to fail when invoked for any working directory other
than the project root directory.

This commit fixes this by ensuring the `npm pack` command is run with
the project root directory as the working directory. This allows the
build scripts to run correctly regardless of the working directory they
are invoked from.

PR Close #39455
2020-10-27 13:35:37 -07:00
JiaLiPassion d37939623f test(zone.js): test zone.js package with tgz (#38649)
Zone.js 0.11.0 release an empty bundle, and now the npm_package tests all target
bazel rule `npm_package`, but not `npm_package.pack`, and these two rules may
generate different results, for example, Zone.js 0.11.0's issue is `package.json`
define files array which make the bundle only include the files in the files array.
So this PR install the zone.js package from the archive generated from `npm_package.pack` rule.

PR Close #38649
2020-10-19 08:06:11 -07:00
Joey Perrott d1ea1f4c7f build: update license headers to reference Google LLC (#37205)
Update the license headers throughout the repository to reference Google LLC
rather than Google Inc, for the required license headers.

PR Close #37205
2020-05-26 14:26:58 -04:00
George Kalpakas 82a6fc5ef9 build(docs-infra): use local version of Zone.js when testing against local packages (#35858)
In some cases, we want to test the AIO app or docs examples against the
locally built Angular packages (for example to ensure that the changes
in a commit do not introduce a breaking change). In order to achieve
this, we have the `ng-packages-installer` script that handles updating
a project's `package.json` file to use the locally built Angular
packages (and appropriate versions for their (dev-/peer-)dependencies).

Previously, `ng-packages-installer` would only consider the locally
built Angular packages (from `dist/packages-dist/`). However, given that
Zone.js is now part of the `angular/angular` repo, it makes sense to
also use the locally built Zone.js package (from `dist/zone.js-dist/`).
Otherwise, the tests might fail for commits that update both the Angular
packages (and related docs examples) and the Zone.js package. An example
of such a simultaneous change (that would have broken tests) is #33838.

This commit updates the script to install the locally built Zone.js
package (in addition to the Angular ones). The commit ensures that the
Zone.js package will always be available alongside the Angular packages
(i.e. that the Zone.js package will be built by the same script that
builds the Angular packages and that the `dist/zone.js-dist/` directory
will be cached on CI).

Note: This problem was discovered while enabling docs examples unit
tests in #34374.

PR Close #35858
2020-03-06 17:30:20 -05:00
George Kalpakas 3f88de9407 build: move build scripts to dedicated directory (#35780)
This commit moves the build-related scripts
(`build-ivy-npm-packages.js`, `build-packages-dist.js` and
`package-builder.js`) to a dedicated directory to keep the `scripts/`
directory cleaner.

It also moves the logic for building the `zone.js` package to a separate
script, `zone-js-builder.js`, to make it re-usable. A subsequent commit
will use it to build the `zone.js` package when building the Ivy Angular
packages as well.

PR Close #35780
2020-03-04 08:35:26 -08:00