This repository contains a yarn 2 (aka berry) plugin for angular development.
yarn plugin import https://github.com/bgotink/yarn-plugin-angular/raw/latest/bin/%40yarnpkg/plugin-angular.js
This plugin makes the Angular CLI available in your entire monorepository.
Once installed in the root package.json
file, running ng
will be available everywhere:
- You can run
yarn ng
in the entire monorepository, regardless of whether the current package has a dependency on@angular/cli
. - You can use
ng
in scripts in thescripts
section of anypackage.json
of your monorepository.
This plugins adds a powerful interactive update command. Try it out using yarn ng update --interactive
.
Some of the features of this command:
- 🙆♂️ It gives an extensive overview of what you're updating before actually performing the update
- 📦 Full monorepository support: every workspace in your repository gets updated, not just the root workspace
- 📝 By using the Yarn APIs the update command seamlessly uses the correct registries with any configured authentication.
This plugin's PnP support is experimental. It should work for angular 8.3, 9, 10, and 11, but only parts of angular have been tested so far. If you're not using PnP, everything should work as is.
- CLI:
- ✅ Running commands in the angular CLI (
ng build
,ng test
,ng e2e
,ng xi18n
etc) - ✅ Running schematics (
ng generate
) - ❌ Updating packages (
ng update
) - …
- ✅ Running commands in the angular CLI (
- Devkit:
- ✅ Building an application (
@angular-devkit/build-angular:browser
) - ✅ Serving an application (
@angular-devkit/build-angular:dev-server
) - ✅ Running unit tests (
@angular-devkit/build-angular:karma
) - ✅ Running e2e tests (
@angular-devkit/build-angular:protractor
) - …
- ✅ Building an application (
- Other:
- …
When making changes, use yarn build
to build the plugin. This'll create two
files.
- At
bundles/@yarnpkg/plugin-angular.js
you'll find the minified bundle, similar to the released file in thebin
folder. - The second file,
bundles/@yarnpkg/plugin-angular.dev.js
is not minified. This is useful when debugging the plugin, as it keeps error stacktraces readable and it allows for easier step-through debugging via the Chrome inspector.
The patchfiles are zipped and included in the src/patches
folder. Use yarn generate-patches
before yarn build
to update these zipped patches.
See LICENSE.md