UNPKG

12.5 kBMarkdownView Raw
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
31I do a bunch of open source and want to make it easier to maintain so many
32projects.
33
34## This solution
35
36This is a CLI that abstracts away all configuration for my open source projects
37for linting, testing, building, and more.
38
39## Table of Contents
40
41<!-- START doctoc generated TOC please keep comment here to allow auto update -->
42<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
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<!-- END doctoc generated TOC please keep comment here to allow auto update -->
54
55## Installation
56
57This module is distributed via [npm][npm] which is bundled with [node][node] and
58should be installed as one of your project's `devDependencies`:
59
60```
61npm install --save-dev kcd-scripts
62```
63
64## Usage
65
66This is a CLI and exposes a bin called `kcd-scripts`. I don't really plan on
67documenting or testing it super duper well because it's really specific to my
68needs. You'll find all available scripts in `src/scripts`.
69
70This project actually dogfoods itself. If you look in the `package.json`, you'll
71find scripts with `node src {scriptName}`. This serves as an example of some
72of the things you can do with `kcd-scripts`.
73
74### Overriding Config
75
76Unlike `react-scripts`, `kcd-scripts` allows you to specify your own
77configuration for things and have that plug directly into the way things work
78with `kcd-scripts`. There are various ways that it works, but basically if you
79want 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
82the parts of the config you need to.
83
84This can be a very helpful way to make editor integration work for tools like
85ESLint which require project-based ESLint configuration to be present to work.
86
87So, if we were to do this for ESLint, you could create an `.eslintrc` with the
88contents 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
97Or, for `babel`, a `.babelrc` with:
98
99```
100{"presets": ["kcd-scripts/babel"]}
101```
102
103Or, for `jest`:
104
105```javascript
106const {jest: jestConfig} = require('kcd-scripts/config')
107module.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
123If 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
127This is inspired by `react-scripts`.
128
129## Other Solutions
130
131I'm not aware of any, if you are please [make a pull request][prs] and add it
132here! Again, this is a very specific-to-me solution.
133
134## Contributors
135
136Thanks goes to these people ([emoji key][emojis]):
137
138<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
139<!-- prettier-ignore -->
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<!-- ALL-CONTRIBUTORS-LIST:END -->
165
166This project follows the [all-contributors][all-contributors] specification.
167Contributions of any kind welcome!
168
169## LICENSE
170
171MIT
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