Support resolving architect builders relative to project
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- angular, typescript
- Domain
- build-system, cli
Research direction
Start by tracing how architect builders referenced in angular.json are resolved, comparing that behavior with the described project-relative schematic resolution. Review the root package.json and the test application's package.json, then verify that build, serve, test, e2e, lint, extract-i18n, and run can use the project's builder dependencies without requiring them at the repository root.
Written by the indexing model from the issue text.
Description
🚀 Feature request
Command (mark with an x)
- new
- build
- serve
- test
- e2e
- generate
- add
- update
- lint
- extract-i18n
- run
- config
- help
- version
- doc
Description
Schematics are loaded relative to the project first, and if the collection isn't found in the project then it's resolved in the folder the angular.json is in. This is great because it allows for situations where multiple versions of a collection are in use, or for collections that require peer dependencies.
The same behaviour is currently not present in architect builders. Those are only resolved in the folder the angular.json file is in, making certain situations impossible.
A very specific case: I've got a repository that contains tooling, and I'm using typescript 4.2 for this repo. I'm using the angular CLI to configure the projects in the repo, with a homebrew architect builder to create npm packages to run in node.
Now I want to add an angular application to the repo to test packages in the repo, as the tool in question is @ngx-playwright/jest, meant for using Jest and Playwright to run e2e tests.
However, building the angular app only works if I install @angular-devkit/build-angular in the root package.json file, which requires @angular/compiler-cli, @angular/compiler, @angular/core, rxjs and zone.js as well. It also requires typscript@>= 4.0 < 4.2 which clashes with the 4.2.3 that I'm using throughout the repo.
Note: I'm using a package manager that doesn't hoist dependencies (i.e. the behaviour of yarn 2's pnp linker or pnpm)
Describe the solution you'd like
I'd like to be able to install @angular-devkit/build-angular in the test application's folder instead of the repo root. This package.json already contains all necessary peer dependencies and it can use 4.1 without me having to downgrade typescript throughout the entire repo.
Describe alternatives you've considered
- Use a package manager that hoists dependencies. This allows for installing the
@angular-devkit/build-angularpackage in the test app's folder while it'll still end up in the rootnode_modulesso the angular CLI can find it. It will still find the wrong version of typescript though, so I'm still stuck. - Downgrade my repo to typescript 4.1: this might be possible, but it feels very wrong that the one angular app in the repo should define the typescript version being used to build the node packages throughout the entire repo as well as the typescript language server version used by VS Code.
- Create a separate
angular.jsonin the test app's folder. This is the solution I'm going for, but if I have multipleangular.jsonfiles I'm losing a lot of the ergonomics the angular CLI normally offers.
- Dominant language
- TypeScript
- Stars
- 27k
- Forks
- 11.8k
- Avg merge
- 16h 35m
- Merged PRs (30d)
- 176
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from angular/angular-cli
-
area: @angular/build gemini-triaged
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
angular/angular-cli#33055 · 1 comment · 3 reactions ·
-
area: @angular/build gemini-triaged
Difficulty 4/5 3-5 days Newbie friendliness 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 assignee ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 assignee ·
All issues in angular/angular-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ontola/atomic-server#1625 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
melgarafael/DeskcommCRM#1451 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
midnightntwrk/midnight-sdk#403 ·