Skip to content

Commit

Permalink
chore: update dependencies (#97)
Browse files Browse the repository at this point in the history
* chore: update typescript

* chore: use @total-typescript/tsconfig

* config

* types

* pretty quick

* update

* recreate lock

* update
  • Loading branch information
lynxtaa authored Oct 14, 2024
1 parent 8ccc1b1 commit 4e90a09
Show file tree
Hide file tree
Showing 32 changed files with 3,273 additions and 3,310 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pnpm exec lint-staged --allow-empty
pnpm exec pretty-quick --staged
6 changes: 3 additions & 3 deletions examples/auth-with-jwt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"awesome-graphql-client": "*"
},
"devDependencies": {
"@lynxtaa/eslint-config": "0.9.0",
"@lynxtaa/eslint-config": "0.10.0",
"@lynxtaa/prettier-config": "0.2.0",
"eslint": "8.57.0",
"prettier": "3.3.2",
"typescript": "5.4.5"
"prettier": "3.3.3",
"typescript": "5.6.3"
}
}
4 changes: 4 additions & 0 deletions examples/auth-with-jwt/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"lib": ["es2022", "dom", "dom.iterable"]
},
"exclude": ["node_modules"],
"include": ["**/*.ts"]
}
2 changes: 1 addition & 1 deletion examples/next-js/graphql-codegen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CodegenConfig } from '@graphql-codegen/cli'
import { type CodegenConfig } from '@graphql-codegen/cli'

const config: CodegenConfig = {
overwrite: true,
Expand Down
4 changes: 2 additions & 2 deletions examples/next-js/jest/testServer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { graphql, rest } from 'msw'
import { setupServer } from 'msw/node'
import { SetupServer, setupServer } from 'msw/node'

export const server = setupServer()
export const server: SetupServer = setupServer()
2 changes: 1 addition & 1 deletion examples/next-js/lib/graphQLClient.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AwesomeGraphQLClient } from 'awesome-graphql-client'

export const graphQLClient = new AwesomeGraphQLClient({
export const graphQLClient: AwesomeGraphQLClient = new AwesomeGraphQLClient({
endpoint: 'https://rickandmortyapi.com/graphql',
})
30 changes: 15 additions & 15 deletions examples/next-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@
"prettier": "@lynxtaa/prettier-config",
"dependencies": {
"awesome-graphql-client": "*",
"next": "14.2.2",
"react": "18.2.0",
"react-dom": "18.2.0"
"next": "14.2.5",
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@graphql-codegen/cli": "5.0.2",
"@graphql-codegen/typescript": "4.0.6",
"@graphql-codegen/typescript-operations": "4.2.0",
"@graphql-codegen/typescript": "4.0.9",
"@graphql-codegen/typescript-operations": "4.2.3",
"@graphql-codegen/typescript-react-query": "6.1.0",
"@lynxtaa/eslint-config": "0.9.0",
"@lynxtaa/eslint-config": "0.10.0",
"@lynxtaa/prettier-config": "0.2.0",
"@tanstack/react-query": "5.29.2",
"@testing-library/jest-dom": "6.4.2",
"@testing-library/react": "15.0.2",
"@tanstack/react-query": "5.51.15",
"@testing-library/jest-dom": "6.4.8",
"@testing-library/react": "16.0.0",
"@testing-library/user-event": "14.5.2",
"@types/jest": "29.5.12",
"@types/node": "20.12.7",
"@types/react": "18.2.79",
"@types/node": "20.14.12",
"@types/react": "18.3.3",
"eslint": "8.57.0",
"eslint-config-next": "14.2.2",
"graphql": "16.8.1",
"eslint-config-next": "14.2.5",
"graphql": "16.9.0",
"jest": "29.7.0",
"msw": "1.3.3",
"prettier": "3.3.2",
"typescript": "5.4.5",
"prettier": "3.3.3",
"typescript": "5.6.3",
"whatwg-fetch": "3.6.20"
}
}
2 changes: 1 addition & 1 deletion examples/next-js/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
QueryClientProvider,
HydrationBoundary,
} from '@tanstack/react-query'
import { AppProps } from 'next/app'
import { type AppProps } from 'next/app'
import { StrictMode } from 'react'

// https://react-query.tanstack.com/guides/ssr
Expand Down
2 changes: 1 addition & 1 deletion examples/next-js/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QueryClient, dehydrate, keepPreviousData } from '@tanstack/react-query'
import { GetStaticProps } from 'next'
import { type GetStaticProps } from 'next'
import { useState } from 'react'

import { graphQLClient } from '../lib/graphQLClient'
Expand Down
5 changes: 4 additions & 1 deletion examples/next-js/tests/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { render, screen } from '@testing-library/react'
import { userEvent } from '@testing-library/user-event'

import { server, graphql } from '../jest/testServer'
import { GetCharactersQuery, GetCharactersQueryVariables } from '../lib/graphql-queries'
import {
type GetCharactersQuery,
type GetCharactersQueryVariables,
} from '../lib/graphql-queries'
import Home from '../pages/index'

const withProvider = ({ children }: { children?: React.ReactNode }) => (
Expand Down
16 changes: 9 additions & 7 deletions examples/next-js/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"allowJs": true,
"incremental": true,
"plugins": [{ "name": "next" }]
"verbatimModuleSyntax": false,
"jsx": "preserve",
"plugins": [
{
"name": "next"
}
],
"lib": ["es2022", "dom", "dom.iterable"],
"allowJs": true
},
"exclude": ["node_modules"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"]
Expand Down
16 changes: 8 additions & 8 deletions examples/typed-document-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
"prettier": "@lynxtaa/prettier-config",
"dependencies": {
"awesome-graphql-client": "*",
"graphql": "16.8.1"
"graphql": "16.9.0"
},
"devDependencies": {
"@graphql-codegen/cli": "5.0.2",
"@graphql-codegen/typed-document-node": "5.0.6",
"@graphql-codegen/typescript": "4.0.6",
"@graphql-codegen/typescript-operations": "4.2.0",
"@graphql-codegen/typed-document-node": "5.0.9",
"@graphql-codegen/typescript": "4.0.9",
"@graphql-codegen/typescript-operations": "4.2.3",
"@graphql-typed-document-node/core": "3.2.0",
"@lynxtaa/eslint-config": "0.9.0",
"@lynxtaa/eslint-config": "0.10.0",
"@lynxtaa/prettier-config": "0.2.0",
"@types/node": "20.12.7",
"@types/node": "20.14.12",
"eslint": "8.57.0",
"prettier": "3.3.2",
"typescript": "5.4.5"
"prettier": "3.3.3",
"typescript": "5.6.3"
}
}
16 changes: 2 additions & 14 deletions examples/typed-document-node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "ESNext",
"lib": ["ESNext"],
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noUncheckedIndexedAccess": true,
"module": "CommonJS",
"moduleResolution": "node",
"resolveJsonModule": true,
"declaration": true,
"declarationMap": true,
"noUnusedLocals": true,
"verbatimModuleSyntax": false,
"outDir": "build"
},
"include": ["src"]
Expand Down
4 changes: 2 additions & 2 deletions examples/with-undici/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"undici": "6.13.0"
},
"devDependencies": {
"@lynxtaa/eslint-config": "0.9.0",
"@lynxtaa/eslint-config": "0.10.0",
"@lynxtaa/prettier-config": "0.2.0",
"eslint": "8.57.0",
"prettier": "3.3.2",
"typescript": "5.4.5"
"typescript": "5.5.2"
}
}
2 changes: 1 addition & 1 deletion examples/with-undici/src/with-undici.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Notice: it's experimental and only Node 16 is supported

import { AwesomeGraphQLClient } from 'awesome-graphql-client'
import { fetch, RequestInit, Response, FormData, File } from 'undici'
import { fetch, type RequestInit, type Response, FormData, File } from 'undici'

const client = new AwesomeGraphQLClient<string, RequestInit, Response>({
endpoint: 'http://localhost:8080/graphql',
Expand Down
5 changes: 4 additions & 1 deletion examples/with-undici/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*.ts"]
"compilerOptions": {
"outDir": "build"
},
"include": ["src"]
}
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,17 @@
"test:coverage": "turbo test:coverage --concurrency=1",
"validate": "turbo lint check-types check-format"
},
"lint-staged": {
"*": "prettier --write --ignore-unknown"
},
"prettier": "@lynxtaa/prettier-config",
"devDependencies": {
"@lynxtaa/prettier-config": "0.2.0",
"awesome-graphql-client": "workspace:*",
"husky": "9.0.11",
"lint-staged": "15.2.7",
"prettier": "3.3.2",
"turbo": "2.0.4",
"typescript": "5.4.5"
"husky": "9.1.3",
"prettier": "3.3.3",
"pretty-quick": "4.0.0",
"turbo": "2.1.3",
"typescript": "5.6.3"
},
"packageManager": "pnpm@9.3.0",
"packageManager": "pnpm@9.12.1",
"engines": {
"node": ">=18.18.0"
}
Expand Down
20 changes: 10 additions & 10 deletions packages/awesome-graphql-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@
"prettier": "@lynxtaa/prettier-config",
"devDependencies": {
"@graphql-typed-document-node/core": "3.2.0",
"@lynxtaa/eslint-config": "0.9.0",
"@lynxtaa/eslint-config": "0.10.0",
"@lynxtaa/prettier-config": "0.2.0",
"@swc/core": "1.4.14",
"@swc/core": "1.7.2",
"@swc/jest": "0.2.36",
"@types/extract-files": "8.1.1",
"@types/graphql-upload": "8.0.12",
"@types/jest": "29.5.12",
"@types/node": "20.12.7",
"@types/node": "20.14.12",
"eslint": "8.57.0",
"eslint-plugin-jest": "28.2.0",
"eslint-plugin-jest": "28.6.0",
"extract-files": "9.0.0",
"fastify": "3.29.5",
"graphql": "16.8.1",
"graphql": "16.9.0",
"graphql-tag": "2.12.6",
"graphql-upload": "13.0.0",
"http-terminator": "3.2.0",
Expand All @@ -74,11 +74,11 @@
"jest-environment-jsdom": "29.7.0",
"mercurius": "9.8.0",
"mercurius-upload": "3.0.1",
"np": "10.0.5",
"prettier": "3.3.2",
"tsup": "8.0.2",
"typescript": "5.4.5",
"undici": "6.13.0",
"np": "10.0.7",
"prettier": "3.3.3",
"tsup": "8.3.0",
"typescript": "5.6.3",
"undici": "6.19.4",
"whatwg-fetch": "3.6.20"
},
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions packages/awesome-graphql-client/src/AwesomeGraphQLClient.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { TypedDocumentNode } from '@graphql-typed-document-node/core'
import { type TypedDocumentNode } from '@graphql-typed-document-node/core'
import { extractFiles } from 'extract-files'

import { GraphQLRequestError } from './GraphQLRequestError'
import { assert } from './util/assert'
import { formatGetRequestUrl } from './util/formatGetRequestUrl'
import { isFileUpload, FileUpload } from './util/isFileUpload'
import { isFileUpload, type FileUpload } from './util/isFileUpload'
import { isResponseJSON } from './util/isResponseJSON'
import { normalizeHeaders } from './util/normalizeHeaders'
import { FetchOptions, RequestResult } from './util/types'
import { type FetchOptions, type RequestResult } from './util/types'

export class AwesomeGraphQLClient<
TQuery = string,
Expand Down
2 changes: 1 addition & 1 deletion packages/awesome-graphql-client/src/GraphQLRequestError.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RequestResult } from './util/types'
import { type RequestResult } from './util/types'

export class GraphQLRequestError<
TResponse extends RequestResult = Response,
Expand Down
2 changes: 1 addition & 1 deletion packages/awesome-graphql-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { AwesomeGraphQLClient } from './AwesomeGraphQLClient'
export { GraphQLRequestError } from './GraphQLRequestError'
export { gql } from './util/gql'
export { isFileUpload, FileUpload } from './util/isFileUpload'
export { isFileUpload, type FileUpload } from './util/isFileUpload'
2 changes: 1 addition & 1 deletion packages/awesome-graphql-client/src/util/isResponseJSON.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RequestResult } from './types'
import { type RequestResult } from './types'

export const isResponseJSON = (response: {
headers: RequestResult['headers']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Headers } from './types'
import { type Headers } from './types'

type HeadersInit =
| Iterable<[string, string]>
Expand Down
10 changes: 5 additions & 5 deletions packages/awesome-graphql-client/test/browser.test.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/**
* @jest-environment jsdom
*/
import { IncomingHttpHeaders } from 'node:http'
import { type IncomingHttpHeaders } from 'node:http'

import { TypedDocumentNode } from '@graphql-typed-document-node/core'
import { print, DocumentNode } from 'graphql'
import { type TypedDocumentNode } from '@graphql-typed-document-node/core'
import { print, type DocumentNode } from 'graphql'
import graphqlTag from 'graphql-tag'
import { GraphQLUpload, FileUpload } from 'graphql-upload'
import { GraphQLUpload, type FileUpload } from 'graphql-upload'
import mercurius from 'mercurius'

import { AwesomeGraphQLClient, GraphQLRequestError } from '../src/index'
import { gql } from '../src/util/gql'

import { createServer, TestServer } from './jest/gqlServer'
import { createServer, type TestServer } from './jest/gqlServer'
import { streamToString } from './streamToString'

let server: TestServer
Expand Down
4 changes: 2 additions & 2 deletions packages/awesome-graphql-client/test/jest/gqlServer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import fastify, { FastifyInstance } from 'fastify'
import fastify, { type FastifyInstance } from 'fastify'
import { createHttpTerminator } from 'http-terminator'
import mercurius, { IResolvers, MercuriusOptions } from 'mercurius'
import mercurius, { type IResolvers, type MercuriusOptions } from 'mercurius'
import upload from 'mercurius-upload'

export type TestServer = FastifyInstance & {
Expand Down
Loading

0 comments on commit 4e90a09

Please sign in to comment.