From 85a9e3a26be6b16ad94be9b7b2a08fd4733637e7 Mon Sep 17 00:00:00 2001 From: Jake Bolam Date: Mon, 7 Jan 2019 15:55:57 +0800 Subject: [PATCH] fix: switch over to new org all-contributors (#132) --- .circleci/config.yml | 69 +++++++++++++++++++ .nvmrc | 1 + .travis.yml | 14 ---- .yvmrc | 1 + README.md | 8 ++- .../__tests__/format-contribution-type.js | 2 +- src/generate/__tests__/format-contributor.js | 2 +- src/repo/__tests__/github.js | 18 ++--- src/util/__tests__/config-file.js | 4 +- 9 files changed, 91 insertions(+), 28 deletions(-) create mode 100644 .circleci/config.yml create mode 100644 .nvmrc delete mode 100644 .travis.yml create mode 100644 .yvmrc diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..a3db038 --- /dev/null +++ b/.circleci/config.yml @@ -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 diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..2a5dd0d --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +8.14.0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f94b23a..0000000 --- a/.travis.yml +++ /dev/null @@ -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 diff --git a/.yvmrc b/.yvmrc new file mode 100644 index 0000000..8fdcf38 --- /dev/null +++ b/.yvmrc @@ -0,0 +1 @@ +1.9.2 diff --git a/README.md b/README.md index 5d57482..3a51efa 100644 --- a/README.md +++ b/README.md @@ -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] @@ -229,6 +230,7 @@ Thanks goes to these wonderful people | [
Bryce Reynolds](https://github.com/brycereynolds)
[💻](https://github.com/all-contributors/all-contributors-cli/commits?author=brycereynolds "Code") | [
James, please](http://www.jmeas.com)
[🤔](#ideas-jmeas "Ideas, Planning, & Feedback") [💻](https://github.com/all-contributors/all-contributors-cli/commits?author=jmeas "Code") | [
Spyros Ioakeimidis](http://www.spyros.io)
[💻](https://github.com/all-contributors/all-contributors-cli/commits?author=spirosikmd "Code") | [
Fernando Costa](https://github.com/fadc80)
[💻](https://github.com/all-contributors/all-contributors-cli/commits?author=fadc80 "Code") | [
snipe](https://snipe.net)
[📖](https://github.com/all-contributors/all-contributors-cli/commits?author=snipe "Documentation") | [
Gant Laborde](http://gantlaborde.com/)
[💻](https://github.com/all-contributors/all-contributors-cli/commits?author=GantMan "Code") | | [
Md Zubair Ahmed](https://in.linkedin.com/in/mzubairahmed)
[📖](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") | [
Divjot Singh](http://bogas04.github.io)
[📖](https://github.com/all-contributors/all-contributors-cli/commits?author=bogas04 "Documentation") | [
João Marques](https://github.com/tigermarques)
[💻](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") | [
Andrew Lisowski](http://hipstersmoothie.com)
[💻](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") | [
Xianming Zhong](https://github.com/chinesedfan)
[📖](https://github.com/all-contributors/all-contributors-cli/commits?author=chinesedfan "Documentation") | [
C.Y.Xu](https://github.com/xuchaoying)
[💻](https://github.com/all-contributors/all-contributors-cli/commits?author=xuchaoying "Code") | | [
Dura](https://github.com/chris-dura)
[📖](https://github.com/all-contributors/all-contributors-cli/commits?author=chris-dura "Documentation") | [
Jake Bolam](https://jakebolam.com)
[🚇](#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") | + This project follows the @@ -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 diff --git a/src/generate/__tests__/format-contribution-type.js b/src/generate/__tests__/format-contribution-type.js index f19e34f..c873623 100644 --- a/src/generate/__tests__/format-contribution-type.js +++ b/src/generate/__tests__/format-contribution-type.js @@ -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', diff --git a/src/generate/__tests__/format-contributor.js b/src/generate/__tests__/format-contributor.js index 187b1ec..de707ce 100644 --- a/src/generate/__tests__/format-contributor.js +++ b/src/generate/__tests__/format-contributor.js @@ -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', diff --git a/src/repo/__tests__/github.js b/src/repo/__tests__/github.js index bf9c9bd..e291b4e 100644 --- a/src/repo/__tests__/github.js +++ b/src/repo/__tests__/github.js @@ -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, { @@ -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) }) @@ -95,10 +97,10 @@ 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 () => { @@ -106,10 +108,10 @@ test('attaches no token when supplied empty', async () => { .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 () => { @@ -117,10 +119,10 @@ test('attaches no token when not supplied', async () => { .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 () => { diff --git a/src/util/__tests__/config-file.js b/src/util/__tests__/config-file.js index 6af8ff2..128c68e 100644 --- a/src/util/__tests__/config-file.js +++ b/src/util/__tests__/config-file.js @@ -12,7 +12,7 @@ const NoOwnerConfigFile = { contributors: [], } const NoNameConfigFile = { - projectOwner: 'jfmengels', + projectOwner: 'all-contributors', projectName: '', imageSize: 100, commit: false, @@ -20,7 +20,7 @@ const NoNameConfigFile = { contributors: [], } const NoFilesConfigFile = { - projectOwner: 'jfmengels', + projectOwner: 'all-contributors', projectName: 'all-contributors-cli', imageSize: 100, commit: false,