Skip to content

Commit

Permalink
fix: switch over to new org all-contributors (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebolam authored Jan 7, 2019
1 parent 5a9c8b7 commit 85a9e3a
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 28 deletions.
69 changes: 69 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
version: 2.1

docker_defaults: &docker_defaults
docker:
- image: circleci/node:8.14.0

commands:
prep_env:
description: Prepares environment with cache
steps:
- checkout:
path: ~/repo
- restore_cache:
name: Restore node_modules cache
key: all-contributors-cli-{{ checksum "package.json" }}-{{ .Branch }}
save_env_cache:
description: Saves environment cache
steps:
- save_cache:
name: Save node_modules cache
key: all-contributors-cli-{{ checksum "package.json" }}-{{ .Branch }}
paths:
- node_modules/

jobs:
node_modules:
<<: *docker_defaults
working_directory: ~/repo
steps:
- prep_env
- run: yarn install
- save_env_cache
validate:
<<: *docker_defaults
working_directory: ~/repo
steps:
- prep_env
- run: yarn validate
- persist_to_workspace:
root: ./
paths:
- dist
- coverage
deploy:
<<: *docker_defaults
working_directory: ~/repo
steps:
- prep_env
- attach_workspace:
at: ./
- run: yarn kcd-scripts travis-after-success
workflows:
version: 2
test_and_deploy:
jobs:
- node_modules
- deploy:
requires:
- node_modules
filters:
branches:
only:
- master

experimental:
notify:
branches:
only:
- master
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.14.0
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions .yvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.9.2
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[![Code Coverage][coverage-badge]][coverage]
[![version][version-badge]][package] [![downloads][downloads-badge]][downloads]
[![MIT License][license-badge]][license]
[![Chat on Slack][chat-badge]][chat]

[![All Contributors](https://img.shields.io/badge/all_contributors-26-orange.svg?style=flat-square)](#contributors)
[![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc]
Expand Down Expand Up @@ -229,6 +230,7 @@ Thanks goes to these wonderful people
| [<img src="https://avatars2.githubusercontent.com/u/1026002?v=4" width="100px;"/><br /><sub><b>Bryce Reynolds</b></sub>](https://github.com/brycereynolds)<br />[💻](https://github.com/all-contributors/all-contributors-cli/commits?author=brycereynolds "Code") | [<img src="https://avatars3.githubusercontent.com/u/2322305?v=4" width="100px;"/><br /><sub><b>James, please</b></sub>](http://www.jmeas.com)<br />[🤔](#ideas-jmeas "Ideas, Planning, & Feedback") [💻](https://github.com/all-contributors/all-contributors-cli/commits?author=jmeas "Code") | [<img src="https://avatars3.githubusercontent.com/u/1057324?v=4" width="100px;"/><br /><sub><b>Spyros Ioakeimidis</b></sub>](http://www.spyros.io)<br />[💻](https://github.com/all-contributors/all-contributors-cli/commits?author=spirosikmd "Code") | [<img src="https://avatars3.githubusercontent.com/u/12335761?v=4" width="100px;"/><br /><sub><b>Fernando Costa</b></sub>](https://github.com/fadc80)<br />[💻](https://github.com/all-contributors/all-contributors-cli/commits?author=fadc80 "Code") | [<img src="https://avatars0.githubusercontent.com/u/197404?v=4" width="100px;"/><br /><sub><b>snipe</b></sub>](https://snipe.net)<br />[📖](https://github.com/all-contributors/all-contributors-cli/commits?author=snipe "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/997157?v=4" width="100px;"/><br /><sub><b>Gant Laborde</b></sub>](http://gantlaborde.com/)<br />[💻](https://github.com/all-contributors/all-contributors-cli/commits?author=GantMan "Code") |
| [<img src="https://avatars2.githubusercontent.com/u/17708702?v=4" width="100px;"/><br /><sub><b>Md Zubair Ahmed</b></sub>](https://in.linkedin.com/in/mzubairahmed)<br />[📖](https://github.com/all-contributors/all-contributors-cli/commits?author=M-ZubairAhmed "Documentation") [🐛](https://github.com/all-contributors/all-contributors-cli/issues?q=author%3AM-ZubairAhmed "Bug reports") [💻](https://github.com/all-contributors/all-contributors-cli/commits?author=M-ZubairAhmed "Code") [⚠️](https://github.com/all-contributors/all-contributors-cli/commits?author=M-ZubairAhmed "Tests") | [<img src="https://avatars3.githubusercontent.com/u/6177621?v=4" width="100px;"/><br /><sub><b>Divjot Singh</b></sub>](http://bogas04.github.io)<br />[📖](https://github.com/all-contributors/all-contributors-cli/commits?author=bogas04 "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/15315098?v=4" width="100px;"/><br /><sub><b>João Marques</b></sub>](https://github.com/tigermarques)<br />[💻](https://github.com/all-contributors/all-contributors-cli/commits?author=tigermarques "Code") [📖](https://github.com/all-contributors/all-contributors-cli/commits?author=tigermarques "Documentation") [🤔](#ideas-tigermarques "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/1192452?v=4" width="100px;"/><br /><sub><b>Andrew Lisowski</b></sub>](http://hipstersmoothie.com)<br />[💻](https://github.com/all-contributors/all-contributors-cli/commits?author=hipstersmoothie "Code") [📖](https://github.com/all-contributors/all-contributors-cli/commits?author=hipstersmoothie "Documentation") [⚠️](https://github.com/all-contributors/all-contributors-cli/commits?author=hipstersmoothie "Tests") | [<img src="https://avatars3.githubusercontent.com/u/1736154?v=4" width="100px;"/><br /><sub><b>Xianming Zhong</b></sub>](https://github.com/chinesedfan)<br />[📖](https://github.com/all-contributors/all-contributors-cli/commits?author=chinesedfan "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/8073251?v=4" width="100px;"/><br /><sub><b>C.Y.Xu</b></sub>](https://github.com/xuchaoying)<br />[💻](https://github.com/all-contributors/all-contributors-cli/commits?author=xuchaoying "Code") |
| [<img src="https://avatars3.githubusercontent.com/u/3680914?v=4" width="100px;"/><br /><sub><b>Dura</b></sub>](https://github.com/chris-dura)<br />[📖](https://github.com/all-contributors/all-contributors-cli/commits?author=chris-dura "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/3534236?v=4" width="100px;"/><br /><sub><b>Jake Bolam</b></sub>](https://jakebolam.com)<br />[🚇](#infra-jakebolam "Infrastructure (Hosting, Build-Tools, etc)") [💻](https://github.com/all-contributors/all-contributors-cli/commits?author=jakebolam "Code") [📖](https://github.com/all-contributors/all-contributors-cli/commits?author=jakebolam "Documentation") [⚠️](https://github.com/all-contributors/all-contributors-cli/commits?author=jakebolam "Tests") |

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

This project follows the
Expand All @@ -242,8 +244,10 @@ MIT

[npm]: https://www.npmjs.com/
[node]: https://nodejs.org
[build-badge]: https://img.shields.io/travis/all-contributors/all-contributors-cli.svg?style=flat-square
[build]: https://travis-ci.org/all-contributors/all-contributors-cli
[chat-badge]: https://img.shields.io/badge/slack-join-ff69b4.svg?style=flat-square
[chat]: https://join.slack.com/t/all-contributors/shared_invite/enQtNTE3ODMyMTA4NTk0LTUwZDMxZGZkMmViMzYzYzk2YTM2NjRkZGM5Yzc0ZTc5NmYzNWY3Y2Q0ZTY3ZmFhZDgyY2E3ZmIzNWQwMTUxZmE
[build-badge]: https://img.shields.io/circleci/project/all-contributors/all-contributors-cli/master.svg?style=flat-square
[build]: https://circleci.com/gh/all-contributors/all-contributors-cli
[coverage-badge]: https://img.shields.io/codecov/c/github/all-contributors/all-contributors-cli.svg?style=flat-square
[coverage]: https://codecov.io/github/all-contributors/all-contributors-cli
[version-badge]: https://img.shields.io/npm/v/all-contributors-cli.svg?style=flat-square
Expand Down
2 changes: 1 addition & 1 deletion src/generate/__tests__/format-contribution-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import contributors from './fixtures/contributors.json'

const fixtures = () => {
const options = {
projectOwner: 'jfmengels',
projectOwner: 'all-contributors',
projectName: 'all-contributors-cli',
repoType: 'github',
repoHost: 'https://github.com',
Expand Down
2 changes: 1 addition & 1 deletion src/generate/__tests__/format-contributor.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import contributors from './fixtures/contributors.json'

function fixtures() {
const options = {
projectOwner: 'jfmengels',
projectOwner: 'all-contributors',
projectName: 'all-contributors-cli',
repoType: 'github',
repoHost: 'https://github.com',
Expand Down
18 changes: 10 additions & 8 deletions src/repo/__tests__/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ const check = githubAPI.getContributors
beforeAll(() => {
nock('https://api.github.com')
.persist()
.get('/repos/all-contributors/all-contributors-cli/contributors?per_page=100')
.get(
'/repos/all-contributors/all-contributors-cli/contributors?per_page=100',
)
.reply(200, allContributorsCliResponse)
.get('/repos/facebook/react-native/contributors?per_page=100')
.reply(200, reactNativeResponse1, {
Expand All @@ -41,7 +43,7 @@ beforeAll(() => {
})

test('Handle a single results page correctly', async () => {
const transformed = await check('jfmengels', 'all-contributors-cli')
const transformed = await check('all-contributors', 'all-contributors-cli')
expect(transformed).toEqual(allContributorsCliTransformed)
})

Expand Down Expand Up @@ -95,32 +97,32 @@ test('attaches token when supplied', async () => {
.matchHeader('authorization', `token ${mockAuthToken}`)
.get('/users/test-token')
.reply(200, {
html_url: 'test-token',
html_url: 'test-token',
})

await(getUserInfo('test-token', 'https://github.com', mockAuthToken))
await getUserInfo('test-token', 'https://github.com', mockAuthToken)
})

test('attaches no token when supplied empty', async () => {
nock('https://api.github.com')
.matchHeader('authorization', '')
.get('/users/test-token')
.reply(200, {
html_url: 'test-token',
html_url: 'test-token',
})

await(getUserInfo('test-token', 'https://github.com', ''))
await getUserInfo('test-token', 'https://github.com', '')
})

test('attaches no token when not supplied', async () => {
nock('https://api.github.com')
.matchHeader('authorization', '')
.get('/users/test-token')
.reply(200, {
html_url: 'test-token',
html_url: 'test-token',
})

await(getUserInfo('test-token'))
await getUserInfo('test-token')
})

test('fill in the name when an empty string is returned', async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/util/__tests__/config-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ const NoOwnerConfigFile = {
contributors: [],
}
const NoNameConfigFile = {
projectOwner: 'jfmengels',
projectOwner: 'all-contributors',
projectName: '',
imageSize: 100,
commit: false,
contributorsPerLine: 6,
contributors: [],
}
const NoFilesConfigFile = {
projectOwner: 'jfmengels',
projectOwner: 'all-contributors',
projectName: 'all-contributors-cli',
imageSize: 100,
commit: false,
Expand Down

0 comments on commit 85a9e3a

Please sign in to comment.