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

💡 RFC: Default Package.json to "dev" command instead of "start" command #612

Closed
1 of 3 tasks
alteredorange opened this issue Jul 6, 2021 · 10 comments
Closed
1 of 3 tasks

Comments

@alteredorange
Copy link

Motivation

This might just bug me, and only me, but... Most frameworks I'm familiar with tend to use "dev' instead of "start" to start the development server. The Astro command is even astro dev not astro start.

Proposed Solution

Possible solutions

It would be great to default the package.json command to: "dev": "astro dev", to keep things consistent with most other modern frameworks.

Then if you ever have a production preview in Astro, you could us "start":"astro preview" or "preview":"astro preview" to start that process.

Alternatives considered

Just leave it as is, as I might be the only one this bothers.

Risks, downsides, and/or tradeoffs

Currently the only risk is that the command doesn't match the actual astro cli command and doesn't match up with most modern frameworks today.

Detailed Design

No response

Open Questions

No response

Help make it happen!

  • I am willing to submit a PR to implement this change.
  • I am willing to submit a PR to implement this change, but would need some guidance.
  • I am not willing to submit a PR to implement this change.
@natemoo-re
Copy link
Member

I'm in favor of this change! I think you're right that this is the most common pattern.

@n7trd
Copy link

n7trd commented Jul 9, 2021

I'm also for "dev".
Sometimes if i switch between npm projects i have think... "start what? dev mode? production server?"

@L1lith
Copy link

L1lith commented Jul 11, 2021

In my experience the start command generally refers to starting the server in production specifically

@jasikpark
Copy link
Contributor

As a -1 my main experience is w/ yarn start as the dev server, I haven't seen an overwhelming difference either way

@natemoo-re
Copy link
Member

natemoo-re commented Jul 13, 2021

Here are the scripts from notable projects, for context.

next.js uses dev, start for production

"scripts": {
  "dev": "next",
  "build": "next build",
  "start": "next start"
}

nuxt.js uses dev, start for production

"scripts": {
  "dev": "nuxt",
  "build": "nuxt build",
  "start": "nuxt start"
}

Vite uses dev, serve for production

"scripts": {
  "dev": "vite",
  "build": "vite build",
  "serve": "vite preview"
}

Snowpack uses start

"scripts": {
  "start": "snowpack dev",
  "build": "snowpack build"
}

Microsite uses start, serve for production

"scripts": {
  "start": "microsite",
  "build": "microsite build",
  "serve": "microsite build --serve"
}

WMR uses start, serve for production

"scripts": {
  "start": "wmr",
  "build": "wmr build --prerender",
  "serve": "wmr serve"
}

Gatsby uses start or develop, serve for production

"scripts": {
  "build": "gatsby build",
  "develop": "gatsby develop",
  "start": "npm run develop",
  "serve": "gatsby serve"
}

@JuanM04
Copy link
Contributor

JuanM04 commented Jul 13, 2021

I think that dev is more explicit and more common than start for the development server.

"scripts": {
  "dev": "astro dev",
  "build": "astro build",
  "serve": "astro serve"
}

@aFuzzyBear
Copy link
Contributor

I have to confess it thru me at first, kinda use to typing in yarn dev and yarn build

@drwpow
Copy link
Member

drwpow commented Aug 17, 2021

I think we’re all in favor of this! Would love a PR to make this change in our templates.

@jonathantneal
Copy link
Contributor

This issue resolves to support dev as in npm run dev or yarn dev, but I don’t see what it resolves to do with start. For npm users, npm start is a well-known shorthand.

After this change, which would you expect?

  1. npm start does nothing. Only done in Vite. Con: Waste of a helpful shorthand for npm users.
  2. npm start mirrors npm run dev. Only done in Gatsby. Con: Now there are 2 commands for the same process (2.1. which will docs favor?).
  3. npm start mirrors npm run serve. Mirrors Next/Nuxt. Con: The helpful shorthand is for servers but not humans?
  4. Something else entirely.

@drwpow
Copy link
Member

drwpow commented Aug 17, 2021

RFC Call: options:

  1. "start": "echo "use yarn dev atm", (start does nothing)
  2. "start": "astro dev" (start is an alias)

Decision: #2, but we have yarn dev in all docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants