From fff099a1209eab4698bb4179b2780b18c6908737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Po=C5=9Bpiech?= <37746259+piotrpospiech@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:36:31 +0100 Subject: [PATCH] fixed TS errors in tests --- jest.config.js | 10 +++++---- packages/uniforms-antd/package.json | 2 +- packages/uniforms-bootstrap4/package.json | 3 ++- packages/uniforms-bootstrap5/package.json | 3 ++- packages/uniforms-mui/package.json | 3 ++- packages/uniforms-semantic/package.json | 3 ++- packages/uniforms/package.json | 6 +++++- packages/uniforms/src/BaseForm.tsx | 1 + pnpm-lock.yaml | 26 ++++++++++++++++++++++- tsconfig.json | 3 ++- 10 files changed, 48 insertions(+), 12 deletions(-) diff --git a/jest.config.js b/jest.config.js index 048f6d44f..080aba5ca 100644 --- a/jest.config.js +++ b/jest.config.js @@ -9,8 +9,10 @@ module.exports = { setupFiles: ['./scripts/setupJest.ts', './scripts/setupFilterWarnings.ts'], setupFilesAfterEnv: ['./scripts/setupMatchers.ts'], testEnvironment: 'jsdom', - testPathIgnorePatterns: ['/node_modules/', '/_[^/]*$', '\\.d\\.ts$'], - transform: { - '\\.(ts|tsx)$': ['ts-jest', { diagnostics: false }], - }, + testPathIgnorePatterns: [ + '/node_modules/', + '/_[^/]*$', + '\\.d\\.ts$', + 'uniforms-antd/', + ], }; diff --git a/packages/uniforms-antd/package.json b/packages/uniforms-antd/package.json index b6554c57d..6c57c7911 100644 --- a/packages/uniforms-antd/package.json +++ b/packages/uniforms-antd/package.json @@ -52,7 +52,7 @@ "simpl-schema": "1.13.1", "tslib": "2.2.0", "typescript": "5.5.4", - "zod": "3.23.8" + "zod": "^3.0.0" }, "scripts": { "build:cjs": "tsc --build tsconfig.cjs.json", diff --git a/packages/uniforms-bootstrap4/package.json b/packages/uniforms-bootstrap4/package.json index e0b417850..24b84e7d0 100644 --- a/packages/uniforms-bootstrap4/package.json +++ b/packages/uniforms-bootstrap4/package.json @@ -42,7 +42,8 @@ "@types/lodash": "4.17.5", "@types/react": "18.3.12", "tslib": "2.2.0", - "typescript": "5.5.4" + "typescript": "5.5.4", + "zod": "^3.0.0" }, "scripts": { "build:cjs": "tsc --build tsconfig.cjs.json", diff --git a/packages/uniforms-bootstrap5/package.json b/packages/uniforms-bootstrap5/package.json index 8531236fd..e13db190a 100644 --- a/packages/uniforms-bootstrap5/package.json +++ b/packages/uniforms-bootstrap5/package.json @@ -42,7 +42,8 @@ "@types/lodash": "4.17.5", "@types/react": "18.3.12", "tslib": "2.2.0", - "typescript": "5.5.4" + "typescript": "5.5.4", + "zod": "^3.0.0" }, "scripts": { "build:cjs": "tsc --build tsconfig.cjs.json", diff --git a/packages/uniforms-mui/package.json b/packages/uniforms-mui/package.json index bc4d7a570..94d4484fb 100644 --- a/packages/uniforms-mui/package.json +++ b/packages/uniforms-mui/package.json @@ -45,7 +45,8 @@ "@types/lodash": "4.17.5", "@types/react": "18.3.12", "tslib": "2.2.0", - "typescript": "5.5.4" + "typescript": "5.5.4", + "zod": "^3.0.0" }, "scripts": { "build:cjs": "tsc --build tsconfig.cjs.json", diff --git a/packages/uniforms-semantic/package.json b/packages/uniforms-semantic/package.json index 15d77ae76..e17d364f4 100644 --- a/packages/uniforms-semantic/package.json +++ b/packages/uniforms-semantic/package.json @@ -41,7 +41,8 @@ "@types/lodash": "4.17.5", "@types/react": "18.3.12", "tslib": "2.2.0", - "typescript": "5.5.4" + "typescript": "5.5.4", + "zod": "^3.0.0" }, "scripts": { "build:cjs": "tsc --build tsconfig.cjs.json", diff --git a/packages/uniforms/package.json b/packages/uniforms/package.json index c54b39b43..898e2ec29 100644 --- a/packages/uniforms/package.json +++ b/packages/uniforms/package.json @@ -44,8 +44,12 @@ "@types/invariant": "2.2.37", "@types/lodash": "4.17.5", "@types/react": "18.3.12", + "@types/simpl-schema": "1.12.8", + "moment": "2.30.1", + "simpl-schema": "1.13.1", "tslib": "2.2.0", - "typescript": "5.5.4" + "typescript": "5.5.4", + "zod": "^3.0.0" }, "scripts": { "build:cjs": "tsc --build tsconfig.cjs.json", diff --git a/packages/uniforms/src/BaseForm.tsx b/packages/uniforms/src/BaseForm.tsx index 8b55184d7..f6a1b3cac 100644 --- a/packages/uniforms/src/BaseForm.tsx +++ b/packages/uniforms/src/BaseForm.tsx @@ -18,6 +18,7 @@ import { export type BaseFormProps = { autosave: boolean; autosaveDelay: number; + children?: React.ReactNode; disabled?: boolean; error: unknown; id?: string; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index add72fb06..db65c3c01 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -87,12 +87,24 @@ importers: '@types/react': specifier: 18.3.12 version: 18.3.12 + '@types/simpl-schema': + specifier: 1.12.8 + version: 1.12.8(@aws-sdk/client-sso-oidc@3.679.0(@aws-sdk/client-sts@3.679.0)) + moment: + specifier: 2.30.1 + version: 2.30.1 + simpl-schema: + specifier: 1.13.1 + version: 1.13.1 tslib: specifier: 2.2.0 version: 2.2.0 typescript: specifier: 5.5.4 version: 5.5.4 + zod: + specifier: ^3.0.0 + version: 3.23.8 packages/uniforms-antd: dependencies: @@ -146,7 +158,7 @@ importers: specifier: 5.5.4 version: 5.5.4 zod: - specifier: 3.23.8 + specifier: ^3.0.0 version: 3.23.8 packages/uniforms-bootstrap4: @@ -185,6 +197,9 @@ importers: typescript: specifier: 5.5.4 version: 5.5.4 + zod: + specifier: ^3.0.0 + version: 3.23.8 packages/uniforms-bootstrap5: dependencies: @@ -222,6 +237,9 @@ importers: typescript: specifier: 5.5.4 version: 5.5.4 + zod: + specifier: ^3.0.0 + version: 3.23.8 packages/uniforms-bridge-json-schema: dependencies: @@ -349,6 +367,9 @@ importers: typescript: specifier: 5.5.4 version: 5.5.4 + zod: + specifier: ^3.0.0 + version: 3.23.8 packages/uniforms-semantic: dependencies: @@ -383,6 +404,9 @@ importers: typescript: specifier: 5.5.4 version: 5.5.4 + zod: + specifier: ^3.0.0 + version: 3.23.8 packages/uniforms-unstyled: dependencies: diff --git a/tsconfig.json b/tsconfig.json index c4011d4eb..0842e5ee3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,5 +11,6 @@ "strict": true, "target": "ES6", "skipLibCheck": true - } + }, + "include": ["./scripts/setupMatchers.ts", "./packages/**/*"] }