Add documentation and packaging config for initial release (#2)

This commit is contained in:
Mike Wilkerson 2018-10-08 13:16:13 -07:00 committed by GitHub
parent 71c7cb2a6d
commit 59a04a4a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 365 additions and 34 deletions

13
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,13 @@
### Describe the problem
<!--- What happened? What are you seeing? How did you arrive here? -->
### What did you expect?
<!--- How would you like this to work instead? -->
### Reproducible test case
<!--- Insert a URL to your test case -->
<!--- Describe any details about the test case that we need to know like "whatever you do, don't click the red button" -->

View File

@ -0,0 +1,25 @@
### Describe the problem you'd like to see solved or task you'd like to see made easier
<!--- What steps or tasks are you trying to complete along the way? -->
### Is this in relation to an existing part of react-native-fontawesome or something new?
<!--- If so, what part of Font Awesome? -->
### What is 1 thing that we can do when building this feature that will guarantee that it is awesome?
<!--- e.g. make the API super-convenient -->
### Why would other react-native-fontawesome users care about this?
<!--- e.g. because everyone wants icons that fly -->
### On a scale of 1 (sometime in the future) to 10 (absolutely right now), how soon would you recommend we make this feature?
<!--- e.g. 5 - "while we're young" -->
### Feature request checklist
* [ ] This is a single feature (i.e. not a re-write of all of Font Awesome)
* [ ] The title starts with "Feature request: " and is followed by a clear feature name (Ex: `Feature request: moar cowbell`)
* [ ] I have [searched for existing issues](https://github.com/FortAwesome/react-native-fontawesome/issues) and to the best of my knowledge this is not a duplicate

13
CHANGELOG.md Normal file
View File

@ -0,0 +1,13 @@
# Change Log
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
---
## [0.0.1](https://github.com/FortAwesome/react-native-fontawesome/releases/tag/0.0.1) - 2018-10-08
### Added
- Initial, minimal implementation, based on [@fortawesome/react-fontawesome](https://github.com/FortAwesome/react-fontawesome/)

74
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers 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, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at <mailto:hello@fontawesome.com>. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [https://contributor-covenant.org/version/1/4][version]
[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/

58
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,58 @@
This is the repository for the _official_ Font Awesome React Native component, _initialized_ by the team behind Font Awesome,
but intended to evolve over time with _community_ contributions.
# Ways to Contribute
## Ask a Question
Trying to figure out how to make it work? Or how to use it in your scenario?
1. Review the [README](README.md)
1. Get familiar with the documentation for the [SVG with JavaScript](https://fontawesome.com/how-to-use/svg-with-js) implementation,
the framework upon which this component is built. Sometimes the answers you need may be there.
1. Post any remaining questions on [StackOverflow](https://stackoverflow.com/questions/tagged/react-fontawesome) with the tag `react-native-fontawesome`.
## Report a Bug
1. Use [Expo Snack](https://snack.expo.io/) to create a reproduction of the unexpected behavior
1. [Open a new issue with this template](https://github.com/FortAwesome/react-native-fontawesome/issues/new?template=bug_report.md),
and be sure to include a link to the reproduction you made with Expo Snack.
## Submit a Pull Request
Add tests if you add code.
## Everything Else
* [Request a feature](https://github.com/FortAwesome/react-native-fontawesome/issues/new??title=Feature%20request:feature-name&template=feature_request.md)
* [Request a new icon](https://github.com/FortAwesome/Font-Awesome/issues/new?title=Icon%20request:%20icon-name&template=icon-request.md)
# Project Goals
1. Achieve and maintain feature parity with Font Awesome's [SVG with JavaScript](https://fontawesome.com/how-to-use/svg-with-js) method.
1. Keep with best practices in the React Native development community.
1. Stay current with major developments in React Native and `react-native-svg`
1. Maintain a reasonable level of consistency between this component and the
official Font Awesome [React component](https://github.com/FortAwesome/react-native-fontawesome).
1. Sharing responsibility: The Font Awesome team will continue to be involved in ongoing development, hoping to _propel_
the project's momentum as we make _our_ contributions, while minimizing any bottle-necking that may happen as we balance
our own priorities across various projects. Ideally, members of the community will enjoy lending a hand to help keep
the project moving forward by responding to issues, answering questions on StackOverflow, reviewing and merging pull
requests, and publishing npm updates.
# Code of Conduct
We'll contribute according to the [Code of Conduct](CODE_OF_CONDUCT.md).
# Wanted: Core Contributors
We're seeking core contributors to help drive this project. Core contributors:
1. Share these goals
1. Demonstrate competence through contributions
1. Contribute with conduct fitting with our code of conduct
1. Want to make this project awesome

19
LICENSE.txt Normal file
View File

@ -0,0 +1,19 @@
Copyright 2018 Fonticons, Inc.
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.

134
README.md Normal file
View File

@ -0,0 +1,134 @@
<a href="https://fontawesome.com">
<img align="right" width="100" height="100" alt="Official Javascript Component" src="https://img.fortawesome.com/349cfdf6/official-javascript-component.svg">
</a>
# react-native-fontawesome
[![npm](https://img.shields.io/npm/v/@fortawesome/react-native-fontawesome.svg?style=flat-square)](https://www.npmjs.com/package/@fortawesome/react-native-fontawesome)
> Font Awesome 5 React Native component using SVG with JS
<!-- toc -->
- [Introduction](#introduction)
+ [Upgrading Font Awesome?](#upgrading-font-awesome)
+ [Get started](#get-started)
+ [Learn about our new SVG implementation](#learn-about-our-new-svg-implementation)
- [Installation](#installation)
- [Add more styles or Pro icons](#add-more-styles-or-pro-icons)
- [or with Yarn](#or-with-yarn)
- [Frequent questions](#frequent-questions)
* [How do I import the same icon from two different styles?](#how-do-i-import-the-same-icon-from-two-different-styles)
* [I don't think tree-shaking is working; got any advice?](#i-dont-think-tree-shaking-is-working-got-any-advice)
- [How to Help](#how-to-help)
- [Contributors](#contributors)
<!-- tocstop -->
## Introduction
Hey there! We're glad you're here...
#### Upgrading Font Awesome?
If you've used Font Awesome in the past (version 4 or older) there are some
things that you should learn before you dive in.
> https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4
#### Get started
This package is for integrating with React Native. If you aren't using React Native then it's
not going to help you. Head over to our "Get Started" page for some guidance.
> https://fontawesome.com/how-to-use/on-the-web/setup/getting-started
#### Learn about our new SVG implementation
This package, under the hood, uses SVG with JS and the `@fortawesome/fontawesome-svg-core` library. This implementation differs drastically from
the web fonts implementation that was used in version 4 and older of Font Awesome. You might head over there to learn about how it works.
> https://fontawesome.com/how-to-use/on-the-web/advanced/svg-javascript-core
## Installation
```
$ npm i --save react-native-svg # **
$ npm i --save @fortawesome/fontawesome-svg-core
$ npm i --save @fortawesome/free-solid-svg-icons
$ npm i --save @fortawesome/react-native-fontawesome
```
** `create-react-native-app` uses Expo, which bundles `reactive-native-svg`. So if you're using `create-reactive-native-app`
you shouldn't try to add `react-native-svg`. At the time of writing, `create-react-native-app` bundles
`react-native-svg` version 6, which does not include support for SVG features such as `Mask`. Therefore, this
component does not yet support `Mask`.
## Add more styles or Pro icons
Brands are separated into their own style and for customers upgrading from
version 4 to 5 we have a limited number of Regular icons available.
**Visit [fontawesome.com/icons](https://fontawesome.com/icons) to search for free and Pro icons**
```
$ npm i --save @fortawesome/free-brands-svg-icons
$ npm i --save @fortawesome/free-regular-svg-icons
```
If you are a [Font Awesome Pro](https://fontawesome.com/pro) subscriber you can install Pro packages; this requires [additional configuration](https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers).
```
$ npm i --save @fortawesome/pro-solid-svg-icons
$ npm i --save @fortawesome/pro-regular-svg-icons
$ npm i --save @fortawesome/pro-light-svg-icons
```
## or with Yarn
```
$ yarn add @fortawesome/fontawesome-svg-core
$ yarn add @fortawesome/free-solid-svg-icons
$ yarn add @fortawesome/react-native-fontawesome
```
## Frequent questions
### How do I import the same icon from two different styles?
With ES modules and `import` statements we can rename:
```javascript
import { library } from '@fortawesome/fontawesome-svg-core'
import { faStroopwafel as fasFaStroopwafel } from '@fortawesome/pro-solid-svg-icons'
import { faStroopwafel as farFaStroopwafel } from '@fortawesome/pro-regular-svg-icons'
library.add(fasFaStroopwafel, farFaStroopwafel)
```
### I don't think tree-shaking is working; got any advice?
Check out our [docs here](https://fontawesome.com/how-to-use/with-the-api/other/tree-shaking).
## How to Help
Review the following docs before diving in:
- [CONTRIBUTING.md](CONTRIBUTING.md)
- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
And then:
1. Check the existing issues and see if you can help!
## Contributors
The Font Awesome team:
| | Name | GitHub |
| :--------------------------------------------------------: | -------------- | -------------------------------------------------- |
| <img src="https://github.com/supercodepoet.png?size=72" /> | Travis Chase | [@supercodepoet](https://github.com/supercodepoet) |
| <img src="https://github.com/robmadole.png?size=72" /> | Rob Madole | [@robmadole](https://github.com/robmadole) |
| <img src="https://github.com/mlwilkerson.png?size=72" /> | Mike Wilkerson | [@mlwilkerson](https://github.com/mlwilkerson) |
| <img src="https://github.com/talbs.png?size=72" /> | Brian Talbot | [@talbs](https://github.com/talbs) |

View File

@ -11,11 +11,9 @@
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.4",
"@fortawesome/free-solid-svg-icons": "^5.3.1",
"@fortawesome/react-native-fontawesome": "git+ssh://git@github.com/FortAwesome/react-native-fontawesome#dev",
"@fortawesome/react-native-fontawesome": "https://github.com/FortAwesome/react-native-fontawesome.git",
"expo": "^30.0.1",
"react": "16.3.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz",
"react-native-fontawesome": "git+ssh://git@github.com/FortAwesome/react-native-fontawesome#dev",
"react-native-svg": "^7.0.3"
"react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz"
}
}

View File

@ -505,28 +505,28 @@
pouchdb-collections "^1.0.1"
tiny-queue "^0.2.1"
"@fortawesome/fontawesome-common-types@^0.2.4":
version "0.2.4"
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.4.tgz#7c560ff732c6c7c7c179ae25227ce5449e6f6d65"
integrity sha512-0qbIVm+MzkxMwKDx8V0C7w/6Nk+ZfBseOn2R1YK0f2DQP5pBcOQbu9NmaVaLzbJK6VJb1TuyTf0ZF97rc6iWJQ==
"@fortawesome/fontawesome-common-types@^0.2.5":
version "0.2.5"
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.5.tgz#a7f660607997b019cc985d525ec37d2fb72df926"
integrity sha512-hkKASkxINPqAyhYDF9QVtDK02hcleUzGxXnGmFkF/fIJgHaGaI4lVV07OfLsC6KIlgXQfIAAf3PNR2C74HN6xg==
"@fortawesome/fontawesome-svg-core@^1.2.4":
version "1.2.4"
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.4.tgz#2e40c65e66c7ad5aabc179a2d7c5827b1599905c"
integrity sha512-oGtnwcdhJomoDxbJcy6S0JxK6ItDhJLNOujm+qILPqajJ2a0P/YRomzBbixFjAPquCoyPUlA9g9ejA22P7TKNA==
version "1.2.5"
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.5.tgz#590eae58179e904b55f6049582fc9f7719a77e6a"
integrity sha512-5q/3JyLg4sxEfk3VxBlBO7Rvl7rLvcEbKrWIGN0Y9xnjkPLIqdP9fgnetjCi3rNzhQjSzTyOgVG0M0I0KabXHw==
dependencies:
"@fortawesome/fontawesome-common-types" "^0.2.4"
"@fortawesome/fontawesome-common-types" "^0.2.5"
"@fortawesome/free-solid-svg-icons@^5.3.1":
version "5.3.1"
resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.3.1.tgz#9660bece3c4850d58f1653e26c1693487ff74b08"
integrity sha512-NkiLBFoiHtJ89cPJdM+W6cLvTVKkLh3j9t3MxkXyip0ncdD3lhCunSuzvFcrTHWeETEyoClGd8ZIWrr3HFZ3BA==
version "5.4.0"
resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.4.0.tgz#5f9494bc8ce98e07a0cefef3537aeca08b550cad"
integrity sha512-+9k7KO8wJbUIa88U2s712r5WAxZuFNb2RTE9AASMMb5VYAWsVGfhLAOkDAkI92RDLjN3Y2NK+2vt8A5uNxCuYQ==
dependencies:
"@fortawesome/fontawesome-common-types" "^0.2.4"
"@fortawesome/fontawesome-common-types" "^0.2.5"
"@fortawesome/react-native-fontawesome@git+ssh://git@github.com/FortAwesome/react-native-fontawesome#dev", "react-native-fontawesome@git+ssh://git@github.com/FortAwesome/react-native-fontawesome#dev":
"@fortawesome/react-native-fontawesome@file:../../../../../../tmp/fortawesome-react-native-fontawesome-0.0.1.tgz":
version "0.0.1"
resolved "git+ssh://git@github.com/FortAwesome/react-native-fontawesome#53c9bb2b227fd082840820defd16f0e26d5ea2ed"
resolved "file:../../../../../../tmp/fortawesome-react-native-fontawesome-0.0.1.tgz#d960f949c43c0ac4b1122f4b67aaff0a2eda5486"
dependencies:
humps "^2.0.1"
prop-types "^15.6.2"
@ -3817,9 +3817,9 @@ npm-bundled@^1.0.1:
integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==
npm-packlist@^1.1.6:
version "1.1.11"
resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.11.tgz#84e8c683cbe7867d34b1d357d893ce29e28a02de"
integrity sha512-CxKlZ24urLkJk+9kCm48RTQ7L4hsmgSVzEk0TLGPzzyuFxD7VNgy5Sl24tOLMzQv773a/NeJ1ce1DKeacqffEA==
version "1.1.12"
resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.12.tgz#22bde2ebc12e72ca482abd67afc51eb49377243a"
integrity sha512-WJKFOVMeAlsU/pjXuqVdzU0WfgtIBCupkEVwn+1Y0ERAbUfWw8R4GjgVbaKnUjRoD2FoQbHOCbOyT5Mbs9Lw4g==
dependencies:
ignore-walk "^3.0.1"
npm-bundled "^1.0.1"
@ -4267,15 +4267,6 @@ react-native-svg@6.2.2:
lodash "^4.16.6"
pegjs "^0.10.0"
react-native-svg@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/react-native-svg/-/react-native-svg-7.0.3.tgz#1ced56f4f6e96ad95374d66706390f51fa86bea7"
integrity sha512-fIMgoum2YWY1mBM93G+vYIj7l0te4v4XmndxAfq7A6GZPYrNNM0rysg+bsGMCFiYQQbjeoqzqQkY3jWqZgY7UQ==
dependencies:
color "^2.0.1"
lodash "^4.16.6"
pegjs "^0.10.0"
react-native-vector-icons@4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-4.5.0.tgz#6b95619e64f62f05f579f74a01fe5640df95158b"
@ -4816,9 +4807,9 @@ source-map@^0.6.0, source-map@~0.6.1:
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
spdx-correct@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.1.tgz#434434ff9d1726b4d9f4219d1004813d80639e30"
integrity sha512-hxSPZbRZvSDuOvADntOElzJpenIR7wXJkuoUcUtS0erbgt2fgeaoPIYretfKpslMhfFDY4k0MZ2F5CUzhBsSvQ==
version "3.0.2"
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.2.tgz#19bb409e91b47b1ad54159243f7312a858db3c2e"
integrity sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==
dependencies:
spdx-expression-parse "^3.0.0"
spdx-license-ids "^3.0.0"

View File

@ -1,5 +1,5 @@
{
"name": "react-native-fontawesome",
"name": "@fortawesome/react-native-fontawesome",
"version": "0.0.1",
"description": "Official React Native component for Font Awesome 5",
"main": "index.js",
@ -43,6 +43,12 @@
"humps": "^2.0.1",
"prop-types": "^15.6.2"
},
"files": [
"index.js",
"dist/converter.js",
"dist/logger.js",
"dist/components/FontAwesomeIcon.js"
],
"jest": {
"preset": "react-native",
"modulePathIgnorePatterns": [