joshwcomeau / guppy

🐠A friendly application manager and task runner for React.js
ISC License
3.27k stars 154 forks source link

Script descriptions per projectType #296

Open AWolf81 opened 5 years ago

AWolf81 commented 5 years ago

Describe the bug During my work on #292 I've noticed that Next.js is adding a script with the name start which is used for a different purpose. It is not the development server. It's the server to serve the production build locally. The development server script is called dev.

This issue needs to wait for the mentioned PR.

To Reproduce

  1. Create a new Next.js project and have a look at description for start script
  2. Create a new CRA project. It will have the same description for start script

Expected behavior We should have a naming that's more specific to each project type.

I think we have two options to solve this:

  1. Create a new reducer project-description.reducer and store the description on the redux state. e.g.
    { 
      'create-react-app': {
         start: 'Run a local development server',
         build: 'Bundle your project for production',
         test: 'Run the automated tests',
         eject: 'Permanently reveal the create-react-app configuration files',
         format: 'Runs a formatter that tweaks your code to align with industry best-practices'
      },
      gatsby: {
        // same as CRA - duplicate string here
      },
      nextjs: {
        start: 'Starts the application in production mode',
        build: 'Bundle your project for production'
      }
    }
  2. Add the description to a config file

Screenshots grafik

Environment:

Things to discuss:

AWolf81 commented 5 years ago

OK, I'm working on this.

I think the .guppy config file can be added later. I'm adding the project task descriptions to src/config/project-descriptions.js - I think it's not needed as a reducer as it is just an object literal constant.