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

Commit

Permalink
chore(build): switch to kcd-scripts (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds authored Sep 8, 2017
1 parent da1e821 commit dd7b1fe
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 214 deletions.
10 changes: 0 additions & 10 deletions .babelrc

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ never done that before, that's great! Check this free short video tutorial to
learn how: http://kcd.im/pull-request
-->

- `cross-env` version:
- `downshift` version:
- `node` version:
- `npm` (or `yarn`) version:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Thanks for your interest in the project. I appreciate bugs filed and PRs submitted!
Thanks for your interest in the project. Bugs filed and PRs submitted are appreciated!
Please make sure that you are familiar with and follow the Code of Conduct for
this project (found in the CODE_OF_CONDUCT.md file).
Expand All @@ -23,5 +23,13 @@ merge of your pull request!
<!-- How were these changes implemented? -->
**How**:

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

<!-- feel free to add additional comments -->
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
registry=http://registry.npmjs.org/
save-exact=true
package-lock=false
16 changes: 7 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ sudo: false
language: node_js
cache:
directories:
- node_modules
- ~/.npm
notifications:
email: false
node_js:
- '6'
script:
- npm start validate
node_js: '8'
install: npm install
script: npm run validate
after_success:
- npm start report-coverage
- npm start release
- npx codecov
- npx -p semantic-release@7 -c "semantic-release pre && npm publish && semantic-release post"
branches:
only:
- master
only: master
66 changes: 36 additions & 30 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,65 @@ Thanks for being willing to contribute!

1. Fork and clone the repo
2. `$ npm install` to install dependencies
3. `$ npm start validate` to validate you've got it working
3. `$ npm run validate` to validate you've got it working
4. Create a branch for your PR

This project uses [`nps`][nps] and you can run `npm start` to see what scripts are available.
> Tip: Keep your `master` branch pointing at the original repository and make
> pull requests from branches on your fork. To do this, run:
>
> ```
> git remote add upstream https://github.com/kentcdodds/cross-env.git
> git fetch upstream
> git branch --set-upstream-to=upstream/master master
> ```
>
> This will add the original repository as a "remote" called "upstream,"
> Then fetch the git information from that remote, then set your local `master`
> branch to use the upstream master branch whenever you run `git pull`.
> Then you can make all of your pull request branches based on this `master`
> branch. Whenever you want to update your version of `master`, do a regular
> `git pull`.
## Add yourself as a contributor

This project follows the [all contributors][all-contributors] specification. To add yourself to the table of
contributors on the README.md, please use the automated script as part of your PR:
This project follows the [all contributors][all-contributors] specification.
To add yourself to the table of contributors on the `README.md`, please use the
automated script as part of your PR:

```console
npm start "addContributor <YOUR_GITHUB_USERNAME>"
npm run add-contributor
```

Follow the prompt. If you've already added yourself to the list and are making a new type of contribution, you can run
it again and select the added contribution type.
Follow the prompt and commit `.all-contributorsrc` and `README.md` in the PR.
If you've already added yourself to the list and are making
a new type of contribution, you can run it again and select the added
contribution type.

## Committing and Pushing changes

This project uses [`semantic-release`][semantic-release] to do automatic releases and generate a changelog based on the
commit history. So we follow [a convention][convention] for commit messages. Please follow this convention for your
commit messages.

You can use `commitizen` to help you to follow [the convention][convention]

Once you are ready to commit the changes, please use the below commands

1. `git add <files to be comitted>`
2. `$ npm start commit`

... and follow the instruction of the interactive prompt.
Please make sure to run the tests before you commit your changes. You can run
`npm run test:update` which will update any snapshots that need updating.
Make sure to include those changes (if they exist) in your commit.

### opt into git hooks

There are git hooks set up with this project that are automatically installed when you install dependencies. They're
really handy, but are turned off by default (so as to not hinder new contributors). You can opt into these by creating
a file called `.opt-in` at the root of the project and putting this inside:
There are git hooks set up with this project that are automatically installed
when you install dependencies. They're really handy, but are turned off by
default (so as to not hinder new contributors). You can opt into these by
creating a file called `.opt-in` at the root of the project and putting this
inside:

```
commit-msg
pre-commit
```

## Help needed

Please checkout the [ROADMAP.md][ROADMAP] and raise an issue to discuss
any of the items in the want to do or might do list.
Please checkout the [the open issues][issues]

Also, please watch the repo and respond to questions/bug reports/feature requests! Thanks!
Also, please watch the repo and respond to questions/bug reports/feature
requests! Thanks!

[egghead]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
[semantic-release]: https://npmjs.com/package/semantic-release
[convention]: https://github.com/conventional-changelog/conventional-changelog-angular/blob/ed32559941719a130bb0327f886d6a32a8cbc2ba/convention.md
[all-contributors]: https://github.com/kentcdodds/all-contributors
[ROADMAP]: ./other/ROADMAP.md
[nps]: https://npmjs.com/package/nps
[issues]: https://github.com/kentcdodds/cross-env/issues
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The MIT License (MIT)
Copyright (c) 2016 Kent C. Dodds
Copyright (c) 2017 Kent C. Dodds

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 3 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
environment:
matrix:
- node_version: "6"
- node_version: "8"

branches:
only:
- master

install:
- ps: Install-Product node $env:node_version
- yarn
- npm i

test_script:
- node --version
- npm test

cache:
- node_modules
- "%LOCALAPPDATA%/Yarn"
- ~/.npm

build: off
6 changes: 6 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const jestConfig = require('kcd-scripts/config').jest

jestConfig.coveragePathIgnorePatterns = jestConfig.coveragePathIgnorePatterns.concat(
['/bin/'],
)
module.exports = jestConfig
74 changes: 0 additions & 74 deletions package-scripts.js

This file was deleted.

78 changes: 15 additions & 63 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "cross-env",
"version": "0.0.0-semantically-released",
"description": "Run scripts that set and use environment variables across platforms",
"description":
"Run scripts that set and use environment variables across platforms",
"main": "dist/index.js",
"bin": {
"cross-env": "dist/bin/cross-env.js",
Expand All @@ -11,78 +12,29 @@
"node": ">=4.0"
},
"scripts": {
"start": "nps",
"test": "nps test",
"commitmsg": "opt --in commit-msg --exec \"validate-commit-msg\"",
"precommit": "lint-staged && opt --in pre-commit --exec \"npm start validate\""
},
"files": [
"dist"
],
"keywords": [],
"add-contributor": "kcd-scripts contributors add",
"build": "kcd-scripts build",
"lint": "kcd-scripts lint",
"test": "kcd-scripts test",
"test:update": "npm test -- --updateSnapshot --coverage",
"validate": "kcd-scripts validate",
"precommit": "kcd-scripts precommit"
},
"files": ["dist"],
"keywords": ["cross-environment", "environment variable", "windows"],
"author": "Kent C. Dodds <kent@doddsfamily.us> (http://kentcdodds.com/)",
"license": "MIT",
"dependencies": {
"cross-spawn": "^5.1.0",
"is-windows": "^1.0.0"
},
"devDependencies": {
"all-contributors-cli": "^4.0.1",
"babel-cli": "^6.24.1",
"babel-core": "^6.23.1",
"babel-jest": "^20.0.3",
"babel-preset-env": "^1.2.0",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.23.0",
"codecov": "^2.3.0",
"commitizen": "^2.9.6",
"cz-conventional-changelog": "^2.0.0",
"eslint": "^3.17.0",
"eslint-config-kentcdodds": "^12.0.0",
"husky": "^0.14.3",
"jest-cli": "^20.0.4",
"lint-staged": "^3.3.1",
"nps": "^5.0.3",
"nps-utils": "^1.1.2",
"opt-cli": "^1.5.1",
"prettier-eslint-cli": "^4.1.1",
"semantic-release": "^6.3.6",
"validate-commit-msg": "^2.11.1"
"kcd-scripts": "^0.3.4"
},
"eslintConfig": {
"extends": [
"kentcdodds",
"kentcdodds/jest"
],
"rules": {
"max-len": [
"error",
80
]
}
},
"lint-staged": {
"*.js": [
"prettier-eslint --write",
"git add"
]
},
"jest": {
"testEnvironment": "node",
"coverageThreshold": {
"global": {
"branches": 100,
"functions": 100,
"lines": 100,
"statements": 100
}
}
},
"config": {
"commitizen": {
"path": "node_modules/cz-conventional-changelog"
}
"extends": "./node_modules/kcd-scripts/eslint.js"
},
"eslintIgnore": ["node_modules", "coverage", "dist"],
"repository": {
"type": "git",
"url": "https://github.com/kentcdodds/cross-env.git"
Expand Down
Loading

0 comments on commit dd7b1fe

Please sign in to comment.