Skip to content

Commit e885ef5

Browse files
committed
Merge branch 'develop' into fix/google-maps-error
2 parents 4943f58 + a3d3ba4 commit e885ef5

File tree

10 files changed

+381
-112
lines changed

10 files changed

+381
-112
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- name: Checkout repository from GitHub
31-
uses: actions/checkout@v2.3.1
31+
uses: actions/checkout@v3
3232
- name: Setup npm
33-
uses: actions/setup-node@v2
33+
uses: actions/setup-node@v3
3434
with:
3535
node-version: '16'
3636
registry-url: 'https://registry.npmjs.org'
3737
# npm cache folder is in ~/, not within the working directory
3838
- name: Cache npm directory
39-
uses: actions/cache@v2
39+
uses: actions/cache@v3
4040
with:
4141
path: ~/.npm
4242
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ jobs:
99
timeout-minutes: 8
1010
steps:
1111
- name: Checkout repository from GitHub
12-
uses: actions/checkout@v2.3.1
12+
uses: actions/checkout@v3
1313
- name: Setup npm
14-
uses: actions/setup-node@v2
14+
uses: actions/setup-node@v3
1515
with:
1616
node-version: '16'
1717
# npm cache folder is in ~/, not within the working directory
1818
- name: Cache npm directory
19-
uses: actions/cache@v2
19+
uses: actions/cache@v3
2020
with:
2121
path: ~/.npm
2222
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

CONTRIBUTING.md

Lines changed: 74 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
# Contributing to Ubilabs Google Maps React Hooks
22

3-
We are happy you came here and thank you for contributing! 🎉
3+
We are happy you came here and thank you for contributing! 🎉
44

55
To get started there are some things that need to be set up.
66

7-
----
7+
---
88

9-
## Setting Up Dev Environment
9+
#### Table of contents
10+
11+
- [Setting Up Dev Environment](#setting-up-dev-environment)
12+
- [Fork the repo and start building](#fork-the-repo-and-start-building)
13+
- [Issue Tracker](#issue-tracker)
14+
- [Pull Requests / Merge Requests](#pull-requests--merge-requests)
15+
- [Code Style and Code Quality](#code-style-and-code-quality)
16+
- [Adding An Example](#adding-an-example)
17+
- [Run examples](#run-examples)
18+
- [Develop examples](#develop-examples)
19+
- [Publish library on npm](#publish-library-on-npm)
1020

11-
We will work on the `develop` branch.
21+
---
22+
23+
## Setting Up Dev Environment
1224

25+
We will work on the `develop` branch.
1326

1427
We use [npm](https://www.npmjs.com/) to manage the dependencies.
1528

@@ -35,8 +48,9 @@ git checkout develop
3548
```
3649

3750
3. At the root directory of the project on the develop branch, install all dependencies and build.
51+
3852
```bash
39-
# Install dependencies
53+
# Install dependencies
4054
npm install
4155

4256
# Start the project locally before changing code
@@ -54,6 +68,7 @@ git checkout -b feat/my-new-feature-branch
5468
```
5569

5670
5. To see example cases of the Google Maps react hooks, checkout the [Examples Folder](./examples). To start an example:
71+
5772
```bash
5873
# If not done already: Go to 'google-maps-react-hooks' directory and run:
5974
npm install
@@ -64,65 +79,101 @@ npm run start:sample-map
6479

6580
Then open [`localhost:1234`](http://localhost:1234) in a browser.
6681

67-
----
82+
---
6883

6984
## Issue Tracker
7085

7186
- before submitting a new issue, please:
7287

73-
- check for existing related issues
88+
- check for existing related issues
7489

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
7691

77-
- check against supported versions of this project (i.e. the latest)
92+
- check against supported versions of this project (i.e. the latest)
7893

7994
- please keep discussions on-topic, and respect the opinions of others
8095

8196
- please contact us privately to discuss security vulnerabilities
8297

83-
----
98+
---
8499

85100
## Pull Requests / Merge Requests
86101

87102
- **IMPORTANT**: by submitting a patch, you agree to allow the project owners to license your work under this [LICENSE.md](LICENSE.md)
88103

89-
- please provide test cases for all features and bug fixes
104+
- please provide test cases for all features and bug fixes
90105

91-
- provide documentation for all public API methods
106+
- provide documentation for all public API methods
92107

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)
94109

95110
### Code Style and Code Quality
96111

97-
- Testing
112+
- **Testing**
98113

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
102117

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
104119

105-
----
120+
---
106121

107122
## 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:
109143

110144
1. Create a new folder in the [examples folder](./examples) with the new example's name.
111145

112146
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.
113147

114148
3. Add a npm task in the [examples workspace package.json](./examples/package.json) with a naming convention like this:
149+
115150
```json
116151
"start:example-folder-name": "EXAMPLE_ENTRY=./example-folder-name/index.html npm run start:example"
117152
```
153+
118154
Please compare to the other example start tasks.
119155

120156
4. Add another npm task in the root [package.json](./package.json) to start the example, with a naming convention like this:
157+
121158
```json
122159
"start:example-folder-name-example": "EXAMPLE=example-folder-name run-p start:library start:example"
123-
````
124-
Please compare to the other example start tasks.
160+
```
161+
162+
Please compare to the other example start tasks.
125163

126164
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.
127165

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.

CONVENTIONS.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,23 @@ Below that, the commit message has a **body**.
2020
```
2121

2222
Examples:
23+
2324
```
2425
feat(ruler): add inches as well as centimeters
2526
```
27+
2628
```
2729
fix(protractor): fix 90 degrees counting as 91 degrees
2830
```
31+
2932
```
3033
refactor(pencil): use graphite instead of lead
3134
3235
Closes #640.
3336
3437
Graphite is a much more available resource than lead, so we use it to lower the price.
3538
```
39+
3640
```
3741
fix(pen): use blue ink instead of red ink
3842
@@ -51,33 +55,37 @@ Any line of the commit message should not be longer 100 characters. This allows
5155
to read on github as well as in various git tools.
5256

5357
### Type
58+
5459
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).
5560

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
6065
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
6469
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
6873

6974
### Scope
75+
7076
The scope could be anything specifying place of the commit change. For example `$location`,
7177
`$browser`, `$compile`, `$rootScope`, `ngHref`, `ngClick`, `ngView`, etc...
7278

7379
### Subject
80+
7481
The subject contains succinct description of the change:
7582

76-
* use the imperative, present tense: "change" not "changed" nor "changes"
77-
* don't capitalize first letter
78-
* no dot (.) at the end
83+
- use the imperative, present tense: "change" not "changed" nor "changes"
84+
- don't capitalize first letter
85+
- no dot (.) at the end
7986

8087
### Breaking Changes
88+
8189
Put any breaking changes with migration instructions in the commit body.
8290

8391
If there is a breaking change, put **BREAKING CHANGE:** in your commit body, and it will show up in the changelog.

0 commit comments

Comments
 (0)