angular / angular-cli

CLI tool for Angular
https://cli.angular.dev
MIT License
26.79k stars 11.98k forks source link

Show setup options during `ng new` #22978

Open mgechev opened 2 years ago

mgechev commented 2 years ago

🚀 Feature request

Command (mark with an x)

Description

It's not obvious to people that we provide integrations with testing and linting solutions even though they exist. Folks have to run ng e2e to see the supported testing frameworks and after that run ng add [solution]. Alternatively, for linting they have to run ng lint to get ESLint installed, but none of the tools comes by default.

Describe the solution you'd like

To better inform developers about the integrations we provide, we can update our setup experience. When folks create a new project we can show two prompts:

- Which end-to-end testing framework you want to use:
  - Cypress
  - Nightwatch
  - WebDriver
  - None
- Do you want ESLint? (Y/n)

If folks select None and n they should still be able to add e2e/linting to their projects with ng add [schematics]. If people select an integration we can automatically run ng add [...] at setup time for them.

krzyhan commented 2 years ago

And how about unit test framework? Imho it would be nice to allow user to choose Karma/Jest and so on as well. What do you think?

mgechev commented 2 years ago

Let's keep the unit testing framework outside this conversation. I'll follow up separately on the topic.

murindwaz commented 2 years ago

This is well overdue feature @mgechev — what would be the criteria to add(or remove) more choice (options) in the list of available e2e test frameworks? What would be the criteria to make it to that default suggestions list?

mgechev commented 2 years ago

We already have a list of established choices. This feature only proposes to add them as part of the ng new experience. Let's focus on discussing if we want to do this in the current issue.

alan-agius4 commented 2 years ago

In version 14, we added similar prompt to ng deploy & ng e2e when the target is not configured.

ng e2e
Cannot find "e2e" target for the specified project.
You can add a package that implements these capabilities.

For example:
  Cypress: ng add @cypress/schematic
  Nightwatch: ng add @nightwatch/schematics
  WebdriverIO: ng add @wdio/schematics

Would you like to add a package with "e2e" capabilities now? (Use arrow keys)
❯ No
  Cypress
  Nightwatch
  WebdriverIO
d-koppenhagen commented 2 years ago

What about Playwright for e2e?

d-koppenhagen commented 2 years ago

checking out this Playwright issue, it seems there is already a communication about adding playwright or at least they will soon release a schematic: https://github.com/microsoft/playwright/issues/11258