Skip to content

@nx/devkit package is missing when using setup-vitest generator in Angular CLI #2055

@yjaaidi

Description

@yjaaidi

Which scope/s are relevant/related to the feature request?

platform

Information

When using setup-vitest generator in an Angular CLI workspace, the generator fails because the @nx/devkit peer dependency is missing.

Describe any alternatives/workarounds you're currently using

I see three options:
A. move @nx/devkit to dependencies instead of peerDependencies and document an Analog/Nx compatibility matrix.
B. add an aliased dependency analog-nx-devkit: 'npm:@nx/devkit@22 and fallback to it if @nx/devkit peer dependency is not found.
C. update the docs and ask Angular CLI users to add @nx/devkit to their peer deps.

I don't like anyone of them 😅.

A. is straightforward
B. seems quite hacky/risky to me
C. might frighten Angular users who are still not ready to switch to Nx (but they will eventually, right? 😊)

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions