Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package(default_visibility = ["//visibility:public"])
load("@build_bazel_rules_angular//:defs.bzl", "ng_module")
load("@angular//:index.bzl", "ng_module")
load("@nrwl//:webpack.bzl", "webpack_bundle")

ng_module(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package(default_visibility = ["//visibility:public"])
load("@build_bazel_rules_angular//:defs.bzl", "ng_module")
load("@angular//:index.bzl", "ng_module")

ng_module(
name = "module",
Expand Down
38 changes: 3 additions & 35 deletions src/schematics/workspace/files/BUILD.bazel__tmpl__
Original file line number Diff line number Diff line change
@@ -1,40 +1,8 @@
package(default_visibility = ["//visibility:public"])
exports_files(["tsconfig.json"])

load("@build_bazel_rules_angular//:defs.bzl", "ng_external_libraries")

# change to glob(["node_modules/**/*.js", "node_modules/**/*.json", "node_modules/**/*.d.ts"])
filegroup(name = "node_modules", srcs = glob([
# should not be whitelisted
"node_modules/@angular/**",
"node_modules/typescript/**",
"node_modules/zone.js/**",
"node_modules/rxjs/**/*.d.ts",
"node_modules/rxjs/**/*.js",
"node_modules/@types/**/*.d.ts",
"node_modules/tsickle/**",
"node_modules/hammerjs/**/*.d.ts",
"node_modules/protobufjs/**",
"node_modules/bytebuffer/**",
"node_modules/reflect-metadata/**",
"node_modules/minimist/**/*.js",
"node_modules/webpack/**"
"node_modules/**/*.json",
"node_modules/**/*.js",
"node_modules/**/*.d.ts",
], exclude=["node_modules/@angular/cli/**"]))

# this should go away soon when we do bootstrap codegen in the scripts.postinstall
ng_external_libraries(name = "ng_libs", srcs = glob([
"node_modules/@angular/**"
], exclude = [
"node_modules/@angular/cli/**",
"node_modules/@angular/platform-browser/animations*",
"node_modules/@angular/platform-browser/animations/**",
"node_modules/@angular/router*",
"node_modules/@angular/router/**",
]))

filegroup(
name= "init",
srcs = [
":ng_libs"
]
)
36 changes: 17 additions & 19 deletions src/schematics/workspace/files/WORKSPACE__tmpl__
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
name = "build_bazel_rules_typescript",
remote = "https://github.com/vsavkin/rules_typescript",
commit = "9a6c806",
)

git_repository(
name = "build_bazel_rules_angular",
remote = "https://github.com/alexeagle/rules_angular",
commit = "ce85fe6",
name = "build_bazel_rules_nodejs",
remote = "https://github.com/bazelbuild/rules_nodejs.git",
tag = "0.0.2",
)

git_repository(
name = "io_bazel_rules_sass",
remote = "https://github.com/bazelbuild/rules_sass.git",
tag = "0.0.2",
local_repository(
name = "build_bazel_rules_typescript",
path = "node_modules/@bazel/typescript",
)

git_repository(
name = "build_bazel_rules_nodejs",
remote = "https://github.com/alexeagle/rules_nodejs.git",
commit = "4924d7b",
local_repository(
name = "angular",
path = "node_modules/@angular/bazel",
)

local_repository(
name = "nrwl",
path = "node_modules/@nrwl/nx/bazel",
)

load("@build_bazel_rules_typescript//:defs.bzl", "node_repositories")
git_repository(
name = "io_bazel_rules_sass",
remote = "https://github.com/bazelbuild/rules_sass.git",
tag = "0.0.2",
)

load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories")
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_repositories")

node_repositories(package_json = "//:package.json")
node_repositories(package_json = ["//:package.json"])
sass_repositories()
23 changes: 23 additions & 0 deletions src/schematics/workspace/files/angular.tsconfig.json__tmpl__
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// WORKAROUND https://github.com/angular/angular/issues/18810
// This file is required to run ngc on angular libraries, to write files like
// node_modules/@angular/core/core.ngsummary.json
{
"compilerOptions": {
"lib": [
"dom",
"es2015"
],
"experimentalDecorators": true,
"types": []
},
"include": [
"node_modules/@angular/**/*"
],
"exclude": [
"node_modules/@angular/bazel/**",
"node_modules/@angular/compiler-cli/**",
// Workaround bug introduced by 079d884
"node_modules/@angular/common/i18n_data*",
"node_modules/@angular/tsc-wrapped/**"
]
}
26 changes: 14 additions & 12 deletions src/schematics/workspace/files/package.json__tmpl__
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,30 @@
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
"e2e": "ng e2e",
"postinstall": "ngc -p angular.tsconfig.json"
},
"private": true,
"dependencies": {
"@angular/animations": "4.3.0",
"@angular/common": "4.3.0",
"@angular/compiler": "4.3.0",
"@angular/core": "4.3.0",
"@angular/forms": "4.3.0",
"@angular/http": "4.3.0",
"@angular/platform-browser": "4.3.0",
"@angular/platform-browser-dynamic": "4.3.0",
"@angular/router": "4.3.0",
"@angular/animations": "angular/animations-builds",
"@angular/common": "angular/common-builds",
"@angular/compiler": "angular/compiler-builds",
"@angular/core": "angular/core-builds",
"@angular/forms": "angular/forms-builds",
"@angular/http": "angular/http-builds",
"@angular/platform-browser": "angular/platform-browser-builds",
"@angular/platform-browser-dynamic": "angular/platform-browser-dynamic-builds",
"@angular/router": "angular/router-builds",
"core-js": "^2.4.1",
"rxjs": "^5.4.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "https://github.com/nrwl/bazel-cli-build",
"@nrwl/nx": "https://github.com/nrwl/nx-build",
"@angular/compiler-cli": "4.3.0",
"@angular/language-service": "4.3.0",
"@angular/bazel": "angular/bazel-builds",
"@angular/compiler-cli": "angular/compiler-cli-builds",
"@angular/language-service": "angular/language-service-builds",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
Expand Down