Skip to content

Commit b090c2c

Browse files
authored
chore(deps): update all deps (#345)
* chore(deps): update all deps * revert change to peer deps
1 parent 7701ff8 commit b090c2c

18 files changed

+3035
-2452
lines changed

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,29 @@
3535
},
3636
"homepage": "https://github.com/vuejs/composition-api#readme",
3737
"devDependencies": {
38-
"@types/jest": "^25.2.1",
39-
"@types/node": "^12.0.2",
40-
"cross-env": "^5.2.0",
41-
"husky": "^2.7.0",
42-
"jest": "^24.8.0",
43-
"lint-staged": "^8.2.1",
44-
"prettier": "^1.18.2",
45-
"rollup": "^1.12.0",
46-
"rollup-plugin-node-resolve": "^5.0.0",
47-
"rollup-plugin-replace": "^2.2.0",
48-
"rollup-plugin-terser": "^4.0.4",
49-
"rollup-plugin-typescript2": "^0.21.0",
50-
"ts-jest": "^24.0.2",
51-
"typescript": "^3.6.2",
52-
"vue": "^2.5.22",
53-
"vue-router": "^3.1.3",
54-
"vue-server-renderer": "^2.6.10"
38+
"@rollup/plugin-node-resolve": "8.0.0",
39+
"@rollup/plugin-replace": "^2.3.2",
40+
"@types/jest": "^25.2.3",
41+
"@types/node": "^14.0.6",
42+
"cross-env": "^7.0.2",
43+
"husky": "^4.2.5",
44+
"jest": "^26.0.1",
45+
"lint-staged": "^10.2.7",
46+
"prettier": "^2.0.5",
47+
"rollup": "^2.12.0",
48+
"rollup-plugin-terser": "^6.1.0",
49+
"rollup-plugin-typescript2": "^0.27.1",
50+
"ts-jest": "^26.1.0",
51+
"typescript": "^3.9.3",
52+
"vue": "^2.6.11",
53+
"vue-router": "^3.3.2",
54+
"vue-server-renderer": "^2.6.11"
5555
},
5656
"peerDependencies": {
5757
"vue": "^2.5.22"
5858
},
5959
"dependencies": {
60-
"tslib": "^1.9.3"
60+
"tslib": "^2.0.0"
6161
},
6262
"husky": {
6363
"hooks": {

rollup.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as path from 'path';
22
// import filesize from 'rollup-plugin-filesize';
33
import typescript from 'rollup-plugin-typescript2';
4-
import resolve from 'rollup-plugin-node-resolve';
4+
import resolve from '@rollup/plugin-node-resolve';
55
import { terser } from 'rollup-plugin-terser';
6-
import replace from 'rollup-plugin-replace';
6+
import replace from '@rollup/plugin-replace';
77

88
const builds = {
99
'cjs-dev': {
@@ -34,7 +34,7 @@ const builds = {
3434
};
3535

3636
function getAllBuilds() {
37-
return Object.keys(builds).map(key => genConfig(builds[key]));
37+
return Object.keys(builds).map((key) => genConfig(builds[key]));
3838
}
3939

4040
function genConfig({ outFile, format, mode }) {

src/apis/inject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function provide<T>(key: InjectionKey<T> | string, value: T): void {
2828
const provideCache = {};
2929
Object.defineProperty(vm, '_provided', {
3030
get: () => provideCache,
31-
set: v => Object.assign(provideCache, v),
31+
set: (v) => Object.assign(provideCache, v),
3232
});
3333
}
3434

src/apis/watch.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type MapSources<T> = {
2323
type MapOldSources<T, Immediate> = {
2424
[K in keyof T]: T[K] extends WatchSource<infer V>
2525
? Immediate extends true
26-
? (V | undefined)
26+
? V | undefined
2727
: V
2828
: never;
2929
};
@@ -172,7 +172,7 @@ function createVueWatcher(
172172
// runCleanup() when it tears down the watcher on unmmount.
173173
function patchWatcherTeardown(watcher: VueWatcher, runCleanup: () => void) {
174174
const _teardown = watcher.teardown;
175-
watcher.teardown = function(...args) {
175+
watcher.teardown = function (...args) {
176176
_teardown.apply(watcher, args);
177177
runCleanup();
178178
};
@@ -244,7 +244,7 @@ function createWatcher(
244244

245245
let getter: () => any;
246246
if (Array.isArray(source)) {
247-
getter = () => source.map(s => (isRef(s) ? s.value : s()));
247+
getter = () => source.map((s) => (isRef(s) ? s.value : s()));
248248
} else if (isRef(source)) {
249249
getter = () => source.value;
250250
} else if (isReactive(source)) {
@@ -318,14 +318,14 @@ export function watch<
318318
// overload #2: single source + cb
319319
export function watch<T, Immediate extends Readonly<boolean> = false>(
320320
source: WatchSource<T>,
321-
cb: WatchCallback<T, Immediate extends true ? (T | undefined) : T>,
321+
cb: WatchCallback<T, Immediate extends true ? T | undefined : T>,
322322
options?: WatchOptions<Immediate>
323323
): WatchStopHandle;
324324

325325
// overload #3: watching reactive object w/ cb
326326
export function watch<T extends object, Immediate extends Readonly<boolean> = false>(
327327
source: T,
328-
cb: WatchCallback<T, Immediate extends true ? (T | undefined) : T>,
328+
cb: WatchCallback<T, Immediate extends true ? T | undefined : T>,
329329
options?: WatchOptions<Immediate>
330330
): WatchStopHandle;
331331

src/install.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ function mergeData(from: AnyObject, to: AnyObject): Object {
2525
to[key] = fromVal;
2626
} else if (
2727
toVal !== fromVal &&
28-
(isPlainObject(toVal) && !isRef(toVal)) &&
29-
(isPlainObject(fromVal) && !isRef(fromVal))
28+
isPlainObject(toVal) &&
29+
!isRef(toVal) &&
30+
isPlainObject(fromVal) &&
31+
!isRef(fromVal)
3032
) {
3133
mergeData(fromVal, toVal);
3234
}
@@ -42,7 +44,7 @@ export function install(Vue: VueConstructor, _install: (Vue: VueConstructor) =>
4244
return;
4345
}
4446

45-
Vue.config.optionMergeStrategies.setup = function(parent: Function, child: Function) {
47+
Vue.config.optionMergeStrategies.setup = function (parent: Function, child: Function) {
4648
return function mergedSetupFn(props: any, context: any) {
4749
return mergeData(
4850
typeof parent === 'function' ? parent(props, context) || {} : {},

src/reactivity/ref.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function ref(raw?: any): any {
104104
const value = reactive({ [RefKey]: raw });
105105
return createRef({
106106
get: () => value[RefKey] as any,
107-
set: v => ((value[RefKey] as any) = v),
107+
set: (v) => ((value[RefKey] as any) = v),
108108
});
109109
}
110110

@@ -137,7 +137,7 @@ export function toRef<T extends object, K extends keyof T>(object: T, key: K): R
137137

138138
return createRef({
139139
get: () => object[key],
140-
set: v => (object[key] = v),
140+
set: (v) => (object[key] = v),
141141
});
142142
}
143143

@@ -150,7 +150,7 @@ export function shallowRef(raw?: unknown) {
150150
const value = shallowReactive({ [RefKey]: raw });
151151
return createRef({
152152
get: () => value[RefKey] as any,
153-
set: v => ((value[RefKey] as any) = v),
153+
set: (v) => ((value[RefKey] as any) = v),
154154
});
155155
}
156156

src/setup.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export function mixin(Vue: VueConstructor) {
132132

133133
if (render) {
134134
// keep currentInstance accessible for createElement
135-
$options.render = function(...args: any): any {
135+
$options.render = function (...args: any): any {
136136
return activateCurrentInstance(vm, () => render.apply(this, args));
137137
};
138138
}
@@ -186,7 +186,7 @@ export function mixin(Vue: VueConstructor) {
186186
if (isPlainObject(binding)) {
187187
const bindingObj = binding;
188188
vmStateManager.set(vm, 'rawBindings', binding);
189-
Object.keys(binding).forEach(name => {
189+
Object.keys(binding).forEach((name) => {
190190
let bindingValue = bindingObj[name];
191191
// only make primitive value reactive
192192
if (!isRef(bindingValue)) {
@@ -226,7 +226,7 @@ export function mixin(Vue: VueConstructor) {
226226
'ssrContext',
227227
];
228228
const methodReturnVoid = ['emit'];
229-
props.forEach(key => {
229+
props.forEach((key) => {
230230
let targetKey: string;
231231
let srcKey: string;
232232
if (Array.isArray(key)) {
@@ -242,7 +242,7 @@ export function mixin(Vue: VueConstructor) {
242242
},
243243
});
244244
});
245-
methodReturnVoid.forEach(key => {
245+
methodReturnVoid.forEach((key) => {
246246
const srcKey = `$${key}`;
247247
proxy(ctx, key, {
248248
get() {

test/apis/lifecycle.spec.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ describe('Hooks lifecycle', () => {
138138
});
139139

140140
describe('beforeUpdate', () => {
141-
it('should be called before update', done => {
141+
it('should be called before update', (done) => {
142142
const spy = jest.fn();
143143
const vm = new Vue({
144144
template: '<div>{{ msg }}</div>',
@@ -158,7 +158,7 @@ describe('Hooks lifecycle', () => {
158158
}).then(done);
159159
});
160160

161-
it('should be called before render and allow mutating state', done => {
161+
it('should be called before render and allow mutating state', (done) => {
162162
const vm = new Vue({
163163
template: '<div>{{ msg }}</div>',
164164
data: { msg: 'foo' },
@@ -175,7 +175,7 @@ describe('Hooks lifecycle', () => {
175175
}).then(done);
176176
});
177177

178-
it('should not be called after destroy', done => {
178+
it('should not be called after destroy', (done) => {
179179
const beforeUpdate = jest.fn();
180180
const destroyed = jest.fn();
181181

@@ -201,7 +201,7 @@ describe('Hooks lifecycle', () => {
201201
},
202202
computed: {
203203
pendingTodos() {
204-
return this.todos.filter(t => !t.done);
204+
return this.todos.filter((t) => !t.done);
205205
},
206206
},
207207
}).$mount();
@@ -215,7 +215,7 @@ describe('Hooks lifecycle', () => {
215215
});
216216

217217
describe('updated', () => {
218-
it('should be called after update', done => {
218+
it('should be called after update', (done) => {
219219
const spy = jest.fn();
220220
const vm = new Vue({
221221
template: '<div>{{ msg }}</div>',
@@ -235,7 +235,7 @@ describe('Hooks lifecycle', () => {
235235
}).then(done);
236236
});
237237

238-
it('should be called after children are updated', done => {
238+
it('should be called after children are updated', (done) => {
239239
const calls = [];
240240
const vm = new Vue({
241241
template: '<div><test ref="child">{{ msg }}</test></div>',
@@ -267,7 +267,7 @@ describe('Hooks lifecycle', () => {
267267
}).then(done);
268268
});
269269

270-
it('should not be called after destroy', done => {
270+
it('should not be called after destroy', (done) => {
271271
const updated = jest.fn();
272272
const destroyed = jest.fn();
273273

@@ -293,7 +293,7 @@ describe('Hooks lifecycle', () => {
293293
},
294294
computed: {
295295
pendingTodos() {
296-
return this.todos.filter(t => !t.done);
296+
return this.todos.filter((t) => !t.done);
297297
},
298298
},
299299
}).$mount();
@@ -377,7 +377,7 @@ describe('Hooks lifecycle', () => {
377377
setup() {
378378
onErrorCaptured(spy);
379379
},
380-
render: h => h(Child),
380+
render: (h) => h(Child),
381381
}).$mount();
382382

383383
expect(spy).toHaveBeenCalledWith(err, child, 'data()');

test/apis/state.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('api/ref', () => {
2121
expect(a.value).toBe(2);
2222
});
2323

24-
it('should be reactive', done => {
24+
it('should be reactive', (done) => {
2525
const a = ref(1);
2626
let dummy;
2727
watch(
@@ -38,7 +38,7 @@ describe('api/ref', () => {
3838
}).then(done);
3939
});
4040

41-
it('should make nested properties reactive', done => {
41+
it('should make nested properties reactive', (done) => {
4242
const a = ref({
4343
count: 1,
4444
});
@@ -59,7 +59,7 @@ describe('api/ref', () => {
5959
});
6060

6161
describe('api/reactive', () => {
62-
it('should work', done => {
62+
it('should work', (done) => {
6363
const app = new Vue({
6464
setup() {
6565
return {
@@ -96,7 +96,7 @@ describe('api/reactive', () => {
9696
});
9797

9898
describe('api/toRefs', () => {
99-
it('should work', done => {
99+
it('should work', (done) => {
100100
const state = reactive({
101101
foo: 1,
102102
bar: 2,

0 commit comments

Comments
 (0)