feat(bazel): add an ng_package rule (#22221)

This produces a directory following the Angular Package layout spec.

Includes integration test coverage by making a minimal ng_package in integration/bazel.
Unit tests verify the content of the @angular/core and @angular/common packages.

This doesn't totally match our current output, but is good enough to unblock some
early adopters.

It re-uses logic from the rollup_bundle rule in rules_nodejs. It should also
eventually have the .pack and .publish secondary targets like npm_package rule.

PR Close #22221
This commit is contained in:
Alex Eagle
2018-02-13 11:26:06 -08:00
committed by Victor Berchet
parent 1dcbc12fd3
commit b43b164a61
23 changed files with 1101 additions and 61 deletions

View File

@ -1,6 +1,6 @@
package(default_visibility = ["//visibility:public"])
load("@angular//:index.bzl", "ng_module")
load("@angular//:index.bzl", "ng_module", "ng_package")
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_binary")
sass_binary(
@ -17,3 +17,9 @@ ng_module(
# npm distro of angular there is no ts_library rule to propagate the dep.
deps = ["@rxjs"],
)
ng_package(
name = "npm_package",
entry_point = "src/hello-world/index.js",
deps = [":hello-world"],
)

View File

@ -0,0 +1,2 @@
export * from './hello-world.component';
export * from './hello-world.module';