Skip to content

List all peerDependencies in @angular-devkit/build-angular's manifest #16979

@bgotink

Description

@bgotink

🚀 Feature request or 🐞 bug depending on your point of view

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Description

The @angular-devkit/build-angular package imports a couple of packages that it doesn't list in it's dependencies or peerDependencies.
When angular is installed using a package manager that doesn't use node_modules (e.g. yarn 2 with plug'n'play), the @angular-devkit/build-angular package cannot access these unlisted dependencies anymore.

Using a package manager that uses node_modules (yarn without PnP, npm, …) this works because the node_modules dependency resolution algorithm is quite forgiving.

Describe the solution you'd like

List these hidden dependencies as (optional) peer dependencies of the @angular-devkit/build-angular package.

The list of hidden dependencies includes, after a cursory search, at least the following packages:

  • karma
  • typescript
  • node-sass
  • protractor
  • tslint

Describe alternatives you've considered

  • Don't support yarn 2.
  • Yarn 2 supports "package extensions" for explicitly this use case: to patch packages that are missing some dependencies and/or peerDependencies.
    This of course means these package extensions need to be added somewhere:
    • Everyone can add them to their own projects, this is by far the worst option
    • Yarn has a compatibility plugin, to support popular packages until they upstream the necessary changes.
    • A custom yarn plugin could include package extensions as well.
  • Yarn 2 has a "pnpify" binary that mocks a node_modules file structure. This requires everyone to run Angular CLI commands as yarn pnpify ng and it adds extra startup time to every angular CLI process and every nodejs process spawned by the angular CLI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions