diff --git a/packages/elements/BUILD.bazel b/packages/elements/BUILD.bazel index ab4f29cde0..03c35cdd47 100644 --- a/packages/elements/BUILD.bazel +++ b/packages/elements/BUILD.bazel @@ -25,6 +25,9 @@ ng_package( "**/package.json", ]), entry_point = "packages/elements/index.js", + packages = [ + "//packages/elements/schematics:npm_package", + ], tags = ["release-with-framework"], deps = [ ":elements", diff --git a/packages/elements/schematics/BUILD.bazel b/packages/elements/schematics/BUILD.bazel index d37f40b269..f95ea9c95a 100644 --- a/packages/elements/schematics/BUILD.bazel +++ b/packages/elements/schematics/BUILD.bazel @@ -1,6 +1,6 @@ package(default_visibility = ["//visibility:public"]) -load("//tools:defaults.bzl", "ts_library") +load("//tools:defaults.bzl", "ts_library", "npm_package") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") exports_files([ @@ -8,47 +8,6 @@ exports_files([ "collection.json", ]) -ts_library( - name = "schematics", - srcs = glob( - [ - "ng-add/index.ts", - "ng-add/schema.d.ts", - ], - ), - module_name = "@angular/elements/schematics", - deps = [ - "//packages/common", - "//packages/core", - "@rxjs", - ], -) - -ts_library( - name = "test_lib", - testonly = 1, - srcs = glob( - [ - "ng-add/index_spec.ts", - ], - ), - deps = [ - ":schematics", - "//packages/common", - "//packages/core", - "@rxjs", - "@rxjs//operators", - ], -) - -jasmine_node_test( - name = "test", - data = [":collection"], - deps = [ - ":test_lib", - ], -) - genrule( name = "collection", srcs = ["collection.json"], @@ -56,3 +15,13 @@ genrule( cmd = "cp $< $@", output_to_bindir = 1, ) + +npm_package( + name = "npm_package", + srcs = [ + "collection.json", + ], + deps = [ + "//packages/elements/schematics/ng-add", + ], +) diff --git a/packages/elements/schematics/ng-add/BUILD.bazel b/packages/elements/schematics/ng-add/BUILD.bazel new file mode 100644 index 0000000000..432f02e661 --- /dev/null +++ b/packages/elements/schematics/ng-add/BUILD.bazel @@ -0,0 +1,46 @@ +package(default_visibility = ["//visibility:public"]) + +load("//tools:defaults.bzl", "ts_library", "npm_package") +load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test") + +ts_library( + name = "ng-add", + srcs = glob( + [ + "index.ts", + "schema.ts", + ], + ), + deps = [ + "//packages/common", + "//packages/core", + "@rxjs", + ], +) + +ts_library( + name = "test_lib", + testonly = 1, + srcs = glob( + [ + "index_spec.ts", + ], + ), + deps = [ + ":ng-add", + "//packages/common", + "//packages/core", + "@rxjs", + "@rxjs//operators", + ], +) + +jasmine_node_test( + name = "test", + data = [ + "//packages/elements/schematics:collection.json", + ], + deps = [ + ":test_lib", + ], +) diff --git a/packages/elements/schematics/ng-add/schema.d.ts b/packages/elements/schematics/ng-add/schema.d.ts deleted file mode 100644 index 224492cbb4..0000000000 --- a/packages/elements/schematics/ng-add/schema.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface Schema { - /** - * Skip package.json install. - */ - skipPackageJson: boolean; - - /** - * The project that needs the polyfill scripts - */ - project: name; -} diff --git a/packages/elements/schematics/ng-add/schema.ts b/packages/elements/schematics/ng-add/schema.ts new file mode 100644 index 0000000000..845cd6ca03 --- /dev/null +++ b/packages/elements/schematics/ng-add/schema.ts @@ -0,0 +1,19 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +export interface Schema { + /** + * Skip package.json install. + */ + skipPackageJson: boolean; + + /** + * The project that needs the polyfill scripts + */ + project: string; +}