Skip to content

Commit

Permalink
fix: force dep updates
Browse files Browse the repository at this point in the history
* WIP: upgrade babel

* cleanup
  • Loading branch information
Kent C. Dodds committed Aug 30, 2017
1 parent bbf317f commit bb185e2
Show file tree
Hide file tree
Showing 13 changed files with 142 additions and 6,029 deletions.
22 changes: 14 additions & 8 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
{
"presets": [
["env", {
"targets": {
"node": "4.5"
[
"env",
{
"targets": {
"node": "4.5"
}
}
}]
]
],
"plugins": [
"transform-class-properties",
"transform-object-rest-spread",
["transform-runtime", {
"polyfill": false,
"regenerator": true
}]
[
"transform-runtime",
{
"polyfill": false,
"regenerator": true
}
]
]
}
19 changes: 19 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": [
"kentcdodds",
"kentcdodds/prettier",
"kentcdodds/jest"
],
"rules": {
"max-len": "off",
"import/max-dependencies": "off",
"semi": [
"error",
"never"
],
"object-curly-spacing": [
"error",
"never"
]
}
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@ coverage
dist
.opt-in
.opt-out
.DS_Store
.eslintcache

# these cause more harm than good
# when working with contributors
package-lock.json
yarn.lock
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ cache:
notifications:
email: false
node_js:
- '6'
- '8'
script:
- yarn start validate
- npm start validate
after_success:
- yarn start report-coverage
- yarn start release
- npx codecov
- npm i -g semantic-release@7 && semantic-release pre && npm publish && semantic-release post
branches:
only:
- master
- /^greenkeeper/.*$/
70 changes: 42 additions & 28 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,59 +12,73 @@ Thanks for being willing to contribute!
3. `$ npm start validate` to validate you've got it working
4. Create a branch for your PR

This project uses [`p-s`][p-s] and you can run `npm start` to see what scripts are available.
This project uses [`nps`][nps] and you can run `npm start help` 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/prettier/prettier-eslint-cli.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 contributor.add
npm start contributors.add
```

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.

> If you need to manually update the `.all-contributorsrc` file, then you can regenerate the table by running
> `npm start contributor.generate`
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`
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. You don't have to follow this
convention if you don't like to. Just know that when we merge your commit, we'll
probably use "Squash and Merge" so we can change the commit message :)

... and follow the instruction of the interactive prompt.
Please make sure to run the tests before you commit your changes. You can run
`npm start 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!

[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
[p-s]: https://npmjs.com/package/p-s
[issues]: https://github.com/prettier/prettier-eslint-cli/issues
[nps]: https://github.com/kentcdodds/nps
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
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ CLI for [`prettier-eslint`][prettier-eslint]

[![Build Status][build-badge]][build]
[![Code Coverage][coverage-badge]][coverage]
[![Dependencies][dependencyci-badge]][dependencyci]
[![version][version-badge]][package]
[![downloads][downloads-badge]][npm-stat]
[![MIT License][license-badge]][LICENSE]
Expand Down Expand Up @@ -227,7 +226,7 @@ Any linter that support ESLint [CLIEngine](http://eslint.org/docs/developer-guid

### Standalone CLI tools based on `prettier-eslint-cli`

- [prettier-std-cli][prettier-std-cli] the easy to use CLI version of [standard-prettier-eslint][standard-prettier-eslint]
- [prettier-std-cli][prettier-std-cli] the easy to use CLI version of [standard-prettier-eslint][standard-prettier-eslint]
- [prettier-semi-cli][prettier-semi-cli] the easy to use CLI version of [semistandard-prettier-eslint][semistandard-prettier-eslint]

## Related
Expand Down Expand Up @@ -259,8 +258,6 @@ MIT
[build]: https://travis-ci.org/prettier/prettier-eslint-cli
[coverage-badge]: https://img.shields.io/codecov/c/github/prettier/prettier-eslint-cli.svg?style=flat-square
[coverage]: https://codecov.io/github/prettier/prettier-eslint-cli
[dependencyci-badge]: https://dependencyci.com/github/prettier/prettier-eslint-cli/badge?style=flat-square
[dependencyci]: https://dependencyci.com/github/prettier/prettier-eslint-cli
[version-badge]: https://img.shields.io/npm/v/prettier-eslint-cli.svg?style=flat-square
[package]: https://www.npmjs.com/package/prettier-eslint-cli
[downloads-badge]: https://img.shields.io/npm/dm/prettier-eslint-cli.svg?style=flat-square
Expand Down
15 changes: 15 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
testEnvironment: 'node',
// TODO: test all the files...
// collectCoverageFrom: ['src/**/*.js'],
testPathIgnorePatterns: ['/node_modules/', '/fixtures/'],
coveragePathIgnorePatterns: ['/node_modules/', '/fixtures/'],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
}
37 changes: 16 additions & 21 deletions package-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const npsUtils = require('nps-utils')
const series = npsUtils.series
const concurrent = npsUtils.concurrent
const rimraf = npsUtils.rimraf
const crossEnv = npsUtils.crossEnv

module.exports = {
scripts: {
Expand All @@ -16,16 +17,21 @@ module.exports = {
script: 'all-contributors generate',
},
},
commit: {
description: 'This uses commitizen to help us generate well formatted commit messages',
script: 'git-cz',
},
test: {
default: 'jest --coverage',
watch: 'jest --watch',
default: crossEnv('NODE_ENV=test jest --coverage'),
update: crossEnv('NODE_ENV=test jest --coverage --updateSnapshot'),
watch: crossEnv('NODE_ENV=test jest --watch'),
openCoverage: 'open coverage/lcov-report/index.html',
cli: {
default: 'jest --config cli-test/jest.config.json',
watch: 'jest --config cli-test/jest.config.json --watch',
default: crossEnv(
'NODE_ENV=test jest --config cli-test/jest.config.json'
),
update: crossEnv(
'NODE_ENV=test jest --config cli-test/jest.config.json --coverage --updateSnapshot'
),
watch: crossEnv(
'NODE_ENV=test jest --config cli-test/jest.config.json --watch'
),
},
},
build: {
Expand All @@ -39,20 +45,9 @@ module.exports = {
description: 'lint the entire project',
script: 'eslint .',
},
reportCoverage: {
description: 'Report coverage stats to codecov. This should be run after the `test` script',
script: 'codecov',
},
release: {
description: 'We automate releases with semantic-release. This should only be run on travis',
script: series(
'semantic-release pre',
'npm publish',
'semantic-release post'
),
},
validate: {
description: 'This runs several scripts to make sure things look good before committing or on clean install',
description:
'This runs several scripts to make sure things look good before committing or on clean install',
script: concurrent.nps('lint', 'build', 'test', 'test.cli'),
},
format: {
Expand Down

0 comments on commit bb185e2

Please sign in to comment.