grommet / grommet-cli

Deprecated, use create-react-app for v2 instead. Command Line interface for grommet
Apache License 2.0
28 stars 18 forks source link

Toolbox integration #10

Closed alansouzati closed 7 years ago

alansouzati commented 7 years ago

Added two new tasks:

jaitaiwan commented 7 years ago

Looks good!

coltonw commented 7 years ago

I really really like that the configuration for all the tools is the standard configuration rather than a custom grommet-toolbox only configuration.

coltonw commented 7 years ago

One thing I like about grommet-toolbox is that it lints and tests as part of the build. Is that something we are losing with this move? Also, what about cli arguments for eslint and more importantly jest, where you may want --coverage or -u and whatnot. Are we going to be in a situation where you have to run jest itself to get those options or will grommet check forward those?

alansouzati commented 7 years ago

hey @coltonw, grommet pack will not run linting anymore. We had a bunch of requests to remove it. Although it is easy to add, I like the idea of having them separated. grommet check && grommet pack == gulp dist.

I added the grommet check to the npm test script and enabled the pre-commit to run that in the grommet-sample project, check it out: https://github.com/grommet/grommet-sample/blob/CLI_INTEGRATION/package.json#L66

You are correct, if you want to run a specific set of CLI arguments, I would say you are better off using the CLI for each tool separately. We tried to think a way that will be flexible enough to avoid that. For example:

We run eslint at **/*.js and allow files/patterns to be ignored through .eslintignore. This will serve most cases, but in a scenario where you need something different, you can run the CLI for eslint directly. 🎉

The same goes for jest we run tests based on the configuration inside the package.json. We allow one argument in our cli that is -u or --updateSnapshot. For example grommet check -u will update the snapshot of your tests. By default we run the coverage (we added that to the package.json). But again, maybe you want to use some other CLI argument that is specific to your needs, then I would say you better off running jest --watch.

The main difference here is that now all the config files are exposed and you can pretty much decide how to execute your tasks.