mediamonks / frontend-coding-standards

Media.Monks - Frontend Coding Standards
60 stars 23 forks source link

Standard set of yarn commands for every project #15

Open skulptur opened 4 years ago

skulptur commented 4 years ago

Linting, testing, starting a dev server, formatting, typechecking, building. Those are things that we should have available in every project in a standard way.

For example should we use yarn start or yarn dev? Or both?

pigeonfresh commented 4 years ago

For most of them we already use more or less the same ones. I am in favor of further unifying these. I think muban uses lint:css and vue-skeleton lint:scss or vice versa. I would be in favor of yarn start.

evertmonk commented 4 years ago

I like yarn dev as it is one characters less than yarn start and it's already been used in most of the projects that I have worked on.

It also gives a good differentiation between running local development and running a build.

ThaNarie commented 4 years ago

yarn start is used a lot in the public, we could add it as an alias to the default dev script (I like to at least have dev and build in there, since they are more descriptive)

ThaNarie commented 4 years ago

List of scripts (feel free to append to the opening comment):

In general the namespacing with npm-run-all works pretty nice.

evertmonk commented 4 years ago

I would suggest to also include yarn deploy for deployment to a configured deploy target.

You could also do something like this to differentiate between environments:

And also yarn preview to check if the yarn build script is valid.

psimk commented 3 years ago

IMO, I think we should get rid of yarn start entirely. As @ThaNarie already mentioned it is indeed used by the majority of the public and most of the time it is used as the command to start the development server. However, to me start doesn't tell me that it will surely start the development server, just that it will start something, which could also be a production build.

For this reason our CRA templates actually switched from the default yarn start to yarn dev.

My 2 cents are that:

  1. yarn dev should be used as the command to start the development server
  2. yarn serve should be use as the command to build and "serve" the production build