mirror of
https://github.com/all-contributors/cli.git
synced 2025-01-24 21:46:29 +00:00
fix: switch over to new org all-contributors (#132)
This commit is contained in:
parent
5a9c8b7557
commit
85a9e3a26b
9 changed files with 91 additions and 28 deletions
69
.circleci/config.yml
Normal file
69
.circleci/config.yml
Normal file
|
@ -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
.nvmrc
Normal file
1
.nvmrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
8.14.0
|
14
.travis.yml
14
.travis.yml
|
@ -1,14 +0,0 @@
|
||||||
sudo: false
|
|
||||||
language: node_js
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- node_modules
|
|
||||||
notifications:
|
|
||||||
email: false
|
|
||||||
node_js:
|
|
||||||
- '8'
|
|
||||||
script: npm run validate
|
|
||||||
after_success: kcd-scripts travis-after-success
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
1
.yvmrc
Normal file
1
.yvmrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
1.9.2
|
|
@ -9,6 +9,7 @@
|
||||||
[![Code Coverage][coverage-badge]][coverage]
|
[![Code Coverage][coverage-badge]][coverage]
|
||||||
[![version][version-badge]][package] [![downloads][downloads-badge]][downloads]
|
[![version][version-badge]][package] [![downloads][downloads-badge]][downloads]
|
||||||
[![MIT License][license-badge]][license]
|
[![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)
|
[![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]
|
[![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc]
|
||||||
|
@ -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/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://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") |
|
| [<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 -->
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||||
|
|
||||||
This project follows the
|
This project follows the
|
||||||
|
@ -242,8 +244,10 @@ MIT
|
||||||
|
|
||||||
[npm]: https://www.npmjs.com/
|
[npm]: https://www.npmjs.com/
|
||||||
[node]: https://nodejs.org
|
[node]: https://nodejs.org
|
||||||
[build-badge]: https://img.shields.io/travis/all-contributors/all-contributors-cli.svg?style=flat-square
|
[chat-badge]: https://img.shields.io/badge/slack-join-ff69b4.svg?style=flat-square
|
||||||
[build]: https://travis-ci.org/all-contributors/all-contributors-cli
|
[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-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
|
[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
|
[version-badge]: https://img.shields.io/npm/v/all-contributors-cli.svg?style=flat-square
|
||||||
|
|
|
@ -3,7 +3,7 @@ import contributors from './fixtures/contributors.json'
|
||||||
|
|
||||||
const fixtures = () => {
|
const fixtures = () => {
|
||||||
const options = {
|
const options = {
|
||||||
projectOwner: 'jfmengels',
|
projectOwner: 'all-contributors',
|
||||||
projectName: 'all-contributors-cli',
|
projectName: 'all-contributors-cli',
|
||||||
repoType: 'github',
|
repoType: 'github',
|
||||||
repoHost: 'https://github.com',
|
repoHost: 'https://github.com',
|
||||||
|
|
|
@ -4,7 +4,7 @@ import contributors from './fixtures/contributors.json'
|
||||||
|
|
||||||
function fixtures() {
|
function fixtures() {
|
||||||
const options = {
|
const options = {
|
||||||
projectOwner: 'jfmengels',
|
projectOwner: 'all-contributors',
|
||||||
projectName: 'all-contributors-cli',
|
projectName: 'all-contributors-cli',
|
||||||
repoType: 'github',
|
repoType: 'github',
|
||||||
repoHost: 'https://github.com',
|
repoHost: 'https://github.com',
|
||||||
|
|
|
@ -16,7 +16,9 @@ const check = githubAPI.getContributors
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
nock('https://api.github.com')
|
nock('https://api.github.com')
|
||||||
.persist()
|
.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)
|
.reply(200, allContributorsCliResponse)
|
||||||
.get('/repos/facebook/react-native/contributors?per_page=100')
|
.get('/repos/facebook/react-native/contributors?per_page=100')
|
||||||
.reply(200, reactNativeResponse1, {
|
.reply(200, reactNativeResponse1, {
|
||||||
|
@ -41,7 +43,7 @@ beforeAll(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Handle a single results page correctly', async () => {
|
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)
|
expect(transformed).toEqual(allContributorsCliTransformed)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -95,10 +97,10 @@ test('attaches token when supplied', async () => {
|
||||||
.matchHeader('authorization', `token ${mockAuthToken}`)
|
.matchHeader('authorization', `token ${mockAuthToken}`)
|
||||||
.get('/users/test-token')
|
.get('/users/test-token')
|
||||||
.reply(200, {
|
.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 () => {
|
test('attaches no token when supplied empty', async () => {
|
||||||
|
@ -106,10 +108,10 @@ test('attaches no token when supplied empty', async () => {
|
||||||
.matchHeader('authorization', '')
|
.matchHeader('authorization', '')
|
||||||
.get('/users/test-token')
|
.get('/users/test-token')
|
||||||
.reply(200, {
|
.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 () => {
|
test('attaches no token when not supplied', async () => {
|
||||||
|
@ -117,10 +119,10 @@ test('attaches no token when not supplied', async () => {
|
||||||
.matchHeader('authorization', '')
|
.matchHeader('authorization', '')
|
||||||
.get('/users/test-token')
|
.get('/users/test-token')
|
||||||
.reply(200, {
|
.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 () => {
|
test('fill in the name when an empty string is returned', async () => {
|
||||||
|
|
|
@ -12,7 +12,7 @@ const NoOwnerConfigFile = {
|
||||||
contributors: [],
|
contributors: [],
|
||||||
}
|
}
|
||||||
const NoNameConfigFile = {
|
const NoNameConfigFile = {
|
||||||
projectOwner: 'jfmengels',
|
projectOwner: 'all-contributors',
|
||||||
projectName: '',
|
projectName: '',
|
||||||
imageSize: 100,
|
imageSize: 100,
|
||||||
commit: false,
|
commit: false,
|
||||||
|
@ -20,7 +20,7 @@ const NoNameConfigFile = {
|
||||||
contributors: [],
|
contributors: [],
|
||||||
}
|
}
|
||||||
const NoFilesConfigFile = {
|
const NoFilesConfigFile = {
|
||||||
projectOwner: 'jfmengels',
|
projectOwner: 'all-contributors',
|
||||||
projectName: 'all-contributors-cli',
|
projectName: 'all-contributors-cli',
|
||||||
imageSize: 100,
|
imageSize: 100,
|
||||||
commit: false,
|
commit: false,
|
||||||
|
|
Loading…
Reference in a new issue