From df0646d47e5e214cafe98fe795e12328ea8e1708 Mon Sep 17 00:00:00 2001 From: Corbin Crutchley Date: Thu, 28 Nov 2024 23:20:15 -0800 Subject: [PATCH] chore!: drop TypeScript 4.9 support --- package.json | 1 - packages/react-store/package.json | 1 - packages/react-store/tsconfig.legacy.json | 10 ---------- packages/solid-store/package.json | 1 - packages/solid-store/tsconfig.legacy.json | 11 ----------- packages/store/package.json | 13 +------------ packages/store/src/derived.ts | 2 +- packages/store/tests/derived.test-d.ts | 2 +- packages/store/ts-5/index.d.cts | 18 ------------------ packages/store/ts-5/index.d.ts | 18 ------------------ packages/store/tsconfig.legacy.json | 4 ---- packages/vue-store/package.json | 1 - packages/vue-store/tsconfig.legacy.json | 12 ------------ pnpm-lock.yaml | 10 ---------- 14 files changed, 3 insertions(+), 101 deletions(-) delete mode 100644 packages/react-store/tsconfig.legacy.json delete mode 100644 packages/solid-store/tsconfig.legacy.json delete mode 100644 packages/store/ts-5/index.d.cts delete mode 100644 packages/store/ts-5/index.d.ts delete mode 100644 packages/store/tsconfig.legacy.json delete mode 100644 packages/vue-store/tsconfig.legacy.json diff --git a/package.json b/package.json index 9e6ca18..75d68a8 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,6 @@ "sherif": "^1.0.2", "solid-js": "^1.9.3", "typescript": "5.6.3", - "typescript49": "npm:typescript@4.9", "typescript50": "npm:typescript@5.0", "typescript51": "npm:typescript@5.1", "typescript52": "npm:typescript@5.2", diff --git a/packages/react-store/package.json b/packages/react-store/package.json index 419076f..183668a 100644 --- a/packages/react-store/package.json +++ b/packages/react-store/package.json @@ -23,7 +23,6 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint ./src ./tests", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts49": "node ../../node_modules/typescript49/lib/tsc.js -p tsconfig.legacy.json", "test:types:ts50": "node ../../node_modules/typescript50/lib/tsc.js", "test:types:ts51": "node ../../node_modules/typescript51/lib/tsc.js", "test:types:ts52": "node ../../node_modules/typescript52/lib/tsc.js", diff --git a/packages/react-store/tsconfig.legacy.json b/packages/react-store/tsconfig.legacy.json deleted file mode 100644 index bfa4367..0000000 --- a/packages/react-store/tsconfig.legacy.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "jsx": "react", - "paths": { - "@tanstack/store": ["../store/src"] - } - }, - "include": ["src"] -} diff --git a/packages/solid-store/package.json b/packages/solid-store/package.json index 958b58f..c4c8eb9 100644 --- a/packages/solid-store/package.json +++ b/packages/solid-store/package.json @@ -23,7 +23,6 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint ./src ./tests", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts49": "node ../../node_modules/typescript49/lib/tsc.js -p tsconfig.legacy.json", "test:types:ts50": "node ../../node_modules/typescript50/lib/tsc.js", "test:types:ts51": "node ../../node_modules/typescript51/lib/tsc.js", "test:types:ts52": "node ../../node_modules/typescript52/lib/tsc.js", diff --git a/packages/solid-store/tsconfig.legacy.json b/packages/solid-store/tsconfig.legacy.json deleted file mode 100644 index 783ab9e..0000000 --- a/packages/solid-store/tsconfig.legacy.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "jsx": "preserve", - "jsxImportSource": "solid-js", - "paths": { - "@tanstack/store": ["../store/src"] - } - }, - "include": ["src"] -} diff --git a/packages/store/package.json b/packages/store/package.json index b6e066b..fb32c9b 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -22,7 +22,6 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint ./src ./tests", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts49": "node ../../node_modules/typescript49/lib/tsc.js -p tsconfig.legacy.json", "test:types:ts50": "node ../../node_modules/typescript50/lib/tsc.js", "test:types:ts51": "node ../../node_modules/typescript51/lib/tsc.js", "test:types:ts52": "node ../../node_modules/typescript52/lib/tsc.js", @@ -36,25 +35,16 @@ }, "type": "module", "types": "dist/esm/index.d.ts", - "typesVersions": { - "=>5.0": { - "index.d.ts": [ - "ts-5/index.v5.d.ts" - ] - } - }, "main": "dist/cjs/index.cjs", "module": "dist/esm/index.js", "exports": { ".": { "import": { "types": "./dist/esm/index.d.ts", - "types@>=5.0": "./ts-5/index.d.ts", "default": "./dist/esm/index.js" }, "require": { "types": "./dist/cjs/index.d.cts", - "types@>=5.0": "./ts-5/index.d.cts", "default": "./dist/cjs/index.cjs" } }, @@ -63,8 +53,7 @@ "sideEffects": false, "files": [ "dist", - "src", - "ts-5" + "src" ], "devDependencies": { "@angular/core": "^19.0.0", diff --git a/packages/store/src/derived.ts b/packages/store/src/derived.ts index d376481..4570ccf 100644 --- a/packages/store/src/derived.ts +++ b/packages/store/src/derived.ts @@ -57,7 +57,7 @@ export interface DerivedOptions< export class Derived< TState, - TArr extends ReadonlyArray | Store> = ReadonlyArray, + const TArr extends ReadonlyArray | Store> = ReadonlyArray, > { /** * @private diff --git a/packages/store/tests/derived.test-d.ts b/packages/store/tests/derived.test-d.ts index 6099e25..9fb0fc4 100644 --- a/packages/store/tests/derived.test-d.ts +++ b/packages/store/tests/derived.test-d.ts @@ -4,7 +4,7 @@ import { Derived, Store } from '../src' test('dep array inner types work', () => { const store = new Store(12) new Derived({ - deps: [store] as const, + deps: [store], fn: ({ currDepVals: [currentStore], prevDepVals }) => { expectTypeOf(currentStore).toMatchTypeOf() expectTypeOf(prevDepVals).toMatchTypeOf<[number] | undefined>() diff --git a/packages/store/ts-5/index.d.cts b/packages/store/ts-5/index.d.cts deleted file mode 100644 index 7da6170..0000000 --- a/packages/store/ts-5/index.d.cts +++ /dev/null @@ -1,18 +0,0 @@ -export * from '../dist/cjs/effect.js' -export * from '../dist/cjs/store.js' -export * from '../dist/cjs/types.js' -export { - DerivedFnProps, - DerivedOptions, - UnwrapDerivedOrStore, -} from '../dist/cjs/derived.js' - -import { Store } from '../dist/cjs/store.js' -import { Derived as DerivedV4 } from '../dist/cjs/derived.js' - -export class Derived< - TVal, - const TArr extends ReadonlyArray< - Derived | Store - > = ReadonlyArray, -> extends DerivedV4 {} diff --git a/packages/store/ts-5/index.d.ts b/packages/store/ts-5/index.d.ts deleted file mode 100644 index 921f816..0000000 --- a/packages/store/ts-5/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export * from '../dist/esm/effect.js' -export * from '../dist/esm/store.js' -export * from '../dist/esm/types.js' -export { - DerivedFnProps, - DerivedOptions, - UnwrapDerivedOrStore, -} from '../dist/esm/derived.js' - -import { Store } from '../dist/esm/store.js' -import { Derived as DerivedV4 } from '../dist/esm/derived.js' - -export class Derived< - TVal, - const TArr extends ReadonlyArray< - Derived | Store - > = ReadonlyArray, -> extends DerivedV4 {} diff --git a/packages/store/tsconfig.legacy.json b/packages/store/tsconfig.legacy.json deleted file mode 100644 index 596e2cf..0000000 --- a/packages/store/tsconfig.legacy.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "include": ["src"] -} diff --git a/packages/vue-store/package.json b/packages/vue-store/package.json index b048d4c..7c3bf48 100644 --- a/packages/vue-store/package.json +++ b/packages/vue-store/package.json @@ -23,7 +23,6 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint ./src ./tests", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts49": "node ../../node_modules/typescript49/lib/tsc.js -p tsconfig.legacy.json", "test:types:ts50": "node ../../node_modules/typescript50/lib/tsc.js", "test:types:ts51": "node ../../node_modules/typescript51/lib/tsc.js", "test:types:ts52": "node ../../node_modules/typescript52/lib/tsc.js", diff --git a/packages/vue-store/tsconfig.legacy.json b/packages/vue-store/tsconfig.legacy.json deleted file mode 100644 index 05c9a49..0000000 --- a/packages/vue-store/tsconfig.legacy.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "jsx": "preserve", - "jsxImportSource": "vue", - "types": ["vue/jsx"], - "paths": { - "@tanstack/store": ["../store/src"] - } - }, - "include": ["src"] -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 855e934..611ade8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -83,9 +83,6 @@ importers: typescript: specifier: 5.6.3 version: 5.6.3 - typescript49: - specifier: npm:typescript@4.9 - version: typescript@4.9.5 typescript50: specifier: npm:typescript@5.0 version: typescript@5.0.4 @@ -6514,11 +6511,6 @@ packages: typescript: optional: true - typescript@4.9.5: - resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} - engines: {node: '>=4.2.0'} - hasBin: true - typescript@5.0.4: resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} engines: {node: '>=12.20'} @@ -13877,8 +13869,6 @@ snapshots: - eslint - supports-color - typescript@4.9.5: {} - typescript@5.0.4: {} typescript@5.1.6: {}