Skip to content

Commit 05ec6cb

Browse files
committed
feat: update deps, query core
1 parent 1a1b2dd commit 05ec6cb

File tree

7 files changed

+5010
-2232
lines changed

7 files changed

+5010
-2232
lines changed

package-lock.json

Lines changed: 4981 additions & 2184 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -48,52 +48,46 @@
4848
"dependencies": {
4949
"@vue/devtools-api": "^6.1.4",
5050
"match-sorter": "^6.3.1",
51-
"react-query": "^4.0.0-beta.15",
52-
"vue-demi": "0.10.1"
51+
"react-query": "^4.0.0-beta.20",
52+
"vue-demi": "0.13.1"
5353
},
5454
"peerDependencies": {
55-
"@nuxtjs/composition-api": "^0.28.0",
5655
"@vue/composition-api": "^1.1.2",
57-
"vue": "^2.0.0 || >=3.0.0"
56+
"vue": "^2.5.0 || >=3.0.0"
5857
},
5958
"peerDependenciesMeta": {
6059
"@vue/composition-api": {
6160
"optional": true
62-
},
63-
"@nuxtjs/composition-api": {
64-
"optional": true
6561
}
6662
},
6763
"devDependencies": {
68-
"@commitlint/cli": "^16.2.4",
69-
"@commitlint/config-conventional": "^16.2.4",
70-
"@nuxtjs/composition-api": "^0.32.0",
64+
"@commitlint/cli": "^17.0.2",
65+
"@commitlint/config-conventional": "^17.0.2",
7166
"@rollup/plugin-node-resolve": "^13.3.0",
72-
"@types/jest": "^27.5.0",
73-
"@typescript-eslint/eslint-plugin": "^5.22.0",
74-
"@typescript-eslint/parser": "^5.22.0",
75-
"@vue/compiler-sfc": "^3.2.33",
76-
"@vue/composition-api": "^1.6.1",
67+
"@types/jest": "^28.1.1",
68+
"@typescript-eslint/eslint-plugin": "^5.27.0",
69+
"@typescript-eslint/parser": "^5.27.0",
70+
"@vue/composition-api": "^1.6.2",
7771
"@vue/eslint-config-prettier": "^7.0.0",
7872
"@vue/eslint-config-typescript": "^10.0.0",
79-
"@vue/vue3-jest": "27.0.0",
80-
"eslint": "^8.15.0",
73+
"@vue/vue3-jest": "28.0.0",
74+
"eslint": "^8.17.0",
8175
"eslint-config-prettier": "^8.5.0",
8276
"eslint-plugin-prettier": "^4.0.0",
8377
"eslint-plugin-vue": "^8.7.1",
84-
"husky": "^7.0.4",
78+
"husky": "^8.0.1",
8579
"jest": "^28.1.0",
8680
"jest-environment-jsdom": "^28.1.0",
8781
"prettier": "^2.6.2",
88-
"rollup": "^2.72.0",
82+
"rollup": "^2.75.5",
8983
"rollup-plugin-auto-external": "^2.0.0",
9084
"rollup-plugin-postcss": "^4.0.2",
91-
"rollup-plugin-typescript2": "^0.31.2",
85+
"rollup-plugin-typescript2": "^0.32.0",
9286
"rollup-plugin-vue": "^6.0.0",
93-
"ts-jest": "^28.0.1",
94-
"ts-node": "^10.7.0",
95-
"typescript": "^4.6.4",
96-
"vue": "^3.2.33",
87+
"ts-jest": "^28.0.4",
88+
"ts-node": "^10.8.1",
89+
"typescript": "^4.7.3",
90+
"vue": "^3.2.36",
9791
"vue2": "npm:vue@2"
9892
}
9993
}

rollup.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const common = {
1212
"vue",
1313
"vue-demi",
1414
"match-sorter",
15-
"@nuxtjs/composition-api",
1615
],
1716
watch: {
1817
include: "src/**",

src/vuejs/__tests__/utils.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ import { reactive, ref } from "vue-demi";
1313

1414
describe("utils", () => {
1515
describe("isQueryKey", () => {
16-
test("should detect string as query key", () => {
17-
expect(isQueryKey("string")).toEqual(true);
18-
});
19-
2016
test("should detect an array as query key", () => {
2117
expect(isQueryKey(["string", "array"])).toEqual(true);
2218
});

src/vuejs/queryClient.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,19 @@ export class QueryClient extends QC {
103103

104104
setQueriesData<TData>(
105105
queryKey: MaybeRefDeep<QueryKey>,
106-
updater: Updater<TData | undefined, TData>,
106+
updater: Updater<TData | undefined, TData | undefined>,
107107
options?: MaybeRefDeep<SetDataOptions>
108-
): [QueryKey, TData][];
108+
): [QueryKey, TData | undefined][];
109109
setQueriesData<TData>(
110110
filters: MaybeRefDeep<QueryFilters>,
111-
updater: Updater<TData | undefined, TData>,
111+
updater: Updater<TData | undefined, TData | undefined>,
112112
options?: MaybeRefDeep<SetDataOptions>
113-
): [QueryKey, TData][];
113+
): [QueryKey, TData | undefined][];
114114
setQueriesData<TData>(
115115
queryKeyOrFilters: MaybeRefDeep<QueryKey | QueryFilters>,
116-
updater: Updater<TData | undefined, TData>,
116+
updater: Updater<TData | undefined, TData | undefined>,
117117
options?: MaybeRefDeep<SetDataOptions>
118-
): [QueryKey, TData][] {
118+
): [QueryKey, TData | undefined][] {
119119
const arg1Unreffed = cloneDeepUnref(queryKeyOrFilters);
120120
const arg3Unreffed = cloneDeepUnref(options) as SetDataOptions;
121121
if (isQueryKey(arg1Unreffed)) {

src/vuejs/useQueries.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ import { UseQueryOptions } from "./useQuery";
1919
// Avoid TS depth-limit error in case of large array literal
2020
type MAXIMUM_DEPTH = 20;
2121

22-
type InvalidQueryFn = QueryFunction<
23-
undefined | Promise<undefined> | void | Promise<void>
24-
>;
25-
2622
type GetOptions<T> =
2723
// Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }
2824
T extends {
@@ -43,9 +39,7 @@ type GetOptions<T> =
4339
: T extends [infer TQueryFnData]
4440
? UseQueryOptions<TQueryFnData>
4541
: // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided
46-
T extends { queryFn?: InvalidQueryFn }
47-
? never | "queryFn must not return undefined or void"
48-
: T extends {
42+
T extends {
4943
queryFn?: QueryFunction<infer TQueryFnData, infer TQueryKey>;
5044
select: (data: any) => infer TData;
5145
}
@@ -100,9 +94,7 @@ export type UseQueriesOptions<
10094
? T
10195
: // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!
10296
// use this to infer the param types in the case of Array.map() argument
103-
T extends { queryFn: InvalidQueryFn }[]
104-
? (never | "queryFn must not return undefined or void")[]
105-
: T extends UseQueryOptions<
97+
T extends UseQueryOptions<
10698
infer TQueryFnData,
10799
infer TError,
108100
infer TData,

src/vuejs/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function getClientKey(key?: string) {
1919
}
2020

2121
export function isQueryKey(value: unknown): value is QueryKey {
22-
return typeof value === "string" || Array.isArray(value);
22+
return Array.isArray(value);
2323
}
2424

2525
// This Function is Deprecated. It's not used internally anymore.
@@ -68,7 +68,7 @@ export function parseFilterArgs<TFilters extends QueryFilters>(
6868
arg2?: TFilters
6969
): TFilters {
7070
if (isQueryKey(arg1)) {
71-
return Object.assign(arg2, { queryKey: arg1 });
71+
return Object.assign(arg2 || ({} as TFilters), { queryKey: arg1 });
7272
}
7373

7474
return arg1 || ({} as TFilters);
@@ -103,7 +103,7 @@ export function parseMutationFilterArgs(
103103
arg2?: MutationFilters
104104
): MutationFilters | undefined {
105105
if (isQueryKey(arg1)) {
106-
return Object.assign(arg2, {
106+
return Object.assign(arg2 || ({} as MutationFilters), {
107107
mutationKey: arg1,
108108
});
109109
}

0 commit comments

Comments
 (0)