Skip to content

Commit 5206993

Browse files
committed
Upgrade dependencies and node
1 parent e359a05 commit 5206993

25 files changed

+5229
-2480
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22

33
defaults: &defaults
44
docker:
5-
- image: circleci/node:7
5+
- image: circleci/node:10
66
working_directory: ~/repo
77

88
restore-npm-cache: &restore-npm-cache

.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
"settings": {
2424
"flowtype": {
2525
"onlyFilesWithFlowAnnotation": true
26+
},
27+
"react": {
28+
"version": "15.0"
2629
}
2730
},
2831
"extends": ["eslint:recommended", "plugin:flowtype/recommended"],

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.10.0
1+
10.14.2

docs/guides/architecture.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ function PlanetsList({ planets = [] }) {
100100
return <p>No Planets</p>
101101
}
102102

103-
return <ul>{planets.map(p => <li key={p.id}>{p.name}</li>)}</ul>
103+
return (
104+
<ul>
105+
{planets.map(p => (
106+
<li key={p.id}>{p.name}</li>
107+
))}
108+
</ul>
109+
)
104110
}
105111
```
106112

docs/guides/quickstart.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,13 @@ And in our PlanetList:
257257
import React from 'react'
258258

259259
export default function PlanetList({ planets = [] }) {
260-
return <ul>{planets.map(p => <li key={p}>{p}</li>)}</ul>
260+
return (
261+
<ul>
262+
{planets.map(p => (
263+
<li key={p}>{p}</li>
264+
))}
265+
</ul>
266+
)
261267
}
262268
```
263269

@@ -462,7 +468,11 @@ import { addPlanet } from '../actions/planets'
462468
export default function PlanetList({ planets = [] }) {
463469
return (
464470
<div>
465-
<ul>{planets.map(p => <li key={p}>{p}</li>)}</ul>
471+
<ul>
472+
{planets.map(p => (
473+
<li key={p}>{p}</li>
474+
))}
475+
</ul>
466476

467477
<ActionButton action={addPlanet} value="Alpha Centauri">
468478
Add Planet

examples/painter/app/views/canvas.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ export default function Canvas({ pixels, height, width, send }) {
1414
strokeWidth={0.25 / scaleX}
1515
strokeOpacity="0.2"
1616
>
17-
{pixels.map((row, y) => <Row key={y} cells={row} y={y} />)}
17+
{pixels.map((row, y) => (
18+
<Row key={y} cells={row} y={y} />
19+
))}
1820
</g>
1921
</svg>
2022
)

package.json

+28-27
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@
3232
],
3333
"license": "MIT",
3434
"dependencies": {
35-
"form-serialize": "^0.7.2"
35+
"form-serialize": "^0.7.2",
36+
"rollup-plugin-unassert": "^0.2.0"
3637
},
3738
"devDependencies": {
38-
"axios": "^0.16.2",
39+
"axios": "^0.18.0",
3940
"babel-core": "^6.26.0",
40-
"babel-eslint": "^7.2.3",
41-
"babel-loader": "^7.1.2",
41+
"babel-eslint": "^10.0.1",
42+
"babel-loader": "^8.0.4",
4243
"babel-plugin-transform-runtime": "^6.23.0",
4344
"babel-polyfill": "^6.26.0",
4445
"babel-preset-es2015": "^6.24.1",
@@ -48,40 +49,40 @@
4849
"babel-register": "^6.26.0",
4950
"body-parser": "^1.17.2",
5051
"browser-sync": "^2.18.13",
51-
"codecov": "^2.3.0",
52-
"console.table": "^0.9.1",
52+
"codecov": "^3.1.0",
53+
"console.table": "^0.10.0",
5354
"elizabot": "^0.0.2",
54-
"enzyme": "^2.9.1",
55-
"eslint": "^4.5.0",
56-
"eslint-plugin-flowtype": "^2.35.0",
55+
"enzyme": "^3.8.0",
56+
"enzyme-adapter-react-15": "^1.2.0",
57+
"eslint": "^5.10.0",
58+
"eslint-plugin-flowtype": "^3.2.0",
5759
"eslint-plugin-flowtype-errors": "^3.3.1",
5860
"eslint-plugin-react": "^7.3.0",
59-
"flow-bin": "^0.53.1",
61+
"flow-bin": "^0.89.0",
6062
"friendly-errors-webpack-plugin": "^1.6.1",
61-
"html-webpack-plugin": "^2.30.1",
62-
"jest": "^20.0.3",
63+
"html-webpack-plugin": "^3.2.0",
64+
"jest": "^23.6.0",
6365
"jsdoc": "^3.5.4",
64-
"jsdoc-babel": "^0.3.0",
66+
"jsdoc-babel": "^0.5.0",
6567
"microcosm-debugger": "^3.0.0",
6668
"minimist": "^1.2.0",
6769
"prettier": "^1.13.6",
68-
"react": "^15.6.1",
69-
"react-dom": "^15.6.1",
70-
"react-hot-loader": "next",
70+
"react": "^15.0.0",
71+
"react-dom": "^15.0.0",
72+
"react-hot-loader": "^4.5.3",
7173
"react-router-dom": "^4.2.2",
72-
"react-test-renderer": "^15.6.1",
73-
"rollup": "^0.49.2",
74-
"rollup-plugin-buble": "^0.15.0",
75-
"rollup-plugin-filesize": "^1.4.2",
74+
"react-test-renderer": "^15.0.0",
75+
"rollup": "^0.67.4",
76+
"rollup-plugin-buble": "^0.19.6",
77+
"rollup-plugin-filesize": "^5.0.1",
7678
"rollup-plugin-flow": "^1.1.1",
77-
"rollup-plugin-json": "^2.3.0",
78-
"rollup-plugin-node-resolve": "^3.0.0",
79-
"rollup-plugin-strip": "^1.1.1",
80-
"rollup-plugin-uglify": "^2.0.1",
79+
"rollup-plugin-json": "^3.1.0",
80+
"rollup-plugin-node-resolve": "^4.0.0",
81+
"rollup-plugin-uglify": "^6.0.0",
8182
"uid": "^0.0.2",
82-
"webpack": "^3.5.5",
83-
"webpack-dev-server": "^2.6.1",
84-
"zen-observable": "^0.5.2"
83+
"webpack": "^4.27.1",
84+
"webpack-dev-server": "^3.1.10",
85+
"zen-observable": "~0.5.2"
8586
},
8687
"prettier": {
8788
"semi": false,

scripts/bundle

+2-8
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
const rollup = require('rollup')
66
const buble = require('rollup-plugin-buble')
77
const flow = require('rollup-plugin-flow')
8-
const strip = require('rollup-plugin-strip')
98
const uglify = require('rollup-plugin-uglify')
109
const node = require('rollup-plugin-node-resolve')
10+
const unassert = require('rollup-plugin-unassert')
1111
const json = require('rollup-plugin-json')
1212
const filesize = require('rollup-plugin-filesize')
1313
const { Dictionary } = require('uglify-js')
@@ -46,13 +46,7 @@ const configs = {
4646
}
4747

4848
if (!options.strict) {
49-
plugins.push(
50-
strip({
51-
debugger: true,
52-
functions: ['console.assert'],
53-
sourceMap: true
54-
})
55-
)
49+
plugins.push( plugins.push(unassert()))
5650
}
5751

5852
if (options.minify) {

src/action.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import Emitter, { type Callback } from './emitter'
88
import tag from './tag'
99
import { uid } from './utils'
10+
import assert from 'assert'
1011

1112
type ActionUpdater = (payload?: mixed) => *
1213
type Revision = { status: string, payload: *, timestamp: number }
@@ -167,10 +168,7 @@ class Action extends Emitter {
167168
if (this.parent) {
168169
this.parent.parent = null
169170
} else {
170-
console.assert(
171-
false,
172-
'Unable to prune action. It is already disconnected.'
173-
)
171+
assert(false, 'Unable to prune action. It is already disconnected.')
174172
}
175173
}
176174

@@ -207,7 +205,7 @@ class Action extends Emitter {
207205
if (this.parent) {
208206
this.parent.abandon(this)
209207
} else {
210-
console.assert(false, 'Action has already been removed.')
208+
assert(false, 'Action has already been removed.')
211209
}
212210

213211
this.removeAllListeners()
@@ -237,7 +235,7 @@ class Action extends Emitter {
237235
*/
238236
_callOrSubscribeOnce(status: Status, callback: Callback, scope: ?Object) {
239237
if (callback) {
240-
console.assert(
238+
assert(
241239
typeof callback === 'function',
242240
`Expected a function when subscribing to ${status}` +
243241
`instead got ${typeof callback}`

src/addons/action-form.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* @flow
33
*/
44

5+
import assert from 'assert'
56
import React from 'react'
67
import DOM from 'react-dom'
78
import { Action, merge } from '../microcosm'
@@ -82,7 +83,7 @@ class ActionForm extends React.PureComponent<Props> {
8283
submit(event: Event) {
8384
let form = this.form
8485

85-
console.assert(
86+
assert(
8687
form,
8788
'ActionForm has no form reference and can not submit. This can happen',
8889
'if submit() is called after the parent component has unmounted.'

src/compare-tree/node.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @flow
55
*/
66

7+
import assert from 'assert'
78
import type Query from './query'
89

910
class Node {
@@ -32,15 +33,12 @@ class Node {
3233
* the list of edges.
3334
*/
3435
connect(node: Node | Query) {
35-
console.assert(
36+
assert(
3637
this.edges.indexOf(node) <= 0,
3738
node.id + ' is already connected to ' + this.id
3839
)
3940

40-
console.assert(
41-
node !== this,
42-
'Unable to connect node ' + node.id + ' to self.'
43-
)
41+
assert(node !== this, 'Unable to connect node ' + node.id + ' to self.')
4442

4543
this.edges.push(node)
4644
}

src/coroutine.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import Action from './action'
66
import { isFunction, isPromise, isGeneratorFn } from './utils'
7+
import assert from 'assert'
78

89
/**
910
* Provide support for generators, performing a sequence of actions in
@@ -32,7 +33,7 @@ function processGenerator(action: Action, body: GeneratorAction, repo: *) {
3233
return progress(repo.parallel(subAction))
3334
}
3435

35-
console.assert(
36+
assert(
3637
subAction instanceof Action,
3738
`Iteration of generator expected an Action. Instead got ${typeof subAction}`
3839
)

src/domain-engine.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import MetaDomain from './meta-domain'
66
import getRegistration from './get-registration'
77
import { get, set, merge, createOrClone } from './utils'
88
import { castPath, type KeyPath } from './key-path'
9+
import assert from 'assert'
910

1011
import type Action from './action'
1112
import type Microcosm from './microcosm'
@@ -79,11 +80,11 @@ class DomainEngine {
7980
}
8081

8182
add(key: string | KeyPath, config: *, options?: Object) {
82-
console.assert(
83+
assert(
8384
!options || options.constructor === Object,
84-
'addDomain expected a plain object as the second argument.',
85-
'Instead got',
86-
get(options, 'constructor.name', 'Unknown')
85+
'addDomain expected a plain object as the second argument. ' +
86+
'Instead got ' +
87+
get(options, 'constructor.name', 'Unknown')
8788
)
8889

8990
let deepOptions = merge(

src/effect-engine.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import getRegistration from './get-registration'
66
import { get, merge, createOrClone } from './utils'
7-
7+
import assert from 'assert'
88
import type Action from './action'
99
import type Microcosm from './microcosm'
1010

@@ -18,10 +18,10 @@ class EffectEngine {
1818
}
1919

2020
add(config: Object | Function, options?: Object) {
21-
console.assert(
21+
assert(
2222
!options || options.constructor === Object,
23-
'addEffect expected a plain object as the second argument. Instead got',
24-
get(options, 'constructor.name', 'Unknown')
23+
'addEffect expected a plain object as the second argument. Instead got ' +
24+
get(options, 'constructor.name', 'Unknown')
2525
)
2626

2727
let deepOptions = merge(this.repo.options, config.defaults, options)

src/emitter.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import { isFunction } from './utils'
8+
import assert from 'assert'
89

910
export type Callback = (...args: *[]) => *
1011

@@ -30,7 +31,7 @@ class Emitter<Event: string> {
3031
* Add an event listener.
3132
*/
3233
on(event: Event, fn: Callback, scope?: any) {
33-
console.assert(
34+
assert(
3435
isFunction(fn),
3536
`Expected ${event} listener to be function, instead got ${typeof fn}`
3637
)
@@ -47,7 +48,7 @@ class Emitter<Event: string> {
4748
* automatically removed.
4849
*/
4950
once(event: Event, fn: Callback, scope?: any) {
50-
console.assert(
51+
assert(
5152
isFunction(fn),
5253
`Expected ${event} listener to be function, instead got ${typeof fn}`
5354
)

src/get-registration.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @flow
22
import { isObject } from './utils'
3+
import assert from 'assert'
34

45
export const STATUSES = {
56
inactive: 'inactive',
@@ -30,8 +31,8 @@ function getRegistration(pool: ?Object, command: Tagged, status: Status) {
3031

3132
let alias = STATUSES[status]
3233

33-
console.assert(alias, 'Invalid action status ' + status)
34-
console.assert(
34+
assert(alias, 'Invalid action status ' + status)
35+
assert(
3536
command.__tagged,
3637
`Unable to register ${command.name || 'action'}(). It has not been tagged.`
3738
)
@@ -48,12 +49,12 @@ function getRegistration(pool: ?Object, command: Tagged, status: Status) {
4849
/**
4950
* Throw in strict mode if a nested registration is undefined. This is usually a typo.
5051
*/
51-
console.assert(
52+
assert(
5253
!(alias in nest) || answer !== undefined,
5354
`The "${alias}" key within a nested registration for ${command.name ||
5455
'an action'} is ${answer}. Is it being referenced correctly?`
5556
)
56-
console.assert(
57+
assert(
5758
!(status in nest) || answer !== undefined,
5859
`The "${status}" key within a nested registration for ${command.name ||
5960
'an action'} is ${answer}. Is it being referenced correctly?`
@@ -64,7 +65,7 @@ function getRegistration(pool: ?Object, command: Tagged, status: Status) {
6465
/**
6566
* Similarly, throw in strict mode if a regular registration is undefined. This is usually a typo.
6667
*/
67-
console.assert(
68+
assert(
6869
!(type in pool) || answer !== undefined,
6970
`${command.name ||
7071
'action'} key within a registration is ${answer}. Is it being referenced correctly?`

0 commit comments

Comments
 (0)