rentpath / react-redux-starter-kit

MIT License
3 stars 2 forks source link

Add script info #18

Open Teapane opened 8 years ago

colinrymer commented 8 years ago

I really like the idea, but I'm not a huge fan of the implementation - if I change a script command (e.g. build:prod to build:production) but don't change the relevant info section bit, the info is now inaccurate.

Teapane commented 8 years ago

I suppose I see your argument. Would it be helpful to add some documentation to the README, or are you not in favor of this lib at all?

c0 commented 8 years ago

I'm up for other implementations. We're limited in that package.json needs to be JSON, which doesn't support comments.

I found this workaround. I'm not 100% confident in it. Thoughts?

  "scripts": {
    "//": "Build JavaScript assets once",
    "build": "webpack & webpack --config webpack/prod.config.js",

    "//": "Install and boot a local server at localhost:3000",
    "start": "npm install && PORT=3000 NODE_PATH=$NODE_PATH:./src node --harmony bin/server.js",

    "//": "Run eslint and report errors",
    "lint": "eslint src",

    "//": "Run eslint and attempt to fix errors",
    "lint:fix": "npm run lint -- --fix",

    "//": "Run mocha tests",
    "test": "NODE_PATH=./src:./test mocha src/**/__tests__/*.js src/**/**/__tests__/*.js",

    "//": "Same as `test`, but runs tests when files change",
    "test:watch": "npm run test -- --watch",

    "//": "Run tests and report coverage",
    "test:cov": "babel-node `npm bin`/istanbul cover `npm bin`/_mocha -- --recursive",

    "//": "Build the styleguide from the React components",
    "styleguide": "rsg -c styleguide.js 'src/components/!(__tests__)/*.js'",

    "//": "Same as `styleguide`, but continues watching for changes",
    "styleguide:watch": "rsg -c styleguide.js 'src/components/!(__tests__)/*.js' -d"
  }
colinrymer commented 8 years ago

A forked version of better npm run that has an info section might be worthwhile (and probably pretty easy to get merged upstream)

c0 commented 8 years ago

Another option that also has a nice interface: https://github.com/ruyadorno/ntl/issues/4

colinrymer commented 8 years ago

Ntl looks cool, but leaves us in the same spot of docs getting out of syncs with reality, which is what I really want to avoid.

Teapane commented 8 years ago

I am researching creating our own lib/customizing an existing lib.