You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
5. To see example cases of the Google Maps react hooks, checkout the [Examples Folder](./examples). To start an example:
71
+
57
72
```bash
58
73
# If not done already: Go to 'google-maps-react-hooks' directory and run:
59
74
npm install
@@ -64,65 +79,101 @@ npm run start:sample-map
64
79
65
80
Then open [`localhost:1234`](http://localhost:1234) in a browser.
66
81
67
-
----
82
+
---
68
83
69
84
## Issue Tracker
70
85
71
86
- before submitting a new issue, please:
72
87
73
-
- check for existing related issues
88
+
- check for existing related issues
74
89
75
-
- check the issue tracker for a specific upstream project that may be more appropriate
90
+
- check the issue tracker for a specific upstream project that may be more appropriate
76
91
77
-
- check against supported versions of this project (i.e. the latest)
92
+
- check against supported versions of this project (i.e. the latest)
78
93
79
94
- please keep discussions on-topic, and respect the opinions of others
80
95
81
96
- please contact us privately to discuss security vulnerabilities
82
97
83
-
----
98
+
---
84
99
85
100
## Pull Requests / Merge Requests
86
101
87
102
-**IMPORTANT**: by submitting a patch, you agree to allow the project owners to license your work under this [LICENSE.md](LICENSE.md)
88
103
89
-
- please provide test cases for all features and bug fixes
104
+
- please provide test cases for all features and bug fixes
90
105
91
-
- provide documentation for all public API methods
106
+
- provide documentation for all public API methods
92
107
93
-
- commit messages should follow the format outlined in [CONVENTIONS.md](CONVENTIONS.md)
108
+
- commit messages should follow the format outlined in [CONVENTIONS.md](CONVENTIONS.md)
94
109
95
110
### Code Style and Code Quality
96
111
97
-
- Testing
112
+
-**Testing**
98
113
99
-
-[ESLint](https://eslint.org/) configuration files are provided
100
-
-[TypeScript](https://www.typescriptlang.org/) check for types and TypeScript setup
101
-
-[Prettier](https://prettier.io/) code formatter
114
+
-[ESLint](https://eslint.org/) configuration files are provided
115
+
-[TypeScript](https://www.typescriptlang.org/) check for types and TypeScript setup
116
+
-[Prettier](https://prettier.io/) code formatter
102
117
103
-
- run`npm run test` before submitting a PR to ensure that your code uses correct style and passes all tests
118
+
Run`npm run test` before submitting a PR to ensure that your code uses correct style and passes all tests
104
119
105
-
----
120
+
---
106
121
107
122
## Adding An Example
108
-
Each hook should have an example in the examples folder. If you want to provide an example for a hook, please follow these steps:
123
+
124
+
Each hook should have an example in the examples folder.
125
+
126
+
### Run examples
127
+
128
+
To develop one of the examples, you have to create a `.env` file in the `/examples` directory first and add your [Google Maps API key](https://developers.google.com/maps/documentation/embed/get-api-key#:~:text=Go%20to%20the%20Google%20Maps%20Platform%20%3E%20Credentials%20page.&text=On%20the%20Credentials%20page%2C%20click,Click%20Close.) to it in the following format:
129
+
130
+
```
131
+
GOOGLE_MAPS_API_KEY="<YOUR API KEY HERE>"
132
+
```
133
+
134
+
An example can be found in `/examples/.env.example`.
135
+
136
+
Start the example locally with the appropriate task, e.g. `npm run start:map-example`. You can find the right task in the README of the example you want to start.
137
+
138
+
The example runs on [localhost:1234](http://localhost:1234).
139
+
140
+
### Develop examples
141
+
142
+
If you want to provide an example for a hook, please follow these steps:
109
143
110
144
1. Create a new folder in the [examples folder](./examples) with the new example's name.
111
145
112
146
2. In the folder, create a runnable React App showing the usage of the new hook in a common use case. Checkout the current examples in the [examples folder](./examples) to see how the setup should looks like. The [basic google map example](./examples/basic-google-map/) is always a good starting point.
113
147
114
148
3. Add a npm task in the [examples workspace package.json](./examples/package.json) with a naming convention like this:
149
+
115
150
```json
116
151
"start:example-folder-name": "EXAMPLE_ENTRY=./example-folder-name/index.html npm run start:example"
117
152
```
153
+
118
154
Please compare to the other example start tasks.
119
155
120
156
4. Add another npm task in the root [package.json](./package.json) to start the example, with a naming convention like this:
5. Add a README to each example with an explanation of what the example does, a code snippet and an image of the example app in a ratio of 2:1.
127
165
128
-
6. Link the example in the [root README](./README.md) and the [README of the library workspace](./library/README.md) in the **Examples** overview of the **Table of contents** section.
166
+
6. Link the example in the [root README](./README.md) and the [README of the library workspace](./library/README.md) in the **Examples** overview of the **Table of contents** section.
167
+
168
+
---
169
+
170
+
## Publish library on npm
171
+
172
+
A new library version is automatically published by Github Actions as soon as a new version tag is available.
173
+
To trigger a new release, run:
174
+
175
+
```sh
176
+
npm version [<newversion>| major | minor | patch | premajor | preminor | prepatch | prerelease | from-git] -w library
177
+
```
178
+
179
+
**NOTE**: Make sure to not forget setting the context to the library workspace with `-w library` when running the command from project root.
Copy file name to clipboardExpand all lines: CONVENTIONS.md
+21-13Lines changed: 21 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -20,19 +20,23 @@ Below that, the commit message has a **body**.
20
20
```
21
21
22
22
Examples:
23
+
23
24
```
24
25
feat(ruler): add inches as well as centimeters
25
26
```
27
+
26
28
```
27
29
fix(protractor): fix 90 degrees counting as 91 degrees
28
30
```
31
+
29
32
```
30
33
refactor(pencil): use graphite instead of lead
31
34
32
35
Closes #640.
33
36
34
37
Graphite is a much more available resource than lead, so we use it to lower the price.
35
38
```
39
+
36
40
```
37
41
fix(pen): use blue ink instead of red ink
38
42
@@ -51,33 +55,37 @@ Any line of the commit message should not be longer 100 characters. This allows
51
55
to read on github as well as in various git tools.
52
56
53
57
### Type
58
+
54
59
Is recommended to be one of the below items. Only **feat** and **fix** show up in the changelog, in addition to breaking changes (see breaking changes section at bottom).
55
60
56
-
***feat**: A new feature
57
-
***fix**: A bug fix
58
-
***docs**: Documentation only changes
59
-
***style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
61
+
-**feat**: A new feature
62
+
-**fix**: A bug fix
63
+
-**docs**: Documentation only changes
64
+
-**style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
60
65
semi-colons, etc)
61
-
***refactor**: A code change that neither fixes a bug or adds a feature
62
-
***test**: Adding missing tests
63
-
***chore**: Changes to the build process or auxiliary tools and libraries such as documentation
66
+
-**refactor**: A code change that neither fixes a bug or adds a feature
67
+
-**test**: Adding missing tests
68
+
-**chore**: Changes to the build process or auxiliary tools and libraries such as documentation
64
69
generation
65
-
***build**: Changes that affect the build system or external dependencies
66
-
***ci**: Changes to our CI configuration files and scripts
67
-
***perf**: A code change that improves performance
70
+
-**build**: Changes that affect the build system or external dependencies
71
+
-**ci**: Changes to our CI configuration files and scripts
72
+
-**perf**: A code change that improves performance
68
73
69
74
### Scope
75
+
70
76
The scope could be anything specifying place of the commit change. For example `$location`,
0 commit comments