Skip to content

Commit 0fa0b69

Browse files
committed
init create-react-library@3.1.1
0 parents  commit 0fa0b69

29 files changed

+23764
-0
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build/
2+
dist/
3+
node_modules/
4+
.snapshots/
5+
*.min.js

.eslintrc

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"extends": [
4+
"standard",
5+
"standard-react",
6+
"plugin:prettier/recommended",
7+
"prettier/standard",
8+
"prettier/react",
9+
"plugin:@typescript-eslint/eslint-recommended"
10+
],
11+
"env": {
12+
"node": true
13+
},
14+
"parserOptions": {
15+
"ecmaVersion": 2020,
16+
"ecmaFeatures": {
17+
"legacyDecorators": true,
18+
"jsx": true
19+
}
20+
},
21+
"settings": {
22+
"react": {
23+
"version": "16"
24+
}
25+
},
26+
"rules": {
27+
"space-before-function-paren": 0,
28+
"react/prop-types": 0,
29+
"react/jsx-handler-names": 0,
30+
"react/jsx-fragments": 0,
31+
"react/no-unused-prop-types": 0,
32+
"import/export": 0
33+
}
34+
}

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
# See https://help.github.com/ignore-files/ for more about ignoring files.
3+
4+
# dependencies
5+
node_modules
6+
7+
# builds
8+
build
9+
dist
10+
.rpt2_cache
11+
12+
# misc
13+
.DS_Store
14+
.env
15+
.env.local
16+
.env.development.local
17+
.env.test.local
18+
.env.production.local
19+
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*

.prettierrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"singleQuote": true,
3+
"jsxSingleQuote": true,
4+
"semi": false,
5+
"tabWidth": 2,
6+
"bracketSpacing": true,
7+
"jsxBracketSameLine": false,
8+
"arrowParens": "always",
9+
"trailingComma": "none"
10+
}

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
language: node_js
2+
node_js:
3+
- 12
4+
- 10

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# @reef-defi/react-lib
2+
3+
> Reef React Library
4+
5+
[![NPM](https://img.shields.io/npm/v/@reef-defi/react-lib.svg)](https://www.npmjs.com/package/@reef-defi/react-lib) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
6+
7+
## Install
8+
9+
```bash
10+
npm install --save @reef-defi/react-lib
11+
```
12+
13+
## Usage
14+
15+
```tsx
16+
import React, { Component } from 'react'
17+
18+
import MyComponent from '@reef-defi/react-lib'
19+
import '@reef-defi/react-lib/dist/index.css'
20+
21+
class Example extends Component {
22+
render() {
23+
return <MyComponent />
24+
}
25+
}
26+
```
27+
28+
## License
29+
30+
MIT © [Frenkiee](https://github.com/Frenkiee)

example/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This example was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2+
3+
It is linked to the @reef-defi/react-lib package in the parent directory for development purposes.
4+
5+
You can run `yarn install` and then `yarn start` to test your package.

example/package.json

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "@reef-defi/react-lib-example",
3+
"homepage": ".",
4+
"version": "0.0.0",
5+
"private": true,
6+
"scripts": {
7+
"start": "node ../node_modules/react-scripts/bin/react-scripts.js start",
8+
"build": "node ../node_modules/react-scripts/bin/react-scripts.js build",
9+
"test": "node ../node_modules/react-scripts/bin/react-scripts.js test",
10+
"eject": "node ../node_modules/react-scripts/bin/react-scripts.js eject"
11+
},
12+
"dependencies": {
13+
"@testing-library/jest-dom": "link:../node_modules/@testing-library/jest-dom",
14+
"@testing-library/react": "link:../node_modules/@testing-library/react",
15+
"@testing-library/user-event": "link:../node_modules/@testing-library/user-event",
16+
"@types/jest": "link:../node_modules/@types/jest",
17+
"@types/node": "link:../node_modules/@types/node",
18+
"@types/react": "link:../node_modules/@types/react",
19+
"@types/react-dom": "link:../node_modules/@types/react-dom",
20+
"react": "link:../node_modules/react",
21+
"react-dom": "link:../node_modules/react-dom",
22+
"react-scripts": "link:../node_modules/react-scripts",
23+
"typescript": "link:../node_modules/typescript",
24+
"@reef-defi/react-lib": "link:.."
25+
},
26+
"devDependencies": {
27+
"@babel/plugin-syntax-object-rest-spread": "^7.8.3"
28+
},
29+
"eslintConfig": {
30+
"extends": "react-app"
31+
},
32+
"browserslist": {
33+
"production": [
34+
">0.2%",
35+
"not dead",
36+
"not op_mini all"
37+
],
38+
"development": [
39+
"last 1 chrome version",
40+
"last 1 firefox version",
41+
"last 1 safari version"
42+
]
43+
}
44+
}

example/public/favicon.ico

3.78 KB
Binary file not shown.

example/public/index.html

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta
7+
name="viewport"
8+
content="width=device-width, initial-scale=1, shrink-to-fit=no"
9+
/>
10+
<meta name="theme-color" content="#000000" />
11+
12+
<!--
13+
manifest.json provides metadata used when your web app is added to the
14+
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
15+
-->
16+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
17+
18+
<!--
19+
Notice the use of %PUBLIC_URL% in the tags above.
20+
It will be replaced with the URL of the `public` folder during the build.
21+
Only files inside the `public` folder can be referenced from the HTML.
22+
23+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24+
work correctly both with client-side routing and a non-root public URL.
25+
Learn how to configure a non-root public URL by running `npm run build`.
26+
-->
27+
<title>@reef-defi/react-lib</title>
28+
</head>
29+
30+
<body>
31+
<noscript>
32+
You need to enable JavaScript to run this app.
33+
</noscript>
34+
35+
<div id="root"></div>
36+
37+
<!--
38+
This HTML file is a template.
39+
If you open it directly in the browser, you will see an empty page.
40+
41+
You can add webfonts, meta tags, or analytics to this file.
42+
The build step will place the bundled scripts into the <body> tag.
43+
44+
To begin the development, run `npm start` or `yarn start`.
45+
To create a production bundle, use `npm run build` or `yarn build`.
46+
-->
47+
</body>
48+
</html>

example/public/manifest.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"short_name": "@reef-defi/react-lib",
3+
"name": "@reef-defi/react-lib",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
}
10+
],
11+
"start_url": ".",
12+
"display": "standalone",
13+
"theme_color": "#000000",
14+
"background_color": "#ffffff"
15+
}

example/src/App.test.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react'
2+
import ReactDOM from 'react-dom'
3+
import App from './App'
4+
5+
it('renders without crashing', () => {
6+
const div = document.createElement('div')
7+
ReactDOM.render(<App />, div)
8+
ReactDOM.unmountComponentAtNode(div)
9+
})

example/src/App.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react'
2+
3+
import { ExampleComponent } from '@reef-defi/react-lib'
4+
import '@reef-defi/react-lib/dist/index.css'
5+
6+
const App = () => {
7+
return <ExampleComponent text="Create React Library Example 😄" />
8+
}
9+
10+
export default App

example/src/index.css

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
body {
2+
margin: 0;
3+
padding: 0;
4+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
5+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
6+
sans-serif;
7+
-webkit-font-smoothing: antialiased;
8+
-moz-osx-font-smoothing: grayscale;
9+
}
10+
11+
code {
12+
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
13+
monospace;
14+
}

example/src/index.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import './index.css'
2+
3+
import React from 'react'
4+
import ReactDOM from 'react-dom'
5+
import App from './App'
6+
7+
ReactDOM.render(<App />, document.getElementById('root'))

example/src/react-app-env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="react-scripts" />

example/src/setupTests.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// jest-dom adds custom jest matchers for asserting on DOM nodes.
2+
// allows you to do things like:
3+
// expect(element).toHaveTextContent(/react/i)
4+
// learn more: https://github.com/testing-library/jest-dom
5+
import '@testing-library/jest-dom/extend-expect';

example/tsconfig.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"compilerOptions": {
3+
"outDir": "dist",
4+
"module": "esnext",
5+
"lib": ["dom", "esnext"],
6+
"moduleResolution": "node",
7+
"jsx": "react",
8+
"sourceMap": true,
9+
"declaration": true,
10+
"esModuleInterop": true,
11+
"noImplicitReturns": true,
12+
"noImplicitThis": true,
13+
"noImplicitAny": true,
14+
"strictNullChecks": true,
15+
"suppressImplicitAnyIndexErrors": true,
16+
"noUnusedLocals": true,
17+
"noUnusedParameters": true,
18+
"allowSyntheticDefaultImports": true
19+
},
20+
"include": ["src"],
21+
"exclude": ["node_modules", "build"]
22+
}

0 commit comments

Comments
 (0)