diff --git a/commitlint.config.js b/commitlint.config.js index f51bb95824..6978e6f995 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -10,6 +10,7 @@ module.exports = { 'buildozer', 'builtin', 'create', + 'examples', 'hide-bazel-files', 'jasmine', 'karma', diff --git a/examples/angular/.firebaserc b/examples/angular/.firebaserc new file mode 100644 index 0000000000..76957fe40c --- /dev/null +++ b/examples/angular/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "bazel-angular-io" + } +} diff --git a/examples/angular/README.md b/examples/angular/README.md new file mode 100644 index 0000000000..35ced91751 --- /dev/null +++ b/examples/angular/README.md @@ -0,0 +1,166 @@ +[![CircleCI](https://circleci.com/gh/angular/angular-bazel-example.svg?style=svg)](https://circleci.com/gh/angular/angular-bazel-example) + +# Example Angular monorepo using Bazel + +**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 `