Skip to content

Commit 5f1814a

Browse files
authored
Merge pull request #26 from satya164/@satya164/release-tooling
Setup some tooling for publishing
2 parents c18b0a4 + 757738e commit 5f1814a

File tree

7 files changed

+4195
-102
lines changed

7 files changed

+4195
-102
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ bin/
4646
\.buckd/
4747
android/app/libs
4848
android/keystores/debug.keystore
49+
50+
# generated by bob
51+
lib/

.release-it.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"increment": "conventional:angular",
3+
"scripts": {
4+
"changelog": "conventional-changelog -p angular | tail -n +3"
5+
},
6+
"git": {
7+
"commitMessage": "chore: release %s",
8+
"tagName": "v%s"
9+
},
10+
"npm": {
11+
"publish": true
12+
},
13+
"github": {
14+
"release": true
15+
}
16+
}

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ class Example extends React.Component {
5656

5757
## Props
5858

59-
| name | required | default | description |
59+
| name | required | default | description |
6060
| ------------------------- | -------- | ------- | ------------|
6161
| snapPoints | yes | | E.g. `[300, 200, 0]`. Points for snapping of bottom sheet coomponent. They define distance from bottom of the screen. Might be number or percent (as string e.g. `'20%'`) for points or percents of screen height from bottom. |
6262
| initialSnap | no | 0 | Determines initial snap point of bottom sheet. The value is the index from snapPoints. |
6363
| renderContent | no | | Method for rendering scrollable content of bottom sheet. |
6464
| renderHeader | no | | Method for rendering non-scrollable header of bottom sheet. |
65-
| enabledGestureInteraction | no | `true` | Defines if bottom sheet could be scrollable by gesture. |
66-
| enabledManualSnapping | no | `true` | If `false` blocks snapping using `snapTo` method. |
65+
| enabledGestureInteraction | no | `true` | Defines if bottom sheet could be scrollable by gesture. |
66+
| enabledManualSnapping | no | `true` | If `false` blocks snapping using `snapTo` method. |
6767
| enabledInnerScrolling | no | `true` | Defines whether it's possible to scroll inner content of bottom sheet. |
6868
| callbackNode | no | | `reanimated` node which holds position of bottom sheet, where `0` it the highest snap point and `1` is the lowest. |
6969
| contentPosition | no | | `reanimated` node which holds position of bottom sheet's content (in dp) |
70-
| overdragResistanceFactor | no | 0 | `Defines how violently sheet has to stopped while overdragging. 0 means no overdrag |
71-
| springConfig | no | `{ }` | Overrides config for spring animation |
72-
| innerGestureHandlerRefs | no | | Refs for gesture handlers used for building bottom sheet. The array consists fo three refs. The first for PanGH used for inner content scrolling. The second for PanGH used for header. The third for TapGH used for stopping scrolling the content. |
70+
| overdragResistanceFactor | no | 0 | `Defines how violently sheet has to stopped while overdragging. 0 means no overdrag |
71+
| springConfig | no | `{ }` | Overrides config for spring animation |
72+
| innerGestureHandlerRefs | no | | Refs for gesture handlers used for building bottom sheet. The array consists fo three refs. The first for PanGH used for inner content scrolling. The second for PanGH used for header. The third for TapGH used for stopping scrolling the content. |
7373

7474

7575
## Methods
@@ -105,3 +105,15 @@ It's not finished and some work has to be done yet.
105105
2. Horizontal mode
106106
3. Deal with GH in inner scrollView
107107
4. Cleanup code (e.g. measuring of components)
108+
109+
## Contributing
110+
111+
### Publishing a release
112+
113+
We use [release-it](https://github.com/release-it/release-it) to automate our release. If you have publish access to the NPM package, run the following from the master branch to publish a new release:
114+
115+
```sh
116+
yarn release
117+
```
118+
119+
NOTE: You must have a `GITHUB_TOKEN` environment variable available. You can create a GitHub access token with the "repo" access [here](https://github.com/settings/tokens).

commitlint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
}

package.json

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
"name": "reanimated-bottom-sheet",
33
"version": "1.0.0-alpha.8",
44
"description": "Bottom sheet component",
5-
"main": "index.js",
5+
"main": "lib/commonjs/index.js",
6+
"module": "lib/module/index.js",
7+
"react-native": "src/index.js",
68
"types": "reanimated-bottom-sheet.d.ts",
79
"scripts": {
8-
"test": "echo \"Error: no test specified\" && exit 1"
10+
"test": "echo \"Error: no test specified\" && exit 1",
11+
"release": "release-it",
12+
"prepare": "bob build"
913
},
1014
"keywords": [
1115
"react-native",
@@ -15,7 +19,8 @@
1519
"handler"
1620
],
1721
"files": [
18-
"index.js",
22+
"lib/",
23+
"src/",
1924
"reanimated-bottom-sheet.d.ts",
2025
"README.md"
2126
],
@@ -25,17 +30,35 @@
2530
"url": "git+https://github.com/osdnk/reanimated-bottom-sheet.git"
2631
},
2732
"license": "MIT",
28-
"readmeFilename": "README.md",
2933
"peerDependencies": {
3034
"react": "*",
3135
"react-native": "*",
3236
"react-native-gesture-handler": "*",
3337
"react-native-reanimated": "*"
3438
},
3539
"devDependencies": {
40+
"@commitlint/config-conventional": "^7.5.0",
41+
"@react-native-community/bob": "^0.3.3",
3642
"babel-eslint": "^10.0.1",
43+
"commitlint": "^7.5.2",
44+
"conventional-changelog-cli": "^2.0.12",
3745
"eslint": "^5.15.1",
3846
"eslint-plugin-react": "^7.12.4",
39-
"react-native-reanimated": "^1.0.0-alpha.12"
47+
"husky": "^1.3.1",
48+
"react-native-reanimated": "^1.0.0-alpha.12",
49+
"release-it": "^10.4.0"
50+
},
51+
"husky": {
52+
"hooks": {
53+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
54+
}
55+
},
56+
"@react-native-community/bob": {
57+
"source": "src",
58+
"output": "lib",
59+
"targets": [
60+
"commonjs",
61+
"module"
62+
]
4063
}
4164
}

index.js renamed to src/index.js

File renamed without changes.

0 commit comments

Comments
 (0)