chore(deps): update dev dependencies (#3309)

* chore(deps): update dev dependencies

* fix devtools test

* update old ts test

* update older ts test

* possible fix

* testing old ts

* move it to older ts
This commit is contained in:
Daishi Kato 2025-11-30 09:45:31 +09:00 committed by GitHub
parent 2cfb6a72d2
commit 350d9ec6bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 872 additions and 881 deletions

View File

@ -41,7 +41,7 @@ jobs:
if: ${{ matrix.build == 'esm' }} if: ${{ matrix.build == 'esm' }}
run: | run: |
sed -i~ "s/resolve('\.\/src\(.*\)\.ts')/resolve('\.\/dist\/esm\1.mjs')/" vitest.config.mts sed -i~ "s/resolve('\.\/src\(.*\)\.ts')/resolve('\.\/dist\/esm\1.mjs')/" vitest.config.mts
sed -i~ "1s/^/import.meta.env=import.meta.env||{};import.meta.env.MODE='${NODE_ENV}';/" tests/*.tsx sed -i~ "1s/^/import.meta.env.MODE='${NODE_ENV}';/" tests/*.tsx
env: env:
NODE_ENV: ${{ matrix.env }} NODE_ENV: ${{ matrix.env }}
- name: Test ${{ matrix.build }} ${{ matrix.env }} - name: Test ${{ matrix.build }} ${{ matrix.env }}

View File

@ -13,7 +13,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
typescript: typescript:
- 5.9.2 - 5.9.3
- 5.8.3 - 5.8.3
- 5.7.3 - 5.7.3
- 5.6.3 - 5.6.3
@ -45,14 +45,19 @@ jobs:
run: | run: |
sed -i~ 's/"verbatimModuleSyntax": true,//' tsconfig.json sed -i~ 's/"verbatimModuleSyntax": true,//' tsconfig.json
- name: Patch for Old TS - name: Patch for Old TS
if: ${{ matrix.typescript == '5.3.3' || matrix.typescript == '5.2.2' || matrix.typescript == '5.1.6' || matrix.typescript == '5.0.4' || matrix.typescript == '4.9.5' || matrix.typescript == '4.8.4' || matrix.typescript == '4.7.4' || matrix.typescript == '4.6.4' || matrix.typescript == '4.5.5' }}
run: | run: |
sed -i~ 's/"moduleResolution": "bundler",/"moduleResolution": "node",/' tsconfig.json sed -i~ 's/"moduleResolution": "bundler",/"moduleResolution": "node",/' tsconfig.json
sed -i~ 's/"allowImportingTsExtensions": true,//' tsconfig.json sed -i~ 's/"allowImportingTsExtensions": true,//' tsconfig.json
sed -i~ 's/"zustand": \["\.\/src\/index\.ts"\],/"zustand": [".\/dist\/index.d.ts"],/' tsconfig.json sed -i~ 's/"zustand": \["\.\/src\/index\.ts"\],/"zustand": [".\/dist\/index.d.ts"],/' tsconfig.json
sed -i~ 's/"zustand\/\*": \["\.\/src\/\*\.ts"\]/"zustand\/*": [".\/dist\/*.d.ts"]/' tsconfig.json sed -i~ 's/"zustand\/\*": \["\.\/src\/\*\.ts"\]/"zustand\/*": [".\/dist\/*.d.ts"]/' tsconfig.json
sed -i~ 's/"include": .*/"include": ["src\/types.d.ts", "dist\/**\/*", "tests\/**\/*"],/' tsconfig.json sed -i~ 's/"include": .*/"include": ["src\/types.d.ts", "dist\/**\/*", "tests\/**\/*"],/' tsconfig.json
- name: Patch for Older TS
if: ${{ matrix.typescript == '4.7.4' || matrix.typescript == '4.6.4' || matrix.typescript == '4.5.5' }}
run: |
pnpm json -I -f package.json -e "this.resolutions={}; this.resolutions['@types/node']='18.13.0';" pnpm json -I -f package.json -e "this.resolutions={}; this.resolutions['@types/node']='18.13.0';"
pnpm add -D @types/node@18.13.0 pnpm add -D @types/node@18.13.0
pnpm add -D vitest@3.2.4 @vitest/coverage-v8@3.2.4 @vitest/ui@3.2.4
- name: Install old TypeScript - name: Install old TypeScript
run: pnpm add -D typescript@${{ matrix.typescript }} run: pnpm add -D typescript@${{ matrix.typescript }}
- name: Test ${{ matrix.typescript }} - name: Test ${{ matrix.typescript }}

View File

@ -116,7 +116,7 @@
"homepage": "https://github.com/pmndrs/zustand", "homepage": "https://github.com/pmndrs/zustand",
"packageManager": "pnpm@10.18.3", "packageManager": "pnpm@10.18.3",
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.38.0", "@eslint/js": "^9.39.1",
"@redux-devtools/extension": "^3.3.0", "@redux-devtools/extension": "^3.3.0",
"@rollup/plugin-alias": "^6.0.0", "@rollup/plugin-alias": "^6.0.0",
"@rollup/plugin-node-resolve": "^16.0.3", "@rollup/plugin-node-resolve": "^16.0.3",
@ -124,37 +124,37 @@
"@rollup/plugin-typescript": "12.3.0", "@rollup/plugin-typescript": "12.3.0",
"@testing-library/jest-dom": "^6.9.1", "@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0", "@testing-library/react": "^16.3.0",
"@types/node": "^24.9.2", "@types/node": "^24.10.1",
"@types/react": "^19.2.2", "@types/react": "^19.2.7",
"@types/react-dom": "^19.2.2", "@types/react-dom": "^19.2.3",
"@types/use-sync-external-store": "^1.5.0", "@types/use-sync-external-store": "^1.5.0",
"@vitest/coverage-v8": "^3.2.4", "@vitest/coverage-v8": "^4.0.14",
"@vitest/eslint-plugin": "^1.3.26", "@vitest/eslint-plugin": "^1.5.0",
"@vitest/ui": "^3.2.4", "@vitest/ui": "^4.0.14",
"esbuild": "^0.25.11", "esbuild": "^0.27.0",
"eslint": "9.38.0", "eslint": "9.39.1",
"eslint-import-resolver-typescript": "^4.4.4", "eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.32.0", "eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest-dom": "^5.5.0", "eslint-plugin-jest-dom": "^5.5.0",
"eslint-plugin-react": "^7.37.5", "eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1", "eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-testing-library": "^7.13.3", "eslint-plugin-testing-library": "^7.13.5",
"immer": "^10.2.0", "immer": "^11.0.1",
"jsdom": "^27.0.1", "jsdom": "^27.2.0",
"json": "^11.0.0", "json": "^11.0.0",
"prettier": "^3.6.2", "prettier": "^3.7.2",
"react": "19.2.0", "react": "19.2.0",
"react-dom": "19.2.0", "react-dom": "19.2.0",
"redux": "^5.0.1", "redux": "^5.0.1",
"rollup": "^4.52.5", "rollup": "^4.53.3",
"rollup-plugin-esbuild": "^6.2.1", "rollup-plugin-esbuild": "^6.2.1",
"shelljs": "^0.10.0", "shelljs": "^0.10.0",
"shx": "^0.4.0", "shx": "^0.4.0",
"tslib": "^2.8.1", "tslib": "^2.8.1",
"typescript": "^5.9.3", "typescript": "^5.9.3",
"typescript-eslint": "^8.46.2", "typescript-eslint": "^8.48.0",
"use-sync-external-store": "^1.6.0", "use-sync-external-store": "^1.6.0",
"vitest": "^3.2.4" "vitest": "^4.0.14"
}, },
"peerDependencies": { "peerDependencies": {
"@types/react": ">=18.0.0", "@types/react": ">=18.0.0",

1699
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@ type TupleOfEqualLength<Arr extends unknown[], T> = number extends Arr['length']
type Connection = { type Connection = {
subscribers: ((message: unknown) => void)[] subscribers: ((message: unknown) => void)[]
api: { api: {
subscribe: Mock<any> subscribe: Mock<(f: (message: unknown) => void) => () => void>
unsubscribe: Mock<any> unsubscribe: Mock<any>
send: Mock<any> send: Mock<any>
init: Mock<any> init: Mock<any>
@ -93,7 +93,7 @@ const extensionConnector = {
? unnamedConnections ? unnamedConnections
: namedConnections : namedConnections
const subscribers: Connection['subscribers'] = [] const subscribers: Connection['subscribers'] = []
const api = { const api: Connection['api'] = {
subscribe: vi.fn((f: (m: unknown) => void) => { subscribe: vi.fn((f: (m: unknown) => void) => {
subscribers.push(f) subscribers.push(f)
return () => {} return () => {}

View File

@ -185,14 +185,16 @@ it('state is covariant', () => {
foo: '', foo: '',
})) }))
const _testIsCovariant: StoreApi<{ count: number }> = store const testIsCovariant: StoreApi<{ count: number }> = store
expect(testIsCovariant).toBeDefined()
// @ts-expect-error should not compile // @ts-expect-error should not compile
const _testIsNotContravariant: StoreApi<{ const testIsNotContravariant: StoreApi<{
count: number count: number
foo: string foo: string
baz: string baz: string
}> = store }> = store
expect(testIsNotContravariant).toBeDefined()
}) })
it('StateCreator<T, [StoreMutatorIdentfier, unknown][]> is StateCreator<T, []>', () => { it('StateCreator<T, [StoreMutatorIdentfier, unknown][]> is StateCreator<T, []>', () => {
@ -229,8 +231,9 @@ it('StateCreator subtyping', () => {
create<State>()(persist(foo(), { name: 'prefix' })) create<State>()(persist(foo(), { name: 'prefix' }))
const _testSubtyping: StateCreator<State, [['zustand/persist', unknown]]> = const testSubtyping: StateCreator<State, [['zustand/persist', unknown]]> =
{} as StateCreator<State, []> {} as StateCreator<State, []>
expect(testSubtyping).toBeDefined()
}) })
it('set state exists on store with readonly store', () => { it('set state exists on store with readonly store', () => {