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

Use well-defined npm script names instead of custom #303

Open
aentwist opened this issue Jun 23, 2023 · 5 comments · May be fixed by #387
Open

Use well-defined npm script names instead of custom #303

aentwist opened this issue Jun 23, 2023 · 5 comments · May be fixed by #387
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@aentwist
Copy link

aentwist commented Jun 23, 2023

Description

npm provides both npm start and npm test. Use these instead of npm run dev and npm run test:unit.

Considerations

Maybe there are different layers of tests. So then keep test:unit + others, and add "test": "run-p test:unit ..."

@cexbrayat
Copy link
Member

@aentwist Thanks for the suggestion

Maybe we could add npm start as an alias for npm run dev and npm test as an alias for npm run test:unit.
This is what Angular CLI does for example.

Would you like to try and open a PR?

@cexbrayat cexbrayat added enhancement New feature or request good first issue Good for newcomers labels Nov 10, 2023
@szgabsz91
Copy link

Hi @cexbrayat,

If this issue is still available, I think I could open a PR.

However, I'm not sure if I understand correctly that you suggest we should keep the dev script, too? Wouldn't it be weird if a newly generated package.json contained two scripts for the same command?

When I saw this issue, I thought about the following steps:

  • rename the dev script to start,
  • keep the current test:unit and test:e2e scripts if they are generated,
  • generate a new test script that either executes
    • test:unit if only unit tests are generated (vitest, cypress-ct or nightwatch-ct)
    • test:e2e if only E2E tests are generated (cypress, nightwatch or playwright)
    • both test:unit and test:e2e if unit AND E2E tests are generated

What do you think?

@cexbrayat
Copy link
Member

I was thinking that it would be better to keep the existing ones to avoid all the tooling/docs/blog posts/books to reference commands that no longer exist.

So I would:

  • add start along dev
  • keep the current test:unit and test:e2e scripts if they are generated
  • add test as an alias of test:unit, except if only e2e tests are generated, and in that case, as an alias of test:e2e

@szgabsz91
Copy link

OK, it's clear now. :) Then I'll take a look into it and open a PR soon, adding you as the reviewer if that's OK.

szgabsz91 added a commit to szgabsz91/create-vue that referenced this issue Nov 25, 2023
szgabsz91 added a commit to szgabsz91/create-vue that referenced this issue Nov 25, 2023
@szgabsz91 szgabsz91 linked a pull request Nov 25, 2023 that will close this issue
szgabsz91 added a commit to szgabsz91/create-vue that referenced this issue Nov 25, 2023
szgabsz91 added a commit to szgabsz91/create-vue that referenced this issue Nov 25, 2023
szgabsz91 added a commit to szgabsz91/create-vue that referenced this issue Nov 26, 2023
szgabsz91 added a commit to szgabsz91/create-vue that referenced this issue Nov 27, 2023
szgabsz91 added a commit to szgabsz91/create-vue that referenced this issue Jun 2, 2024
@evandrofgarcia
Copy link

I don’t receive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants