Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(bazel): Explain explicit version requirement #28482

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 32 additions & 14 deletions packages/bazel/src/schematics/README.md
Expand Up @@ -7,28 +7,46 @@ please use with caution. For feedbacks and comments, please open an issue on
GitHub and ping [@mgechev](https://github.com/mgechev) or
[@kyliau](https://github.com/kyliau).

## Create a Bazel-managed Angular project
## Requirements

To create a new Angular project that builds with Bazel, all you need to do is install the `@angular/bazel` package.
To create a new Angular project that builds with Bazel + CLI, the following
packages have to be installed.

The example below assumes that you have a global installation of Angular CLI.
If not, please run `yarn global add @angular/cli@next`.
Package | Minimum Version
--------|----------------
@angular/cli | v7.3.x
@angular/bazel | v8.0.x

Note, it is very *important* to install the **cutting-edge** (`@next`) version of
`@angular/cli` because the Bazel schematics relies on some of the new APIs in
`@angular-devkit/schematics`. There is currently no way for a schematic to
mandate a minimum "schematic runtime" version. The version of
`@angular-devkit/schematics` that is installed with the CLI is used to run the
schematic even though a different version is used in the schematic itself.
Invoking `@angular/bazel` schematics with an older version of CLI would very
likely result in unexpected errors.
The `@angular/bazel` package contains schematics to generate necessary Bazel
build files.

Install the latest `@angular/bazel` for generating Bazel schematics.
If the packages are not on your system yet, install them with the following
commands:

```
$ yarn global add @angular/bazel
yarn global add @angular/cli@latest @angular/bazel@next
```

It is very *important* to meet the minimum version requirement of `@angular/cli`
because Bazel schematics rely on some of the new APIs that are missing in older
versions of the CLI. Invoking `@angular/bazel` schematics with an older version
of CLI would very likely result in unexpected errors.

<details>
<summary>
More details
</summary>
Bazel schematics rely on the new
<a href="https://github.com/angular/angular-cli/commit/a0ac4b0e3dd60c75e1edafd6bb8cced47d10a8d3">
<code>ScopedTree</code></a> in <code>@angular-devkit/schematics</code>.
There is currently no way for a schematic to mandate a minimum
"schematic runtime" version. The version of <code>@angular-devkit/schematics</code>
that is installed with the CLI is used to run the schematic even though a different
version is used in the schematic itself.
</details>

## Create a Bazel-managed Angular project

Create a new project using `@angular/bazel` schematics for `ng new`.

```
Expand Down