Skip to content

Commit b5eaa54

Browse files
committed
2 parents 1c16a95 + 63fa07f commit b5eaa54

File tree

17 files changed

+5976
-3509
lines changed

17 files changed

+5976
-3509
lines changed

.babelrc

Lines changed: 0 additions & 59 deletions
This file was deleted.

.babelrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = function(api) {
2+
const plugins = [
3+
'@babel/plugin-transform-flow-strip-types',
4+
'@babel/plugin-syntax-dynamic-import',
5+
'@babel/plugin-proposal-export-default-from',
6+
'@babel/plugin-proposal-export-namespace-from',
7+
'@babel/plugin-proposal-object-rest-spread',
8+
'@babel/plugin-proposal-class-properties',
9+
]
10+
const presets = [
11+
[
12+
'@babel/preset-env',
13+
api.env('es5')
14+
? { forceAllTransforms: true }
15+
: { targets: { node: 'current' } },
16+
],
17+
'@babel/preset-react',
18+
'@babel/preset-flow',
19+
]
20+
21+
if (api.env(['test', 'coverage', 'es5'])) {
22+
plugins.push('@babel/plugin-transform-runtime')
23+
}
24+
if (api.env('coverage')) {
25+
plugins.push('babel-plugin-istanbul')
26+
}
27+
28+
return { plugins, presets }
29+
}

.circleci/config.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: circleci/node:8
6+
7+
steps:
8+
- checkout
9+
- restore_cache:
10+
name: Restore Yarn Package Cache
11+
keys:
12+
- v1-yarn-packages-{{ checksum "yarn.lock" }}
13+
14+
- run:
15+
name: Setup NPM Token
16+
command: |
17+
yarn config set registry "https://registry.npmjs.org/"
18+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
19+
echo "registry=https://registry.npmjs.org/" >> .npmrc
20+
21+
- run:
22+
name: Install Dependencies
23+
command: yarn install --frozen-lockfile
24+
- save_cache:
25+
name: Save Yarn Package Cache
26+
key: v1-yarn-packages-{{ checksum "yarn.lock" }}
27+
paths:
28+
- ~/.cache/yarn
29+
30+
- run:
31+
name: build
32+
command: yarn run prepublishOnly
33+
- run:
34+
name: upload test coverage
35+
command: yarn codecov || true
36+
- run:
37+
name: release
38+
command: yarn run semantic-release || true

.eslintrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
{
22
"extends": [
3-
"@jedwards1211/eslint-config-react", "@jedwards1211/eslint-config-flow"
3+
"@jedwards1211/eslint-config-react",
4+
"@jedwards1211/eslint-config-flow",
5+
"eslint-config-prettier"
46
],
57
"parser": "babel-eslint",
8+
"parserOptions": {
9+
"ecmaVersion": 6,
10+
"sourceType": "module"
11+
},
612
"env": {
713
"es6": true
814
}

.flowconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
[ignore]
2+
<PROJECT_ROOT>/[^/\\]+\.js$
3+
<PROJECT_ROOT>/[^/\\]+\.js\.flow$
24
<PROJECT_ROOT>/es/.*
35
<PROJECT_ROOT>/lib/.*
46
<PROJECT_ROOT>/node_modules/.*/fbjs/.*
57
<PROJECT_ROOT>/node_modules/fbjs/.*
8+
<PROJECT_ROOT>/node_modules/.*/config-chain/.*
69

710
[include]
811
./src

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
.nyc_output
33
coverage
44
es
5-
lib
65
node_modules
6+
.eslintcache
7+
/*.js
8+
/*.js.flow
9+
!/.babelrc.js

.npmignore

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
.babelrc
2-
.eslintcache
3-
.eslintrc
4-
.idea
5-
.nyc_output
6-
.storybook
7-
.travis.yml
8-
commitlint.config.js
9-
coverage
10-
flow-typed
11-
lib
12-
node_modules
13-
renovate.json
14-
solano.yml
15-
src
16-
stories
17-
test
1+
**
2+
!**/*.js
3+
!**/*.js.flow
4+
!/*.md
5+
!yarn.lock
6+
/lib
7+
/src
8+
/stories
9+
/test
10+
/coverage
11+
/flow-typed
12+
__tests__
13+
/.*
14+
!/.flowconfig

.travis.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
# react-render-props-script-loader
22

3-
[![Build Status](https://travis-ci.org/jcoreio/react-render-props-script-loader.svg?branch=master)](https://travis-ci.org/jcoreio/react-render-props-script-loader)
3+
[![CircleCI](https://circleci.com/gh/jcoreio/react-render-props-script-loader.svg?style=svg)](https://circleci.com/gh/jcoreio/react-render-props-script-loader)
44
[![Coverage Status](https://codecov.io/gh/jcoreio/react-render-props-script-loader/branch/master/graph/badge.svg)](https://codecov.io/gh/jcoreio/react-render-props-script-loader)
5-
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
65
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
6+
[![npm version](https://badge.fury.io/js/react-library-skeleton.svg)](https://badge.fury.io/js/react-library-skeleton)
77

88
an easier to use dynamic script loader with a [render prop](https://reactjs.org/docs/render-props.html)
99

1010
This is useful if you want to wait to load the Google Maps API until the user
11-
navigates to a view that uses it. When you mount a `<ScriptLoader>` component,
11+
navigates to a view that uses it. When you mount a `<ScriptLoader>` component,
1212
it will create the script tag you've requested.
1313

1414
`<ScriptLoader>` doesn't load a given script URL more than once, even if there
15-
is a pre-existing `<script>` tag for that URL that it didn't create. If `src`
15+
is a pre-existing `<script>` tag for that URL that it didn't create. If `src`
1616
prop changes, it will load that new URL.
1717

1818
## Version notes
1919

20-
* supports React 15 or 16
21-
* if building for legacy browsers with a bundler like Webpack that supports the
22-
`module` field of `package.json`, you will probably need to add a rule to
23-
transpile this package.
20+
- supports React 15 or 16
21+
- if building for legacy browsers with a bundler like Webpack that supports the
22+
`module` field of `package.json`, you will probably need to add a rule to
23+
transpile this package.
2424

2525
## Installation
2626

@@ -43,7 +43,7 @@ export const MapViewContainer = props => (
4343
onLoad={() => console.log('loaded google maps!')}
4444
onError={error => console.error('failed to load google maps:', error.stack)}
4545
>
46-
{({loading, error}) => {
46+
{({ loading, error }) => {
4747
if (loading) return <h3>Loading Google Maps API...</h3>
4848
if (error) return <h3>Failed to load Google Maps API: {error.message}</h3>
4949
return <MapView {...props} />
@@ -71,9 +71,5 @@ script
7171

7272
### `children` (`?(state: State) => ?React.Node`)
7373

74-
The render function. It will be called with an object having the following
74+
The render function. It will be called with an object having the following
7575
props, and may return your desired content to display:
76-
77-
* `loading` (`boolean`) - `true` iff the script is loading
78-
* `loaded` (`boolean`) - `true` iff the script successfully loaded
79-
* `error` (`?Error`) - the `Error` that occurred if the script failed to load

commitlint.config.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)