Skip to content

Commit

Permalink
Init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wellyshen committed Jan 18, 2020
0 parents commit bdeaddf
Show file tree
Hide file tree
Showing 36 changed files with 9,490 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .all-contributorsrc
@@ -0,0 +1,26 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "wellyshen",
"name": "Welly",
"avatar_url": "https://avatars1.githubusercontent.com/u/21308003?v=4",
"profile": "https://www.linkedin.com/in/welly-shen-8b43287a/",
"contributions": [
"code",
"doc",
"maintenance"
]
}
],
"contributorsPerLine": 7,
"projectName": "use-places-autocomplete",
"projectOwner": "wellyshen",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
}
17 changes: 17 additions & 0 deletions .editorconfig
@@ -0,0 +1,17 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true

[*]
# Change these settings to your own preference
indent_style = space
indent_size = 2
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/1.BUG_REPORT.md
@@ -0,0 +1,36 @@
---
name: Bug report
about: Create a bug report
---

# Bug Report

## Describe the Bug

A clear and concise description of what the bug is.

## How to Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

1. Go to '....'
2. Click on '....'
3. See error

## Expected Behavior

Tell me what should happen.

## Screenshots

Add screenshots to help explain your problem.

## Your Environment

- OS: [e.g. macOS, Windows]
- Browser [e.g. Chrome, Safari]
- Version of use-places-autocomplete: [e.g. v1.0.0]

## Additional Information

Any other information about the problem here.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/2.FEATURE_REQUEST.md
@@ -0,0 +1,22 @@
---
name: Feature request
about: Create a feature request
---

# Feature Request

## Describe the Feature

A clear and concise description of what you want and what your use case is.

## Describe the Solution You'd Like

A clear and concise description of what you want to happen.

## Describe Alternatives You've Considered

A clear and concise description of any alternative solutions or features you've considered.

## Additional Information

Any other information about the feature here.
8 changes: 8 additions & 0 deletions .gitignore
@@ -0,0 +1,8 @@
.DS_Store
*.log

node_modules
src/.dev
demo
dist
coverage
1 change: 1 addition & 0 deletions .nvmrc
@@ -0,0 +1 @@
lts/*
21 changes: 21 additions & 0 deletions .travis.yml
@@ -0,0 +1,21 @@
language: node_js

node_js:
- "lts/*"

cache:
yarn: true
directories:
- node_module

script:
- yarn type-check
- yarn lint
- yarn test:cov

notifications:
email:
on_failure: change

after_success:
- yarn coveralls
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,4 @@
# Changelog

This project adheres to [Semantic Versioning](http://semver.org).
Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/wellyshen/use-places-autocomplete/releases) page.
84 changes: 84 additions & 0 deletions CODE_OF_CONDUCT.md
@@ -0,0 +1,84 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or
advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at hivoid19@gmail.com. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the project community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
51 changes: 51 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,51 @@
# Contributing to usePlacesAutocomplete

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a [code of conduct](https://github.com/wellyshen/use-places-autocomplete/blob/master/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.

> Working on your first Pull Request? You can learn how from [this free video series](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github).
## Pull Request Process

1. Fork the repository and create your branch from `master`
2. Run `yarn` in the repository root
3. If you’ve fixed a bug or added code that should be tested
4. Ensure the test suite passes by running `yarn test`
5. Update the [README.md](https://github.com/wellyshen/use-places-autocomplete/blob/master/README.md) with details of changes to the interface
6. Update the [demo app](https://github.com/wellyshen/use-places-autocomplete/tree/master/src/App) if needed
7. Format your code with [Prettier](https://prettier.io)
8. Make sure your code lints by running `yarn lint`
9. Make sure your code passes type check by running `yarn type-check`

## Development Workflow

After cloning usePlacesAutocomplete, run `yarn` to fetch its dependencies. Then, you can run several commands:

- `yarn dev` runs the [demo app](https://github.com/wellyshen/use-places-autocomplete/tree/master/src/App) as your playground at `localhost:10001`. Support live reloading
- `yarn lint:code` lints all `.js` and `.tsx?` files
- `yarn lint:style` lints all `.css` and `.tsx?` (for [Emotion](https://emotion.sh)) files
- `yarn lint` lints both `code` and `style`
- `yarn type-check` runs the [Typescript](https://www.typescriptlang.org) typechecks
- `yarn type-check:watch` runs an interactive typechecks watcher (helpful in development)
- `yarn test` runs the complete test suite
- `yarn test:watch` runs an interactive test watcher (helpful in development)
- `yarn test:cov` runs the complete test suite with coverage report
- `yarn build:demo` creates an `demo` folder with all the static files
- `yarn build:dist` creates a `dist` folder with package builds (`CJS` & `ESM`) and type definition file. You can test the package locally via [yarn link](https://yarnpkg.com/lang/en/docs/cli/link)
- `yarn build` creates both `demo` and `dist`
- `yarn clean:dev` deletes the `src/.dev` build folder
- `yarn clean:demo` deletes the `demo` build folder
- `yarn clean:dist` deletes the `dist` build folder
- `yarn clean:cov` deletes the `coverage` report folder
- `yarn clean` deletes all the build/coverage folders

## Style Guide

We use an automatic code formatter called [Prettier](https://prettier.io). Run `yarn lint` after making any changes to the code. Then, our linter will catch most issues that may exist in your code.

However, there are still some styles that the linter cannot pick up. If you are unsure about something, looking at [Airbnb’s Style Guide](https://github.com/airbnb/javascript) will guide you in the right direction.

## License

By contributing to **usePlacesAutocomplete**, you agree that your contributions will be licensed under its MIT license.
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 Welly Shen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
23 changes: 23 additions & 0 deletions README.md
@@ -0,0 +1,23 @@
# usePlacesAutocomplete

This is a React [hook](https://reactjs.org/docs/hooks-custom.html#using-a-custom-hook) of Google Maps

[![build status](https://img.shields.io/travis/wellyshen/use-places-autocomplete/master?style=flat-square)](https://travis-ci.org/wellyshen/use-places-autocomplete)
[![npm version](https://img.shields.io/npm/v/use-places-autocomplete?style=flat-square)](https://www.npmjs.com/package/use-places-autocomplete)
[![npm downloads](https://img.shields.io/npm/dm/use-places-autocomplete?style=flat-square)](https://www.npmtrends.com/use-places-autocomplete)
[![npm downloads](https://img.shields.io/npm/dt/use-places-autocomplete?style=flat-square)](https://www.npmtrends.com/use-places-autocomplete)
[![npm bundle size](https://img.shields.io/bundlephobia/minzip/use-places-autocomplete?style=flat-square)](https://bundlephobia.com/result?p=use-places-autocomplete)
[![MIT licensed](https://img.shields.io/github/license/wellyshen/use-places-autocomplete?style=flat-square)](https://raw.githubusercontent.com/wellyshen/use-places-autocomplete/master/LICENSE)
[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen?style=flat-square)](https://github.com/wellyshen/use-places-autocomplete/blob/master/CONTRIBUTING.md)

🚧 This package is under developing, **PLEASE DON'T USE IT NOW ✋🏻**. The milestone as below:

- [x] usePlacesAutocomplete hook
- [ ] Useful utils, e.g. geocoding etc.
- [ ] Server-side rendering compatibility
- [ ] Built-in autocomplete UI component (maybe...)
- [ ] Unit testing
- [ ] Demo app
- [ ] Documentation
- [ ] Typescript type definition
- [ ] CI/CD
1 change: 1 addition & 0 deletions __mocks__/file.ts
@@ -0,0 +1 @@
module.exports = 'test-file-stub';

0 comments on commit bdeaddf

Please sign in to comment.