Skip to content

Commit 6dec7ff

Browse files
committed
- setup gh workflow
- setup release-it - improve README.md Signed-off-by: Dmitriy Nevzorov <[email protected]>
1 parent ee3ec82 commit 6dec7ff

File tree

4 files changed

+868
-297
lines changed

4 files changed

+868
-297
lines changed

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
13+
- uses: actions/setup-node@v1
14+
with:
15+
node-version: 12
16+
registry-url: https://registry.npmjs.org/
17+
18+
- name: get yarn cache
19+
id: yarn-cache
20+
run: echo "::set-output name=dir::$(yarn cache dir)"
21+
22+
- uses: actions/cache@v1
23+
with:
24+
path: ${{ steps.yarn-cache.outputs.dir }}
25+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
26+
restore-keys: |
27+
${{ runner.os }}-yarn-
28+
29+
- run: yarn install --skip-integrity-check --non-interactive --no-progress
30+
31+
- run: npm publish --access public
32+
env:
33+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ const Header = ({siteTitle}) => {
187187
| redirect | boolean | if the value is `true`, `/` or `/page-2` will be redirected to the user's preferred language router. e.g) `/es` or `/es/page-2`. Otherwise, the pages will render `defaultLangugage` language. |
188188
| i18nextOptions | object | [i18next configuration options](https://www.i18next.com/overview/configuration-options) |
189189

190-
## API
190+
## Plugin API
191191

192192
### `Link`
193193

package.json

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,39 @@
11
{
22
"name": "gatsby-plugin-react-i18next",
33
"version": "0.0.1",
4-
"description": "Gatsby react-i18next plugin",
4+
"description": "Easily translate your Gatsby website into multiple languages",
55
"main": "index.js",
66
"types": "dist/index.d.ts",
77
"author": "Dmitriy Nevzorov",
88
"license": "MIT",
99
"keywords": [
1010
"react",
1111
"gatsby",
12+
"gatsbyjs",
1213
"gatsby-plugin",
1314
"gatsby-component",
1415
"i18next",
16+
"react-i18next",
17+
"gatsby-i18n",
1518
"i18n"
1619
],
20+
"repository": {
21+
"url": "https://github.com/microapps/gatsby-plugin-react-i18next"
22+
},
1723
"scripts": {
1824
"build": "tsc --declaration --outDir dist",
19-
"dev": "tsc --watch --declaration --outDir dist"
25+
"dev": "tsc --watch --declaration --outDir dist",
26+
"prepare": "yarn run build",
27+
"release": "release-it"
2028
},
2129
"devDependencies": {
2230
"@types/bluebird": "^3.5.32",
2331
"@types/react": "^16.9.35",
2432
"gatsby": "^2.22.9",
33+
"husky": "^4.2.5",
2534
"prettier": "^2.0.5",
35+
"pretty-quick": "^2.0.1",
36+
"release-it": "^13.6.1",
2637
"typescript": "^3.9.3"
2738
},
2839
"dependencies": {
@@ -35,5 +46,22 @@
3546
"peerDependencies": {
3647
"gatsby": "^2.2.0",
3748
"react": "^16.12.0"
49+
},
50+
"husky": {
51+
"hooks": {
52+
"pre-commit": "pretty-quick --staged"
53+
}
54+
},
55+
"release-it": {
56+
"git": {
57+
"tagName": "v${version}",
58+
"commitMessage": "chore: release v${version}"
59+
},
60+
"github": {
61+
"release": true
62+
},
63+
"npm": {
64+
"publish": false
65+
}
3866
}
3967
}

0 commit comments

Comments
 (0)