Skip to content

Commit

Permalink
build: update bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
timdeschryver committed Nov 9, 2019
1 parent c1be563 commit f51f623
Show file tree
Hide file tree
Showing 13 changed files with 196 additions and 84 deletions.
33 changes: 24 additions & 9 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,41 @@ workspace(name = "ngrx")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Rules for NodeJS
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "abcf497e89cfc1d09132adfcd8c07526d026e162ae2cb681dcb896046417ce91",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.30.1/rules_nodejs-0.30.1.tar.gz"],
sha256 = "3d7296d834208792fa3b2ded8ec04e75068e3de172fae79db217615bd75a6ff7",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.39.1/rules_nodejs-0.39.1.tar.gz"],
)

# Rules for web testing
http_archive(
name = "io_bazel_rules_webtesting",
sha256 = "1c0900547bdbe33d22aa258637dc560ce6042230e41e9ea9dad5d7d2fca8bc42",
urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.0/rules_webtesting.tar.gz"],
sha256 = "f1f4d2c2f88d2beac64c82499a1e762b037966675dd892da89c87e39d72b33f6",
urls = [
"https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.2/rules_webtesting.tar.gz",
],
)

# Rules for compiling sass
http_archive(
name = "io_bazel_rules_sass",
sha256 = "d8b89e47b05092a6eed3fa199f2de7cf671a4b9165d0bf38f12a0363dda928d3",
strip_prefix = "rules_sass-1.14.1",
url = "https://github.com/bazelbuild/rules_sass/archive/1.14.1.zip",
sha256 = "ad08e8c82aa1f48b72dc295cb83bba33f514cdf24cc7b0e21e9353f20f0dc147",
strip_prefix = "rules_sass-5d1b26f8cd12c5d75dd359f9291090b341e8fd52",
# We need to use a version that includes SHA 5d1b26f8cd12c5d75dd359f9291090b341e8fd52 of
# the "rules_sass" repository as it adds support for workers.
url = "https://github.com/bazelbuild/rules_sass/archive/5d1b26f8cd12c5d75dd359f9291090b341e8fd52.zip",
)

####################################
# Load and install our dependencies downloaded above.

load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "yarn_install")

check_bazel_version(minimum_bazel_version = "0.26.0")
check_bazel_version(
message = "The minimum bazel version to use with this repo is 1.0.0",
minimum_bazel_version = "1.0.0",
)

yarn_install(
name = "npm",
Expand All @@ -43,23 +52,29 @@ yarn_install(
yarn_lock = "//:yarn.lock",
)

# Install all bazel dependencies of the @ngdeps npm packages
load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")

install_bazel_dependencies()

load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories")
# Setup web testing
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")

web_test_repositories()

load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")

browser_repositories(
chromium = True,
firefox = True,
)

# Setup TypeScript Bazel workspace
load("@npm_bazel_typescript//:index.bzl", "ts_setup_workspace")

ts_setup_workspace()

# Setup the Sass rule repositories
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")

sass_repositories()
1 change: 1 addition & 0 deletions modules/data/schematics-core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ts_library(
deps = [
"@npm//@angular-devkit/core",
"@npm//@angular-devkit/schematics",
"@npm//tslib",
"@npm//typescript",
],
)
Expand Down
4 changes: 2 additions & 2 deletions modules/data/src/effects/entity-effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class EntityEffects {
case EntityOp.SAVE_UPDATE_ONE:
const { id, changes } = data as Update<any>; // data must be Update<T>
return service.update(data).pipe(
map(updatedEntity => {
map((updatedEntity: any) => {
// Return an Update<T> with updated entity data.
// If server returned entity data, merge with the changes that were sent
// and set the 'changed' flag to true.
Expand All @@ -148,7 +148,7 @@ export class EntityEffects {

case EntityOp.SAVE_UPSERT_ONE:
return service.upsert(data).pipe(
map(upsertedEntity => {
map((upsertedEntity: any) => {
const hasData =
upsertedEntity && Object.keys(upsertedEntity).length > 0;
return hasData ? upsertedEntity : data; // ensure a returned entity value.
Expand Down
1 change: 1 addition & 0 deletions modules/effects/schematics-core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ts_library(
deps = [
"@npm//@angular-devkit/core",
"@npm//@angular-devkit/schematics",
"@npm//tslib",
"@npm//typescript",
],
)
Expand Down
1 change: 1 addition & 0 deletions modules/entity/schematics-core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ts_library(
deps = [
"@npm//@angular-devkit/core",
"@npm//@angular-devkit/schematics",
"@npm//tslib",
"@npm//typescript",
],
)
Expand Down
1 change: 1 addition & 0 deletions modules/router-store/schematics-core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ts_library(
deps = [
"@npm//@angular-devkit/core",
"@npm//@angular-devkit/schematics",
"@npm//tslib",
"@npm//typescript",
],
)
Expand Down
1 change: 1 addition & 0 deletions modules/schematics-core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ts_library(
"@npm//@angular-devkit/core",
"@npm//@angular-devkit/schematics",
"@npm//rxjs",
"@npm//tslib",
"@npm//typescript",
],
)
1 change: 1 addition & 0 deletions modules/schematics/schematics-core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ts_library(
deps = [
"@npm//@angular-devkit/core",
"@npm//@angular-devkit/schematics",
"@npm//tslib",
"@npm//typescript",
],
)
Expand Down
6 changes: 5 additions & 1 deletion modules/schematics/src/ng-add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ import {
} from '../../schematics-core/utility/config';
import { Schema as SchematicOptions } from './schema';

function updateWorkspace(host: Tree, key: keyof WorkspaceSchema, value: any) {
function updateWorkspace<K extends keyof WorkspaceSchema>(
host: Tree,
key: K,
value: any
) {
const workspace = getWorkspace(host);
const path = getWorkspacePath(host);
workspace[key] = value;
Expand Down
1 change: 1 addition & 0 deletions modules/store-devtools/schematics-core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ts_library(
deps = [
"@npm//@angular-devkit/core",
"@npm//@angular-devkit/schematics",
"@npm//tslib",
"@npm//typescript",
],
)
Expand Down
1 change: 1 addition & 0 deletions modules/store/schematics-core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ts_library(
deps = [
"@npm//@angular-devkit/core",
"@npm//@angular-devkit/schematics",
"@npm//tslib",
"@npm//typescript",
],
)
Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"@angular/platform-server": "^9.0.0-rc.0",
"@angular/router": "^9.0.0-rc.0",
"@applitools/eyes-cypress": "^3.4.12",
"@bazel/buildifier": "^0.22.0",
"@bazel/buildifier": "^0.29.0",
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"opencollective": "^1.0.3",
Expand All @@ -104,10 +104,10 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.900.0-rc.0",
"@bazel/bazel": "0.26.0",
"@bazel/bazel": "1.0.0",
"@bazel/ibazel": "0.10.3",
"@bazel/jasmine": "0.29.0",
"@bazel/typescript": "0.39.1",
"@bazel/jasmine": "^0.39.1",
"@bazel/typescript": "^0.39.1",
"@cypress/webpack-preprocessor": "^4.0.3",
"@octokit/rest": "^15.17.0",
"@types/fs-extra": "^2.1.0",
Expand Down Expand Up @@ -158,7 +158,11 @@
"reflect-metadata": "^0.1.9",
"replace-in-file": "^3.1.1",
"rimraf": "^2.5.4",
"rollup": "^0.50.0",
"rollup": "~1.25.0",
"rollup-plugin-alias": "^1.4.0",
"rollup-plugin-commonjs": "10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"shelljs": "^0.8.3",
"sorcery": "^0.10.0",
"ts-loader": "^5.3.3",
Expand Down
Loading

0 comments on commit f51f623

Please sign in to comment.