Skip to content

Commit 893467a

Browse files
author
Dimi Mikadze
committed
Add CLI to easily install the project
0 parents  commit 893467a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+13467
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
**Describe the bug**
10+
11+
(Write your answer here.)
12+
13+
**System**
14+
15+
Node.js version:
16+
NPM or Yarn version:
17+
Operating system:
18+
19+
**Steps to reproduce**
20+
(Write your steps here:)
21+
22+
1.
23+
2.
24+
3.
25+
26+
**Expected behavior**
27+
28+
(Write what you thought would happen.)
29+
30+
**Actual behavior**
31+
32+
(Write what happened. Please add screenshots!)
33+
34+
**Reproducible demo**
35+
36+
(Paste the link to an example project and exact instructions to reproduce the issue.)
37+
38+
**Additional context**
39+
40+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/discussion.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Discussion
3+
about: Create a discussion topic.
4+
title: ''
5+
labels: question
6+
assignees: ''
7+
---
8+
9+
**Describe the topic**
10+
11+
A clear and concise description of what the topic is.
12+
13+
**Your suggestions for this topic**
14+
15+
Clear and simple suggestions for how you think this should be handled.
16+
17+
**Screenshots**
18+
19+
If applicable, add screenshots to help explain your points.
20+
21+
**Code snippets**
22+
23+
If applicable, add code samples to help explain your points.
24+
25+
**Additional context**
26+
27+
Add any other context about the problem here.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
15+
A clear and concise description of what you want to happen.
16+
17+
**Describe alternatives you've considered**
18+
19+
A clear and concise description of any alternative solutions or features you've considered.
20+
21+
**Additional context**
22+
23+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#### Description of what you did:
2+
3+
<!--
4+
Replace [ ] by [x] to check these checkboxes!
5+
-->
6+
7+
#### My PR is a:
8+
9+
- [ ] 💥 Breaking change
10+
- [ ] 🐛 Bug fix
11+
- [ ] 💅 Enhancement
12+
- [ ] 🚀 New feature
13+
14+
#### Main update on the:
15+
16+
- [ ] lib
17+
- [ ] template

CHANGELOG.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Changelog
2+
3+
## 3.1.2 ( October 3, 2019 )
4+
5+
- Updated to `create-react-app` version 3.1.2
6+
7+
## 3.0 ( April 26, 2019 )
8+
9+
- Updated to `create-react-app` version 3.0
10+
11+
## 2.0 ( November 25, 2018 )
12+
13+
- Updated to `create-react-app` version 2.0
14+
15+
## 1.1.0 ( December 27, 2017 )
16+
17+
### News
18+
19+
We have decided to track and follow philosophy of `create-react-app` and constantly update our NPM library starter with the updates of `create-react-app`
20+
21+
### Breaking
22+
23+
- Removed Sass support by default
24+
25+
### Main
26+
27+
- Updated to `create-react-app` version `1.4.3`
28+
- Updated demo example of library

CODE_OF_CONDUCT.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Contributing to Create React Library
2+
3+
Create React Library is a open source project maintained by [udilia](https://udilia.com/).
4+
5+
All efforts to contribute are highly appreciated, we recommend you talk to a maintainer prior to spending a lot of time making a pull request that may not align with the project roadmap.
6+
7+
## Submitting a Pull Request
8+
9+
Good pull requests, such as patches, improvements, and new features, are a fantastic help. They should remain focused in scope and avoid containing unrelated commits.
10+
11+
Please ask first if somebody else is already working on this or the core developers think your feature is in-scope for Create React Library. Generally always have a related issue with discussions for whatever you are including.
12+
13+
## Folder Structure
14+
15+
create-react-library is divided into two independent sub-packages. Overview of directory structure:
16+
17+
```
18+
lib
19+
template
20+
```
21+
22+
#### [template](https://github.com/udilia/create-react-library/tree/master/template)
23+
24+
Is a Create React App's template that is modified to build NPM Libraries with React.
25+
26+
#### [lib](https://github.com/udilia/create-react-library/tree/master/lib)
27+
28+
This package includes Node.js command line script that is published to NPM as a `@udilia/create-react-library` that helps users to install the template with one command.
29+
30+
## Development Workflow
31+
32+
1. Clone the repo with `git clone https://github.com/udilia/create-react-library.git`
33+
2. cd into `create-react-library/template` run `yarn` to install dependencies.
34+
3. and then run `yarn start`
35+
36+
## Reporting an issue
37+
38+
Before submitting an issue you need to make sure:
39+
40+
- You have already searched for related [issues](https://github.com/udilia/create-react-library/issues), and found none open (if you found a related closed issue, please link to it from your post).
41+
- Your issue title is concise and on-topic.
42+
- You can and do provide steps to reproduce your issue.
43+
- Make sure the [issue template](https://github.com/udilia/create-react-library/tree/master/.github/ISSUE_TEMPLATE) is respected.
44+
- Make sure your issue body is readable and [well formated](https://guides.github.com/features/mastering-markdown/).

LICENSE.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2019 udilia.
2+
3+
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:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
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.

README.md

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Create React Library ![npm](https://img.shields.io/npm/dm/@udilia/create-react-library) ![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)
2+
3+
Create React NPM Library with no build configuration, based on Facebook's [Create React App](https://github.com/facebook/create-react-app). We are constantly updating the repository with the updates of create-react-app, so we have all new features and bug fixes of it.
4+
5+
## Quick Overview
6+
7+
```sh
8+
npx @udilia/create-react-library my-lib
9+
cd my-lib
10+
npm start
11+
```
12+
13+
_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/DimiMikadze/f984a074acea510e91b445fae9b39b44))_
14+
15+
Then open [http://localhost:3000](http://localhost:3000) to see demo library running in the browser.
16+
17+
## Creating a Library
18+
19+
You’ll need to have Node 8.16.0 or Node 10.16.0 or later version on your local development machine.
20+
21+
To create a new library, you may choose one of the following methods:
22+
23+
### npx
24+
25+
```sh
26+
npx @udilia/create-react-library my-lib
27+
```
28+
29+
_([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/DimiMikadze/f984a074acea510e91b445fae9b39b44))_
30+
31+
### npm
32+
33+
```sh
34+
npm init @udilia/react-library my-lib
35+
```
36+
37+
_`npm init <initializer>` is available in npm 6+_
38+
39+
### Yarn
40+
41+
```sh
42+
yarn create @udilia/react-library my-lib
43+
```
44+
45+
_`yarn create` is available in Yarn 0.25+_
46+
47+
It will create a directory called `my-lib` inside the current folder.
48+
Inside that directory, it will generate the initial project structure and install dependencies.
49+
50+
```
51+
my-lib
52+
├── config
53+
├── node_modules
54+
├── public
55+
├── scripts
56+
├── src
57+
├── demo
58+
├── lib
59+
├── .gitignore
60+
├── package.json
61+
├── README.md
62+
```
63+
64+
All library files are located inside **src/lib** folder.
65+
66+
Inside **src/demo** folder, you can test your library while developing.
67+
68+
Once the installation is done, you can open your project folder:
69+
70+
```
71+
cd my-lib
72+
```
73+
74+
Inside the newly created project, you can run some built-in commands:
75+
76+
### `npm start` or `yarn start`
77+
78+
Runs the library in development mode. Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
79+
80+
### `npm run test` or `yarn run test`
81+
82+
Runs the test watcher in an interactive mode.
83+
84+
### `npm run build` or `yarn build`
85+
86+
Builds the library for production to the `build` folder.
87+
It correctly bundles React in production mode and optimizes the build for the best performance.
88+
89+
### `npm publish`
90+
91+
Publishes the library to NPM.
92+
93+
## Contributing
94+
95+
Please read our [CONTRIBUTING.md](https://github.com/udilia/create-react-library/blob/master/CONTRIBUTING.md) before submitting a Pull Request to the project.
96+
97+
## Troubleshooting
98+
99+
### Usage of other libraries within your library
100+
101+
- Add the library as a peer dependency in package.json (effectively requiring the calling project to provide this dependency)
102+
- Add the library as a dev dependency in package.json (effectively allowing this library to successfully build without complaining about not having this dependency)
103+
- Add the library to the externals config in your webpack.config file(s). By default, only react and react-dom are there, meaning that those are the only two libraries that you can use within your new shared library.
104+
105+
## Example libraries built with Create React Library
106+
107+
https://github.com/DimiMikadze/react-under-construction
108+
109+
## License
110+
111+
[MIT License](https://github.com/udilia/create-react-library/blob/master/LICENSE.md) Copyright (c) 2019 [udilia](https://udilia.com/)

0 commit comments

Comments
 (0)