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

Version Compatibility check should only be checked within Angular related builders #14266

Closed
FrozenPandaz opened this issue Apr 24, 2019 · 1 comment

Comments

@FrozenPandaz
Copy link
Contributor

FrozenPandaz commented Apr 24, 2019

🐞 Bug report

Command (mark with an x)

- [ ] new
- [x] build
- [x] serve
- [x] test
- [x] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [x] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

All Architect Commands in @angular/cli

Is this a regression?

Nope

Description

The Version compatibility check is called for every single architect command at this line here:

Version.assertCompatibleAngularVersion(this.workspace.root);
. The architect command in question might have nothing to do with Angular. For example, it could be a custom webpack build or a tslint check. This compatibility check should be moved to the following builders:

  • @angular-dekvit/build-angular:browser
  • @angular-devkit/build-angular:dev-server
  • @angular-devkit/build-angular:server
  • @angular-devkit/build-angular:app-shell
  • .etc

The following builders do not require this check:

  • @angular-devkit/build-angular:karma
  • @angular-devkit/build-angular:tslint
  • @angular-devkit/build-angular:protractor
  • @angular-devkit/build-angular:karma

🔬 Minimal Reproduction

Create a custom builder and try to use it with the @angular/cli in a project which does not have @angular/core installed.

https://github.com/FrozenPandaz/reacttest/tree/versionbug

🔥 Exception or Error


Jasons-MacBook-Pro:empty-ws jason$ ng build app1
You seem to not be depending on "@angular/core" and/or "rxjs". This is an error.

🌍 Your Environment


Jasons-MacBook-Pro:empty-ws jason$ ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 7.3.1
Node: 10.12.0
OS: darwin x64
Angular: undefined
... 

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.8
@angular-devkit/build-angular     0.13.8
@angular-devkit/build-optimizer   0.13.8
@angular-devkit/build-webpack     0.13.8
@angular-devkit/core              7.3.8
@angular-devkit/schematics        7.3.1
@angular/cli                      7.3.1
@ngtools/webpack                  7.3.8
@schematics/angular               7.3.1
@schematics/update                0.13.1
rxjs                              6.3.3
typescript                        3.2.2
webpack                           4.29.0

Anything else relevant?
This is needed to improve non-angular support in @nrwl/nx. 🙏

cc @alexeagle

clydin added a commit to clydin/angular-cli that referenced this issue Apr 25, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant