Skip to content

Commit c0ea6d3

Browse files
authored
Merge pull request #1 from Vydia/package-for-deployment
Package for deployment
2 parents 674cb66 + 3b26fee commit c0ea6d3

File tree

9 files changed

+26
-39
lines changed

9 files changed

+26
-39
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"semi": [2, "never"],
1313
"no-unexpected-multiline": 2,
1414
"compat/compat": 2,
15-
"react/prop-types": 0
15+
"react/prop-types": 0,
16+
"flowtype/require-valid-file-annotation": 2
1617
},
1718
"env": {
1819
"jest": true

lib/LoadingSwitch.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ between our mobile and web apps, and also really any app that uses react-apollo
3838

3939
class LoadingSwitch extends _react.Component {
4040
render() {
41-
let {
41+
const {
4242
children,
4343
error,
4444
errorWhenMissing,
@@ -63,7 +63,6 @@ class LoadingSwitch extends _react.Component {
6363
return children && typeof children === 'function' ? children() : children;
6464
}
6565
}
66-
6766
LoadingSwitch.displayName = 'LoadingSwitch';
6867

6968
module.exports = LoadingSwitch;

lib/LoadingSwitch.js.flow

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @flow
2-
import { Component } from 'react'
3-
import { type Node } from 'react'
2+
import { Component, type Node } from 'react'
43
import isPending, { type PendingValue } from './utils/isPending'
54

65
/*
@@ -43,7 +42,7 @@ export type Props = {|
4342

4443
class LoadingSwitch extends Component<Props> {
4544
render() {
46-
let {
45+
const {
4746
children,
4847
error,
4948
errorWhenMissing,

lib/index.js

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,13 @@ exports.isPending = undefined;
77

88
var _LoadingSwitch = require('./LoadingSwitch');
99

10-
Object.keys(_LoadingSwitch).forEach(function (key) {
11-
if (key === "default" || key === "__esModule") return;
12-
Object.defineProperty(exports, key, {
13-
enumerable: true,
14-
get: function () {
15-
return _LoadingSwitch[key];
16-
}
17-
});
18-
});
10+
var _LoadingSwitch2 = _interopRequireDefault(_LoadingSwitch);
1911

20-
var _utils = require('./utils');
12+
var _isPending2 = require('./utils/isPending');
2113

22-
Object.defineProperty(exports, 'isPending', {
23-
enumerable: true,
24-
get: function () {
25-
return _utils.isPending;
26-
}
27-
});
28-
29-
var _LoadingSwitch2 = _interopRequireDefault(_LoadingSwitch);
14+
var _isPending3 = _interopRequireDefault(_isPending2);
3015

3116
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3217

33-
exports.default = _LoadingSwitch2.default;
18+
exports.default = _LoadingSwitch2.default;
19+
const isPending = exports.isPending = _isPending3.default;

lib/index.js.flow

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
// @flow
12
import LoadingSwitch, { type Props as _Props } from './LoadingSwitch'
3+
import _isPending, { type PendingValue as _PendingValue } from './utils/isPending'
24

35
export type Props = _Props
6+
export type PendingValue = _PendingValue
47

58
export default LoadingSwitch
69

7-
export * from './LoadingSwitch'
8-
export { isPending } from './utils'
10+
export const isPending = _isPending

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
{
22
"name": "react-loading-switch",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "React component API for easily composing the render logic surrounding react-apollo data fetching, loading, and error handling",
5+
"browser": "lib/index.js",
56
"main": "lib/index.js",
67
"module": "src/index.js",
8+
"files": ["lib/"],
79
"scripts": {
810
"lint": "./node_modules/.bin/eslint src/.",
911
"lint-fix": "npm run lint -- --fix",
1012
"flow-typed-install": "flow-typed install",
1113
"flow": "flow",
14+
"prepublishOnly": "npm run ci-test && npm run build",
1215
"build": "npm run build:babel && npm run build:flow",
1316
"build:babel": "babel src/ -d lib",
1417
"build:flow": "flow-copy-source src lib",
15-
"ci-test": "NODE_ENV=test npm run build && npm run flow && npm run jest",
16-
"test": "NODE_ENV=test npm run build && npm run jest",
18+
"ci-test": "npm run build && npm run lint && npm run flow && npm run jest",
19+
"test": "npm run build && npm run jest",
1720
"jest": "jest --testMatch **/test/*.js --verbose",
1821
"test-update": "npm run test -- -u"
1922
},
@@ -83,6 +86,5 @@
8386
"regenerator-runtime": "^0.11.1"
8487
},
8588
"dependencies": {
86-
"react": "^16.3.2"
8789
}
8890
}

src/LoadingSwitch.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @flow
2-
import { Component } from 'react'
3-
import { type Node } from 'react'
2+
import { Component, type Node } from 'react'
43
import isPending, { type PendingValue } from './utils/isPending'
54

65
/*
@@ -43,7 +42,7 @@ export type Props = {|
4342

4443
class LoadingSwitch extends Component<Props> {
4544
render() {
46-
let {
45+
const {
4746
children,
4847
error,
4948
errorWhenMissing,

src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
// @flow
12
import LoadingSwitch, { type Props as _Props } from './LoadingSwitch'
3+
import _isPending, { type PendingValue as _PendingValue } from './utils/isPending'
24

35
export type Props = _Props
6+
export type PendingValue = _PendingValue
47

58
export default LoadingSwitch
69

7-
export * from './LoadingSwitch'
8-
export { isPending } from './utils'
10+
export const isPending = _isPending

src/utils/index.js

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

0 commit comments

Comments
 (0)