Skip to content

Commit ccc43ec

Browse files
committed
chore: modernize tooling (use github actions)
Closes #163
1 parent 6b71ecf commit ccc43ec

File tree

18 files changed

+309
-184
lines changed

18 files changed

+309
-184
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ learn how: http://kcd.im/pull-request
1313

1414
- `babel-plugin-macros` version:
1515
- `node` version:
16-
- `npm` (or `yarn`) version:
16+
- `npm` version:
1717

1818
Relevant code or config
1919

2020
```javascript
21+
2122
```
2223

2324
What you did:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
Thanks for your interest in the project. I appreciate bugs filed and PRs submitted!
2+
Thanks for your interest in the project. Bugs filed and PRs submitted are appreciated!
33
44
Please make sure that you are familiar with and follow the Code of Conduct for
55
this project (found in the CODE_OF_CONDUCT.md file).
@@ -26,4 +26,16 @@ merge of your pull request!
2626

2727
**How**:
2828

29+
<!-- Have you done all of these things? -->
30+
31+
**Checklist**:
32+
33+
<!-- add "N/A" to the end of each line that's irrelevant to your changes -->
34+
<!-- to check an item, place an "x" in the box like so: "- [x] Documentation" -->
35+
36+
- [ ] Documentation
37+
- [ ] Tests
38+
- [ ] Ready to be merged
39+
<!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->
40+
2941
<!-- feel free to add additional comments -->

.github/workflows/validate.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: validate
2+
on:
3+
push:
4+
branches:
5+
- '+([0-9])?(.{+([0-9]),x}).x'
6+
- 'master'
7+
- 'next'
8+
- 'next-major'
9+
- 'beta'
10+
- 'alpha'
11+
- '!all-contributors/**'
12+
pull_request: {}
13+
jobs:
14+
main:
15+
# ignore all-contributors PRs
16+
if: ${{ !contains(github.head_ref, 'all-contributors') }}
17+
strategy:
18+
matrix:
19+
node: [10.13, 12, 14, 15]
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: ⬇️ Checkout repo
23+
uses: actions/checkout@v2
24+
25+
- name: ⎔ Setup node
26+
uses: actions/setup-node@v1
27+
with:
28+
node-version: ${{ matrix.node }}
29+
30+
- name: 📥 Download deps
31+
uses: bahmutov/npm-install@v1
32+
with:
33+
useLockFile: false
34+
35+
- name: ▶️ Run validate script
36+
run: npm run validate
37+
38+
- name: ⬆️ Upload coverage report
39+
uses: codecov/codecov-action@v1
40+
41+
release:
42+
needs: main
43+
runs-on: ubuntu-latest
44+
if:
45+
${{ github.repository == 'kentcdodds/babel-plugin-macros' &&
46+
contains('refs/heads/master,refs/heads/beta,refs/heads/next,refs/heads/alpha',
47+
github.ref) && github.event_name == 'push' }}
48+
steps:
49+
- name: ⬇️ Checkout repo
50+
uses: actions/checkout@v2
51+
52+
- name: ⎔ Setup node
53+
uses: actions/setup-node@v1
54+
with:
55+
node-version: 14
56+
57+
- name: 📥 Download deps
58+
uses: bahmutov/npm-install@v1
59+
with:
60+
useLockFile: false
61+
62+
- name: 🏗 Run build script
63+
run: npm run build
64+
65+
- name: 🚀 Release
66+
uses: cycjimmy/semantic-release-action@v2
67+
with:
68+
semantic_version: 17
69+
branches: |
70+
[
71+
'+([0-9])?(.{+([0-9]),x}).x',
72+
'master',
73+
'next',
74+
'next-major',
75+
{name: 'beta', prerelease: true},
76+
{name: 'alpha', prerelease: true}
77+
]
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
registry=http://registry.npmjs.org
1+
registry=https://registry.npmjs.org/

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
- Focusing on what is best not just for us as individuals, but for the overall
26+
community
27+
28+
Examples of unacceptable behavior include:
29+
30+
- The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
[email protected]. All complaints will be reviewed and investigated promptly
64+
and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series of
86+
actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or permanent
93+
ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within the
113+
community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by
122+
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

CONTRIBUTING.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,23 @@ series [How to Contribute to an Open Source Project on GitHub][egghead]
88
## Project setup
99

1010
1. Fork and clone the repo
11-
2. `$ npm install` to install dependencies
12-
3. `$ npm run validate` to validate you've got it working
13-
4. Create a branch for your PR
11+
2. Run `npm run setup -s` to install dependencies and run validation
12+
3. Create a branch for your PR with `git checkout -b pr/your-branch-name`
1413

15-
> Tip: Keep your `master` branch pointing at the original repository and make
16-
> pull requests from branches on your fork. To do this, run:
14+
> Tip: Keep your `main` branch pointing at the original repository and make pull
15+
> requests from branches on your fork. To do this, run:
1716
>
1817
> ```
1918
> git remote add upstream https://github.com/kentcdodds/babel-plugin-macros
2019
> git fetch upstream
21-
> git branch --set-upstream-to=upstream/master master
20+
> git branch --set-upstream-to=upstream/main main
2221
> ```
2322
>
2423
> This will add the original repository as a "remote" called "upstream," Then
25-
> fetch the git information from that remote, then set your local `master`
26-
> branch to use the upstream master branch whenever you run `git pull`. Then you
27-
> can make all of your pull request branches based on this `master` branch.
28-
> Whenever you want to update your version of `master`, do a regular `git pull`.
24+
> fetch the git information from that remote, then set your local `main` branch
25+
> to use the upstream main branch whenever you run `git pull`. Then you can make
26+
> all of your pull request branches based on this `main` branch. Whenever you
27+
> want to update your version of `main`, do a regular `git pull`.
2928
3029
## Committing and Pushing changes
3130
@@ -42,5 +41,6 @@ requests! Thanks!
4241
4342
<!-- prettier-ignore-start -->
4443
[egghead]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
44+
[all-contributors]: https://github.com/all-contributors/all-contributors
4545
[issues]: https://github.com/kentcdodds/babel-plugin-macros/issues
4646
<!-- prettier-ignore-end -->

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The MIT License (MIT)
2-
Copyright (c) 2017 Kent C. Dodds
2+
Copyright (c) 2020 Kent C. Dodds
33

44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)