Skip to content

Commit 246bf70

Browse files
committed
Add Priettier and CircleCI, improve README
1 parent c3dcb64 commit 246bf70

15 files changed

Lines changed: 97 additions & 51 deletions

.circleci/config.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2.1
2+
3+
jobs:
4+
run_tests:
5+
docker:
6+
- image: circleci/node:10.18.1
7+
environment:
8+
TERM: xterm
9+
steps:
10+
- checkout
11+
- run:
12+
command: npm install
13+
- run:
14+
command: npm run ci:test
15+
16+
workflows:
17+
tests:
18+
jobs:
19+
- run_tests

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2018 Jan Grzegorowski
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
> React useGoogleMaps hook
44
5-
[![NPM](https://img.shields.io/npm/v/react-hook-google-maps.svg)](https://www.npmjs.com/package/react-hook-google-maps)
5+
[![license](https://img.shields.io/github/license/react-hook-google-maps/react-hook-google-maps.svg)](https://opensource.org/licenses/MIT)
6+
[![version](https://img.shields.io/npm/v/react-hook-google-maps.svg)](https://www.npmjs.com/package/react-hook-google-maps)
7+
[![dependencies status](https://img.shields.io/david/react-hook-google-maps/react-hook-google-maps.svg)](https://david-dm.org/react-hook-google-maps/react-hook-google-maps)
8+
[![CI build](https://img.shields.io/circleci/project/github/react-hook-google-maps/react-hook-google-maps/master.svg)](https://circleci.com/gh/react-hook-google-maps/react-hook-google-maps)
9+
[![code coverage](https://img.shields.io/codecov/c/github/react-hook-google-maps/react-hook-google-maps.svg)](https://codecov.io/gh/react-hook-google-maps/react-hook-google-maps)
610

711
Easiest way to use Google Maps in your React application.
812

@@ -28,8 +32,8 @@ const App = () => {
2832
// NOTE: even if you change options later
2933
{
3034
center: { lat: 0, lng: 0 },
31-
zoom: 3
32-
}
35+
zoom: 3,
36+
},
3337
);
3438
console.log(map); // instance of created Map object (https://developers.google.com/maps/documentation/javascript/reference/map)
3539
console.log(google); // google API object (easily get google.maps.LatLng or google.maps.Marker or any other Google Maps class)
@@ -45,8 +49,8 @@ export default App;
4549

4650
## License
4751

48-
MIT
52+
[MIT](./LICENSE)
4953

5054
## Author
5155

52-
Jan Grzegorowski [jmarceli](https://github.com/jmarceli)
56+
Jan Grzegorowski

example/src/Map.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export const Map = React.memo(function Map() {
77
"AIzaSyC4Z5Qz97EWcoCczNn2IcYvaYG0L9pe6Rk",
88
{
99
center: { lat: 0, lng: 0 },
10-
zoom: 3
11-
}
10+
zoom: 3,
11+
},
1212
);
1313
console.log("render Map");
1414

example/src/MapWithMarker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export const MapWithMarker = React.memo(function Map() {
99
"AIzaSyC4Z5Qz97EWcoCczNn2IcYvaYG0L9pe6Rk",
1010
{
1111
zoom: 4,
12-
center: uluru
13-
}
12+
center: uluru,
13+
},
1414
);
1515
console.log("render MapWithMarkers");
1616

example/tsconfig.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
4+
"lib": ["dom", "dom.iterable", "esnext"],
95
"allowJs": true,
106
"skipLibCheck": true,
117
"esModuleInterop": true,
@@ -19,7 +15,5 @@
1915
"noEmit": true,
2016
"jsx": "react"
2117
},
22-
"include": [
23-
"src"
24-
]
18+
"include": ["src"]
2519
}

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,24 @@
22
"name": "react-hook-google-maps",
33
"version": "0.0.2",
44
"description": "React useGoogleMaps hook",
5-
"author": "Jan Grzegorowski",
5+
"author": "Jan Grzegorowski (https://www.grzegorowski.com)",
66
"license": "MIT",
7-
"repository": "jmarceli/react-hook-google-maps",
7+
"private": false,
8+
"repository": "https://github.com/jmarceli/react-hook-google-maps",
89
"main": "dist/index.js",
910
"module": "dist/index.es.js",
1011
"jsnext:main": "dist/index.es.js",
12+
"keywords": [
13+
"react",
14+
"google-maps",
15+
"hook",
16+
"useGoogleMaps",
17+
"google-maps-api"
18+
],
19+
"homepage": "https://github.com/jmarceli/react-hook-google-maps",
20+
"bugs": {
21+
"url": "https://github.com/jmarceli/react-hook-google-maps/issues"
22+
},
1123
"engines": {
1224
"node": ">=8",
1325
"npm": ">=5"
@@ -36,6 +48,7 @@
3648
"@types/react-dom": "^16.9.4",
3749
"cross-env": "^6.0.3",
3850
"gh-pages": "^2.2.0",
51+
"prettier": "^1.19.1",
3952
"react": "^16.12.0",
4053
"react-dom": "^16.12.0",
4154
"react-scripts": "3.3.0",

prettier.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
trailingComma: "all",
3+
tabWidth: 2,
4+
};

rollup.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,27 @@ export default {
1616
file: pkg.main,
1717
format: "cjs",
1818
exports: "named",
19-
sourcemap: true
19+
sourcemap: true,
2020
},
2121
{
2222
file: pkg.module,
2323
format: "es",
2424
exports: "named",
25-
sourcemap: true
26-
}
25+
sourcemap: true,
26+
},
2727
],
2828
plugins: [
2929
external(),
3030
postcss({
31-
modules: true
31+
modules: true,
3232
}),
3333
url(),
3434
svgr(),
3535
resolve(),
3636
typescript({
3737
rollupCommonJSResolveHack: true,
38-
clean: true
38+
clean: true,
3939
}),
40-
commonjs()
41-
]
40+
commonjs(),
41+
],
4242
};

0 commit comments

Comments
 (0)