Skip to content

Commit 734d35e

Browse files
authored
chore: Add semantic release, update docs, add contribution guide
1 parent 8eba217 commit 734d35e

File tree

10 files changed

+2689
-70
lines changed

10 files changed

+2689
-70
lines changed

.circleci/config.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,18 @@ jobs:
278278
name: Run e2e tests
279279
command: yarn test:e2e:android
280280

281+
"Publish: semantic release":
282+
<<: *js_defaults
283+
steps:
284+
- restore-cache: *cache_restore_yarn
285+
- run:
286+
name: Install dependencies
287+
command: yarn --pure-lockfile --non-interactive --cache-folder ~/.cache/yarn
288+
- save-cache: *cache_save_yarn
289+
- run:
290+
name: Publish to NPM registry
291+
command: yarn ci:publish
292+
281293
# ==============================
282294
# WORK FLOWS
283295
# ==============================
@@ -304,4 +316,11 @@ workflows:
304316
requires:
305317
- "Test: lint"
306318
- "Test: flow"
307-
- "Build: Android release apk"
319+
- "Build: Android release apk"
320+
- "Publish: semantic release":
321+
requires:
322+
- "Test: Android e2e"
323+
- "Test: iOS e2e"
324+
filters:
325+
branches:
326+
only: master
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: ':bug: Bug report'
3+
about: Something not working as expected
4+
label: 'Bug'
5+
---
6+
7+
## Current behavior
8+
9+
<!-- Describe the issue. -->
10+
11+
## Expected behavior
12+
13+
<!-- Describe what the desired behavior would be. -->
14+
15+
## Repro steps
16+
17+
<!-- Please provide us steps (in points) how we can reproduce the issue. -->
18+
19+
## Environment
20+
21+
- **Async Storage version**: <!-- @react-native-community/async-storage version set in package.json -->
22+
- **React-Native version**: <!-- React Native version set in package.json -->
23+
- **Platform tested**: <!-- iOS / Android -->
24+
- **Logs/Error that are relevant**: <!-- link to your CI logs or semantic-release logs -->
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: ':wrench: Feature request'
3+
about: New functionality for Async Storage
4+
label: 'Enhancement'
5+
---
6+
7+
## Motivation
8+
9+
<!-- Describe the context, the use-case and the advantages of the feature request. -->
10+
11+
## Description
12+
13+
<!-- Describe the functional changes that would have to be made -->
14+
15+
## New feature implementation
16+
17+
<!-- Optionally, describe the technical changes to be made -->
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: ':speaking_head: Have a question / start a discussion'
3+
about: You want to ask or discuss something
4+
label: 'Question/Discussion'
5+
---
6+
7+
## You want to:
8+
<!-- Ask question / Discuss something -->
9+
10+
## Details:
11+
<!-- Place for your question/discussion -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Summary:
2+
---------
3+
4+
<!-- Thank you for sending the PR!
5+
Help us understand more of your work - you can explain what you did, post a link to an issue etc. Anything helps! -->
6+
7+
8+
Test Plan:
9+
----------
10+
11+
<!-- Help us test your work (**REQUIRED**). If you changed code, please provide us with instruction of how we can try it out ourselves, so we can confirm it's working. You can also post screenshots/gifts. -->

.releaserc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
"@semantic-release/npm",
6+
"@semantic-release/github",
7+
[
8+
"@semantic-release/git",
9+
{
10+
"assets": "package.json",
11+
"message": "chore(release): ${nextRelease.version} [skip ci] \n\n${nextRelease.notes}"
12+
}
13+
]
14+
]
15+
}

CONTRIBUTING.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Contributing to React Native Async Storage
2+
3+
Thank you for helping out with Async Storage!
4+
We'd like to make contributions as pleasent as possible, so here's a small guide of how we see it. Happy to hear your feedback about anything, so please let us know.
5+
6+
7+
## Tests
8+
We use `flow` for type check, `eslint` with `prettier` for linting/formatting, `jest/detox` for tests (unit and e2e). All tests are run on CircleCI for all opened pull requests, but you should use them locally when making changes.
9+
10+
* `yarn test`: Run all tests, except for e2e (see note below).
11+
* `yarn test:lint`: Run `eslint` check.
12+
* `yarn test:flow`: Run `flow` type check.
13+
* `yarn test:e2e:<ios|android>`: Runs e2e tests. Before you can run it, you should build the app that can be run, by using `yarn build:e2e:<ios|android>`.
14+
15+
16+
## Sending a pull request
17+
When you're sending a pull request:
18+
19+
* Communication is a key. If you want fix/add something, please open new/find existing issue, so we can discuss it.
20+
* We prefer small pull requests focused on one change, as those are easier to test/check.
21+
* Please make sure that all tests are passing on your local machine.
22+
* Follow the template when opening a PR.
23+
24+
25+
## Commits and versioning
26+
All PRs are squashed into `master` and wrapped up in a single commit, following [conventional commit message](https://www.conventionalcommits.org/en/v1.0.0-beta.3). Combined with [semantic versioning](https://semver.org/), this allows us to have a frequent releases of the library.
27+
28+
*Note*: We don't force this convention on Pull Requests from contributors, but it's a clean way to see what type of changes are made, so feel free to follow it.
29+
30+
31+
Most notably prefixes you'll see:
32+
33+
* **fix**: Bug fixes, triggers *patch* release
34+
* **feat**: New feature implemented, triggers *minor*
35+
* **chore**: Changes that are not affecting end user (CI config changes, scripts, ["grunt work"](https://stackoverflow.com/a/26944812/3510245))
36+
* **docs**: Documentation changes.
37+
* **perf**: A code change that improves performance.
38+
* **refactor**: A code change that neither fixes a bug nor adds a feature.
39+
* **test**: Adding missing tests or correcting existing tests.
40+
41+
42+
## Release process
43+
We use [Semantic Release](http://semantic-release.org) to automatically release new versions of the library when changes are merged into master. Using the commit message convention described above, it will detect if we need to release a patch, minor, or major version of the library.
44+
45+
46+
## Reporting issues
47+
You can report issues on our [bug tracker](https://github.com/react-native-community/react-native-async-storage/issues). Please search for existing issues and follow the issue template when opening an one.
48+
49+
50+
## License
51+
By contributing to React Native Async Storage, you agree that your contributions will be licensed under the **MIT** license.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ const {
7575

7676
See docs for [api and more examples.](docs/API.md)
7777

78+
## Contribution
79+
80+
See the [CONTRIBUTING](CONTRIBUTING.md) file for how to help out.
81+
7882
## License
7983

8084
MIT

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@
2828
"test:flow": "flow check",
2929
"test:lint": "eslint 'lib/**/*.js' 'example/**/*.js'",
3030
"test:e2e:ios": "detox test -c ios",
31-
"test:e2e:android": "detox test -c android"
31+
"test:e2e:android": "detox test -c android",
32+
"ci:publish": "yarn semantic-release"
3233
},
3334
"peerDependencies": {
3435
"react": "^16.0",
3536
"react-native": "^0.57.0"
3637
},
3738
"devDependencies": {
3839
"@babel/core": "7.0.0",
40+
"@semantic-release/git": "7.0.8",
3941
"babel-core": "7.0.0-bridge.0",
4042
"babel-eslint": "9.0.0",
4143
"babel-jest": "24.1.0",
@@ -57,7 +59,8 @@
5759
"prettier": "1.16.4",
5860
"react": "16.6.3",
5961
"react-native": "0.58.4",
60-
"react-test-renderer": "16.6.3"
62+
"react-test-renderer": "16.6.3",
63+
"semantic-release": "15.13.3"
6164
},
6265
"jest": {
6366
"preset": "react-native"

0 commit comments

Comments
 (0)