Skip to content

Commit

Permalink
chore(deps): update dev dependencies (#2217)
Browse files Browse the repository at this point in the history
* chore(deps): update dev dependencies

* more typescript versions

* downgrade vite 4.5.0
  • Loading branch information
dai-shi authored Nov 28, 2023
1 parent 949b505 commit 15635ab
Show file tree
Hide file tree
Showing 8 changed files with 928 additions and 974 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-multiple-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
- 18.0.0
- 18.1.0
- 18.2.0
- 18.3.0-canary-0c6348758-20231030
- 0.0.0-experimental-0c6348758-20231030
- 18.3.0-canary-6c7b41da3-20231123
- 0.0.0-experimental-6c7b41da3-20231123
devtools-skip:
- CI-MATRIX-NOSKIP
include:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-old-typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
fail-fast: false
matrix:
typescript:
- 5.3.2
- 5.2.2
- 5.1.6
- 5.0.4
- 4.9.5
Expand Down
47 changes: 25 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,49 +205,49 @@
"use-sync-external-store": "1.2.0"
},
"devDependencies": {
"@babel/core": "^7.23.2",
"@babel/plugin-external-helpers": "^7.22.5",
"@babel/plugin-transform-react-jsx": "^7.22.15",
"@babel/plugin-transform-runtime": "^7.23.2",
"@babel/plugin-transform-typescript": "^7.22.15",
"@babel/preset-env": "^7.23.2",
"@redux-devtools/extension": "^3.2.5",
"@rollup/plugin-alias": "^5.0.1",
"@babel/core": "^7.23.3",
"@babel/plugin-external-helpers": "^7.23.3",
"@babel/plugin-transform-react-jsx": "^7.23.4",
"@babel/plugin-transform-runtime": "^7.23.4",
"@babel/plugin-transform-typescript": "^7.23.4",
"@babel/preset-env": "^7.23.3",
"@redux-devtools/extension": "^3.2.6",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.5",
"@testing-library/react": "^14.0.0",
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"@types/use-sync-external-store": "^0.0.5",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"@vitest/coverage-c8": "^0.33.0",
"@testing-library/react": "^14.1.2",
"@types/react": "^18.2.39",
"@types/react-dom": "^18.2.17",
"@types/use-sync-external-store": "^0.0.6",
"@typescript-eslint/eslint-plugin": "^6.13.0",
"@typescript-eslint/parser": "^6.13.0",
"@vitest/coverage-v8": "^0.34.6",
"@vitest/ui": "^0.34.6",
"concurrently": "^8.2.2",
"downlevel-dts": "^0.11.0",
"esbuild": "^0.19.5",
"eslint": "^8.52.0",
"esbuild": "^0.19.8",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-vitest": "^0.3.8",
"eslint-plugin-vitest": "^0.3.10",
"immer": "^10.0.3",
"jsdom": "^22.1.0",
"jsdom": "^23.0.0",
"json": "^11.0.0",
"prettier": "^3.0.3",
"prettier": "^3.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redux": "5.0.0-alpha.1",
"rollup": "^4.2.0",
"rollup": "^4.6.0",
"rollup-plugin-esbuild": "^6.1.0",
"shx": "^0.3.4",
"typescript": "^5.2.2",
"typescript": "^5.3.2",
"vitest": "^0.34.6"
},
"peerDependencies": {
Expand All @@ -265,5 +265,8 @@
"react": {
"optional": true
}
},
"resolutions": {
"vite": "4.5.0"
}
}
40 changes: 20 additions & 20 deletions src/middleware/devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,30 @@ type Write<T, U> = Omit<T, keyof U> & U
type TakeTwo<T> = T extends { length: 0 }
? [undefined, undefined]
: T extends { length: 1 }
? [...a0: Cast<T, unknown[]>, a1: undefined]
: T extends { length: 0 | 1 }
? [...a0: Cast<T, unknown[]>, a1: undefined]
: T extends { length: 2 }
? T
: T extends { length: 1 | 2 }
? T
: T extends { length: 0 | 1 | 2 }
? T
: T extends [infer A0, infer A1, ...unknown[]]
? [A0, A1]
: T extends [infer A0, (infer A1)?, ...unknown[]]
? [A0, A1?]
: T extends [(infer A0)?, (infer A1)?, ...unknown[]]
? [A0?, A1?]
: never
? [...a0: Cast<T, unknown[]>, a1: undefined]
: T extends { length: 0 | 1 }
? [...a0: Cast<T, unknown[]>, a1: undefined]
: T extends { length: 2 }
? T
: T extends { length: 1 | 2 }
? T
: T extends { length: 0 | 1 | 2 }
? T
: T extends [infer A0, infer A1, ...unknown[]]
? [A0, A1]
: T extends [infer A0, (infer A1)?, ...unknown[]]
? [A0, A1?]
: T extends [(infer A0)?, (infer A1)?, ...unknown[]]
? [A0?, A1?]
: never

type WithDevtools<S> = Write<S, StoreDevtools<S>>

type StoreDevtools<S> = S extends {
setState: (...a: infer Sa) => infer Sr
}
? {
setState<A extends string | { type: unknown }>(
setState<A extends string | { type: string }>(
...a: [...a: TakeTwo<Sa>, action?: A]
): Sr
}
Expand Down Expand Up @@ -173,12 +173,12 @@ const devtoolsImpl: DevtoolsImpl =
;(api.setState as NamedSet<S>) = (state, replace, nameOrAction) => {
const r = set(state, replace)
if (!isRecording) return r
const action: { type: unknown } =
const action: { type: string } =
nameOrAction === undefined
? { type: anonymousActionType || 'anonymous' }
: typeof nameOrAction === 'string'
? { type: nameOrAction }
: nameOrAction
? { type: nameOrAction }
: nameOrAction
if (store === undefined) {
connection?.send(action, get())
return r
Expand Down
20 changes: 10 additions & 10 deletions src/middleware/immer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ type Write<T, U> = Omit<T, keyof U> & U
type SkipTwo<T> = T extends { length: 0 }
? []
: T extends { length: 1 }
? []
: T extends { length: 0 | 1 }
? []
: T extends [unknown, unknown, ...infer A]
? A
: T extends [unknown, unknown?, ...infer A]
? A
: T extends [unknown?, unknown?, ...infer A]
? A
: never
? []
: T extends { length: 0 | 1 }
? []
: T extends [unknown, unknown, ...infer A]
? A
: T extends [unknown, unknown?, ...infer A]
? A
: T extends [unknown?, unknown?, ...infer A]
? A
: never

type WithImmer<S> = Write<S, StoreImmer<S>>

Expand Down
2 changes: 1 addition & 1 deletion src/middleware/redux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NamedSet } from './devtools.ts'

type Write<T, U> = Omit<T, keyof U> & U

type Action = { type: unknown }
type Action = { type: string }

type StoreRedux<A> = {
dispatch: (a: A) => A
Expand Down
8 changes: 4 additions & 4 deletions src/vanilla.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ type Get<T, K, F> = K extends keyof T ? T[K] : F
export type Mutate<S, Ms> = number extends Ms['length' & keyof Ms]
? S
: Ms extends []
? S
: Ms extends [[infer Mi, infer Ma], ...infer Mrs]
? Mutate<StoreMutators<S, Ma>[Mi & StoreMutatorIdentifier], Mrs>
: never
? S
: Ms extends [[infer Mi, infer Ma], ...infer Mrs]
? Mutate<StoreMutators<S, Ma>[Mi & StoreMutatorIdentifier], Mrs>
: never

export type StateCreator<
T,
Expand Down
Loading

1 comment on commit 15635ab

@vercel
Copy link

@vercel vercel bot commented on 15635ab Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.