Skip to content
This repository was archived by the owner on Jan 6, 2021. It is now read-only.

Commit 36bb6c3

Browse files
author
Kent C. Dodds
committed
fix: update all packages, tests, and README
1 parent 67d9aa6 commit 36bb6c3

17 files changed

+270
-290
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@ learn how: http://kcd.im/pull-request
1818
Relevant code or config
1919

2020
```javascript
21-
2221
```
2322

2423
What you did:
2524

26-
27-
2825
What happened:
2926

3027
<!-- Please provide the full error message/screenshots/anything -->
@@ -38,6 +35,4 @@ minimal amount of code possible.
3835

3936
Problem description:
4037

41-
42-
4338
Suggested solution:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,27 @@ merge of your pull request!
1515
-->
1616

1717
<!-- What changes are being made? (What feature/bug is being fixed here?) -->
18+
1819
**What**:
1920

2021
<!-- Why are these changes necessary? -->
22+
2123
**Why**:
2224

2325
<!-- How were these changes implemented? -->
26+
2427
**How**:
2528

2629
<!-- Have you done all of these things? -->
30+
2731
**Checklist**:
32+
2833
<!-- add "N/A" to the end of each line that's irrelevant to your changes -->
2934
<!-- to check an item, place an "x" in the box like so: "- [x] Documentation" -->
35+
3036
- [ ] Documentation
3137
- [ ] Tests
32-
- [ ] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->
33-
- [ ] Added myself to contributors table <!-- this is optional, see the contributing guidelines for instructions -->
38+
- [ ] Ready to be merged
39+
<!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->
3440

3541
<!-- feel free to add additional comments -->

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# CHANGELOG
22

3-
The changelog is automatically updated using [semantic-release](https://github.com/semantic-release/semantic-release).
4-
You can see it on the [releases page](../../releases).
3+
The changelog is automatically updated using
4+
[semantic-release](https://github.com/semantic-release/semantic-release). You
5+
can see it on the [releases page](../../releases).

CONTRIBUTING.md

Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
Thanks for being willing to contribute!
44

5-
**Working on your first Pull Request?** You can learn how from this *free* series
6-
[How to Contribute to an Open Source Project on GitHub][egghead]
5+
**Working on your first Pull Request?** You can learn how from this _free_
6+
series [How to Contribute to an Open Source Project on GitHub][egghead]
77

88
## Project setup
99

1010
1. Fork and clone the repo
11-
2. `$ npm install` to install dependencies
12-
3. `$ npm run validate` to validate you've got it working
11+
2. `npm install` to install dependencies
12+
3. `npm run validate` to validate you've got it working
1313
4. Create a branch for your PR
1414

1515
> Tip: Keep your `master` branch pointing at the original repository and make
@@ -21,45 +21,11 @@ Thanks for being willing to contribute!
2121
> git branch --set-upstream-to=upstream/master master
2222
> ```
2323
>
24-
> This will add the original repository as a "remote" called "upstream,"
25-
> Then fetch the git information from that remote, then set your local `master`
26-
> branch to use the upstream master branch whenever you run `git pull`.
27-
> Then you can make all of your pull request branches based on this `master`
28-
> branch. Whenever you want to update your version of `master`, do a regular
29-
> `git pull`.
30-
31-
## Add yourself as a contributor
32-
33-
This project follows the [all contributors][all-contributors] specification.
34-
To add yourself to the table of contributors on the `README.md`, please use the
35-
automated script as part of your PR:
36-
37-
```console
38-
npm run add-contributor
39-
```
40-
41-
Follow the prompt and commit `.all-contributorsrc` and `README.md` in the PR.
42-
If you've already added yourself to the list and are making
43-
a new type of contribution, you can run it again and select the added
44-
contribution type.
45-
46-
## Committing and Pushing changes
47-
48-
Please make sure to run the tests before you commit your changes. You can run
49-
`npm run test:update` which will update any snapshots that need updating.
50-
Make sure to include those changes (if they exist) in your commit.
51-
52-
### opt into git hooks
53-
54-
There are git hooks set up with this project that are automatically installed
55-
when you install dependencies. They're really handy, but are turned off by
56-
default (so as to not hinder new contributors). You can opt into these by
57-
creating a file called `.opt-in` at the root of the project and putting this
58-
inside:
59-
60-
```
61-
pre-commit
62-
```
24+
> This will add the original repository as a "remote" called "upstream," Then
25+
> fetch the git information from that remote, then set your local `master`
26+
> branch to use the upstream master branch whenever you run `git pull`. Then you
27+
> can make all of your pull request branches based on this `master` branch.
28+
> Whenever you want to update your version of `master`, do a regular `git pull`.
6329
6430
## Help needed
6531
@@ -68,6 +34,7 @@ Please checkout the [the open issues][issues]
6834
Also, please watch the repo and respond to questions/bug reports/feature
6935
requests! Thanks!
7036
71-
[egghead]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
37+
[egghead]:
38+
https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
7239
[all-contributors]: https://github.com/kentcdodds/all-contributors
7340
[issues]: https://github.com/kentcdodds/cross-env/issues

README.md

Lines changed: 69 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3+
4+
- [cross-env 🔀](#cross-env-)
5+
- [The problem](#the-problem)
6+
- [This solution](#this-solution)
7+
- [Installation](#installation)
8+
- [Usage](#usage)
9+
- [`cross-env` vs `cross-env-shell`](#cross-env-vs-cross-env-shell)
10+
- [Windows Issues](#windows-issues)
11+
- [Inspiration](#inspiration)
12+
- [Other Solutions](#other-solutions)
13+
- [Contributors](#contributors)
14+
- [LICENSE](#license)
15+
16+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
17+
118
<p align="center">
219
<a href="https://codefund.io/properties/445/visit-sponsor">
320
<img src="https://codefund.io/properties/445/sponsor" />
@@ -16,22 +33,11 @@ Run scripts that set and use environment variables across platforms
1633
[![Travis Build Status][build-badge]][build]
1734
[![AppVeyor Build Status][win-build-badge]][win-build]
1835
[![Code Coverage][coverage-badge]][coverage]
19-
[![Dependencies][dependencyci-badge]][dependencyci]
20-
[![version][version-badge]][package]
21-
[![node-version][node-version-badge]][node]
22-
[![downloads][downloads-badge]][npm-stat]
36+
[![version][version-badge]][package] [![MIT License][license-badge]][license]
2337

24-
[![MIT License][license-badge]][LICENSE]
2538
[![All Contributors](https://img.shields.io/badge/all_contributors-20-orange.svg?style=flat-square)](#contributors)
26-
[![PRs Welcome][prs-badge]][prs]
27-
[![Donate][donate-badge]][donate]
28-
[![Code of Conduct][coc-badge]][coc]
29-
[![Roadmap][roadmap-badge]][roadmap]
30-
[![Examples][examples-badge]][examples]
31-
32-
[![Watch on GitHub][github-watch-badge]][github-watch]
33-
[![Star on GitHub][github-star-badge]][github-star]
34-
[![Tweet][twitter-badge]][twitter]
39+
[![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc]
40+
[![downloads][downloads-badge]][npmtrends]
3541

3642
## The problem
3743

@@ -60,8 +66,8 @@ npm install --save-dev cross-env
6066
> WARNING! Make sure that when you're installing packages that you spell things
6167
> correctly to avoid [mistakenly installing malware][malware]
6268
63-
> NOTE : Version 6 of cross-env only supports Node.js 8 and higher, to use it on Node.js 7 or lower install version 5
64-
> ```npm install --save-dev cross-env@5 ```
69+
> NOTE : Version 6 of cross-env only supports Node.js 8 and higher, to use it on
70+
> Node.js 7 or lower install version 5 `npm install --save-dev cross-env@5`
6571
6672
## Usage
6773

@@ -100,12 +106,16 @@ Where `childScript` holds the actual command to execute and `parentScript` sets
100106
the environment variables to use. Then instead of run the childScript you run
101107
the parent. This is quite useful for launching the same command with different
102108
env variables or when the environment variables are too long to have everything
103-
in one line. It also means that you can use `$GREET` env var syntax even on
109+
in one line. It also means that you can use `$GREET` env var syntax even on
104110
Windows which would usually require it to be `%GREET%`.
105111

106-
If you precede a dollar sign with an odd number of backslashes the expression statement will not be replaced. Note that this means backslashes after the JSON string escaping took place. `"FOO=\\$BAR"` will not be replaced. `"FOO=\\\\$BAR"` will be replaced though.
112+
If you precede a dollar sign with an odd number of backslashes the expression
113+
statement will not be replaced. Note that this means backslashes after the JSON
114+
string escaping took place. `"FOO=\\$BAR"` will not be replaced.
115+
`"FOO=\\\\$BAR"` will be replaced though.
107116

108-
Lastly, if you want to pass a JSON string (e.g., when using [ts-loader]), you can do as follows:
117+
Lastly, if you want to pass a JSON string (e.g., when using [ts-loader]), you
118+
can do as follows:
109119

110120
```json
111121
{
@@ -115,21 +125,21 @@ Lastly, if you want to pass a JSON string (e.g., when using [ts-loader]), you ca
115125
}
116126
```
117127

118-
Pay special attention to the **triple backslash** `(\\\)` **before** the **double quotes** `(")` and the **absence** of **single quotes** `(')`.
119-
Both of these conditions have to be met in order to work both on Windows and UNIX.
128+
Pay special attention to the **triple backslash** `(\\\)` **before** the
129+
**double quotes** `(")` and the **absence** of **single quotes** `(')`. Both of
130+
these conditions have to be met in order to work both on Windows and UNIX.
120131

121132
## `cross-env` vs `cross-env-shell`
122133

123134
The `cross-env` module exposes two bins: `cross-env` and `cross-env-shell`. The
124-
first one executes commands using [`cross-spawn`][cross-spawn], while the
125-
second one uses the `shell` option from Node's `spawn`.
135+
first one executes commands using [`cross-spawn`][cross-spawn], while the second
136+
one uses the `shell` option from Node's `spawn`.
126137

127-
The main use case for `cross-env-shell` is when you need an environment
128-
variable to be set across an entire inline shell script, rather than just one
129-
command.
138+
The main use case for `cross-env-shell` is when you need an environment variable
139+
to be set across an entire inline shell script, rather than just one command.
130140

131141
For example, if you want to have the environment variable apply to several
132-
commands in series then you will need to wrap those in quotes and use
142+
commands in series then you will need to wrap those in quotes and use
133143
`cross-env-shell` instead of `cross-env`.
134144

135145
```json
@@ -140,29 +150,34 @@ commands in series then you will need to wrap those in quotes and use
140150
}
141151
```
142152

143-
The rule of thumb is: if you want to pass to `cross-env` a command that
144-
contains special shell characters *that you want interpreted*, then use
153+
The rule of thumb is: if you want to pass to `cross-env` a command that contains
154+
special shell characters _that you want interpreted_, then use
145155
`cross-env-shell`. Otherwise stick to `cross-env`.
146156

147-
On Windows you need to use `cross-env-shell`, if you want to handle [signal events](https://nodejs.org/api/process.html#process_signal_events) inside of your program. A common case for that is when you want to capture a `SIGINT` event invoked by pressing `Ctrl + C` on the command-line interface.
157+
On Windows you need to use `cross-env-shell`, if you want to handle
158+
[signal events](https://nodejs.org/api/process.html#process_signal_events)
159+
inside of your program. A common case for that is when you want to capture a
160+
`SIGINT` event invoked by pressing `Ctrl + C` on the command-line interface.
148161

149162
## Windows Issues
150163

151164
Please note that `npm` uses `cmd` by default and that doesn't support command
152-
substitution, so if you want to leaverage that, then you need to update your
165+
substitution, so if you want to leverage that, then you need to update your
153166
`.npmrc` to set the `script-shell` to powershell.
154167
[Learn more here](https://github.com/kentcdodds/cross-env/issues/192#issuecomment-513341729).
155168

156169
## Inspiration
157170

158171
I originally created this to solve a problem I was having with my npm scripts in
159-
[angular-formly][angular-formly]. This made contributing to the project
160-
much easier for Windows users.
172+
[angular-formly][angular-formly]. This made contributing to the project much
173+
easier for Windows users.
161174

162175
## Other Solutions
163176

164-
- [`env-cmd`](https://github.com/toddbluhm/env-cmd) - Reads environment variables from a file instead
165-
- [`@naholyr/cross-env`](https://www.npmjs.com/package/@naholyr/cross-env) - `cross-env` with support for setting default values
177+
- [`env-cmd`](https://github.com/toddbluhm/env-cmd) - Reads environment
178+
variables from a file instead
179+
- [`@naholyr/cross-env`](https://www.npmjs.com/package/@naholyr/cross-env) -
180+
`cross-env` with support for setting default values
166181

167182
## Contributors
168183

@@ -201,53 +216,46 @@ Thanks goes to these people ([emoji key][emojis]):
201216

202217
<!-- ALL-CONTRIBUTORS-LIST:END -->
203218

204-
This project follows the [all-contributors][all-contributors] specification. Contributions of any kind welcome!
219+
This project follows the [all-contributors][all-contributors] specification.
220+
Contributions of any kind welcome!
205221

206222
> Note: this was added late into the project. If you've contributed to this
207-
> project in any way, please make a pull request to add yourself to the list
208-
> by following the instructions in the `CONTRIBUTING.md`
223+
> project in any way, please make a pull request to add yourself to the list by
224+
> following the instructions in the `CONTRIBUTING.md`
209225
210226
## LICENSE
211227

212228
MIT
213229

214230
[npm]: https://www.npmjs.com/
215231
[node]: https://nodejs.org
216-
[build-badge]: https://img.shields.io/travis/kentcdodds/cross-env.svg?style=flat-square
232+
[build-badge]:
233+
https://img.shields.io/travis/kentcdodds/cross-env.svg?style=flat-square
217234
[build]: https://travis-ci.org/kentcdodds/cross-env
218-
[win-build-badge]: https://img.shields.io/appveyor/ci/kentcdodds/cross-env.svg?style=flat-square
235+
[win-build-badge]:
236+
https://img.shields.io/appveyor/ci/kentcdodds/cross-env.svg?style=flat-square
219237
[win-build]: https://ci.appveyor.com/project/kentcdodds/cross-env
220-
[coverage-badge]: https://img.shields.io/codecov/c/github/kentcdodds/cross-env.svg?style=flat-square
238+
[coverage-badge]:
239+
https://img.shields.io/codecov/c/github/kentcdodds/cross-env.svg?style=flat-square
221240
[coverage]: https://codecov.io/github/kentcdodds/cross-env
222-
[dependencyci-badge]: https://dependencyci.com/github/kentcdodds/cross-env/badge?style=flat-square
223-
[dependencyci]: https://dependencyci.com/github/kentcdodds/cross-env
224241
[version-badge]: https://img.shields.io/npm/v/cross-env.svg?style=flat-square
225242
[package]: https://www.npmjs.com/package/cross-env
226-
[node-version-badge]: https://img.shields.io/badge/node-%3E%3D%204.0-orange.svg?style=flat-square
227243
[downloads-badge]: https://img.shields.io/npm/dm/cross-env.svg?style=flat-square
228-
[npm-stat]: http://npm-stat.com/charts.html?package=cross-env&from=2016-04-01
244+
[npmtrends]: https://www.npmtrends.com/cross-env
229245
[license-badge]: https://img.shields.io/npm/l/cross-env.svg?style=flat-square
230246
[license]: https://github.com/kentcdodds/cross-env/blob/master/other/LICENSE
231-
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
247+
[prs-badge]:
248+
https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
232249
[prs]: http://makeapullrequest.com
233-
[donate-badge]: https://img.shields.io/badge/$-support-green.svg?style=flat-square
234-
[donate]: http://kcd.im/donate
235-
[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
236-
[coc]: https://github.com/kentcdodds/cross-env/blob/master/other/CODE_OF_CONDUCT.md
237-
[roadmap-badge]: https://img.shields.io/badge/%F0%9F%93%94-roadmap-CD9523.svg?style=flat-square
238-
[roadmap]: https://github.com/kentcdodds/cross-env/blob/master/other/ROADMAP.md
239-
[examples-badge]: https://img.shields.io/badge/%F0%9F%92%A1-examples-8C8E93.svg?style=flat-square
240-
[examples]: https://github.com/kentcdodds/cross-env/blob/master/other/EXAMPLES.md
241-
[github-watch-badge]: https://img.shields.io/github/watchers/kentcdodds/cross-env.svg?style=social
242-
[github-watch]: https://github.com/kentcdodds/cross-env/watchers
243-
[github-star-badge]: https://img.shields.io/github/stars/kentcdodds/cross-env.svg?style=social
244-
[github-star]: https://github.com/kentcdodds/cross-env/stargazers
245-
[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20cross-env!%20https://github.com/kentcdodds/cross-env%20%F0%9F%91%8D
246-
[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/kentcdodds/cross-env.svg?style=social
250+
[coc-badge]:
251+
https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
252+
[coc]:
253+
https://github.com/kentcdodds/cross-env/blob/master/other/CODE_OF_CONDUCT.md
247254
[emojis]: https://github.com/kentcdodds/all-contributors#emoji-key
248255
[all-contributors]: https://github.com/kentcdodds/all-contributors
249256
[win-bash]: https://msdn.microsoft.com/en-us/commandline/wsl/about
250257
[angular-formly]: https://github.com/formly-js/angular-formly
251258
[cross-spawn]: https://www.npmjs.com/package/cross-spawn
252259
[ts-loader]: https://www.npmjs.com/package/ts-loader
253-
[malware]: http://blog.npmjs.org/post/163723642530/crossenv-malware-on-the-npm-registry
260+
[malware]:
261+
http://blog.npmjs.org/post/163723642530/crossenv-malware-on-the-npm-registry

__mocks__/cross-spawn.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const jestConfig = require('kcd-scripts/config').jest
22

33
jestConfig.coveragePathIgnorePatterns = jestConfig.coveragePathIgnorePatterns.concat(
4-
['/bin/']
4+
['/bin/'],
55
)
66
module.exports = jestConfig

0 commit comments

Comments
 (0)