1 | <p align="center">
|
2 | <a href="https://codefund.io/properties/447/visit-sponsor">
|
3 | <img src="https://codefund.io/properties/447/sponsor" />
|
4 | </a>
|
5 | </p>
|
6 |
|
7 | <div align="center">
|
8 | <h1>kcd-scripts π π¦</h1>
|
9 |
|
10 | <p>CLI toolbox for common scripts for my projects</p>
|
11 | </div>
|
12 |
|
13 | <hr />
|
14 |
|
15 | [![Build Status][build-badge]][build]
|
16 | [![Code Coverage][coverage-badge]][coverage]
|
17 | [![version][version-badge]][package]
|
18 | [![downloads][downloads-badge]][npmcharts]
|
19 | [![MIT License][license-badge]][license]
|
20 |
|
21 | [![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg?style=flat-square)](#contributors)
|
22 | [![PRs Welcome][prs-badge]][prs]
|
23 | [![Code of Conduct][coc-badge]][coc]
|
24 |
|
25 | [![Watch on GitHub][github-watch-badge]][github-watch]
|
26 | [![Star on GitHub][github-star-badge]][github-star]
|
27 | [![Tweet][twitter-badge]][twitter]
|
28 |
|
29 | ## The problem
|
30 |
|
31 | I do a bunch of open source and want to make it easier to maintain so many
|
32 | projects.
|
33 |
|
34 | ## This solution
|
35 |
|
36 | This is a CLI that abstracts away all configuration for my open source projects
|
37 | for linting, testing, building, and more.
|
38 |
|
39 | ## Table of Contents
|
40 |
|
41 |
|
42 |
|
43 |
|
44 | - [Installation](#installation)
|
45 | - [Usage](#usage)
|
46 | - [Overriding Config](#overriding-config)
|
47 | - [Flow support](#flow-support)
|
48 | - [Inspiration](#inspiration)
|
49 | - [Other Solutions](#other-solutions)
|
50 | - [Contributors](#contributors)
|
51 | - [LICENSE](#license)
|
52 |
|
53 |
|
54 |
|
55 | ## Installation
|
56 |
|
57 | This module is distributed via [npm][npm] which is bundled with [node][node] and
|
58 | should be installed as one of your project's `devDependencies`:
|
59 |
|
60 | ```
|
61 | npm install --save-dev kcd-scripts
|
62 | ```
|
63 |
|
64 | ## Usage
|
65 |
|
66 | This is a CLI and exposes a bin called `kcd-scripts`. I don't really plan on
|
67 | documenting or testing it super duper well because it's really specific to my
|
68 | needs. You'll find all available scripts in `src/scripts`.
|
69 |
|
70 | This project actually dogfoods itself. If you look in the `package.json`, you'll
|
71 | find scripts with `node src {scriptName}`. This serves as an example of some
|
72 | of the things you can do with `kcd-scripts`.
|
73 |
|
74 | ### Overriding Config
|
75 |
|
76 | Unlike `react-scripts`, `kcd-scripts` allows you to specify your own
|
77 | configuration for things and have that plug directly into the way things work
|
78 | with `kcd-scripts`. There are various ways that it works, but basically if you
|
79 | want to have your own config for something, just add the configuration and
|
80 | `kcd-scripts` will use that instead of it's own internal config. In addition,
|
81 | `kcd-scripts` exposes its configuration so you can use it and override only
|
82 | the parts of the config you need to.
|
83 |
|
84 | This can be a very helpful way to make editor integration work for tools like
|
85 | ESLint which require project-based ESLint configuration to be present to work.
|
86 |
|
87 | So, if we were to do this for ESLint, you could create an `.eslintrc` with the
|
88 | contents of:
|
89 |
|
90 | ```
|
91 | {"extends": "./node_modules/kcd-scripts/eslint.js"}
|
92 | ```
|
93 |
|
94 | > Note: for now, you'll have to include an `.eslintignore` in your project until
|
95 | > [this eslint issue is resolved](https://github.com/eslint/eslint/issues/9227).
|
96 |
|
97 | Or, for `babel`, a `.babelrc` with:
|
98 |
|
99 | ```
|
100 | {"presets": ["kcd-scripts/babel"]}
|
101 | ```
|
102 |
|
103 | Or, for `jest`:
|
104 |
|
105 | ```javascript
|
106 | const {jest: jestConfig} = require('kcd-scripts/config')
|
107 | module.exports = Object.assign(jestConfig, {
|
108 | // your overrides here
|
109 |
|
110 | // for test written in Typescript, add:
|
111 | transform: {
|
112 | '\\.(ts|tsx)$': '<rootDir>/node_modules/ts-jest/preprocessor.js',
|
113 | },
|
114 | })
|
115 | ```
|
116 |
|
117 | > Note: `kcd-scripts` intentionally does not merge things for you when you start
|
118 | > configuring things to make it less magical and more straightforward. Extending
|
119 | > can take place on your terms. I think this is actually a great way to do this.
|
120 |
|
121 | ### Flow support
|
122 |
|
123 | If the `flow-bin` is a dependency on the project the `@babel/preset-flow` will automatically get loaded when you use the default babel config that comes with `kcd-scripts`. If you customised your `.babelrc`-file you might need to manually add `@babel/preset-flow` to the `presets`-section.
|
124 |
|
125 | ## Inspiration
|
126 |
|
127 | This is inspired by `react-scripts`.
|
128 |
|
129 | ## Other Solutions
|
130 |
|
131 | I'm not aware of any, if you are please [make a pull request][prs] and add it
|
132 | here! Again, this is a very specific-to-me solution.
|
133 |
|
134 | ## Contributors
|
135 |
|
136 | Thanks goes to these people ([emoji key][emojis]):
|
137 |
|
138 |
|
139 |
|
140 | <table>
|
141 | <tr>
|
142 | <td align="center"><a href="https://kentcdodds.com"><img src="https://avatars.githubusercontent.com/u/1500684?v=3" width="100px;" alt="Kent C. Dodds"/><br /><sub><b>Kent C. Dodds</b></sub></a><br /><a href="https://github.com/kentcdodds/kcd-scripts/commits?author=kentcdodds" title="Code">π»</a> <a href="https://github.com/kentcdodds/kcd-scripts/commits?author=kentcdodds" title="Documentation">π</a> <a href="#infra-kentcdodds" title="Infrastructure (Hosting, Build-Tools, etc)">π</a> <a href="https://github.com/kentcdodds/kcd-scripts/commits?author=kentcdodds" title="Tests">β οΈ</a></td>
|
143 | <td align="center"><a href="https://github.com/sudo-suhas"><img src="https://avatars2.githubusercontent.com/u/22251956?v=4" width="100px;" alt="Suhas Karanth"/><br /><sub><b>Suhas Karanth</b></sub></a><br /><a href="https://github.com/kentcdodds/kcd-scripts/commits?author=sudo-suhas" title="Code">π»</a> <a href="https://github.com/kentcdodds/kcd-scripts/issues?q=author%3Asudo-suhas" title="Bug reports">π</a> <a href="https://github.com/kentcdodds/kcd-scripts/commits?author=sudo-suhas" title="Tests">β οΈ</a></td>
|
144 | <td align="center"><a href="https://github.com/pbomb"><img src="https://avatars0.githubusercontent.com/u/1402095?v=4" width="100px;" alt="Matt Parrish"/><br /><sub><b>Matt Parrish</b></sub></a><br /><a href="https://github.com/kentcdodds/kcd-scripts/commits?author=pbomb" title="Code">π»</a> <a href="https://github.com/kentcdodds/kcd-scripts/commits?author=pbomb" title="Tests">β οΈ</a></td>
|
145 | <td align="center"><a href="https://github.com/mateuscb"><img src="https://avatars3.githubusercontent.com/u/1319157?v=4" width="100px;" alt="Mateus"/><br /><sub><b>Mateus</b></sub></a><br /><a href="https://github.com/kentcdodds/kcd-scripts/commits?author=mateuscb" title="Code">π»</a> <a href="https://github.com/kentcdodds/kcd-scripts/commits?author=mateuscb" title="Tests">β οΈ</a></td>
|
146 | <td align="center"><a href="http://macklin.underdown.me"><img src="https://avatars1.githubusercontent.com/u/2344137?v=4" width="100px;" alt="Macklin Underdown"/><br /><sub><b>Macklin Underdown</b></sub></a><br /><a href="https://github.com/kentcdodds/kcd-scripts/commits?author=macklinu" title="Code">π»</a> <a href="https://github.com/kentcdodds/kcd-scripts/commits?author=macklinu" title="Tests">β οΈ</a></td>
|
147 | <td align="center"><a href="https://github.com/stereobooster"><img src="https://avatars2.githubusercontent.com/u/179534?v=4" width="100px;" alt="stereobooster"/><br /><sub><b>stereobooster</b></sub></a><br /><a href="https://github.com/kentcdodds/kcd-scripts/commits?author=stereobooster" title="Code">π»</a> <a href="https://github.com/kentcdodds/kcd-scripts/commits?author=stereobooster" title="Tests">β οΈ</a></td>
|
148 | <td align="center"><a href="http://dsds.io"><img src="https://avatars0.githubusercontent.com/u/410792?v=4" width="100px;" alt="Dony Sukardi"/><br /><sub><b>Dony Sukardi</b></sub></a><br /><a href="https://github.com/kentcdodds/kcd-scripts/issues?q=author%3Adonysukardi" title="Bug reports">π</a> <a href="https://github.com/kentcdodds/kcd-scripts/commits?author=donysukardi" title="Code">π»</a></td>
|
149 | </tr>
|
150 | <tr>
|
151 | <td align="center"><a href="https://alexandernanberg.com"><img src="https://avatars3.githubusercontent.com/u/8997319?v=4" width="100px;" alt="Alexander Nanberg"/><br /><sub><b>Alexander Nanberg</b></sub></a><br /><a href="https://github.com/kentcdodds/kcd-scripts/commits?author=alexandernanberg" title="Code">π»</a></td>
|
152 | <td align="center"><a href="https://github.com/fobbyal"><img src="https://avatars2.githubusercontent.com/u/7818365?v=4" width="100px;" alt="Alex Liang"/><br /><sub><b>Alex Liang</b></sub></a><br /><a href="https://github.com/kentcdodds/kcd-scripts/commits?author=fobbyal" title="Code">π»</a></td>
|
153 | <td align="center"><a href="http://www.jeffdetmer.com"><img src="https://avatars1.githubusercontent.com/u/649578?v=4" width="100px;" alt="Jeff Detmer"/><br /><sub><b>Jeff Detmer</b></sub></a><br /><a href="https://github.com/kentcdodds/kcd-scripts/commits?author=shellthor" title="Code">π»</a></td>
|
154 | <td align="center"><a href="https://twitter.com/endymion_r"><img src="https://avatars3.githubusercontent.com/u/93752?v=4" width="100px;" alt="Alex Zherdev"/><br /><sub><b>Alex Zherdev</b></sub></a><br /><a href="https://github.com/kentcdodds/kcd-scripts/commits?author=alexzherdev" title="Code">π»</a></td>
|
155 | <td align="center"><a href="https://github.com/adamdharrington"><img src="https://avatars0.githubusercontent.com/u/5477801?v=4" width="100px;" alt="Adam Harrington"/><br /><sub><b>Adam Harrington</b></sub></a><br /><a href="https://github.com/kentcdodds/kcd-scripts/commits?author=adamdharrington" title="Code">π»</a> <a href="https://github.com/kentcdodds/kcd-scripts/commits?author=adamdharrington" title="Tests">β οΈ</a></td>
|
156 | <td align="center"><a href="https://afontcu.dev"><img src="https://avatars0.githubusercontent.com/u/9197791?v=4" width="100px;" alt="AdriΓ Fontcuberta"/><br /><sub><b>AdriΓ Fontcuberta</b></sub></a><br /><a href="https://github.com/kentcdodds/kcd-scripts/commits?author=afontcu" title="Code">π»</a></td>
|
157 | <td align="center"><a href="https://codefund.io"><img src="https://avatars2.githubusercontent.com/u/12481?v=4" width="100px;" alt="Eric Berry"/><br /><sub><b>Eric Berry</b></sub></a><br /><a href="#fundingFinding-coderberry" title="Funding Finding">π</a></td>
|
158 | </tr>
|
159 | <tr>
|
160 | <td align="center"><a href="https://github.com/schaab"><img src="https://avatars0.githubusercontent.com/u/1103255?v=4" width="100px;" alt="Jared Schaab"/><br /><sub><b>Jared Schaab</b></sub></a><br /><a href="https://github.com/kentcdodds/kcd-scripts/commits?author=schaab" title="Code">π»</a> <a href="https://github.com/kentcdodds/kcd-scripts/commits?author=schaab" title="Tests">β οΈ</a></td>
|
161 | </tr>
|
162 | </table>
|
163 |
|
164 |
|
165 |
|
166 | This project follows the [all-contributors][all-contributors] specification.
|
167 | Contributions of any kind welcome!
|
168 |
|
169 | ## LICENSE
|
170 |
|
171 | MIT
|
172 |
|
173 | [npm]: https://www.npmjs.com/
|
174 | [node]: https://nodejs.org
|
175 | [build-badge]: https://img.shields.io/travis/kentcdodds/kcd-scripts.svg?style=flat-square
|
176 | [build]: https://travis-ci.org/kentcdodds/kcd-scripts
|
177 | [coverage-badge]: https://img.shields.io/codecov/c/github/kentcdodds/kcd-scripts.svg?style=flat-square
|
178 | [coverage]: https://codecov.io/github/kentcdodds/kcd-scripts
|
179 | [version-badge]: https://img.shields.io/npm/v/kcd-scripts.svg?style=flat-square
|
180 | [package]: https://www.npmjs.com/package/kcd-scripts
|
181 | [downloads-badge]: https://img.shields.io/npm/dm/kcd-scripts.svg?style=flat-square
|
182 | [npmcharts]: http://npmcharts.com/compare/kcd-scripts
|
183 | [license-badge]: https://img.shields.io/npm/l/kcd-scripts.svg?style=flat-square
|
184 | [license]: https://github.com/kentcdodds/kcd-scripts/blob/master/LICENSE
|
185 | [prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
|
186 | [prs]: http://makeapullrequest.com
|
187 | [donate-badge]: https://img.shields.io/badge/$-support-green.svg?style=flat-square
|
188 | [coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
|
189 | [coc]: https://github.com/kentcdodds/kcd-scripts/blob/master/other/CODE_OF_CONDUCT.md
|
190 | [github-watch-badge]: https://img.shields.io/github/watchers/kentcdodds/kcd-scripts.svg?style=social
|
191 | [github-watch]: https://github.com/kentcdodds/kcd-scripts/watchers
|
192 | [github-star-badge]: https://img.shields.io/github/stars/kentcdodds/kcd-scripts.svg?style=social
|
193 | [github-star]: https://github.com/kentcdodds/kcd-scripts/stargazers
|
194 | [twitter]: https://twitter.com/intent/tweet?text=Check%20out%20kcd-scripts!%20https://github.com/kentcdodds/kcd-scripts%20%F0%9F%91%8D
|
195 | [twitter-badge]: https://img.shields.io/twitter/url/https/github.com/kentcdodds/kcd-scripts.svg?style=social
|
196 | [emojis]: https://github.com/kentcdodds/all-contributors#emoji-key
|
197 | [all-contributors]: https://github.com/kentcdodds/all-contributors
|