PR Close #26488
This commit is contained in:
parent
30d6233e83
commit
631998b2df
|
@ -1 +1,2 @@
|
|||
node_modules
|
||||
dist
|
||||
|
|
24
BUILD.bazel
24
BUILD.bazel
|
@ -41,21 +41,17 @@ filegroup(
|
|||
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
|
||||
|
||||
# Override for ts_web_test_suite to use @ngdeps instead of @npm
|
||||
# A nodejs_binary for @angular/bazel/ngc-wrapped to use by default in
|
||||
# ng_module that depends on @npm//@angular/bazel instead of the
|
||||
# output of the //packages/bazel/src/ngc-wrapped ts_library rule. This
|
||||
# default is for downstream users that depend on the @angular/bazel npm
|
||||
# package. The generated @npm//@angular/bazel/ngc-wrapped target
|
||||
# does not work because it does not have the node `--expose-gc` flag
|
||||
# set which is required to support the call to `global.gc()`.
|
||||
nodejs_binary(
|
||||
name = "@bazel/karma/karma",
|
||||
data = ["@ngdeps//@bazel/karma"],
|
||||
entry_point = "@bazel/karma/karma.js",
|
||||
install_source_map_support = False,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
# Override for ts_library to use @ngdeps instead of @npm
|
||||
nodejs_binary(
|
||||
name = "@bazel/typescript/tsc_wrapped",
|
||||
data = ["@ngdeps//@bazel/typescript"],
|
||||
entry_point = "@bazel/typescript/tsc_wrapped/tsc_wrapped.js",
|
||||
name = "@angular/bazel/ngc-wrapped",
|
||||
data = ["@npm//@angular/bazel"],
|
||||
entry_point = "@angular/bazel/src/ngc-wrapped/index.js",
|
||||
install_source_map_support = False,
|
||||
templated_args = ["--node_options=--expose-gc"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -9,9 +9,11 @@ local_repository(
|
|||
path = "../..",
|
||||
)
|
||||
|
||||
local_repository(
|
||||
http_archive(
|
||||
name = "rxjs",
|
||||
path = "node_modules/rxjs/src",
|
||||
url = "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz",
|
||||
strip_prefix = "package/src",
|
||||
sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403",
|
||||
)
|
||||
|
||||
load("@angular//packages/bazel:package.bzl", "rules_angular_dependencies")
|
||||
|
@ -26,15 +28,14 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_reposi
|
|||
|
||||
check_bazel_version("0.17.0")
|
||||
node_repositories(
|
||||
package_json = ["//:package.json"],
|
||||
node_version = "10.9.0",
|
||||
yarn_version = "1.9.2",
|
||||
)
|
||||
|
||||
yarn_install(
|
||||
name = "npm",
|
||||
package_json = "//:package.json",
|
||||
yarn_lock = "//:yarn.lock",
|
||||
package_json = "//src:package.json",
|
||||
yarn_lock = "//src:yarn.lock",
|
||||
)
|
||||
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
|
||||
|
|
|
@ -4,23 +4,9 @@
|
|||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"reflect-metadata": "0.1.12",
|
||||
"rxjs": "6.0.0",
|
||||
"tslib": "1.9.3",
|
||||
"zone.js": "0.8.26"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@bazel/karma": "0.20.2",
|
||||
"@bazel/typescript": "0.20.2",
|
||||
"@types/jasmine": "2.8.8",
|
||||
"@types/source-map": "0.5.1",
|
||||
"protractor": "5.1.2",
|
||||
"shelljs": "^0.8.2",
|
||||
"tsickle": "0.32.0",
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"//": "TODO(gmagolan): figure out how to keep dependencies here up to date with the root package.json",
|
||||
"//": "deps are listed in src/package.json which is used by yarn_install",
|
||||
"test": "bazel build ... --noshow_progress && bazel test ..."
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "angular-bazel",
|
||||
"description": "example and integration test for building Angular apps with Bazel",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"reflect-metadata": "0.1.12",
|
||||
"rxjs": "6.3.3",
|
||||
"tslib": "1.9.3",
|
||||
"zone.js": "0.8.26"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/bazel": "file:../angular/dist/packages-dist/bazel",
|
||||
"@angular/compiler": "file:../angular/dist/packages-dist/compiler",
|
||||
"@angular/compiler-cli": "file:../angular/dist/packages-dist/compiler-cli",
|
||||
"@bazel/karma": "0.20.2",
|
||||
"@bazel/typescript": "0.20.2",
|
||||
"@types/jasmine": "2.8.8",
|
||||
"@types/source-map": "0.5.1",
|
||||
"protractor": "5.1.2",
|
||||
"tsickle": "0.32.0",
|
||||
"typescript": "3.1.1"
|
||||
},
|
||||
"scripts": {
|
||||
"//": "TODO(gregmagolan): figure out how to keep dependencies here up to date with the root package.json"
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -18,7 +18,7 @@ ts_library(
|
|||
srcs = ["on-prepare.ts"],
|
||||
tsconfig = ":tsconfig.json",
|
||||
deps = [
|
||||
"@angular//packages/bazel/src/protractor/utils",
|
||||
"@npm//@angular/bazel",
|
||||
"@npm//@types",
|
||||
"@npm//protractor",
|
||||
],
|
||||
|
@ -28,7 +28,7 @@ protractor_web_test_suite(
|
|||
name = "devserver_test",
|
||||
configuration = "//:protractor.conf.js",
|
||||
data = [
|
||||
"@angular//packages/bazel/src/protractor/utils",
|
||||
"@npm//@angular/bazel",
|
||||
"@npm//protractor",
|
||||
],
|
||||
on_prepare = ":ts_on_prepare",
|
||||
|
@ -40,7 +40,7 @@ protractor_web_test_suite(
|
|||
name = "prodserver_test",
|
||||
configuration = "//:protractor.conf.js",
|
||||
data = [
|
||||
"@angular//packages/bazel/src/protractor/utils",
|
||||
"@npm//@angular/bazel",
|
||||
"@npm//protractor",
|
||||
],
|
||||
on_prepare = ":ts_on_prepare",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -52,6 +52,10 @@ protractor_web_test(
|
|||
data = [
|
||||
"//packages/bazel/src/protractor/utils",
|
||||
"//packages/benchpress",
|
||||
"@ngdeps//node-uuid",
|
||||
"@ngdeps//protractor",
|
||||
"@ngdeps//reflect-metadata",
|
||||
"@ngdeps//yargs",
|
||||
],
|
||||
on_prepare = ":protractor.on-prepare.js",
|
||||
server = ":devserver",
|
||||
|
|
|
@ -113,7 +113,6 @@
|
|||
"mock-fs": "^4.5.0",
|
||||
"mutation-observer": "^1.0.3",
|
||||
"node-uuid": "1.4.8",
|
||||
"protobufjs": "5.0.0",
|
||||
"protractor": "5.1.2",
|
||||
"rewire": "2.5.2",
|
||||
"rollup": "0.47.4",
|
||||
|
|
|
@ -1,24 +1,20 @@
|
|||
load("//tools:defaults.bzl", "npm_package")
|
||||
|
||||
genrule(
|
||||
name = "workspace",
|
||||
outs = ["WORKSPACE"],
|
||||
cmd = "echo 'workspace(name=\"angular\")' > $@",
|
||||
)
|
||||
|
||||
npm_package(
|
||||
name = "npm_package",
|
||||
srcs = glob(["*.bzl"]) + [
|
||||
"BUILD.bazel",
|
||||
srcs = [
|
||||
"check_version.js",
|
||||
"package.json",
|
||||
"protractor-utils.js",
|
||||
"//packages/bazel/src:package_assets",
|
||||
],
|
||||
packages = ["//packages/bazel/docs"],
|
||||
# Re-host //packages/bazel/ which is just // in the public distro
|
||||
replacements = {
|
||||
"//packages/bazel/": "//",
|
||||
"angular/packages/bazel/": "angular/",
|
||||
},
|
||||
packages = [
|
||||
"//packages/bazel/docs",
|
||||
],
|
||||
tags = ["release-with-framework"],
|
||||
deps = [":workspace"],
|
||||
deps = [
|
||||
"//packages/bazel/src/ng_package:lib",
|
||||
"//packages/bazel/src/ngc-wrapped:ngc_lib",
|
||||
"//packages/bazel/src/protractor/utils",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
/**
|
||||
* @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
|
||||
*/
|
||||
/**
|
||||
* @fileoverview This script runs as a postinstall in the published npm packages
|
||||
* and checks that the version of the build_bazel_rules_typescript external
|
||||
* repository matches that of the published npm package.
|
||||
*
|
||||
* Note, this check is only performed with bazel managed deps when the yarn or
|
||||
* npm install is from a yarn_install or npm_install repository rule. For self
|
||||
* managed bazel deps this check is not performed and it is the responsibility
|
||||
* of the user to ensure that the versions match.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
// Version in package.bzl should match the npm package version
|
||||
// but this should be tolerant of development stamped versions such as
|
||||
// "0.17.0-7-g76dc057"
|
||||
const npmPackageVersion = process.env.npm_package_version.split('-')[0];
|
||||
|
||||
// If this is a bazel managed deps yarn_install or npm_install then the
|
||||
// cwd is $(bazel info
|
||||
// output_base)/external/<wksp>/node_modules/@angular/bazel and there should
|
||||
// be $(bazel info output_base)/external/<wksp>/internal/generate_build_file.js
|
||||
// folder
|
||||
function isBazelManagedDeps() {
|
||||
try {
|
||||
fs.statSync('../../../generate_build_file.js');
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isBazelManagedDeps()) {
|
||||
let contents;
|
||||
try {
|
||||
// If this is a yarn_install or npm_install then the cwd is $(bazel info
|
||||
// output_base)/external/<wksp>/node_modules/@angular/bazel so we can look for
|
||||
// the package.json file under $(bazel info
|
||||
// output_base)/external/angular/package.json
|
||||
const packagePath = path.resolve(process.cwd(), '../../../../angular/package.json');
|
||||
contents = require(packagePath);
|
||||
} catch (e) {
|
||||
throw new Error('The angular repository is not installed in your Bazel WORKSPACE file');
|
||||
}
|
||||
if (contents.name !== 'angular-srcs') {
|
||||
throw new Error('Invalid package.json in angular repository');
|
||||
}
|
||||
// Be tolerant of versions such as "0.17.0-7-g76dc057"
|
||||
const angularPackageVersion = contents.version.split('-')[0];
|
||||
if (npmPackageVersion !== angularPackageVersion) {
|
||||
// TODO: we might need to support a range here.
|
||||
// For example, if you end up with @angular/bazel@6.1.8 and
|
||||
// @angular/bazel@6.1.9 both installed one of the postinstalls is
|
||||
// guaranteed to fail since there's only one version of
|
||||
// angular
|
||||
throw new Error(`Expected angular repository to be version ${
|
||||
npmPackageVersion} but found ${angularPackageVersion}`);
|
||||
}
|
||||
} else {
|
||||
// No version check
|
||||
console.warn(`WARNING: With self managed deps you must ensure the @angular/bazel
|
||||
npm package version matches the angular repository version.
|
||||
Use yarn_install or npm_install for this version to be checked automatically.
|
||||
`);
|
||||
}
|
|
@ -4,10 +4,17 @@
|
|||
"description": "Angular - bazel build rules",
|
||||
"author": "angular",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"ngc-wrapped": "./src/ngc-wrapped/index.js",
|
||||
"packager": "./src/ng_package/packager.js",
|
||||
"xi18n": "./src/ngc-wrapped/extract_i18n.js",
|
||||
"modify_tsconfig": "./src/modify_tsconfig.js"
|
||||
},
|
||||
"typings": "./src/ngc-wrapped/index.d.ts",
|
||||
"dependencies": {
|
||||
"@bazel/typescript": "^0.15.0",
|
||||
"@bazel/typescript": "^0.19.1",
|
||||
"@types/node": "6.0.84",
|
||||
"protobufjs": "5.0.0"
|
||||
"tsickle": "0.28.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/compiler-cli": "0.0.0-PLACEHOLDER",
|
||||
|
@ -19,5 +26,8 @@
|
|||
},
|
||||
"ng-update": {
|
||||
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node ./check_version.js"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @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
|
||||
*/
|
||||
|
||||
module.exports = require('./src/protractor/utils');
|
|
@ -2,14 +2,13 @@ package(default_visibility = ["//visibility:public"])
|
|||
|
||||
filegroup(
|
||||
name = "package_assets",
|
||||
srcs = glob(["*"]) + [
|
||||
"//packages/bazel/src/ng_package:package_assets",
|
||||
"//packages/bazel/src/ngc-wrapped:package_assets",
|
||||
"//packages/bazel/src/protractor:package_assets",
|
||||
],
|
||||
srcs = ["modify_tsconfig.js"],
|
||||
visibility = ["//packages/bazel:__subpackages__"],
|
||||
)
|
||||
|
||||
# For generating skydoc
|
||||
exports_files(glob(["*.bzl"]))
|
||||
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
|
||||
|
||||
nodejs_binary(
|
||||
|
|
|
@ -16,6 +16,9 @@ load(
|
|||
)
|
||||
load("@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", "NodeModuleInfo", "collect_node_modules_aspect")
|
||||
|
||||
_DEFAULT_COMPILER = "@angular//:@angular/bazel/ngc-wrapped"
|
||||
_DEFAULT_NG_XI18N = "@npm//@angular/bazel/bin:xi18n"
|
||||
|
||||
def compile_strategy(ctx):
|
||||
"""Detect which strategy should be used to implement ng_module.
|
||||
|
||||
|
@ -358,7 +361,7 @@ def ngc_compile_action(
|
|||
ctx.actions.run(
|
||||
inputs = list(inputs),
|
||||
outputs = messages_out,
|
||||
executable = ctx.executable._ng_xi18n,
|
||||
executable = ctx.executable.ng_xi18n,
|
||||
arguments = (_EXTRA_NODE_OPTIONS_FLAGS +
|
||||
[tsconfig_file.path] +
|
||||
# The base path is bin_dir because of the way the ngc
|
||||
|
@ -521,12 +524,21 @@ NG_MODULE_ATTRIBUTES = {
|
|||
"inline_resources": attr.bool(default = True),
|
||||
"no_i18n": attr.bool(default = False),
|
||||
"compiler": attr.label(
|
||||
default = Label("//packages/bazel/src/ngc-wrapped"),
|
||||
doc = """Sets a different ngc compiler binary to use for this library.
|
||||
|
||||
The default ngc compiler depends on the `@npm//@angular/bazel`
|
||||
target which is setup for projects that use bazel managed npm deps that
|
||||
fetch the @angular/bazel npm package. It is recommended that you use
|
||||
the workspace name `@npm` for bazel managed deps so the default
|
||||
compiler works out of the box. Otherwise, you'll have to override
|
||||
the compiler attribute manually.
|
||||
""",
|
||||
default = Label(_DEFAULT_COMPILER),
|
||||
executable = True,
|
||||
cfg = "host",
|
||||
),
|
||||
"_ng_xi18n": attr.label(
|
||||
default = Label("//packages/bazel/src/ngc-wrapped:xi18n"),
|
||||
"ng_xi18n": attr.label(
|
||||
default = Label(_DEFAULT_NG_XI18N),
|
||||
executable = True,
|
||||
cfg = "host",
|
||||
),
|
||||
|
|
|
@ -1,20 +1,16 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
filegroup(
|
||||
name = "package_assets",
|
||||
srcs = glob(["*"]),
|
||||
visibility = ["//packages/bazel:__subpackages__"],
|
||||
)
|
||||
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
exports_files(["rollup.config.js"])
|
||||
exports_files([
|
||||
"rollup.config.js",
|
||||
"ng_package.bzl",
|
||||
])
|
||||
|
||||
ts_library(
|
||||
name = "lib",
|
||||
srcs = glob(["*.ts"]),
|
||||
compiler = "//:@bazel/typescript/tsc_wrapped",
|
||||
node_modules = "@angular_packager_deps//:node_modules",
|
||||
tsconfig = ":tsconfig.json",
|
||||
)
|
||||
|
|
|
@ -31,6 +31,8 @@ load("@build_bazel_rules_nodejs//:internal/node.bzl", "sources_aspect")
|
|||
load("@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", "NodeModuleInfo")
|
||||
load("//packages/bazel/src:esm5.bzl", "esm5_outputs_aspect", "esm5_root_dir", "flatten_esm5")
|
||||
|
||||
_DEFAULT_NG_PACKAGER = "@npm//@angular/bazel/bin:packager"
|
||||
|
||||
# Convert from some-dash-case to someCamelCase
|
||||
def _convert_dash_case_to_camel_case(s):
|
||||
parts = s.split("-")
|
||||
|
@ -341,7 +343,7 @@ def _ng_package_impl(ctx):
|
|||
mnemonic = "AngularPackage",
|
||||
inputs = packager_inputs,
|
||||
outputs = [npm_package_directory],
|
||||
executable = ctx.executable._ng_packager,
|
||||
executable = ctx.executable.ng_packager,
|
||||
arguments = [packager_args],
|
||||
)
|
||||
|
||||
|
@ -379,8 +381,8 @@ NG_PACKAGE_ATTRS = dict(NPM_PACKAGE_ATTRS, **dict(ROLLUP_ATTRS, **{
|
|||
"entry_point_name": attr.string(
|
||||
doc = "Name to use when generating bundle files for the primary entry-point.",
|
||||
),
|
||||
"_ng_packager": attr.label(
|
||||
default = Label("//packages/bazel/src/ng_package:packager"),
|
||||
"ng_packager": attr.label(
|
||||
default = Label(_DEFAULT_NG_PACKAGER),
|
||||
executable = True,
|
||||
cfg = "host",
|
||||
),
|
||||
|
|
|
@ -1,23 +1,19 @@
|
|||
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
filegroup(
|
||||
name = "package_assets",
|
||||
srcs = glob(["*"]),
|
||||
visibility = ["//packages/bazel:__subpackages__"],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
name = "ngc_lib",
|
||||
srcs = [
|
||||
"extract_i18n.ts",
|
||||
"index.ts",
|
||||
],
|
||||
compiler = "//:@bazel/typescript/tsc_wrapped",
|
||||
module_name = "@angular/bazel",
|
||||
node_modules = "@ngdeps//typescript:typescript__typings",
|
||||
tsconfig = ":tsconfig.json",
|
||||
visibility = ["//packages/bazel/test/ngc-wrapped:__subpackages__"],
|
||||
visibility = [
|
||||
"//packages/bazel:__pkg__",
|
||||
"//packages/bazel/test/ngc-wrapped:__subpackages__",
|
||||
],
|
||||
deps = [
|
||||
# BEGIN-INTERNAL
|
||||
# Only needed when compiling within the Angular repo.
|
||||
|
@ -47,6 +43,6 @@ nodejs_binary(
|
|||
data = [
|
||||
":ngc_lib",
|
||||
],
|
||||
entry_point = "angular/packages/bazel/src/ngc-wrapped/index.js/extract_i18n.js",
|
||||
entry_point = "angular/packages/bazel/src/ngc-wrapped/extract_i18n.js",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
filegroup(
|
||||
name = "package_assets",
|
||||
srcs = glob(["*"]) + [
|
||||
"//packages/bazel/src/protractor/utils:package_assets",
|
||||
],
|
||||
visibility = ["//packages/bazel:__subpackages__"],
|
||||
)
|
||||
|
||||
exports_files([
|
||||
"protractor.conf.js",
|
||||
"protractor_web_test.bzl",
|
||||
])
|
||||
|
|
|
@ -1,17 +1,10 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
filegroup(
|
||||
name = "package_assets",
|
||||
srcs = glob(["*"]),
|
||||
visibility = ["//packages/bazel:__subpackages__"],
|
||||
)
|
||||
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
ts_library(
|
||||
name = "utils",
|
||||
srcs = ["index.ts"],
|
||||
compiler = "//:@bazel/typescript/tsc_wrapped",
|
||||
module_name = "@angular/bazel/protractor-utils",
|
||||
node_modules = "@ngdeps//typescript:typescript__typings",
|
||||
tsconfig = ":tsconfig.json",
|
||||
|
|
|
@ -3,9 +3,11 @@ load("//packages/bazel:index.bzl", "ng_module")
|
|||
ng_module(
|
||||
name = "test_module",
|
||||
srcs = glob(["*.ts"]),
|
||||
compiler = "//packages/bazel/src/ngc-wrapped",
|
||||
entry_point = "index.ts",
|
||||
flat_module_out_file = "flat_module_filename",
|
||||
module_name = "some_npm_module",
|
||||
ng_xi18n = "//packages/bazel/src/ngc-wrapped:xi18n",
|
||||
node_modules = "@ngdeps//typescript:typescript__typings",
|
||||
deps = [
|
||||
"//packages/core",
|
||||
|
|
|
@ -6,11 +6,12 @@ load("//packages/bazel:index.bzl", _ng_module = "ng_module", _ng_package = "ng_p
|
|||
load("//packages/bazel/src:ng_module.bzl", _internal_global_ng_module = "internal_global_ng_module")
|
||||
load("//packages/bazel/src:ng_rollup_bundle.bzl", _ng_rollup_bundle = "ng_rollup_bundle")
|
||||
|
||||
DEFAULT_TSCONFIG_BUILD = "//packages:tsconfig-build.json"
|
||||
DEFAULT_TSCONFIG_TEST = "//packages:tsconfig-test.json"
|
||||
DEFAULT_COMPILER_BIN = "//:@bazel/typescript/tsc_wrapped"
|
||||
DEFAULT_TS_TYPINGS = "@ngdeps//typescript:typescript__typings"
|
||||
DEFAULT_KARMA_BIN = "//:@bazel/karma/karma"
|
||||
_DEFAULT_TSCONFIG_BUILD = "//packages:tsconfig-build.json"
|
||||
_DEFAULT_TSCONFIG_TEST = "//packages:tsconfig-test.json"
|
||||
_DEFAULT_TS_TYPINGS = "@ngdeps//typescript:typescript__typings"
|
||||
_INTERNAL_NG_MODULE_COMPILER = "//packages/bazel/src/ngc-wrapped"
|
||||
_INTERNAL_NG_MODULE_XI18N = "//packages/bazel/src/ngc-wrapped:xi18n"
|
||||
_INTERNAL_NG_PACKAGER_PACKAGER = "//packages/bazel/src/ng_package:packager"
|
||||
|
||||
# Packages which are versioned together on npm
|
||||
ANGULAR_SCOPED_PACKAGES = ["@angular/%s" % p for p in [
|
||||
|
@ -52,15 +53,14 @@ def ts_library(tsconfig = None, testonly = False, deps = [], **kwargs):
|
|||
deps.append("@ngdeps//@types/node")
|
||||
if not tsconfig:
|
||||
if testonly:
|
||||
tsconfig = DEFAULT_TSCONFIG_TEST
|
||||
tsconfig = _DEFAULT_TSCONFIG_TEST
|
||||
else:
|
||||
tsconfig = DEFAULT_TSCONFIG_BUILD
|
||||
tsconfig = _DEFAULT_TSCONFIG_BUILD
|
||||
_ts_library(
|
||||
tsconfig = tsconfig,
|
||||
testonly = testonly,
|
||||
deps = deps,
|
||||
compiler = DEFAULT_COMPILER_BIN,
|
||||
node_modules = DEFAULT_TS_TYPINGS,
|
||||
node_modules = _DEFAULT_TS_TYPINGS,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
|
@ -73,9 +73,9 @@ def ng_module(name, tsconfig = None, entry_point = None, testonly = False, deps
|
|||
deps.append("@ngdeps//@types/node")
|
||||
if not tsconfig:
|
||||
if testonly:
|
||||
tsconfig = DEFAULT_TSCONFIG_TEST
|
||||
tsconfig = _DEFAULT_TSCONFIG_TEST
|
||||
else:
|
||||
tsconfig = DEFAULT_TSCONFIG_BUILD
|
||||
tsconfig = _DEFAULT_TSCONFIG_BUILD
|
||||
if not entry_point:
|
||||
entry_point = "public_api.ts"
|
||||
_ng_module(
|
||||
|
@ -85,7 +85,9 @@ def ng_module(name, tsconfig = None, entry_point = None, testonly = False, deps
|
|||
entry_point = entry_point,
|
||||
testonly = testonly,
|
||||
deps = deps,
|
||||
node_modules = DEFAULT_TS_TYPINGS,
|
||||
compiler = _INTERNAL_NG_MODULE_COMPILER,
|
||||
ng_xi18n = _INTERNAL_NG_MODULE_XI18N,
|
||||
node_modules = _DEFAULT_TS_TYPINGS,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
|
@ -101,9 +103,9 @@ def ivy_ng_module(name, tsconfig = None, entry_point = None, testonly = False, d
|
|||
deps.append("@ngdeps//@types/node")
|
||||
if not tsconfig:
|
||||
if testonly:
|
||||
tsconfig = DEFAULT_TSCONFIG_TEST
|
||||
tsconfig = _DEFAULT_TSCONFIG_TEST
|
||||
else:
|
||||
tsconfig = DEFAULT_TSCONFIG_BUILD
|
||||
tsconfig = _DEFAULT_TSCONFIG_BUILD
|
||||
if not entry_point:
|
||||
entry_point = "public_api.ts"
|
||||
_internal_global_ng_module(
|
||||
|
@ -113,7 +115,9 @@ def ivy_ng_module(name, tsconfig = None, entry_point = None, testonly = False, d
|
|||
entry_point = entry_point,
|
||||
testonly = testonly,
|
||||
deps = deps,
|
||||
node_modules = DEFAULT_TS_TYPINGS,
|
||||
compiler = _INTERNAL_NG_MODULE_COMPILER,
|
||||
ng_xi18n = _INTERNAL_NG_MODULE_XI18N,
|
||||
node_modules = _DEFAULT_TS_TYPINGS,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
|
@ -133,6 +137,7 @@ def ng_package(name, readme_md = None, license_banner = None, deps = [], **kwarg
|
|||
readme_md = readme_md,
|
||||
license_banner = license_banner,
|
||||
replacements = PKG_GROUP_REPLACEMENTS,
|
||||
ng_packager = _INTERNAL_NG_PACKAGER_PACKAGER,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
|
@ -167,7 +172,6 @@ def ts_web_test_suite(bootstrap = [], deps = [], **kwargs):
|
|||
# "@io_bazel_rules_webtesting//browsers:firefox-local",
|
||||
# TODO(alexeagle): add remote browsers on SauceLabs
|
||||
],
|
||||
karma = DEFAULT_KARMA_BIN,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
{
|
||||
"description": "minimal @npm repo",
|
||||
"description": "minimal @npm repo required to build @rxjs from source and so that @npm//@angular/bazel is a valid target",
|
||||
"dependencies": {
|
||||
"@angular/bazel": "6.1.9",
|
||||
"@angular/compiler": "6.1.9",
|
||||
"@angular/compiler-cli": "6.1.9",
|
||||
"@bazel/karma": "0.20.2",
|
||||
"@bazel/typescript": "0.20.2",
|
||||
"typescript": "~3.1.1"
|
||||
},
|
||||
"scripts": {
|
||||
"//": "TODO(gmagolan): figure out how to keep dependencies here up to date with the root package.json"
|
||||
"//": "TODO(gregmagolan): figure out how to keep @bazel/karma & @bazel/typescript dependencies here up to date with the root package.json; NOTE: versions of @angular/x don't matter here as they are only require to create the @npm//@angular/bazel target name"
|
||||
}
|
||||
}
|
|
@ -2,6 +2,29 @@
|
|||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@angular/bazel@6.1.9":
|
||||
version "6.1.9"
|
||||
resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-6.1.9.tgz#71a236809c8e059e09489a2f82bf7cfb51df54e8"
|
||||
dependencies:
|
||||
"@bazel/typescript" "^0.15.0"
|
||||
"@types/node" "6.0.84"
|
||||
protobufjs "5.0.0"
|
||||
|
||||
"@angular/compiler-cli@6.1.9":
|
||||
version "6.1.9"
|
||||
resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-6.1.9.tgz#9ac56fc3ea274c897ccbb3c3fe0aaa100c01137d"
|
||||
dependencies:
|
||||
chokidar "^1.4.2"
|
||||
minimist "^1.2.0"
|
||||
reflect-metadata "^0.1.2"
|
||||
tsickle "^0.32.1"
|
||||
|
||||
"@angular/compiler@6.1.9":
|
||||
version "6.1.9"
|
||||
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-6.1.9.tgz#3696659f752b5e239f5186cea72cf17965b59cb8"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@bazel/karma@0.20.2":
|
||||
version "0.20.2"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-0.20.2.tgz#69b440e320eadce2b4c7de922f87c5fc539b6586"
|
||||
|
@ -26,6 +49,18 @@
|
|||
tsickle "0.28.0"
|
||||
tsutils "2.27.2"
|
||||
|
||||
"@bazel/typescript@^0.15.0":
|
||||
version "0.15.3"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.15.3.tgz#5c32b3bf664b268f9ffb634b86f40004a50e7ef9"
|
||||
dependencies:
|
||||
protobufjs "5.0.0"
|
||||
tsickle "0.25.x"
|
||||
tsutils "2.20.0"
|
||||
|
||||
"@types/node@6.0.84":
|
||||
version "6.0.84"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.84.tgz#193ffe5a9f42864d425ffd9739d95b753c6a1eab"
|
||||
|
||||
abbrev@1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
|
||||
|
@ -477,7 +512,7 @@ chalk@^1.1.1:
|
|||
strip-ansi "^3.0.0"
|
||||
supports-color "^2.0.0"
|
||||
|
||||
chokidar@^1.4.1:
|
||||
chokidar@^1.4.1, chokidar@^1.4.2:
|
||||
version "1.7.0"
|
||||
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468"
|
||||
dependencies:
|
||||
|
@ -744,6 +779,10 @@ di@^0.0.1:
|
|||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c"
|
||||
|
||||
diff@^3.2.0:
|
||||
version "3.5.0"
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
|
||||
|
||||
dom-serialize@^2.2.0:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b"
|
||||
|
@ -1586,6 +1625,12 @@ jasmine-core@2.8.0:
|
|||
version "2.8.0"
|
||||
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e"
|
||||
|
||||
jasmine-diff@^0.1.3:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/jasmine-diff/-/jasmine-diff-0.1.3.tgz#93ccc2dcc41028c5ddd4606558074839f2deeaa8"
|
||||
dependencies:
|
||||
diff "^3.2.0"
|
||||
|
||||
jsbn@~0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
|
||||
|
@ -1649,7 +1694,7 @@ karma-sourcemap-loader@0.3.7:
|
|||
dependencies:
|
||||
graceful-fs "^4.1.2"
|
||||
|
||||
"karma@github:alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a":
|
||||
karma@alexeagle/karma#fa1a84ac881485b5657cb669e9b4e5da77b79f0a:
|
||||
version "1.7.1"
|
||||
resolved "https://codeload.github.com/alexeagle/karma/tar.gz/fa1a84ac881485b5657cb669e9b4e5da77b79f0a"
|
||||
dependencies:
|
||||
|
@ -2412,6 +2457,10 @@ redis@^2.7.1:
|
|||
redis-commands "^1.2.0"
|
||||
redis-parser "^2.6.0"
|
||||
|
||||
reflect-metadata@^0.1.2:
|
||||
version "0.1.12"
|
||||
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.12.tgz#311bf0c6b63cd782f228a81abe146a2bfa9c56f2"
|
||||
|
||||
regex-cache@^0.4.2:
|
||||
version "0.4.4"
|
||||
resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd"
|
||||
|
@ -2757,6 +2806,12 @@ source-map-support@0.5.9, source-map-support@^0.5.0:
|
|||
buffer-from "^1.0.0"
|
||||
source-map "^0.6.0"
|
||||
|
||||
source-map-support@^0.4.2:
|
||||
version "0.4.18"
|
||||
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f"
|
||||
dependencies:
|
||||
source-map "^0.5.6"
|
||||
|
||||
source-map-url@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3"
|
||||
|
@ -2944,6 +2999,15 @@ tough-cookie@~2.4.3:
|
|||
psl "^1.1.24"
|
||||
punycode "^1.4.1"
|
||||
|
||||
tsickle@0.25.x:
|
||||
version "0.25.6"
|
||||
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.25.6.tgz#b595db16b236721824eeeda8bb262365b47ef334"
|
||||
dependencies:
|
||||
minimist "^1.2.0"
|
||||
mkdirp "^0.5.1"
|
||||
source-map "^0.5.6"
|
||||
source-map-support "^0.4.2"
|
||||
|
||||
tsickle@0.28.0:
|
||||
version "0.28.0"
|
||||
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.28.0.tgz#6cd6fa004766c6ad9261b599c83866ee97cc7875"
|
||||
|
@ -2953,7 +3017,17 @@ tsickle@0.28.0:
|
|||
source-map "^0.6.0"
|
||||
source-map-support "^0.5.0"
|
||||
|
||||
tslib@^1.8.1:
|
||||
tsickle@^0.32.1:
|
||||
version "0.32.1"
|
||||
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.32.1.tgz#f16e94ba80b32fc9ebe320dc94fbc2ca7f3521a5"
|
||||
dependencies:
|
||||
jasmine-diff "^0.1.3"
|
||||
minimist "^1.2.0"
|
||||
mkdirp "^0.5.1"
|
||||
source-map "^0.6.0"
|
||||
source-map-support "^0.5.0"
|
||||
|
||||
tslib@^1.8.1, tslib@^1.9.0:
|
||||
version "1.9.3"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
|
||||
|
||||
|
@ -2961,6 +3035,12 @@ tsscmp@~1.0.0:
|
|||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb"
|
||||
|
||||
tsutils@2.20.0:
|
||||
version "2.20.0"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.20.0.tgz#303394064bc80be8ee04e10b8609ae852e9312d3"
|
||||
dependencies:
|
||||
tslib "^1.8.1"
|
||||
|
||||
tsutils@2.27.2:
|
||||
version "2.27.2"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7"
|
||||
|
|
|
@ -12,7 +12,6 @@ exports_files(["bin/ts-api-guardian"])
|
|||
ts_library(
|
||||
name = "lib",
|
||||
srcs = glob(["lib/*.ts"]),
|
||||
compiler = "//:@bazel/typescript/tsc_wrapped",
|
||||
module_name = "ts-api-guardian",
|
||||
node_modules = "@ts-api-guardian_runtime_deps//:node_modules",
|
||||
tsconfig = "//tools:tsconfig.json",
|
||||
|
@ -48,7 +47,6 @@ ts_library(
|
|||
name = "test_lib",
|
||||
testonly = True,
|
||||
srcs = glob(["test/*.ts"]),
|
||||
compiler = "//:@bazel/typescript/tsc_wrapped",
|
||||
node_modules = "@ngdeps//typescript:typescript__typings",
|
||||
tsconfig = "//tools:tsconfig-test",
|
||||
deps = [
|
||||
|
|
Loading…
Reference in New Issue