Repository: alexeagle/angular-bazel-example
Branch: master
Commit: 2f1abb9b0279
Files: 336
Total size: 580.1 KB
Directory structure:
gitextract_yf405e50/
├── .bazelignore
├── .bazelrc
├── .circleci/
│ ├── bazel.rc
│ └── config.yml
├── .clang-format
├── .firebaserc
├── .gitignore
├── BUILD.bazel
├── LICENSE
├── README.md
├── WORKSPACE
├── angular-metadata.tsconfig.json
├── angular.json
├── deployment.yaml
├── e2e/
│ ├── BUILD.bazel
│ ├── protractor.on-prepare.js
│ └── src/
│ ├── app.e2e-spec.ts
│ └── app.po.ts
├── firebase.json
├── package.json
├── renovate.json
├── src/
│ ├── BUILD.bazel
│ ├── app/
│ │ ├── BUILD.bazel
│ │ ├── app-routing.module.ts
│ │ ├── app.component.html
│ │ ├── app.component.ts
│ │ ├── app.module.ts
│ │ ├── billing/
│ │ │ ├── BUILD.bazel
│ │ │ ├── billing.module.ts
│ │ │ ├── index/
│ │ │ │ ├── index.component.html
│ │ │ │ ├── index.component.spec.ts
│ │ │ │ └── index.component.ts
│ │ │ ├── module0/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp0/
│ │ │ │ │ ├── cmp0.component.html
│ │ │ │ │ ├── cmp0.component.scss
│ │ │ │ │ ├── cmp0.component.spec.ts
│ │ │ │ │ └── cmp0.component.ts
│ │ │ │ ├── cmp1/
│ │ │ │ │ ├── cmp1.component.html
│ │ │ │ │ ├── cmp1.component.scss
│ │ │ │ │ ├── cmp1.component.spec.ts
│ │ │ │ │ └── cmp1.component.ts
│ │ │ │ └── module0.module.ts
│ │ │ └── module1/
│ │ │ ├── BUILD.bazel
│ │ │ ├── cmp2/
│ │ │ │ ├── cmp2.component.html
│ │ │ │ ├── cmp2.component.scss
│ │ │ │ ├── cmp2.component.spec.ts
│ │ │ │ └── cmp2.component.ts
│ │ │ ├── cmp3/
│ │ │ │ ├── cmp3.component.html
│ │ │ │ ├── cmp3.component.scss
│ │ │ │ ├── cmp3.component.spec.ts
│ │ │ │ └── cmp3.component.ts
│ │ │ └── module1.module.ts
│ │ ├── compute/
│ │ │ ├── BUILD.bazel
│ │ │ ├── compute.module.ts
│ │ │ ├── index/
│ │ │ │ ├── index.component.html
│ │ │ │ ├── index.component.spec.ts
│ │ │ │ └── index.component.ts
│ │ │ ├── module0/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp4/
│ │ │ │ │ ├── cmp4.component.html
│ │ │ │ │ ├── cmp4.component.scss
│ │ │ │ │ ├── cmp4.component.spec.ts
│ │ │ │ │ └── cmp4.component.ts
│ │ │ │ ├── cmp5/
│ │ │ │ │ ├── cmp5.component.html
│ │ │ │ │ ├── cmp5.component.scss
│ │ │ │ │ ├── cmp5.component.spec.ts
│ │ │ │ │ └── cmp5.component.ts
│ │ │ │ └── module0.module.ts
│ │ │ └── module1/
│ │ │ ├── BUILD.bazel
│ │ │ ├── cmp6/
│ │ │ │ ├── cmp6.component.html
│ │ │ │ ├── cmp6.component.scss
│ │ │ │ ├── cmp6.component.spec.ts
│ │ │ │ └── cmp6.component.ts
│ │ │ ├── cmp7/
│ │ │ │ ├── cmp7.component.html
│ │ │ │ ├── cmp7.component.scss
│ │ │ │ ├── cmp7.component.spec.ts
│ │ │ │ └── cmp7.component.ts
│ │ │ └── module1.module.ts
│ │ ├── datastore/
│ │ │ ├── BUILD.bazel
│ │ │ ├── datastore.module.ts
│ │ │ ├── index/
│ │ │ │ ├── index.component.html
│ │ │ │ ├── index.component.spec.ts
│ │ │ │ └── index.component.ts
│ │ │ ├── module0/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp8/
│ │ │ │ │ ├── cmp8.component.html
│ │ │ │ │ ├── cmp8.component.scss
│ │ │ │ │ ├── cmp8.component.spec.ts
│ │ │ │ │ └── cmp8.component.ts
│ │ │ │ ├── cmp9/
│ │ │ │ │ ├── cmp9.component.html
│ │ │ │ │ ├── cmp9.component.scss
│ │ │ │ │ ├── cmp9.component.spec.ts
│ │ │ │ │ └── cmp9.component.ts
│ │ │ │ └── module0.module.ts
│ │ │ └── module1/
│ │ │ ├── BUILD.bazel
│ │ │ ├── cmp10/
│ │ │ │ ├── cmp10.component.html
│ │ │ │ ├── cmp10.component.scss
│ │ │ │ ├── cmp10.component.spec.ts
│ │ │ │ └── cmp10.component.ts
│ │ │ ├── cmp11/
│ │ │ │ ├── cmp11.component.html
│ │ │ │ ├── cmp11.component.scss
│ │ │ │ ├── cmp11.component.spec.ts
│ │ │ │ └── cmp11.component.ts
│ │ │ └── module1.module.ts
│ │ ├── functions/
│ │ │ ├── BUILD.bazel
│ │ │ ├── functions.module.ts
│ │ │ ├── index/
│ │ │ │ ├── index.component.html
│ │ │ │ ├── index.component.spec.ts
│ │ │ │ └── index.component.ts
│ │ │ ├── module0/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp12/
│ │ │ │ │ ├── cmp12.component.html
│ │ │ │ │ ├── cmp12.component.scss
│ │ │ │ │ ├── cmp12.component.spec.ts
│ │ │ │ │ └── cmp12.component.ts
│ │ │ │ ├── cmp13/
│ │ │ │ │ ├── cmp13.component.html
│ │ │ │ │ ├── cmp13.component.scss
│ │ │ │ │ ├── cmp13.component.spec.ts
│ │ │ │ │ └── cmp13.component.ts
│ │ │ │ └── module0.module.ts
│ │ │ └── module1/
│ │ │ ├── BUILD.bazel
│ │ │ ├── cmp14/
│ │ │ │ ├── cmp14.component.html
│ │ │ │ ├── cmp14.component.scss
│ │ │ │ ├── cmp14.component.spec.ts
│ │ │ │ └── cmp14.component.ts
│ │ │ ├── cmp15/
│ │ │ │ ├── cmp15.component.html
│ │ │ │ ├── cmp15.component.scss
│ │ │ │ ├── cmp15.component.spec.ts
│ │ │ │ └── cmp15.component.ts
│ │ │ └── module1.module.ts
│ │ ├── hello-world/
│ │ │ ├── BUILD.bazel
│ │ │ ├── hello-world.component.html
│ │ │ ├── hello-world.component.scss
│ │ │ ├── hello-world.component.spec.ts
│ │ │ ├── hello-world.component.ts
│ │ │ └── hello-world.module.ts
│ │ ├── home/
│ │ │ ├── BUILD.bazel
│ │ │ ├── home.html
│ │ │ └── home.ts
│ │ ├── logging/
│ │ │ ├── BUILD.bazel
│ │ │ ├── index/
│ │ │ │ ├── index.component.html
│ │ │ │ ├── index.component.spec.ts
│ │ │ │ └── index.component.ts
│ │ │ ├── logging.module.ts
│ │ │ ├── module0/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp16/
│ │ │ │ │ ├── cmp16.component.html
│ │ │ │ │ ├── cmp16.component.scss
│ │ │ │ │ ├── cmp16.component.spec.ts
│ │ │ │ │ └── cmp16.component.ts
│ │ │ │ ├── cmp17/
│ │ │ │ │ ├── cmp17.component.html
│ │ │ │ │ ├── cmp17.component.scss
│ │ │ │ │ ├── cmp17.component.spec.ts
│ │ │ │ │ └── cmp17.component.ts
│ │ │ │ └── module0.module.ts
│ │ │ └── module1/
│ │ │ ├── BUILD.bazel
│ │ │ ├── cmp18/
│ │ │ │ ├── cmp18.component.html
│ │ │ │ ├── cmp18.component.scss
│ │ │ │ ├── cmp18.component.spec.ts
│ │ │ │ └── cmp18.component.ts
│ │ │ ├── cmp19/
│ │ │ │ ├── cmp19.component.html
│ │ │ │ ├── cmp19.component.scss
│ │ │ │ ├── cmp19.component.spec.ts
│ │ │ │ └── cmp19.component.ts
│ │ │ └── module1.module.ts
│ │ ├── monitoring/
│ │ │ ├── BUILD.bazel
│ │ │ ├── index/
│ │ │ │ ├── index.component.html
│ │ │ │ ├── index.component.spec.ts
│ │ │ │ └── index.component.ts
│ │ │ ├── module0/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp20/
│ │ │ │ │ ├── cmp20.component.html
│ │ │ │ │ ├── cmp20.component.scss
│ │ │ │ │ ├── cmp20.component.spec.ts
│ │ │ │ │ └── cmp20.component.ts
│ │ │ │ ├── cmp21/
│ │ │ │ │ ├── cmp21.component.html
│ │ │ │ │ ├── cmp21.component.scss
│ │ │ │ │ ├── cmp21.component.spec.ts
│ │ │ │ │ └── cmp21.component.ts
│ │ │ │ └── module0.module.ts
│ │ │ ├── module1/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp22/
│ │ │ │ │ ├── cmp22.component.html
│ │ │ │ │ ├── cmp22.component.scss
│ │ │ │ │ ├── cmp22.component.spec.ts
│ │ │ │ │ └── cmp22.component.ts
│ │ │ │ ├── cmp23/
│ │ │ │ │ ├── cmp23.component.html
│ │ │ │ │ ├── cmp23.component.scss
│ │ │ │ │ ├── cmp23.component.spec.ts
│ │ │ │ │ └── cmp23.component.ts
│ │ │ │ └── module1.module.ts
│ │ │ └── monitoring.module.ts
│ │ ├── networking/
│ │ │ ├── BUILD.bazel
│ │ │ ├── index/
│ │ │ │ ├── index.component.html
│ │ │ │ ├── index.component.spec.ts
│ │ │ │ └── index.component.ts
│ │ │ ├── module0/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp24/
│ │ │ │ │ ├── cmp24.component.html
│ │ │ │ │ ├── cmp24.component.scss
│ │ │ │ │ ├── cmp24.component.spec.ts
│ │ │ │ │ └── cmp24.component.ts
│ │ │ │ ├── cmp25/
│ │ │ │ │ ├── cmp25.component.html
│ │ │ │ │ ├── cmp25.component.scss
│ │ │ │ │ ├── cmp25.component.spec.ts
│ │ │ │ │ └── cmp25.component.ts
│ │ │ │ └── module0.module.ts
│ │ │ ├── module1/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp26/
│ │ │ │ │ ├── cmp26.component.html
│ │ │ │ │ ├── cmp26.component.scss
│ │ │ │ │ ├── cmp26.component.spec.ts
│ │ │ │ │ └── cmp26.component.ts
│ │ │ │ ├── cmp27/
│ │ │ │ │ ├── cmp27.component.html
│ │ │ │ │ ├── cmp27.component.scss
│ │ │ │ │ ├── cmp27.component.spec.ts
│ │ │ │ │ └── cmp27.component.ts
│ │ │ │ └── module1.module.ts
│ │ │ └── networking.module.ts
│ │ ├── registry/
│ │ │ ├── BUILD.bazel
│ │ │ ├── index/
│ │ │ │ ├── index.component.html
│ │ │ │ ├── index.component.spec.ts
│ │ │ │ └── index.component.ts
│ │ │ ├── module0/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp28/
│ │ │ │ │ ├── cmp28.component.html
│ │ │ │ │ ├── cmp28.component.scss
│ │ │ │ │ ├── cmp28.component.spec.ts
│ │ │ │ │ └── cmp28.component.ts
│ │ │ │ ├── cmp29/
│ │ │ │ │ ├── cmp29.component.html
│ │ │ │ │ ├── cmp29.component.scss
│ │ │ │ │ ├── cmp29.component.spec.ts
│ │ │ │ │ └── cmp29.component.ts
│ │ │ │ └── module0.module.ts
│ │ │ ├── module1/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp30/
│ │ │ │ │ ├── cmp30.component.html
│ │ │ │ │ ├── cmp30.component.scss
│ │ │ │ │ ├── cmp30.component.spec.ts
│ │ │ │ │ └── cmp30.component.ts
│ │ │ │ ├── cmp31/
│ │ │ │ │ ├── cmp31.component.html
│ │ │ │ │ ├── cmp31.component.scss
│ │ │ │ │ ├── cmp31.component.spec.ts
│ │ │ │ │ └── cmp31.component.ts
│ │ │ │ └── module1.module.ts
│ │ │ └── registry.module.ts
│ │ ├── storage/
│ │ │ ├── BUILD.bazel
│ │ │ ├── index/
│ │ │ │ ├── index.component.html
│ │ │ │ ├── index.component.spec.ts
│ │ │ │ └── index.component.ts
│ │ │ ├── module0/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp32/
│ │ │ │ │ ├── cmp32.component.html
│ │ │ │ │ ├── cmp32.component.scss
│ │ │ │ │ ├── cmp32.component.spec.ts
│ │ │ │ │ └── cmp32.component.ts
│ │ │ │ ├── cmp33/
│ │ │ │ │ ├── cmp33.component.html
│ │ │ │ │ ├── cmp33.component.scss
│ │ │ │ │ ├── cmp33.component.spec.ts
│ │ │ │ │ └── cmp33.component.ts
│ │ │ │ └── module0.module.ts
│ │ │ ├── module1/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp34/
│ │ │ │ │ ├── cmp34.component.html
│ │ │ │ │ ├── cmp34.component.scss
│ │ │ │ │ ├── cmp34.component.spec.ts
│ │ │ │ │ └── cmp34.component.ts
│ │ │ │ ├── cmp35/
│ │ │ │ │ ├── cmp35.component.html
│ │ │ │ │ ├── cmp35.component.scss
│ │ │ │ │ ├── cmp35.component.spec.ts
│ │ │ │ │ └── cmp35.component.ts
│ │ │ │ └── module1.module.ts
│ │ │ └── storage.module.ts
│ │ ├── support/
│ │ │ ├── BUILD.bazel
│ │ │ ├── index/
│ │ │ │ ├── index.component.html
│ │ │ │ ├── index.component.spec.ts
│ │ │ │ └── index.component.ts
│ │ │ ├── module0/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp36/
│ │ │ │ │ ├── cmp36.component.html
│ │ │ │ │ ├── cmp36.component.scss
│ │ │ │ │ ├── cmp36.component.spec.ts
│ │ │ │ │ └── cmp36.component.ts
│ │ │ │ ├── cmp37/
│ │ │ │ │ ├── cmp37.component.html
│ │ │ │ │ ├── cmp37.component.scss
│ │ │ │ │ ├── cmp37.component.spec.ts
│ │ │ │ │ └── cmp37.component.ts
│ │ │ │ └── module0.module.ts
│ │ │ ├── module1/
│ │ │ │ ├── BUILD.bazel
│ │ │ │ ├── cmp38/
│ │ │ │ │ ├── cmp38.component.html
│ │ │ │ │ ├── cmp38.component.scss
│ │ │ │ │ ├── cmp38.component.spec.ts
│ │ │ │ │ └── cmp38.component.ts
│ │ │ │ ├── cmp39/
│ │ │ │ │ ├── cmp39.component.html
│ │ │ │ │ ├── cmp39.component.scss
│ │ │ │ │ ├── cmp39.component.spec.ts
│ │ │ │ │ └── cmp39.component.ts
│ │ │ │ └── module1.module.ts
│ │ │ └── support.module.ts
│ │ └── todos/
│ │ ├── BUILD.bazel
│ │ ├── reducers/
│ │ │ ├── BUILD.bazel
│ │ │ └── reducers.ts
│ │ ├── todos.component.html
│ │ ├── todos.component.scss
│ │ ├── todos.component.ts
│ │ └── todos.module.ts
│ ├── assets/
│ │ ├── BUILD.bazel
│ │ └── landing.css
│ ├── example/
│ │ ├── BUILD.bazel
│ │ └── index.html
│ ├── index.html
│ ├── initialize_testbed.ts
│ ├── lib/
│ │ └── shorten/
│ │ ├── BUILD.bazel
│ │ ├── README.md
│ │ └── shorten.ts
│ ├── main.dev.ts
│ ├── main.prod.ts
│ ├── main.ts
│ ├── rxjs_shims.js
│ ├── shared/
│ │ └── material/
│ │ ├── BUILD.bazel
│ │ └── material.module.ts
│ ├── styles.scss
│ ├── tsconfig-test.json
│ └── tsconfig.json
├── third_party/
│ └── github.com/
│ └── bazelbuild/
│ └── bazel-toolchains/
│ └── bazelrc/
│ └── bazel-0.24.0.bazelrc
└── tools/
├── BUILD.bazel
├── defaults.bzl
└── generator/
├── index.js
├── src/
│ ├── build-file.js
│ ├── clean.js
│ ├── create-feature-module.js
│ ├── feature-names.js
│ ├── generate.js
│ ├── ng-module.js
│ ├── ng.js
│ ├── reference-components.js
│ └── utils.js
└── templates/
├── dashboard/
│ ├── component.html
│ ├── component.scss
│ ├── component.spec.ts
│ └── component.ts
├── form/
│ ├── component.html
│ ├── component.scss
│ ├── component.spec.ts
│ └── component.ts
└── table/
├── component.html
├── component.scss
├── component.spec.ts
└── component.ts
================================================
FILE CONTENTS
================================================
================================================
FILE: .bazelignore
================================================
node_modules
================================================
FILE: .bazelrc
================================================
# Make TypeScript and Angular compilation fast, by keeping a few copies of the
# compiler running as daemons, and cache SourceFile AST's to reduce parse time.
build --strategy=TypeScriptCompile=worker
build --strategy=AngularTemplateCompile=worker
# Don't create bazel-* symlinks in the WORKSPACE directory.
# These require .gitignore and may scare users.
# Also, it's a workaround for https://github.com/bazelbuild/rules_typescript/issues/12
# which affects the common case of having `tsconfig.json` in the WORKSPACE directory.
#
# Instead, you should run `bazel info bazel-bin` to find out where the outputs went.
build --symlink_prefix=dist/
test --test_output=errors
# Use the Angular 6 compiler
build --define=compile=legacy
# Turn off legacy external runfiles
run --nolegacy_external_runfiles
test --nolegacy_external_runfiles
# Turn on --incompatible_strict_action_env which was on by default
# in Bazel 0.21.0 but turned off again in 0.22.0. Follow
# https://github.com/bazelbuild/bazel/issues/7026 for more details.
# This flag is needed to so that the bazel cache is not invalidated
# when running bazel via `yarn bazel`.
# See https://github.com/angular/angular/issues/27514.
build --incompatible_strict_action_env
run --incompatible_strict_action_env
test --incompatible_strict_action_env
# Turn on managed directories feature in Bazel
# This allows us to avoid installing a second copy of node_modules
build --experimental_allow_incremental_repository_updates
query --experimental_allow_incremental_repository_updates
###############################
# Remote Build Execution support
# Turn on these settings with
# --config=remote
###############################
# Load default settings for Remote Build Execution
# When updating, the URLs of bazel_toolchains in packages/bazel/package.bzl
# may also need to be updated (see https://github.com/angular/angular/pull/27935)
import %workspace%/third_party/github.com/bazelbuild/bazel-toolchains/bazelrc/bazel-0.24.0.bazelrc
# Point to our custom execution platform; see tools/BUILD.bazel
build:remote --extra_execution_platforms=//tools:rbe_ubuntu1604-angular
build:remote --host_platform=//tools:rbe_ubuntu1604-angular
build:remote --platforms=//tools:rbe_ubuntu1604-angular
# Remote instance.
# rbe-shared-demo has 500 2-core workers
# rbe-shared-demo2 has 100 8-core workers
build:remote --remote_instance_name=projects/rbe-shared-demo2/instances/default_instance
# Allow Bazel to consume all the workers
build:remote --jobs=100
# Schedule actions both locally and remote, take the faster one
# See https://blog.bazel.build/2019/02/01/dynamic-spawn-scheduler.html
# NB: this setting is experimental and can cause obscure build failures.
# The Bazel team does not recommend using this in all projects.
# We can observe failures like Remote connection/protocol failed
# build:remote --experimental_spawn_scheduler
##################################################
# Load any settings specific to the current user.
##################################################
# Needs to be last statement in this
# config, as the user configuration should be able to overwrite flags from this file.
# To use Remote Build Execution, this file should contain a line like
# build --google_credentials=[path to the .json credentials file]
try-import .bazelrc.user
================================================
FILE: .circleci/bazel.rc
================================================
# These options are enabled when running on CI
# We do this by copying this file to /etc/bazel.bazelrc at the start of the build.
# See remote cache documentation in /docs/BAZEL.md
# Don't be spammy in the logs
# TODO: re-enable after we deal with 10m timeout on circleci
#build --noshow_progress
# Don't run tests that are not meant to be run on circleci
test --test_tag_filters=-no-circleci
# Print all the options that apply to the build.
# This helps us diagnose which options override others
# (e.g. /etc/bazel.bazelrc vs. tools/bazel.rc)
build --announce_rc
# Prevent unstable environment variables from tainting cache keys
build --experimental_strict_action_env
# Save downloaded repositories such as the go toolchain
# This directory can then be included in the CircleCI cache
# It should save time running the first build
build --experimental_repository_cache=/home/circleci/bazel_repository_cache
# Workaround https://github.com/bazelbuild/bazel/issues/3645
# Bazel doesn't calculate the memory ceiling correctly when running under Docker.
# Limit Bazel to consuming resources that fit in CircleCI "xlarge" class
# https://circleci.com/docs/2.0/configuration-reference/#resource_class
build --local_resources=14336,8.0,1.0
# Use fixed chunk names for code-split bundles in CI
# so that GitHub buildsize bot reports are accurate
build --define=ROLLUP_BUNDLE_FIXED_CHUNK_NAMES=1
================================================
FILE: .circleci/config.yml
================================================
# This file configures the build at https://circleci.com/gh/alexeagle/angular-bazel-example
# Complete documentation is at https://circleci.com/docs/2.0/
# CircleCI lets us pick the key for storing one or more caches, to speed up subsequent builds.
# We can use this to avoid re-fetching our dependencies from npm on every build.
# To ensure we don't load a stale cache, we invalidate it based on the entries in the key:
# - the checksum of Yarn's lock file
# - the branch we are on, which really shouldn't be needed since the yarn lock file should be hermetic
# - the docker image tag, working around an issue we saw where changing docker images causes permission
# errors when restoring the cache, like when the user we run as changes
var_1: &default_docker_image circleci/node:10.16
var_2: &cache_key node-0.16-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.8.0
# Each job will inherit these defaults
var_3: &job_defaults
working_directory: ~/angular-bazel-example
docker:
- image: *default_docker_image
# After checkout, rebase on top of master, because we want to test the proposed merge of a
# onto the target branch, not just test what's on the user's fork.
# Similar to travis behavior, but not quite the same.
# See https://discuss.circleci.com/t/1662
var_4: &post_checkout
post: git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge"
var_5: &restore_cache
restore_cache:
keys:
- *cache_key
var_6: &init_environment
run:
name: Initializing environment
command: |
sudo apt-get update
# Install GTK+ graphical user interface (libgtk-3-0), advanced linux sound architecture (libasound2)
# and network security service libraries (libnss3) & X11 Screen Saver extension library (libssx1)
# which are dependendies of chrome & needed for karma & protractor headless chrome tests.
# This is a very small install with the whole init_environment step taking less than 8 seconds.
# TODO(gregmagolan): switch rules_webtesting to use a chrome headless_shell binary which does
# not depend on any dynamically linked libs
sudo apt-get -y install libgtk-3-0 libasound2 libnss3 libxss1
# Also install libraries required for firefox
sudo apt-get -y install libdbus-glib-1-2
# Setup /etc/bazel.bazelrc
sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
var_7: &yarn_install
run:
name: Run yarn install
command: yarn install
var_8: &init_bazel
run:
name: Initializing Bazel
command: |
# Symlink fetched bazel to /usr/local/bin/bazel
pathToBazel=$(ls $(realpath ./node_modules/@bazel/bazel-linux_x64)/bazel-*)
sudo ln -fs $pathToBazel /usr/local/bin/bazel
echo "Bazel version:"
bazel version
var_9: &attach_workspace
attach_workspace:
at: ~/
version: 2
# These jobs will run in parallel, and report separate statuses to GitHub PRs
jobs:
setup:
<<: *job_defaults
steps:
- checkout:
<<: *post_checkout
- *restore_cache
- *init_environment
- *yarn_install
- *init_bazel
# Save all node_modules to the cache
- save_cache:
key: *cache_key
paths:
- "node_modules"
# Persist any changes at this point to be reused by further jobs.
- persist_to_workspace:
root: ~/
paths:
- ./angular-bazel-example
lint:
<<: *job_defaults
steps:
- *attach_workspace
- *init_environment
- *init_bazel
# Run the Buildifier to check our Bazel rules for format issues.
- run: 'yarn bazel:format --mode=check ||
(echo "BUILD files not formatted. Please run ''yarn bazel:format --mode=fix''" ; exit 1)'
# Run the Buildifier to check our Bazel rules for lint issues.
# Note: The `--lint=warn` will auto fixe (re-write) the affected files.
- run: 'yarn bazel:format --lint=warn ||
(echo "BUILD files contain unresolved lint errors. Please fix manually the remaining errors." ; exit 1)'
build_and_test:
<<: *job_defaults
resource_class: xlarge
steps:
- *attach_workspace
- *init_environment
- *init_bazel
# Build and Test
- run: yarn ng test
- run: yarn ng e2e
# Also run prodserver test which is not covered by `ng e2e`
- run: bazel test //e2e:prodserver_test
- store_artifacts:
path: dist/bin/src/bundle.min.js
destination: bundle.min.js
- store_artifacts:
path: dist/bin/src/bundle.cs.min
destination: bundle.cs.min
benchmark:
<<: *job_defaults
resource_class: xlarge
steps:
- *attach_workspace
- *init_environment
- *init_bazel
# Run `bazel build` first as a temporary workaround to unexpected
# benchmark failure when entire build runs withing ibazel-benchmark-runner
# ```
# Error running Bazel unexpected EOF
# [ibazel-benchmark-runner] iBazel process exited unexpectedly 4 null
# error Command failed with exit code 1.
# ```
# TODO(gregmagolan): remove this once issue is resolved
- run: bazel build ...
# Run the benchmark
- run: yarn benchmark
workflows:
version: 2
default_workflow:
jobs:
- setup
- lint:
requires:
- setup
- build_and_test:
requires:
- setup
- benchmark:
requires:
- setup
================================================
FILE: .clang-format
================================================
Language: JavaScript
BasedOnStyle: Google
ColumnLimit: 100
================================================
FILE: .firebaserc
================================================
{
"projects": {
"default": "bazel-angular-io"
}
}
================================================
FILE: .gitignore
================================================
node_modules
bazel-out
dist
.firebase
.DS_Store
.bazelrc.user
================================================
FILE: BUILD.bazel
================================================
load("@k8s_deploy//:defaults.bzl", "k8s_deploy")
package(default_visibility = ["//:__subpackages__"])
# ts_library and ng_module use the `//:tsconfig.json` target
# by default. This alias allows omitting explicit tsconfig
# attribute.
alias(
name = "tsconfig.json",
actual = "//src:tsconfig.json",
)
k8s_deploy(
name = "deploy",
images = {
"gcr.io/internal-200822/src:nodejs_image": "//src:image",
},
template = ":deployment.yaml",
)
================================================
FILE: LICENSE
================================================
The MIT License
Copyright (c) 2014-2017 Google, Inc. http://angular.io
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: README.md
================================================
[](https://circleci.com/gh/angular/angular-bazel-example)
# Moved to rules_nodejs monorepo: https://github.com/bazelbuild/rules_nodejs/tree/master/examples/angular
**Readme content is preserved below to avoid breaking links**
**This is experimental, as part of Angular Labs! There may be breaking changes.**
This is part of the ABC project. The overall goal is to make it possible to
develop Angular applications the same way we do at Google.
Learn more about Bazel and Angular at https://bazel.angular.io
This example is deployed at https://bazel.angular.io/example
## Guide to the example
This example is a monorepo, meant to show many different features and integrations that we expect are generally useful for enterprise use cases.
- **Angular CLI**: you can use the `ng` command to run build, serve, test, and e2e
- **Angular Libraries**: to maximize build incrementality, each Angular module is compiled as a separate step. This lets us re-use Angular libraries without having to publish them as npm packages. See `src/todos` for a typical `NgModule` compiled as a library for use in the application, using the `ng_module` rule in the `BUILD.bazel` file.
- **TypeScript Libraries**: see `src/lib` for a trivial example of a pure-TS library that's consumed in the application, using the `ts_library` rule in the `BUILD.bazel` file.
- **Sass**: we use Sass for all styling. Angular components import Sass files, and these are built by Bazel as independent processes calling the modern Sass compiler (written in Dart).
- **Material design**: see `src/material` where we collect the material modules we use.
- **Redux-style state management**: see `src/reducers` where we use the [NgRx Store](https://ngrx.io/guide/store).
- **Lazy loading**: in production mode, the application is served in chunks. Run `ng serve --prod`
- **Differential loading**: in production mode, we load a pair of `