Skip to content

Commit e92e290

Browse files
authored
Merge pull request #79 from ReactiveDB/upgrade-deps
chore: deps upgrade
2 parents 96521a7 + cf4641e commit e92e290

File tree

10 files changed

+2920
-2675
lines changed

10 files changed

+2920
-2675
lines changed

.circleci/config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defaults: &defaults
22
working_directory: ~/ReactiveDB
33
docker:
4-
- image: circleci/node:6
4+
- image: circleci/node:10
55

66
version: 2
77
jobs:
@@ -10,6 +10,8 @@ jobs:
1010
steps:
1111
- checkout
1212
- run: echo 'export PATH=${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin' >> $BASH_ENV
13+
- run: curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
14+
- run: sudo ln -sf ~/.yarn/bin/yarn /usr/local/bin/yarn
1315
- restore_cache:
1416
key: dependency-cache-{{ checksum "package.json" }}
1517
- run:

package.json

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"copy_src_es": "shx mkdir -p ./dist/es/src && shx cp -r ./src/* ./dist/es/src",
1818
"cover": "rm -rf ./.nyc_output ./coverage && NODE_ENV=test nyc --reporter=html --reporter=lcov --exclude=node_modules --exclude=spec-js/test --exclude=spec-js/src/storage/lovefield.js --exclude=spec-js/src/shared/Logger.js --exclude=spec-js/src/utils/option.js --exclude=spec-js/src/utils/valid.js --exclude=spec-js/src/addons/aggresive-optimizer.js tman --mocha spec-js/test/run.js && nyc report",
1919
"lint": "tslint -c tslint.json src/*.ts --project ./tsconfig.json \"src/**/*.ts\" \"./test/**/*.ts\" -e \"./test/e2e/*.ts\"",
20-
"precommit": "lint-staged",
2120
"publish_all": "ts-node ./tools/publish.ts",
2221
"start": "webpack-dev-server --inline --colors --progress --port 3000",
2322
"start-demo": "webpack-dev-server --config ./example/webpack.config.js --inline --colors --progress --port 3001 --open",
@@ -61,47 +60,48 @@
6160
},
6261
"license": "MIT",
6362
"devDependencies": {
64-
"@types/chai": "^4.1.2",
63+
"@types/chai": "^4.1.7",
6564
"@types/chai-string": "^1.4.1",
66-
"@types/node": "^10.5.5",
65+
"@types/node": "^10.12.9",
6766
"@types/shelljs": "^0.8.0",
68-
"@types/sinon": "^5.0.0",
69-
"@types/sinon-chai": "^3.2.0",
70-
"chai": "^4.1.2",
71-
"chai-string": "^1.4.0",
72-
"coveralls": "^3.0.0",
73-
"css-loader": "^1.0.0",
67+
"@types/sinon": "^5.0.6",
68+
"@types/sinon-chai": "^3.2.1",
69+
"chai": "^4.2.0",
70+
"chai-string": "^1.5.0",
71+
"coveralls": "^3.0.2",
72+
"css-loader": "^1.0.1",
7473
"extract-text-webpack-plugin": "^4.0.0-beta.0",
75-
"html-webpack-plugin": "^3.0.6",
76-
"husky": "^1.0.0",
77-
"lint-staged": "^7.2.0",
78-
"madge": "^3.0.1",
79-
"moment": "^2.21.0",
74+
"html-webpack-plugin": "^3.2.0",
75+
"husky": "^1.1.4",
76+
"lint-staged": "^8.0.5",
77+
"madge": "^3.3.0",
78+
"moment": "^2.22.2",
8079
"node-watch": "^0.5.8",
81-
"npm-run-all": "^4.1.2",
82-
"nyc": "^12.0.1",
83-
"prettier": "^1.14.0",
80+
"npm-run-all": "^4.1.3",
81+
"nyc": "^13.1.0",
82+
"prettier": "^1.15.2",
8483
"raw-loader": "^0.5.1",
85-
"rxjs": "^6.2.2",
86-
"shelljs": "^0.8.1",
87-
"shx": "^0.3.0",
88-
"sinon": "^6.1.4",
89-
"sinon-chai": "^3.0.0",
90-
"source-map-loader": "^0.2.3",
91-
"style-loader": "^0.23.0",
92-
"tman": "^1.7.4",
93-
"ts-loader": "^4.0.1",
94-
"ts-node": "^7.0.0",
95-
"tslint": "^5.9.1",
96-
"tslint-eslint-rules": "^5.1.0",
84+
"rxjs": "^6.3.3",
85+
"shelljs": "^0.8.3",
86+
"shx": "^0.3.2",
87+
"sinon": "^7.1.1",
88+
"sinon-chai": "^3.2.0",
89+
"source-map-loader": "^0.2.4",
90+
"style-loader": "^0.23.1",
91+
"tman": "^1.8.1",
92+
"ts-loader": "^5.3.0",
93+
"ts-node": "^7.0.1",
94+
"tslint": "^5.11.0",
95+
"tslint-config-prettier": "^1.16.0",
96+
"tslint-eslint-rules": "^5.4.0",
9797
"tslint-loader": "^3.6.0",
98-
"typescript": "^3.0.1",
99-
"webpack": "^4.1.1",
100-
"webpack-cli": "^3.1.0",
101-
"webpack-dev-server": "^3.1.0"
98+
"typescript": "^3.1.6",
99+
"webpack": "^4.25.1",
100+
"webpack-cli": "^3.1.2",
101+
"webpack-dev-server": "^3.1.10"
102102
},
103103
"dependencies": {
104-
"@types/lovefield": "^2.1.1",
104+
"@types/lovefield": "^2.1.2",
105105
"lovefield": "2.1.12",
106106
"nesthydrationjs": "^1.0.5"
107107
},
@@ -124,5 +124,10 @@
124124
"tslint -c tslint.json -p tsconfig.json --fix",
125125
"git add"
126126
]
127+
},
128+
"husky": {
129+
"hooks": {
130+
"pre-commit": "lint-staged"
131+
}
127132
}
128133
}

src/storage/helper/db-factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const lfFactory = (
1616
config: LfFactoryInit,
1717
): ConnectableObservable<lf.Database> => {
1818
return Observable.create((observer: Observer<lf.Database>) => {
19-
(config as any).onUpgrade = onUpgrade
19+
;(config as any).onUpgrade = onUpgrade
2020
if (config.storeType >= 3) {
2121
config.storeType = config.storeType + 1
2222
}

src/storage/modules/QueryToken.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ export class QueryToken<T> {
3232
assert(!this.consumed, TokenConsumed)
3333

3434
this.consumed = true
35-
return this.selector$.pipe(switchMap((s) => s.values()), take(1))
35+
return this.selector$.pipe(
36+
switchMap((s) => s.values()),
37+
take(1),
38+
)
3639
}
3740

3841
changes(): Observable<T[]> {

src/utils/for-each.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function forEach(target: any, eachFunc: (val: any, key: any) => any, inve
1717
let handler = eachFunc
1818
if (target instanceof Set || target instanceof Map) {
1919
// since we cannot use [[Set/Map]].entries() directly
20-
(target as any).forEach((value: any, key: any) => {
20+
;(target as any).forEach((value: any, key: any) => {
2121
if (handler(value, key) === false) {
2222
handler = noop
2323
}

test/specs/storage/modules/Mutation.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ export default describe('Mutation Testcase: ', () => {
5151
const mut = new Mutation(database, table, { foo: 666, bar: 233 })
5252
mut.withId('id', 42)
5353

54-
sinon.stub(Mutation, 'aggregate').callsFake((_: any, [m]: any[], __: any[]) => {
55-
const meta = { key: 'id', val: 42 }
56-
expect(m.meta).to.deep.equal(meta)
57-
})
54+
const stub = sinon.stub(Mutation, 'aggregate')
5855

5956
Mutation.aggregate(database, [mut], [])
57+
58+
const [m] = stub.args[0][1]
59+
const meta = { key: 'id', val: 42 }
60+
expect(m['meta']).to.deep.equal(meta)
6061
})
6162
})
6263

test/specs/storage/modules/Selector.spec.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,13 @@ export default describe('Selector test', () => {
185185
yield selector.values().pipe(
186186
tap((result) => {
187187
expect(result).to.have.lengthOf(950)
188-
const expectResult = storeData.filter((r) => r.time >= 50).sort((a, b) => {
189-
const higherPriority = Math.sign(a.priority - b.priority)
190-
const earlier = -Math.sign(a.time - b.time)
191-
return higherPriority * 10 + earlier
192-
})
188+
const expectResult = storeData
189+
.filter((r) => r.time >= 50)
190+
.sort((a, b) => {
191+
const higherPriority = Math.sign(a.priority - b.priority)
192+
const earlier = -Math.sign(a.time - b.time)
193+
return higherPriority * 10 + earlier
194+
})
193195

194196
expect(result).to.deep.equal(expectResult)
195197
}),

tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"tools/build",
2626
"dist",
2727
"coverage",
28-
"example"
28+
"example",
29+
"spec-js",
30+
"./webpack.config.js"
2931
],
3032
"compileOnSave": false,
3133
"awesomeTypescriptLoaderOptions": {

tslint.json

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
{
2-
"extends": ["tslint-eslint-rules"],
2+
"extends": ["tslint-eslint-rules", "tslint-config-prettier"],
33
"rules": {
44
"curly": true,
5-
"eofline": true,
6-
"align": [true, "parameters"],
75
"class-name": true,
8-
"indent": [true, "spaces", 2],
9-
"max-line-length": [true, 150],
10-
"no-consecutive-blank-lines": true,
11-
"no-trailing-whitespace": true,
126
"no-duplicate-variable": true,
137
"no-console": [true, "log", "trace"],
148
"no-construct": true,
@@ -19,31 +13,9 @@
1913
"no-var-requires": false,
2014
"no-require-imports": false,
2115
"no-shadowed-variable": true,
22-
"object-curly-spacing": true,
23-
"one-line": [true,
24-
"check-else",
25-
"check-whitespace",
26-
"check-open-brace"],
2716
"prefer-const": true,
28-
"quotemark": [true,
29-
"single",
30-
"avoid-escape"],
31-
"semicolon": [true, "never"],
3217
"ter-prefer-arrow-callback": true,
33-
"typedef-whitespace": [true, {
34-
"call-signature": "nospace",
35-
"index-signature": "nospace",
36-
"parameter": "nospace",
37-
"property-declaration": "nospace",
38-
"variable-declaration": "nospace"
39-
}],
4018
"use-isnan": true,
41-
"whitespace": [true,
42-
"check-branch",
43-
"check-decl",
44-
"check-operator",
45-
"check-separator",
46-
"check-type"],
4719
"comment-format": [true, "check-space", "check-lowercase"]
4820
}
4921
}

0 commit comments

Comments
 (0)