Skip to content

Commit fc15402

Browse files
committed
Initial commit 👢
1 parent 002aea7 commit fc15402

File tree

11 files changed

+225
-207
lines changed

11 files changed

+225
-207
lines changed

README.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
> This is my personal starter kit for npm libraries.
1+
# react-async-bootstrapper 👢
22

3-
# Your Library Name
3+
Provides the ability to execute async bootstrapper functions within your React element tree.
44

5-
A one liner description of your library.
6-
7-
___BADGES: EDIT THESE TO USE THE URLS FOR EACH SERVICE CONFIGURED FOR YOUR OWN LIBRARY, THEN REMOVE THIS MESSAGE___
8-
9-
[![npm](https://img.shields.io/npm/v/npm-library-starter.svg?style=flat-square)](http://npm.im/npm-library-starter)
10-
[![MIT License](https://img.shields.io/npm/l/npm-library-starter.svg?style=flat-square)](http://opensource.org/licenses/MIT)
11-
[![Travis](https://img.shields.io/travis/ctrlplusb/npm-library-starter.svg?style=flat-square)](https://travis-ci.org/ctrlplusb/npm-library-starter)
12-
[![Codecov](https://img.shields.io/codecov/c/github/ctrlplusb/npm-library-starter.svg?style=flat-square)](https://codecov.io/github/ctrlplusb/npm-library-starter)
5+
[![npm](https://img.shields.io/npm/v/react-async-bootstrapper.svg?style=flat-square)](http://npm.im/react-async-bootstrapper)
6+
[![MIT License](https://img.shields.io/npm/l/react-async-bootstrapper.svg?style=flat-square)](http://opensource.org/licenses/MIT)
7+
[![Travis](https://img.shields.io/travis/ctrlplusb/react-async-bootstrapper.svg?style=flat-square)](https://travis-ci.org/ctrlplusb/react-async-bootstrapper)
8+
[![Codecov](https://img.shields.io/codecov/c/github/ctrlplusb/react-async-bootstrapper.svg?style=flat-square)](https://codecov.io/github/ctrlplusb/react-async-bootstrapper)
139

1410
## TOCs
1511

@@ -18,14 +14,8 @@ ___BADGES: EDIT THESE TO USE THE URLS FOR EACH SERVICE CONFIGURED FOR YOUR OWN L
1814

1915
## Introduction
2016

21-
An introduction to your library...
17+
> Coming Soon
2218
2319
## FAQs
2420

25-
___A common question around your library?___
26-
27-
The answer to the question.
28-
29-
___A common question around your library?___
30-
31-
The answer to the question.
21+
> Let me know if you have any questions

package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "npm-library-starter",
2+
"name": "react-async-bootstrapper",
33
"version": "0.0.1",
4-
"description": "Starter kit for npm libraries.",
4+
"description": "Provides the ability to execute async bootstrapper functions within your React element tree.",
55
"license": "MIT",
66
"main": "commonjs/index.js",
77
"files": [
@@ -12,9 +12,9 @@
1212
],
1313
"repository": {
1414
"type": "git",
15-
"url": "https://github.com/ctrlplusb/npm-library-starter.git"
15+
"url": "https://github.com/ctrlplusb/react-async-bootstrapper.git"
1616
},
17-
"homepage": "https://github.com/ctrlplusb/npm-library-starter#readme",
17+
"homepage": "https://github.com/ctrlplusb/react-async-bootstrapper#readme",
1818
"author": "Sean Matheson <sean@ctrlplusb.com>",
1919
"keywords": [
2020
"library"
@@ -57,13 +57,13 @@
5757
"babel-jest": "19.0.0",
5858
"babel-loader": "6.4.0",
5959
"babel-polyfill": "6.23.0",
60-
"babel-preset-env": "1.2.1",
60+
"babel-preset-env": "1.2.2",
6161
"babel-preset-latest": "6.24.0",
6262
"babel-preset-react": "6.23.0",
6363
"babel-preset-stage-3": "6.22.0",
6464
"babel-register": "6.24.0",
65-
"codecov": "1.0.1",
66-
"cross-env": "3.2.3",
65+
"codecov": "2.0.1",
66+
"cross-env": "3.2.4",
6767
"enzyme": "2.7.1",
6868
"enzyme-to-json": "1.5.0",
6969
"eslint": "3.17.1",
@@ -77,7 +77,7 @@
7777
"jest": "19.0.2",
7878
"lint-staged": "3.4.0",
7979
"prettier": "0.22.0",
80-
"prettier-eslint": "4.3.0",
80+
"prettier-eslint": "4.3.2",
8181
"prettier-eslint-cli": "3.1.2",
8282
"pretty-bytes": "4.0.2",
8383
"ramda": "0.23.0",
@@ -86,9 +86,12 @@
8686
"react-dom": "15.4.2",
8787
"readline-sync": "1.4.6",
8888
"rimraf": "2.6.1",
89-
"sinon": "1.17.7",
89+
"sinon": "2.0.0",
9090
"webpack": "2.2.1",
9191
"webpack-dev-middleware": "1.10.1",
9292
"webpack-hot-middleware": "2.17.1"
93+
},
94+
"dependencies": {
95+
"react-tree-walker": "2.0.0-alpha.2"
9396
}
9497
}

src/MyComponent.js

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

src/__tests__/MyComponent.test.js

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

src/__tests__/__snapshots__/MyComponent.test.js.snap

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

src/__tests__/helloWorld.test.js

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

src/goodbyeWorld.js

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

src/helloWorld.js

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

src/index.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
import helloWorld from './helloWorld'
2-
import goodbyeWorld from './goodbyeWorld'
3-
import MyComponent from './MyComponent'
1+
import reactTreeWalker from 'react-tree-walker'
42

5-
export { helloWorld, goodbyeWorld, MyComponent }
3+
export default function asyncResolver(app) {
4+
const visitor = (element, instance) => {
5+
if (instance && typeof instance.reactAsyncResolverTarget === 'function') {
6+
return instance.reactAsyncResolverTarget()
7+
}
8+
return true
9+
}
10+
11+
return (
12+
reactTreeWalker(app, visitor, {})
13+
// Swallow errors.
14+
.catch(() => undefined)
15+
)
16+
}

tools/webpack/configFactory.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ function webpackConfigFactory({ target }) {
6363
{
6464
test: /\.js$/,
6565
loader: 'babel-loader',
66-
include: [resolvePath(appRootDir.get(), './src')],
66+
include: [
67+
resolvePath(appRootDir.get(), './src'),
68+
resolvePath(appRootDir.get(), './node_modules/p-limit'),
69+
resolvePath(appRootDir.get(), './node_modules/p-locate'),
70+
resolvePath(appRootDir.get(), './node_modules/p-map-series'),
71+
resolvePath(appRootDir.get(), './node_modules/p-reduce'),
72+
],
6773
},
6874
],
6975
},

0 commit comments

Comments
 (0)