chore: update deps + jest to vitest
This commit is contained in:
+4
-4
@@ -22,17 +22,17 @@
|
|||||||
"@vue/eslint-config-typescript": "^7.0.0",
|
"@vue/eslint-config-typescript": "^7.0.0",
|
||||||
"conventional-changelog-cli": "^2.2.2",
|
"conventional-changelog-cli": "^2.2.2",
|
||||||
"core-js": "^3.23.2",
|
"core-js": "^3.23.2",
|
||||||
"esbuild": "^0.8.57",
|
"esbuild": "^0.25.0",
|
||||||
"esbuild-node-externals": "^1.4.1",
|
"esbuild-node-externals": "^1.18.0",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^4.3.1",
|
"eslint-plugin-promise": "^4.3.1",
|
||||||
"eslint-plugin-standard": "^5.0.0",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
"eslint-plugin-vue": "^7.20.0",
|
"eslint-plugin-vue": "^7.20.0",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^5.8.2"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@9.7.1",
|
"packageManager": "pnpm@10.6.1+sha512.40ee09af407fa9fbb5fbfb8e1cb40fbb74c0af0c3e10e9224d7b53c7658528615b2c92450e74cfad91e3a2dcafe3ce4050d80bda71d757756d2ce2b66213e9a3",
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"eslint-scope": "^5",
|
"eslint-scope": "^5",
|
||||||
|
|||||||
@@ -46,7 +46,11 @@ export default defineComponent({
|
|||||||
<div>Loaded channel: {{ channel.label }}</div>
|
<div>Loaded channel: {{ channel.label }}</div>
|
||||||
<div>Messages: {{ channel.messages.length }}</div>
|
<div>Messages: {{ channel.messages.length }}</div>
|
||||||
|
|
||||||
<div v-for="message in channel.messages" :key="message.id" class="message">
|
<div
|
||||||
|
v-for="message in channel.messages"
|
||||||
|
:key="message.id"
|
||||||
|
class="message"
|
||||||
|
>
|
||||||
{{ message.text }}
|
{{ message.text }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -57,7 +57,6 @@
|
|||||||
"babel-core": "^7.0.0-bridge.0",
|
"babel-core": "^7.0.0-bridge.0",
|
||||||
"cross-env": "^6.0.3",
|
"cross-env": "^6.0.3",
|
||||||
"graphql": "^15.8.0",
|
"graphql": "^15.8.0",
|
||||||
"jest": "^24.9.0",
|
|
||||||
"nodemon": "^1.19.4",
|
"nodemon": "^1.19.4",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rollup": "^1.32.1",
|
"rollup": "^1.32.1",
|
||||||
@@ -69,8 +68,5 @@
|
|||||||
"uglify-es": "^3.3.9",
|
"uglify-es": "^3.3.9",
|
||||||
"vue": "^3.2.37",
|
"vue": "^3.2.37",
|
||||||
"vue-property-decorator": "^8.5.1"
|
"vue-property-decorator": "^8.5.1"
|
||||||
},
|
|
||||||
"jest": {
|
|
||||||
"testRegex": "tests/unit/.*\\.test.js$"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,11 +19,13 @@ import type {
|
|||||||
ApolloQueryResult,
|
ApolloQueryResult,
|
||||||
SubscribeToMoreOptions,
|
SubscribeToMoreOptions,
|
||||||
FetchMoreQueryOptions,
|
FetchMoreQueryOptions,
|
||||||
FetchMoreOptions,
|
|
||||||
ObservableSubscription,
|
ObservableSubscription,
|
||||||
TypedDocumentNode,
|
TypedDocumentNode,
|
||||||
ApolloError,
|
ApolloError,
|
||||||
ApolloClient,
|
ApolloClient,
|
||||||
|
UpdateQueryMapFn,
|
||||||
|
Unmasked,
|
||||||
|
MaybeMasked,
|
||||||
} from '@apollo/client/core/index.js'
|
} from '@apollo/client/core/index.js'
|
||||||
import { throttle, debounce } from 'throttle-debounce'
|
import { throttle, debounce } from 'throttle-debounce'
|
||||||
import { useApolloClient } from './useApolloClient'
|
import { useApolloClient } from './useApolloClient'
|
||||||
@@ -81,9 +83,14 @@ export interface UseQueryReturn<TResult, TVariables extends OperationVariables>
|
|||||||
options: UseQueryOptions<TResult, TVariables> | Ref<UseQueryOptions<TResult, TVariables>>
|
options: UseQueryOptions<TResult, TVariables> | Ref<UseQueryOptions<TResult, TVariables>>
|
||||||
query: Ref<ObservableQuery<TResult, TVariables> | null | undefined>
|
query: Ref<ObservableQuery<TResult, TVariables> | null | undefined>
|
||||||
refetch: (variables?: TVariables) => Promise<ApolloQueryResult<TResult>> | undefined
|
refetch: (variables?: TVariables) => Promise<ApolloQueryResult<TResult>> | undefined
|
||||||
fetchMore: (options: FetchMoreQueryOptions<TVariables, TResult> & FetchMoreOptions<TResult, TVariables>) => Promise<ApolloQueryResult<TResult>> | undefined
|
fetchMore: <TFetchData = TResult, TFetchVars extends OperationVariables = TVariables> (options: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
|
||||||
updateQuery: (mapFn: (previousQueryResult: TResult, options: Pick<WatchQueryOptions<TVariables, TResult>, 'variables'>) => TResult) => void
|
updateQuery?: (previousQueryResult: Unmasked<TResult>, options: {
|
||||||
subscribeToMore: <TSubscriptionVariables = OperationVariables, TSubscriptionData = TResult>(options: SubscribeToMoreOptions<TResult, TSubscriptionVariables, TSubscriptionData> | Ref<SubscribeToMoreOptions<TResult, TSubscriptionVariables, TSubscriptionData>> | ReactiveFunction<SubscribeToMoreOptions<TResult, TSubscriptionVariables, TSubscriptionData>>) => void
|
fetchMoreResult: Unmasked<TFetchData>
|
||||||
|
variables: TFetchVars
|
||||||
|
}) => Unmasked<TResult>
|
||||||
|
}) => Promise<ApolloQueryResult<MaybeMasked<TFetchData>>> | undefined
|
||||||
|
updateQuery: (mapFn: UpdateQueryMapFn<TResult, TVariables>) => void
|
||||||
|
subscribeToMore: <TSubscriptionVariables extends OperationVariables = OperationVariables, TSubscriptionData = TResult>(options: SubscribeToMoreOptions<TResult, TSubscriptionVariables, TSubscriptionData> | Ref<SubscribeToMoreOptions<TResult, TSubscriptionVariables, TSubscriptionData>> | ReactiveFunction<SubscribeToMoreOptions<TResult, TSubscriptionVariables, TSubscriptionData>>) => void
|
||||||
onResult: (fn: (param: ApolloQueryResult<TResult>, context: OnResultContext) => void) => {
|
onResult: (fn: (param: ApolloQueryResult<TResult>, context: OnResultContext) => void) => {
|
||||||
off: () => void
|
off: () => void
|
||||||
}
|
}
|
||||||
@@ -545,7 +552,7 @@ export function useQueryImpl<
|
|||||||
|
|
||||||
// Update Query
|
// Update Query
|
||||||
|
|
||||||
function updateQuery (mapFn: (previousQueryResult: TResult, options: Pick<WatchQueryOptions<TVariables, TResult>, 'variables'>) => TResult) {
|
function updateQuery (mapFn: UpdateQueryMapFn<TResult, TVariables>) {
|
||||||
if (query.value) {
|
if (query.value) {
|
||||||
query.value.updateQuery(mapFn)
|
query.value.updateQuery(mapFn)
|
||||||
}
|
}
|
||||||
@@ -553,7 +560,12 @@ export function useQueryImpl<
|
|||||||
|
|
||||||
// Fetch more
|
// Fetch more
|
||||||
|
|
||||||
function fetchMore (options: FetchMoreQueryOptions<TVariables, TResult> & FetchMoreOptions<TResult, TVariables>) {
|
function fetchMore <TFetchData = TResult, TFetchVars extends OperationVariables = TVariables> (options: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
|
||||||
|
updateQuery?: (previousQueryResult: Unmasked<TResult>, options: {
|
||||||
|
fetchMoreResult: Unmasked<TFetchData>
|
||||||
|
variables: TFetchVars
|
||||||
|
}) => Unmasked<TResult>
|
||||||
|
}): Promise<ApolloQueryResult<MaybeMasked<TFetchData>>> | undefined {
|
||||||
if (query.value) {
|
if (query.value) {
|
||||||
error.value = null
|
error.value = null
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@@ -571,7 +583,7 @@ export function useQueryImpl<
|
|||||||
const subscribeToMoreItems: SubscribeToMoreItem[] = []
|
const subscribeToMoreItems: SubscribeToMoreItem[] = []
|
||||||
|
|
||||||
function subscribeToMore<
|
function subscribeToMore<
|
||||||
TSubscriptionVariables = OperationVariables,
|
TSubscriptionVariables extends OperationVariables = OperationVariables,
|
||||||
TSubscriptionData = TResult
|
TSubscriptionData = TResult
|
||||||
> (
|
> (
|
||||||
options: SubscribeToMoreOptions<TResult, TSubscriptionVariables, TSubscriptionData> |
|
options: SubscribeToMoreOptions<TResult, TSubscriptionVariables, TSubscriptionData> |
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ApolloError, isApolloError } from '@apollo/client/core/index.js'
|
import { ApolloError, isApolloError } from '@apollo/client/core/index.js'
|
||||||
import { GraphQLErrors } from '@apollo/client/errors/index.js'
|
import type { GraphQLFormattedError } from 'graphql'
|
||||||
|
|
||||||
export function toApolloError (error: unknown): ApolloError {
|
export function toApolloError (error: unknown): ApolloError {
|
||||||
if (!(error instanceof Error)) {
|
if (!(error instanceof Error)) {
|
||||||
@@ -16,7 +16,7 @@ export function toApolloError (error: unknown): ApolloError {
|
|||||||
return new ApolloError({ networkError: error, errorMessage: error.message })
|
return new ApolloError({ networkError: error, errorMessage: error.message })
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resultErrorsToApolloError (errors: GraphQLErrors): ApolloError {
|
export function resultErrorsToApolloError (errors: ReadonlyArray<GraphQLFormattedError>): ApolloError {
|
||||||
return new ApolloError({
|
return new ApolloError({
|
||||||
graphQLErrors: errors,
|
graphQLErrors: errors,
|
||||||
errorMessage: `GraphQL response contains errors: ${errors.map((e: any) => e.message).join(' | ')}`,
|
errorMessage: `GraphQL response contains errors: ${errors.map((e: any) => e.message).join(' | ')}`,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
"dev": "nodemon --exec 'pnpm run build:es && pnpm run build:umd' --watch src --watch lib",
|
"dev": "nodemon --exec 'pnpm run build:es && pnpm run build:umd' --watch src --watch lib",
|
||||||
"test": "pnpm run test:types && pnpm run test:unit",
|
"test": "pnpm run test:types && pnpm run test:unit",
|
||||||
"test:types": "tsc -p types/test",
|
"test:types": "tsc -p types/test",
|
||||||
"test:unit": "jest"
|
"test:unit": "vitest run"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -66,7 +66,6 @@
|
|||||||
"cross-env": "^6.0.3",
|
"cross-env": "^6.0.3",
|
||||||
"graphql": "^15.8.0",
|
"graphql": "^15.8.0",
|
||||||
"graphql-tag": "^2.12.6",
|
"graphql-tag": "^2.12.6",
|
||||||
"jest": "^24.9.0",
|
|
||||||
"nodemon": "^1.19.4",
|
"nodemon": "^1.19.4",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rollup": "^1.32.1",
|
"rollup": "^1.32.1",
|
||||||
@@ -76,10 +75,8 @@
|
|||||||
"rollup-plugin-replace": "^2.2.0",
|
"rollup-plugin-replace": "^2.2.0",
|
||||||
"rollup-plugin-uglify": "^6.0.4",
|
"rollup-plugin-uglify": "^6.0.4",
|
||||||
"uglify-es": "^3.3.9",
|
"uglify-es": "^3.3.9",
|
||||||
|
"vitest": "^3.0.8",
|
||||||
"vue": "^3.2.37",
|
"vue": "^3.2.37",
|
||||||
"vue-property-decorator": "^10.0.0-rc.3"
|
"vue-property-decorator": "^10.0.0-rc.3"
|
||||||
},
|
|
||||||
"jest": {
|
|
||||||
"testRegex": "tests/unit/.*\\.test.js$"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { defineConfig } from 'vitest/config'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
test: {
|
||||||
|
globals: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
Generated
+6356
-6996
File diff suppressed because it is too large
Load Diff
+9
-1
@@ -1,2 +1,10 @@
|
|||||||
packages:
|
packages:
|
||||||
- 'packages/*'
|
- packages/*
|
||||||
|
onlyBuiltDependencies:
|
||||||
|
- '@apollo/protobufjs'
|
||||||
|
- core-js
|
||||||
|
- core-js-pure
|
||||||
|
- cypress
|
||||||
|
- esbuild
|
||||||
|
- nodemon
|
||||||
|
- vue-demi
|
||||||
|
|||||||
Reference in New Issue
Block a user