Skip to content

Commit 3a8080b

Browse files
Add @storybook/react (#27)
* Add @storybook/react
1 parent f94eacd commit 3a8080b

31 files changed

+10321
-4119
lines changed

.env.development

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

.env.production

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

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@ module.exports = {
33
"extends": "airbnb",
44
"rules": {
55
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
6+
"import/no-extraneous-dependencies": [
7+
"error",
8+
{
9+
devDependencies: [
10+
"src/stories/**",
11+
]
12+
}
13+
]
614
},
715
"env": {
816
"es6": true,
17+
"jest": true,
918
"browser": true,
1019
}
1120
};

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
# See https://help.github.com/ignore-files/ for more about ignoring files.
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

33
# dependencies
44
/node_modules
5+
/.pnp
6+
.pnp.js
57

68
# testing
79
/coverage
810

911
# production
1012
/build
13+
/storybook-static
1114

1215
# misc
1316
.DS_Store
@@ -19,5 +22,6 @@
1922
npm-debug.log*
2023
yarn-debug.log*
2124
yarn-error.log*
25+
build-storybook.log*
2226

23-
.env
27+
.env.*

.storybook/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
stories: ['../src/**/*.stories.js'],
3+
addons: [
4+
'@storybook/preset-create-react-app',
5+
'@storybook/addon-actions',
6+
'@storybook/addon-links',
7+
],
8+
};

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo
1010

1111
## Examples
1212

13-
- [Main](https://google-map-react.github.io/google-map-react-examples/default) ([source](https://github.com/google-map-react/google-map-react-examples/blob/master/src/examples/Main.js))
14-
- [Heatmap](https://google-map-react.github.io/google-map-react-examples/heatmap) ([source](https://github.com/google-map-react/google-map-react-examples/blob/master/src/examples/Heatmap.js))
15-
- [Searchbox](https://google-map-react.github.io/google-map-react-examples/searchbox) ([source](https://github.com/google-map-react/google-map-react-examples/blob/master/src/examples/Searchbox.js))
16-
- [Autocomplete](https://google-map-react.github.io/google-map-react-examples/autocomplete) ([source](https://github.com/google-map-react/google-map-react-examples/blob/master/src/examples/Searchbox.js))
17-
- [Marker and Info Window using React Component](https://google-map-react.github.io/google-map-react-examples/marker-info-window) ([source](https://github.com/google-map-react/google-map-react-examples/blob/master/src/examples/MarkerInfoWindow.js))
18-
- [Marker and Info Window using Google Maps API Object](https://google-map-react.github.io/google-map-react-examples/marker-info-window-gmaps-obj) ([source](https://github.com/google-map-react/google-map-react-examples/blob/master/src/examples/MarkerInfoWindowGmapsObj.js))
13+
- [Main](https://google-map-react.github.io/google-map-react-examples/?path=/story/main-examples--base) ([source](https://github.com/google-map-react/google-map-react-examples/blob/master/src/examples/Main.js))
14+
- [Heatmap](https://google-map-react.github.io/google-map-react-examples/?path=/story/heatmap-examples--base) ([source](https://github.com/google-map-react/google-map-react-examples/blob/master/src/examples/Heatmap.js))
15+
- [Searchbox](https://google-map-react.github.io/google-map-react-examples/?path=/story/searchbox-examples--base) ([source](https://github.com/google-map-react/google-map-react-examples/blob/master/src/examples/Searchbox.js))
16+
- [Autocomplete](https://google-map-react.github.io/google-map-react-examples/?path=/story/autocomplete-examples--base) ([source](https://github.com/google-map-react/google-map-react-examples/blob/master/src/examples/Searchbox.js))
17+
- [Marker and Info Window using React Component](https://google-map-react.github.io/google-map-react-examples/?path=/story/markerinfo-examples--custom-component) ([source](https://github.com/google-map-react/google-map-react-examples/blob/master/src/examples/MarkerInfoWindow.js))
18+
- [Marker and Info Window using Google Maps API Object](https://google-map-react.github.io/google-map-react-examples/?path=/story/markerinfo-examples--default-marker) ([source](https://github.com/google-map-react/google-map-react-examples/blob/master/src/examples/MarkerInfoWindowGmapsObj.js))
1919

2020
## Getting started
2121

package.json

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,53 @@
44
"private": true,
55
"homepage": "https://itsmichaeldiego.github.io/google-map-react-examples/",
66
"dependencies": {
7-
"google-map-react": "^1.0.0",
7+
"@testing-library/jest-dom": "^5.11.0",
8+
"@testing-library/react": "^10.4.5",
9+
"@testing-library/user-event": "^12.0.11",
10+
"google-map-react": "^1.1.7",
811
"lodash.isempty": "^4.4.0",
912
"prop-types": "^15.6.1",
10-
"react": "^16.2.0",
11-
"react-dom": "^16.2.0",
12-
"react-router-dom": "^4.3.1",
13-
"react-scripts": "1.1.1",
14-
"styled-components": "^3.2.1"
13+
"react": "^16.13.1",
14+
"react-dom": "^16.13.1",
15+
"react-scripts": "3.4.1",
16+
"styled-components": "^5.1.1"
1517
},
1618
"scripts": {
1719
"lint": "eslint src",
1820
"start": "react-scripts start",
1921
"build": "react-scripts build",
20-
"test": "react-scripts test --env=jsdom",
22+
"test": "react-scripts test",
2123
"eject": "react-scripts eject",
22-
"predeploy": "npm run build",
23-
"deploy": "gh-pages -d build"
24+
"predeploy": "npm run build-storybook",
25+
"deploy": "gh-pages -d storybook-static",
26+
"storybook": "start-storybook -p 9009 -s public",
27+
"build-storybook": "build-storybook -s public",
28+
"chromatic": "npx chromatic --project-token=2mchcgpjqg2"
2429
},
2530
"devDependencies": {
31+
"@storybook/addon-actions": "^5.3.19",
32+
"@storybook/addon-links": "^5.3.19",
33+
"@storybook/addons": "^5.3.19",
34+
"@storybook/preset-create-react-app": "^3.1.3",
35+
"@storybook/react": "^5.3.19",
2636
"babel-eslint": "^10.0.1",
27-
"eslint": "^4.19.1",
28-
"eslint-config-airbnb": "^16.1.0",
37+
"chromatic": "^5.0.0",
38+
"eslint-config-airbnb": "^18.2.0",
2939
"eslint-plugin-import": "^2.9.0",
3040
"eslint-plugin-jsx-a11y": "^6.0.3",
3141
"eslint-plugin-react": "^7.7.0",
32-
"gh-pages": "^1.2.0"
42+
"gh-pages": "^3.1.0"
43+
},
44+
"browserslist": {
45+
"production": [
46+
">0.2%",
47+
"not dead",
48+
"not op_mini all"
49+
],
50+
"development": [
51+
"last 1 chrome version",
52+
"last 1 firefox version",
53+
"last 1 safari version"
54+
]
3355
}
3456
}

public/favicon.ico

-720 Bytes
Binary file not shown.

public/index.html

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6-
<meta name="theme-color" content="#000000">
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
713
<!--
8-
manifest.json provides metadata used when your web app is added to the
9-
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
14+
manifest.json provides metadata used when your web app is installed on a
15+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1016
-->
11-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
12-
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
17+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
1318
<!--
1419
Notice the use of %PUBLIC_URL% in the tags above.
1520
It will be replaced with the URL of the `public` folder during the build.
@@ -22,9 +27,7 @@
2227
<title>React App</title>
2328
</head>
2429
<body>
25-
<noscript>
26-
You need to enable JavaScript to run this app.
27-
</noscript>
30+
<noscript>You need to enable JavaScript to run this app.</noscript>
2831
<div id="root"></div>
2932
<!--
3033
This HTML file is a template.

public/logo192.png

5.22 KB
Loading

0 commit comments

Comments
 (0)