1
0
Fork 0
This commit is contained in:
Travis Fischer 2018-03-04 15:43:18 -05:00 committed by Joost De Cock
parent e80c3b2298
commit 907845feb1
27 changed files with 11082 additions and 0 deletions

View file

@ -0,0 +1,12 @@
{
"presets": [
["env", {
"modules": false
}],
"stage-0",
"react"
],
"plugins": [
"external-helpers"
]
}

View file

@ -0,0 +1,27 @@
{
"parser": "babel-eslint",
"extends": [
"standard",
"standard-react"
],
"env": {
"es6": true
},
"plugins": [
"react"
],
"parserOptions": {
"sourceType": "module",
"allowImportExportEverywhere": true
},
"rules": {
// don't force es6 functions to include space before paren
"space-before-function-paren": 0,
// allow specifying true explicitly for boolean props
"react/jsx-boolean-value": 0,
// allow imports mixed with non-import statements at top of file
"import/first": 0
}
}

View file

@ -0,0 +1,20 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
node_modules
# builds
build
dist
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

View file

@ -0,0 +1,31 @@
# {{name}}
> {{description}}
[![NPM](https://img.shields.io/npm/v/{{name}}.svg)](https://www.npmjs.com/package/{{name}}) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
## Install
```bash
npm install --save {{name}}
```
## Usage
```jsx
import React, { Component } from 'react'
import MyComponent from '{{name}}'
class Example extends Component {
render () {
return (
<MyComponent />
)
}
}
```
## License
{{license}} © [{{author}}](https://github.com/{{repo}})

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,20 @@
{
"name": "{{name}}-example",
"homepage": "https://{{author}}.github.io/{{name}}",
"version": "0.0.0",
"private": true,
"license": "MIT",
"dependencies": {
"prop-types": "^15.6.1",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"{{name}}": "{{#if yarn}}link:..{{else}}*{{/if}}",
"react-scripts": "^1.1.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}

View file

@ -0,0 +1,20 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<title>{{name}}</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
</body>
</html>

View file

@ -0,0 +1,8 @@
{
"short_name": "{{name}}",
"name": "{{name}}",
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View file

@ -0,0 +1,13 @@
import React, { Component } from 'react'
import ExampleComponent from '{{name}}'
export default class App extends Component {
render () {
return (
<div>
<ExampleComponent text='Modern React component module' />
</div>
)
}
}

View file

@ -0,0 +1,5 @@
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}

View file

@ -0,0 +1,7 @@
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import App from './App'
ReactDOM.render(<App />, document.getElementById('root'))

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,43 @@
{
"name": "{{name}}",
"version": "1.0.0",
"description": "{{description}}",
"author": "{{author}}",
"license": "{{license}}",
"repository": "{{repo}}",
"main": "dist/index.js",
"module": "dist/index.es.js",
"jsnext:main": "dist/index.es.js",
"scripts": {
"test": "react-scripts test --env=jsdom",
"build": "rollup -c",
"start": "rollup -c -w",
"prepare": "{{manager}} run build",
"predeploy": "cd example && {{manager}} install && {{manager}} run build",
"deploy": "gh-pages -d example/build"
},
"dependencies": {},
"peerDependencies": {
"prop-types": "^15.5.4",
"react": "^15.0.0 || ^16.0.0",
"react-dom": "^15.0.0 || ^16.0.0"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.1",
"babel-plugin-external-helpers": "^6.22.0",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"gh-pages": "^1.1.0",
"rollup": "^0.54.0",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-commonjs": "^8.2.1",
"rollup-plugin-node-resolve": "^3.0.2",
"rollup-plugin-peer-deps-external": "^2.0.0",
"rollup-plugin-postcss": "^1.1.0"
},
"files": [
"dist"
]
}

View file

@ -0,0 +1,32 @@
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import external from 'rollup-plugin-peer-deps-external'
import postcss from 'rollup-plugin-postcss'
import resolve from 'rollup-plugin-node-resolve'
import pkg from './package.json'
export default {
input: 'src/index.js',
output: [
{
file: pkg.main,
format: 'cjs'
},
{
file: pkg.module,
format: 'es'
}
],
plugins: [
external(),
postcss({
modules: true
}),
babel({
exclude: 'node_modules/**'
}),
resolve(),
commonjs()
]
}

View file

@ -0,0 +1,8 @@
{
"env": {
"mocha": true
},
"globals": {
"expect": true
}
}

View file

@ -0,0 +1,26 @@
/**
* @class ExampleComponent
*/
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import styles from './styles.css'
export default class ExampleComponent extends Component {
static propTypes = {
text: PropTypes.string
}
render() {
const {
text
} = this.props
return (
<div className={styles.test}>
Example Component: {text}
</div>
)
}
}

View file

@ -0,0 +1,8 @@
/* add css styles here (optional) */
.test {
display: inline-block;
margin: 2em auto;
border: 2px solid #000;
font-size: 2em;
}

View file

@ -0,0 +1,7 @@
import ExampleComponent from './'
describe('ExampleComponent', () => {
it('is truthy', () => {
expect(ExampleComponent).toBeTruthy()
})
})