diff --git a/.gitignore b/.gitignore
index c3e05d6f25..bbd8fe162e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -137,3 +137,6 @@ coverage
venv
*.orig
out/
+
+# typescript tsbuildinfo
+*.tsbuildinfo
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ea4b36f55f..d33ca1990a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,6 +21,15 @@ should change the heading of the (upcoming) version to include a major version b
- Added theme for Fluent UI v9 (React Components), fixing [#3659](https://github.com/rjsf-team/react-jsonschema-form/issues/3659)
+## @rjsf/snapshot-tests
+
+Move theme snapshot tests into separate package
+
+## Dev / playground
+
+- update configuration to use typescript project references, start type checking the tests
+
+
# 5.13.6
## @rjsf/core
diff --git a/nx.json b/nx.json
index 4977839da8..f836e8d38c 100644
--- a/nx.json
+++ b/nx.json
@@ -25,7 +25,11 @@
},
"targetDefaults": {
"build": {
- "dependsOn": ["^build"]
+ "dependsOn": [{
+ "//": "use only dependencies to avoid cycle @rjsf/core:build --> @rjsf/snapshot-tests:build --> @rjsf/core:build",
+ "projects": "dependencies",
+ "target": "^build"
+ }]
}
},
"affected": {
diff --git a/package-lock.json b/package-lock.json
index 9dec41b902..a245a7b0e0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -20,7 +20,8 @@
"packages/semantic-ui",
"packages/utils",
"packages/validator-ajv6",
- "packages/validator-ajv8"
+ "packages/validator-ajv8",
+ "packages/snapshot-tests"
],
"devDependencies": {
"@babel/eslint-parser": "^7.22.15",
@@ -9662,6 +9663,10 @@
"resolved": "packages/semantic-ui",
"link": true
},
+ "node_modules/@rjsf/snapshot-tests": {
+ "resolved": "packages/snapshot-tests",
+ "link": true
+ },
"node_modules/@rjsf/utils": {
"resolved": "packages/utils",
"link": true
@@ -10402,9 +10407,9 @@
}
},
"node_modules/@types/jest": {
- "version": "29.5.5",
- "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.5.tgz",
- "integrity": "sha512-ebylz2hnsWR9mYvmBFbXJXr+33UPc4+ZdxyDXh5w0FlPBTfCVN3wPL+kuOiQt3xvrK419v7XWeAs+AeOksafXg==",
+ "version": "29.5.8",
+ "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.8.tgz",
+ "integrity": "sha512-fXEFTxMV2Co8ZF5aYFJv+YeA08RTYJfhtN5c9JSv/mFEMe+xxjufCb+PHL+bJcMs/ebPUsBu+UNTEz+ydXrR6g==",
"dev": true,
"dependencies": {
"expect": "^29.0.0",
@@ -33535,9 +33540,11 @@
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
"@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
"@rollup/plugin-replace": "^5.0.2",
+ "@types/jest": "^29.5.5",
"@types/lodash": "^4.14.198",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
@@ -34193,8 +34200,10 @@
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
"@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
"@types/react-test-renderer": "^17.0.3",
@@ -34243,8 +34252,10 @@
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
"@types/react-test-renderer": "^17.0.3",
@@ -34336,9 +34347,11 @@
"@babel/preset-env": "^7.22.15",
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv6": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/lodash": "^4.14.198",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
@@ -34452,8 +34465,10 @@
"@babel/preset-typescript": "^7.22.15",
"@fluentui/react": "^8.111.2",
"@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/lodash": "^4.14.198",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
@@ -34496,28 +34511,24 @@
"@babel/preset-env": "^7.22.15",
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
- "@rjsf/core": "^5.13.2",
- "@rjsf/utils": "^5.13.0",
- "@rjsf/validator-ajv8": "^5.13.0",
+ "@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
+ "@rjsf/utils": "^5.13.6",
+ "@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
"@types/react-test-renderer": "^17.0.3",
- "ajv": "^8.12.0",
"babel-jest": "^29.6.4",
- "chai": "^3.5.0",
"esbuild": "^0.18.20",
"eslint": "^8.48.0",
"jest": "^29.6.4",
"jest-environment-jsdom": "^29.6.4",
- "jsdom": "^20.0.3",
- "mocha": "^10.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
- "react-portal": "^4.2.2",
"react-test-renderer": "^17.0.2",
"rimraf": "^5.0.1",
"rollup": "^3.29.0",
- "sinon": "^9.2.4",
"typescript": "^4.9.5"
},
"engines": {
@@ -34528,28 +34539,6 @@
"react": "^16.14.0 || >=17"
}
},
- "packages/fluentui-rc/node_modules/ajv": {
- "version": "8.12.0",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz",
- "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==",
- "dev": true,
- "dependencies": {
- "fast-deep-equal": "^3.1.1",
- "json-schema-traverse": "^1.0.0",
- "require-from-string": "^2.0.2",
- "uri-js": "^4.2.2"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/epoberezkin"
- }
- },
- "packages/fluentui-rc/node_modules/json-schema-traverse": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
- "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
- "dev": true
- },
"packages/material-ui": {
"name": "@rjsf/material-ui",
"version": "5.13.6",
@@ -34564,8 +34553,10 @@
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
"@types/react-test-renderer": "^17.0.3",
@@ -34609,8 +34600,10 @@
"@mui/icons-material": "^5.14.8",
"@mui/material": "^5.14.8",
"@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
"@types/react-test-renderer": "^17.0.3",
@@ -34717,6 +34710,7 @@
"react-transform-hmr": "^1.0.4",
"rimraf": "^5.0.1",
"source-map-loader": "^4.0.1",
+ "typescript": "^4.9.5",
"vite": "^4.4.9"
},
"engines": {
@@ -34793,8 +34787,10 @@
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
"@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/lodash": "^4.14.198",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
@@ -34823,6 +34819,32 @@
"semantic-ui-react": "^1.3.1"
}
},
+ "packages/snapshot-tests": {
+ "name": "@rjsf/snapshot-tests",
+ "version": "5.13.6",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@rjsf/core": "^5.10.0",
+ "@rjsf/utils": "^5.10.0",
+ "@rjsf/validator-ajv8": "^5.10.0"
+ },
+ "devDependencies": {
+ "@types/jest": "^29.5.3",
+ "@types/react": "^17.0.62",
+ "@types/react-dom": "^17.0.20",
+ "@types/react-test-renderer": "^17.0.2",
+ "react": "^17.0.2",
+ "react-test-renderer": "^17.0.2",
+ "typescript": "^4.9.5"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "peerDependencies": {
+ "react": "^16.14.0 || >=17",
+ "react-test-renderer": "^17.0.2"
+ }
+ },
"packages/utils": {
"name": "@rjsf/utils",
"version": "5.13.6",
@@ -34841,6 +34863,7 @@
"@babel/preset-env": "^7.22.15",
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
+ "@types/jest": "^29.5.5",
"@types/json-schema": "^7.0.12",
"@types/json-schema-merge-allof": "^0.6.1",
"@types/lodash": "^4.14.198",
@@ -34892,6 +34915,7 @@
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
"@rjsf/utils": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/json-schema": "^7.0.12",
"@types/lodash": "^4.14.198",
"babel-jest": "^29.6.4",
@@ -34928,6 +34952,7 @@
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
"@rjsf/utils": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/json-schema": "^7.0.12",
"@types/lodash": "^4.14.198",
"babel-jest": "^29.6.4",
diff --git a/package.json b/package.json
index 5d59d58036..82498696b0 100644
--- a/package.json
+++ b/package.json
@@ -73,6 +73,7 @@
"packages/semantic-ui",
"packages/utils",
"packages/validator-ajv6",
- "packages/validator-ajv8"
+ "packages/validator-ajv8",
+ "packages/snapshot-tests"
]
}
diff --git a/packages/antd/package.json b/packages/antd/package.json
index 6403e4c59d..41b75ab940 100644
--- a/packages/antd/package.json
+++ b/packages/antd/package.json
@@ -6,11 +6,11 @@
"module": "lib/index.js",
"typings": "lib/index.d.ts",
"scripts": {
- "build:ts": "rimraf lib && tsc",
+ "build:ts": "tsc -b",
"build:cjs": "esbuild ./src/index.ts --bundle --outfile=dist/index.js --sourcemap --packages=external --format=cjs",
"build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/antd.esm.js --sourcemap --packages=external --format=esm",
"build:umd": "rollup dist/antd.esm.js --format=umd --file=dist/antd.umd.js --name=@rjsf/antd",
- "build": "rimraf dist && npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
+ "build": "npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
"cs-check": "prettier -l \"{src,test}/**/*.ts?(x)\"",
"cs-format": "prettier \"{src,test}/**/*.ts?(x)\" --write",
"lint": "eslint src test",
@@ -57,9 +57,11 @@
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
"@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
"@rollup/plugin-replace": "^5.0.2",
+ "@types/jest": "^29.5.5",
"@types/lodash": "^4.14.198",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
diff --git a/packages/antd/src/tsconfig.json b/packages/antd/src/tsconfig.json
new file mode 100644
index 0000000000..01834bf1ab
--- /dev/null
+++ b/packages/antd/src/tsconfig.json
@@ -0,0 +1,23 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "include": [
+ "./"
+ ],
+ "compilerOptions": {
+ "rootDir": "./",
+ "outDir": "../lib",
+ "baseUrl": "../",
+ "jsx": "react-jsx"
+ },
+ "references": [
+ {
+ "path": "../../core"
+ },
+ {
+ "path": "../../utils"
+ },
+ {
+ "path": "../../validator-ajv8"
+ }
+ ]
+}
diff --git a/packages/antd/test/Array.test.tsx b/packages/antd/test/Array.test.tsx
index e8648cfe4c..2ae40788e3 100644
--- a/packages/antd/test/Array.test.tsx
+++ b/packages/antd/test/Array.test.tsx
@@ -1,4 +1,4 @@
-import arrayTests, { CHECKBOXES_CUSTOMIZE } from '@rjsf/core/testSnap/arrayTests';
+import { arrayTests, CHECKBOXES_CUSTOMIZE } from '@rjsf/snapshot-tests';
import '../__mocks__/matchMedia.mock';
import Form from '../src';
diff --git a/packages/antd/test/Form.test.tsx b/packages/antd/test/Form.test.tsx
index ca4a92cdd9..005ed52a46 100644
--- a/packages/antd/test/Form.test.tsx
+++ b/packages/antd/test/Form.test.tsx
@@ -1,7 +1,7 @@
import renderer from 'react-test-renderer';
import validator from '@rjsf/validator-ajv8';
import { RJSFSchema } from '@rjsf/utils';
-import formTests, { SELECT_CUSTOMIZE } from '@rjsf/core/testSnap/formTests';
+import { formTests, SELECT_CUSTOMIZE } from '@rjsf/snapshot-tests';
import '../__mocks__/matchMedia.mock';
import Form from '../src';
diff --git a/packages/antd/test/Object.test.tsx b/packages/antd/test/Object.test.tsx
index fd12052c8e..fc9655bca3 100644
--- a/packages/antd/test/Object.test.tsx
+++ b/packages/antd/test/Object.test.tsx
@@ -1,4 +1,4 @@
-import objectTests from '@rjsf/core/testSnap/objectTests';
+import { objectTests } from '@rjsf/snapshot-tests';
import '../__mocks__/matchMedia.mock';
import Form from '../src';
diff --git a/packages/antd/test/tsconfig.json b/packages/antd/test/tsconfig.json
new file mode 100644
index 0000000000..5db560d2c3
--- /dev/null
+++ b/packages/antd/test/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "include": ["./"],
+ "compilerOptions": {
+ "rootDir": "./",
+ "baseUrl": "../",
+ "noEmit": true,
+ "jsx": "react-jsx"
+ },
+ "references": [
+ {
+ "path": "../src"
+ },
+ {
+ "path": "../../snapshot-tests"
+ }
+ ]
+}
diff --git a/packages/antd/tsconfig.json b/packages/antd/tsconfig.json
index 0786a3f6bf..82462dfbeb 100644
--- a/packages/antd/tsconfig.json
+++ b/packages/antd/tsconfig.json
@@ -1,10 +1,12 @@
{
"extends": "../../tsconfig.base.json",
- "include": ["src"],
- "compilerOptions": {
- "rootDir": "./src",
- "outDir": "./lib",
- "baseUrl": "./",
- "jsx": "react-jsx"
- }
+ "files": [],
+ "references": [
+ {
+ "path": "./src"
+ },
+ {
+ "path": "./test"
+ }
+ ]
}
diff --git a/packages/bootstrap-4/package.json b/packages/bootstrap-4/package.json
index e0beff7e35..7c8dba5f58 100644
--- a/packages/bootstrap-4/package.json
+++ b/packages/bootstrap-4/package.json
@@ -15,11 +15,11 @@
"url": ""
},
"scripts": {
- "build:ts": "rimraf lib && tsc",
+ "build:ts": "tsc -b",
"build:cjs": "esbuild ./src/index.ts --bundle --outfile=dist/index.js --sourcemap --packages=external --format=cjs",
"build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/bootstrap-4.esm.js --sourcemap --packages=external --format=esm",
"build:umd": "rollup dist/bootstrap-4.esm.js --format=umd --file=dist/bootstrap-4.umd.js --name=@rjsf/bootstrap-4",
- "build": "rimraf dist && npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
+ "build": "npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
"cs-check": "prettier -l \"{src,test}/**/*.ts?(x)\"",
"cs-format": "prettier \"{src,test}/**/*.ts?(x)\" --write",
"lint": "eslint src test",
@@ -50,8 +50,10 @@
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
"@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
"@types/react-test-renderer": "^17.0.3",
diff --git a/packages/bootstrap-4/src/tsconfig.json b/packages/bootstrap-4/src/tsconfig.json
new file mode 100644
index 0000000000..01834bf1ab
--- /dev/null
+++ b/packages/bootstrap-4/src/tsconfig.json
@@ -0,0 +1,23 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "include": [
+ "./"
+ ],
+ "compilerOptions": {
+ "rootDir": "./",
+ "outDir": "../lib",
+ "baseUrl": "../",
+ "jsx": "react-jsx"
+ },
+ "references": [
+ {
+ "path": "../../core"
+ },
+ {
+ "path": "../../utils"
+ },
+ {
+ "path": "../../validator-ajv8"
+ }
+ ]
+}
diff --git a/packages/bootstrap-4/test/Array.test.tsx b/packages/bootstrap-4/test/Array.test.tsx
index 7709a7a692..a17060201a 100644
--- a/packages/bootstrap-4/test/Array.test.tsx
+++ b/packages/bootstrap-4/test/Array.test.tsx
@@ -1,4 +1,4 @@
-import arrayTests from '@rjsf/core/testSnap/arrayTests';
+import { arrayTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/bootstrap-4/test/Form.test.tsx b/packages/bootstrap-4/test/Form.test.tsx
index 8aac502b3e..c96826c914 100644
--- a/packages/bootstrap-4/test/Form.test.tsx
+++ b/packages/bootstrap-4/test/Form.test.tsx
@@ -1,4 +1,4 @@
-import formTests from '@rjsf/core/testSnap/formTests';
+import { formTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/bootstrap-4/test/Object.test.tsx b/packages/bootstrap-4/test/Object.test.tsx
index 3caaa69282..dabe023e32 100644
--- a/packages/bootstrap-4/test/Object.test.tsx
+++ b/packages/bootstrap-4/test/Object.test.tsx
@@ -1,4 +1,4 @@
-import objectTests from '@rjsf/core/testSnap/objectTests';
+import { objectTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/bootstrap-4/test/tsconfig.json b/packages/bootstrap-4/test/tsconfig.json
new file mode 100644
index 0000000000..5db560d2c3
--- /dev/null
+++ b/packages/bootstrap-4/test/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "include": ["./"],
+ "compilerOptions": {
+ "rootDir": "./",
+ "baseUrl": "../",
+ "noEmit": true,
+ "jsx": "react-jsx"
+ },
+ "references": [
+ {
+ "path": "../src"
+ },
+ {
+ "path": "../../snapshot-tests"
+ }
+ ]
+}
diff --git a/packages/bootstrap-4/tsconfig.json b/packages/bootstrap-4/tsconfig.json
index 0786a3f6bf..82462dfbeb 100644
--- a/packages/bootstrap-4/tsconfig.json
+++ b/packages/bootstrap-4/tsconfig.json
@@ -1,10 +1,12 @@
{
"extends": "../../tsconfig.base.json",
- "include": ["src"],
- "compilerOptions": {
- "rootDir": "./src",
- "outDir": "./lib",
- "baseUrl": "./",
- "jsx": "react-jsx"
- }
+ "files": [],
+ "references": [
+ {
+ "path": "./src"
+ },
+ {
+ "path": "./test"
+ }
+ ]
}
diff --git a/packages/chakra-ui/package.json b/packages/chakra-ui/package.json
index 4c0e5e9f58..24139a9ac3 100644
--- a/packages/chakra-ui/package.json
+++ b/packages/chakra-ui/package.json
@@ -11,11 +11,11 @@
"src"
],
"scripts": {
- "build:ts": "rimraf lib && tsc",
+ "build:ts": "tsc -b",
"build:cjs": "esbuild ./src/index.ts --bundle --outfile=dist/index.js --sourcemap --packages=external --format=cjs",
"build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/chakra-ui.esm.js --sourcemap --packages=external --format=esm",
"build:umd": "rollup dist/chakra-ui.esm.js --format=umd --file=dist/chakra-ui.umd.js --name=@rjsf/chakra-ui",
- "build": "rimraf dist && npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
+ "build": "npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
"cs-check": "prettier -l \"{src,test}/**/*.ts?(x)\"",
"cs-format": "prettier \"{src,test}/**/*.ts?(x)\" --write",
"lint": "eslint src test",
@@ -69,8 +69,10 @@
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
"@types/react-test-renderer": "^17.0.3",
diff --git a/packages/chakra-ui/src/tsconfig.json b/packages/chakra-ui/src/tsconfig.json
new file mode 100644
index 0000000000..794ef76faa
--- /dev/null
+++ b/packages/chakra-ui/src/tsconfig.json
@@ -0,0 +1,26 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "include": [
+ "./"
+ ],
+ "compilerOptions": {
+ "rootDir": "./",
+ "outDir": "../lib",
+ "baseUrl": "../",
+ "jsx": "react-jsx",
+ // There are type errors in @chakra-ui/menu type definitions because of which skipLibCheck had to be added
+ // @chakra-ui/menu/dist/declarations/src/use-menu.d.ts:986:61 - error TS2694: Namespace '"node_modules/csstype/index".Property' has no exported member 'ColorAdjust'.
+ "skipLibCheck": true
+ },
+ "references": [
+ {
+ "path": "../../core"
+ },
+ {
+ "path": "../../utils"
+ },
+ {
+ "path": "../../validator-ajv8"
+ }
+ ]
+}
diff --git a/packages/chakra-ui/test/Array.test.tsx b/packages/chakra-ui/test/Array.test.tsx
index 7709a7a692..a17060201a 100644
--- a/packages/chakra-ui/test/Array.test.tsx
+++ b/packages/chakra-ui/test/Array.test.tsx
@@ -1,4 +1,4 @@
-import arrayTests from '@rjsf/core/testSnap/arrayTests';
+import { arrayTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/chakra-ui/test/Form.test.tsx b/packages/chakra-ui/test/Form.test.tsx
index 8aac502b3e..c96826c914 100644
--- a/packages/chakra-ui/test/Form.test.tsx
+++ b/packages/chakra-ui/test/Form.test.tsx
@@ -1,4 +1,4 @@
-import formTests from '@rjsf/core/testSnap/formTests';
+import { formTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/chakra-ui/test/Object.test.tsx b/packages/chakra-ui/test/Object.test.tsx
index 3caaa69282..dabe023e32 100644
--- a/packages/chakra-ui/test/Object.test.tsx
+++ b/packages/chakra-ui/test/Object.test.tsx
@@ -1,4 +1,4 @@
-import objectTests from '@rjsf/core/testSnap/objectTests';
+import { objectTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/chakra-ui/test/tsconfig.json b/packages/chakra-ui/test/tsconfig.json
new file mode 100644
index 0000000000..d825800ca7
--- /dev/null
+++ b/packages/chakra-ui/test/tsconfig.json
@@ -0,0 +1,21 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "include": ["./"],
+ "compilerOptions": {
+ "rootDir": "./",
+ "baseUrl": "../",
+ "noEmit": true,
+ "jsx": "react-jsx",
+ // todo:
+ // ../../node_modules/@chakra-ui/menu/dist/declarations/src/use-menu.d.ts:986:61 - error TS2694: Namespace '"node_modules/csstype/index".Property' has no exported member 'ColorAdjust'.
+ "skipLibCheck": true
+ },
+ "references": [
+ {
+ "path": "../src"
+ },
+ {
+ "path": "../../snapshot-tests"
+ }
+ ]
+}
diff --git a/packages/chakra-ui/tsconfig.json b/packages/chakra-ui/tsconfig.json
index 0230c34710..82462dfbeb 100644
--- a/packages/chakra-ui/tsconfig.json
+++ b/packages/chakra-ui/tsconfig.json
@@ -1,13 +1,12 @@
{
"extends": "../../tsconfig.base.json",
- "include": ["src"],
- "compilerOptions": {
- "rootDir": "./src",
- "outDir": "./lib",
- "baseUrl": "./",
- "jsx": "react-jsx",
- // There are type errors in @chakra-ui/menu type definitions because of which skipLibCheck had to be added
- // @chakra-ui/menu/dist/declarations/src/use-menu.d.ts:986:61 - error TS2694: Namespace '"node_modules/csstype/index".Property' has no exported member 'ColorAdjust'.
- "skipLibCheck": true
- }
+ "files": [],
+ "references": [
+ {
+ "path": "./src"
+ },
+ {
+ "path": "./test"
+ }
+ ]
}
diff --git a/packages/core/package.json b/packages/core/package.json
index 4634d82fab..84c230e7b1 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -3,13 +3,13 @@
"version": "5.13.6",
"description": "A simple React component capable of building HTML forms out of a JSON schema.",
"scripts": {
- "build:ts": "rimraf lib && tsc",
+ "build:ts": "tsc -b",
"build:cjs": "esbuild ./src/index.ts --bundle --outfile=dist/index.js --sourcemap --packages=external --format=cjs",
"build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/index.esm.js --sourcemap --packages=external --format=esm",
"build:umd": "rollup dist/index.esm.js --format=umd --file=dist/core.umd.js --name=JSONSchemaForm",
- "build": "rimraf dist && npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
- "cs-check": "prettier -l \"{src,test,testSnap}/**/*.[jt]s?(x)\"",
- "cs-format": "prettier \"{src,test,testSnap}/**/*.[jt]s?(x)\" --write",
+ "build": "npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
+ "cs-check": "prettier -l \"{src,test}/**/*.[jt]s?(x)\"",
+ "cs-format": "prettier \"{src,test}/**/*.[jt]s?(x)\" --write",
"lint": "eslint src test",
"precommit": "lint-staged",
"publish-to-npm": "npm run build && npm publish",
@@ -20,7 +20,7 @@
"test-coverage": "jest --coverage"
},
"lint-staged": {
- "{src,test,testSnap}/**/*.[jt]s?(x)": [
+ "{src,test}/**/*.[jt]s?(x)": [
"eslint --fix"
]
},
@@ -54,9 +54,11 @@
"@babel/preset-env": "^7.22.15",
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv6": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/lodash": "^4.14.198",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
diff --git a/packages/core/src/tsconfig.json b/packages/core/src/tsconfig.json
new file mode 100644
index 0000000000..d2e6a35741
--- /dev/null
+++ b/packages/core/src/tsconfig.json
@@ -0,0 +1,23 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "include": [
+ "./"
+ ],
+ "compilerOptions": {
+ "rootDir": "./",
+ "outDir": "../lib",
+ "baseUrl": "../",
+ "jsx": "react-jsx"
+ },
+ "references": [
+ {
+ "path": "../../utils"
+ },
+ {
+ "path": "../../validator-ajv6"
+ },
+ {
+ "path": "../../validator-ajv8"
+ }
+ ]
+}
diff --git a/packages/core/test/ArraySnap.test.jsx b/packages/core/test/ArraySnap.test.jsx
index 540590fe99..93046e87f1 100644
--- a/packages/core/test/ArraySnap.test.jsx
+++ b/packages/core/test/ArraySnap.test.jsx
@@ -1,4 +1,4 @@
import Form from '../src';
-import arrayTests from '../testSnap/arrayTests';
+import { arrayTests } from '@rjsf/snapshot-tests';
arrayTests(Form);
diff --git a/packages/core/test/FormSnap.test.jsx b/packages/core/test/FormSnap.test.jsx
index 19ed866c93..65498a69b4 100644
--- a/packages/core/test/FormSnap.test.jsx
+++ b/packages/core/test/FormSnap.test.jsx
@@ -1,4 +1,4 @@
import Form from '../src';
-import formTests from '../testSnap/formTests';
+import { formTests } from '@rjsf/snapshot-tests';
formTests(Form);
diff --git a/packages/core/test/ObjectSnap.test.jsx b/packages/core/test/ObjectSnap.test.jsx
index 45f4895a62..3721817572 100644
--- a/packages/core/test/ObjectSnap.test.jsx
+++ b/packages/core/test/ObjectSnap.test.jsx
@@ -1,4 +1,4 @@
import Form from '../src';
-import objectTests from '../testSnap/objectTests';
+import { objectTests } from '@rjsf/snapshot-tests';
objectTests(Form);
diff --git a/packages/core/test/tsconfig.json b/packages/core/test/tsconfig.json
new file mode 100644
index 0000000000..3655ccd74d
--- /dev/null
+++ b/packages/core/test/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "include": ["./"],
+ "compilerOptions": {
+ "rootDir": "./",
+ "baseUrl": "../",
+ "noEmit": true,
+ "jsx": "react-jsx"
+ },
+ "references": [
+ {
+ "path": "../src"
+ },
+ {
+ "path": "../../snapshot-tests"
+ },
+ ]
+}
diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json
index 0786a3f6bf..82462dfbeb 100644
--- a/packages/core/tsconfig.json
+++ b/packages/core/tsconfig.json
@@ -1,10 +1,12 @@
{
"extends": "../../tsconfig.base.json",
- "include": ["src"],
- "compilerOptions": {
- "rootDir": "./src",
- "outDir": "./lib",
- "baseUrl": "./",
- "jsx": "react-jsx"
- }
+ "files": [],
+ "references": [
+ {
+ "path": "./src"
+ },
+ {
+ "path": "./test"
+ }
+ ]
}
diff --git a/packages/docs/docs/contributing.md b/packages/docs/docs/contributing.md
index 4f0fc2bac8..99fcb0145c 100644
--- a/packages/docs/docs/contributing.md
+++ b/packages/docs/docs/contributing.md
@@ -73,9 +73,9 @@ There are functions in the `testSnap` directory: `arrayTests`, `formTests` and `
Each theme will basically run these functions by creating a `Xxx.test.tsx` file (where `Xxx` is `Array`, `Form` or `Object`) that looks like the following:
```tsx
-import arrayTests from '@rjsf/core/testSnap/arrayTests'; // OR
-// import arrayTests from '@rjsf/core/testSnap/formTests'
-// import arrayTests from '@rjsf/core/testSnap/objectTests'
+import { arrayTests } from '@rjsf/snapshot-tests'; // OR
+// import { formTests } from '@rjsf/snapshot-tests';
+// import { objectTests } from '@rjsf/snapshot-tests';
import Form from '../src';
@@ -90,7 +90,7 @@ For example:
```tsx
import { RJSFSchema, UiSchema } from '@rjsf/utils';
-import arrayTests from '@rjsf/core/testSnap/formTests';
+import { arrayTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/fluent-ui/package.json b/packages/fluent-ui/package.json
index 03cbd58f65..a12f86cdc3 100644
--- a/packages/fluent-ui/package.json
+++ b/packages/fluent-ui/package.json
@@ -11,11 +11,11 @@
"src"
],
"scripts": {
- "build:ts": "rimraf lib && tsc",
+ "build:ts": "tsc -b",
"build:cjs": "esbuild ./src/index.ts --bundle --outfile=dist/index.js --sourcemap --packages=external --format=cjs",
"build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/fluent-ui.esm.js --sourcemap --packages=external --format=esm",
"build:umd": "rollup dist/fluent-ui.esm.js --format=umd --file=dist/fluent-ui.umd.js --name=@rjsf/fluent-ui",
- "build": "rimraf dist && npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
+ "build": "npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
"cs-check": "prettier -l \"{src,test}/**/*.ts?(x)\"",
"cs-format": "prettier \"{src,test}/**/*.ts?(x)\" --write",
"lint": "eslint src test",
@@ -47,8 +47,10 @@
"@babel/preset-typescript": "^7.22.15",
"@fluentui/react": "^8.111.2",
"@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/lodash": "^4.14.198",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
diff --git a/packages/fluent-ui/src/tsconfig.json b/packages/fluent-ui/src/tsconfig.json
new file mode 100644
index 0000000000..36a20a539a
--- /dev/null
+++ b/packages/fluent-ui/src/tsconfig.json
@@ -0,0 +1,29 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "include": [
+ "./"
+ ],
+ "compilerOptions": {
+ "rootDir": "./",
+ "outDir": "../lib",
+ "baseUrl": "../",
+ "jsx": "react-jsx",
+ // There are type errors in @fluentui type definitions because of which skipLibCheck had to be added
+ // @fluentui/font-icons-mdl2/lib/IconNames.d.ts
+ // @fluentui/merge-styles/lib/mergeStyleSets.d.ts
+ // @fluentui/react/lib/components/SelectedItemsList/BaseSelectedItemsList.d.ts
+ // @fluentui/utilities/lib/styled.d.ts
+ "skipLibCheck": true
+ },
+ "references": [
+ {
+ "path": "../../core"
+ },
+ {
+ "path": "../../utils"
+ },
+ {
+ "path": "../../validator-ajv8"
+ }
+ ]
+}
diff --git a/packages/fluent-ui/test/Array.test.tsx b/packages/fluent-ui/test/Array.test.tsx
index 7709a7a692..a17060201a 100644
--- a/packages/fluent-ui/test/Array.test.tsx
+++ b/packages/fluent-ui/test/Array.test.tsx
@@ -1,4 +1,4 @@
-import arrayTests from '@rjsf/core/testSnap/arrayTests';
+import { arrayTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/fluent-ui/test/Form.test.tsx b/packages/fluent-ui/test/Form.test.tsx
index 8aac502b3e..c96826c914 100644
--- a/packages/fluent-ui/test/Form.test.tsx
+++ b/packages/fluent-ui/test/Form.test.tsx
@@ -1,4 +1,4 @@
-import formTests from '@rjsf/core/testSnap/formTests';
+import { formTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/fluent-ui/test/Object.test.tsx b/packages/fluent-ui/test/Object.test.tsx
index 3caaa69282..dabe023e32 100644
--- a/packages/fluent-ui/test/Object.test.tsx
+++ b/packages/fluent-ui/test/Object.test.tsx
@@ -1,4 +1,4 @@
-import objectTests from '@rjsf/core/testSnap/objectTests';
+import { objectTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/fluent-ui/test/tsconfig.json b/packages/fluent-ui/test/tsconfig.json
new file mode 100644
index 0000000000..5db560d2c3
--- /dev/null
+++ b/packages/fluent-ui/test/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "include": ["./"],
+ "compilerOptions": {
+ "rootDir": "./",
+ "baseUrl": "../",
+ "noEmit": true,
+ "jsx": "react-jsx"
+ },
+ "references": [
+ {
+ "path": "../src"
+ },
+ {
+ "path": "../../snapshot-tests"
+ }
+ ]
+}
diff --git a/packages/fluent-ui/tsconfig.json b/packages/fluent-ui/tsconfig.json
index 9738c553a3..82462dfbeb 100644
--- a/packages/fluent-ui/tsconfig.json
+++ b/packages/fluent-ui/tsconfig.json
@@ -1,16 +1,12 @@
{
"extends": "../../tsconfig.base.json",
- "include": ["src"],
- "compilerOptions": {
- "rootDir": "./src",
- "outDir": "./lib",
- "baseUrl": "./",
- "jsx": "react-jsx",
- // There are type errors in @fluentui type definitions because of which skipLibCheck had to be added
- // @fluentui/font-icons-mdl2/lib/IconNames.d.ts
- // @fluentui/merge-styles/lib/mergeStyleSets.d.ts
- // @fluentui/react/lib/components/SelectedItemsList/BaseSelectedItemsList.d.ts
- // @fluentui/utilities/lib/styled.d.ts
- "skipLibCheck": true
- }
+ "files": [],
+ "references": [
+ {
+ "path": "./src"
+ },
+ {
+ "path": "./test"
+ }
+ ]
}
diff --git a/packages/fluentui-rc/package.json b/packages/fluentui-rc/package.json
index a3384d1c76..7563e48c0e 100644
--- a/packages/fluentui-rc/package.json
+++ b/packages/fluentui-rc/package.json
@@ -3,11 +3,11 @@
"version": "5.13.6",
"description": "FluentUI React Components theme, fields and widgets for react-jsonschema-form",
"scripts": {
- "build:ts": "rimraf lib && tsc",
+ "build:ts": "tsc -b",
"build:cjs": "esbuild ./src/index.ts --bundle --outfile=dist/index.js --sourcemap --packages=external --format=cjs",
"build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/index.esm.js --sourcemap --packages=external --format=esm",
"build:umd": "rollup dist/index.esm.js --format=umd --file=dist/core.umd.js --name=JSONSchemaForm",
- "build": "rimraf dist && npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
+ "build": "npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
"cs-check": "prettier -l \"{src,test,testSnap}/**/*.[jt]s?(x)\"",
"cs-format": "prettier \"{src,test,testSnap}/**/*.[jt]s?(x)\" --write",
"lint": "eslint src test",
@@ -20,9 +20,8 @@
"test-coverage": "jest --coverage"
},
"lint-staged": {
- "{src,test,testSnap}/**/*.[jt]s?(x)": [
- "eslint --fix",
- "prettier --write"
+ "{src,test}/**/*.[jt]s?(x)": [
+ "eslint --fix"
]
},
"main": "dist/index.js",
@@ -53,28 +52,24 @@
"@babel/preset-env": "^7.22.15",
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.15",
- "@rjsf/core": "^5.13.2",
- "@rjsf/utils": "^5.13.0",
- "@rjsf/validator-ajv8": "^5.13.0",
+ "@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
+ "@rjsf/utils": "^5.13.6",
+ "@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
"@types/react-test-renderer": "^17.0.3",
- "ajv": "^8.12.0",
"babel-jest": "^29.6.4",
- "chai": "^3.5.0",
"esbuild": "^0.18.20",
"eslint": "^8.48.0",
"jest": "^29.6.4",
"jest-environment-jsdom": "^29.6.4",
- "jsdom": "^20.0.3",
- "mocha": "^10.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
- "react-portal": "^4.2.2",
"react-test-renderer": "^17.0.2",
"rimraf": "^5.0.1",
"rollup": "^3.29.0",
- "sinon": "^9.2.4",
"typescript": "^4.9.5"
},
"directories": {
diff --git a/packages/fluentui-rc/test/Array.test.tsx b/packages/fluentui-rc/test/Array.test.tsx
index 7709a7a692..a17060201a 100644
--- a/packages/fluentui-rc/test/Array.test.tsx
+++ b/packages/fluentui-rc/test/Array.test.tsx
@@ -1,4 +1,4 @@
-import arrayTests from '@rjsf/core/testSnap/arrayTests';
+import { arrayTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/fluentui-rc/test/Form.test.tsx b/packages/fluentui-rc/test/Form.test.tsx
index 8aac502b3e..c96826c914 100644
--- a/packages/fluentui-rc/test/Form.test.tsx
+++ b/packages/fluentui-rc/test/Form.test.tsx
@@ -1,4 +1,4 @@
-import formTests from '@rjsf/core/testSnap/formTests';
+import { formTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/fluentui-rc/test/Object.test.tsx b/packages/fluentui-rc/test/Object.test.tsx
index 3caaa69282..dabe023e32 100644
--- a/packages/fluentui-rc/test/Object.test.tsx
+++ b/packages/fluentui-rc/test/Object.test.tsx
@@ -1,4 +1,4 @@
-import objectTests from '@rjsf/core/testSnap/objectTests';
+import { objectTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/fluentui-rc/tsconfig.json b/packages/fluentui-rc/tsconfig.json
index a0a7c6e7bd..77e127b0ed 100644
--- a/packages/fluentui-rc/tsconfig.json
+++ b/packages/fluentui-rc/tsconfig.json
@@ -7,5 +7,16 @@
"baseUrl": "./",
"jsx": "react-jsx",
"skipLibCheck": true
- }
+ },
+ "references": [
+ {
+ "path": "../core"
+ },
+ {
+ "path": "../utils"
+ },
+ {
+ "path": "../validator-ajv8"
+ }
+ ]
}
diff --git a/packages/material-ui/package.json b/packages/material-ui/package.json
index 4c9b912c46..2ba3dfbb5d 100644
--- a/packages/material-ui/package.json
+++ b/packages/material-ui/package.json
@@ -11,11 +11,11 @@
"src"
],
"scripts": {
- "build:ts": "rimraf lib && tsc",
+ "build:ts": "tsc -b",
"build:cjs": "esbuild ./src/index.ts --bundle --outfile=dist/index.js --sourcemap --packages=external --format=cjs",
"build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/material-ui.esm.js --sourcemap --packages=external --format=esm",
"build:umd": "rollup dist/material-ui.esm.js --format=umd --file=dist/material-ui.umd.js --name=@rjsf/material-ui",
- "build": "rimraf dist && npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
+ "build": "npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
"cs-check": "prettier -l \"{src,test}/**/*.ts?(x)\"",
"cs-format": "prettier \"{src,test}/**/*.ts?(x)\" --write",
"lint": "eslint src test",
@@ -48,8 +48,10 @@
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3",
"@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
"@types/react-test-renderer": "^17.0.3",
diff --git a/packages/material-ui/src/tsconfig.json b/packages/material-ui/src/tsconfig.json
new file mode 100644
index 0000000000..01834bf1ab
--- /dev/null
+++ b/packages/material-ui/src/tsconfig.json
@@ -0,0 +1,23 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "include": [
+ "./"
+ ],
+ "compilerOptions": {
+ "rootDir": "./",
+ "outDir": "../lib",
+ "baseUrl": "../",
+ "jsx": "react-jsx"
+ },
+ "references": [
+ {
+ "path": "../../core"
+ },
+ {
+ "path": "../../utils"
+ },
+ {
+ "path": "../../validator-ajv8"
+ }
+ ]
+}
diff --git a/packages/material-ui/test/Array.test.tsx b/packages/material-ui/test/Array.test.tsx
index 7709a7a692..a17060201a 100644
--- a/packages/material-ui/test/Array.test.tsx
+++ b/packages/material-ui/test/Array.test.tsx
@@ -1,4 +1,4 @@
-import arrayTests from '@rjsf/core/testSnap/arrayTests';
+import { arrayTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/material-ui/test/Form.test.tsx b/packages/material-ui/test/Form.test.tsx
index 6829f8aa97..bdcb9b0bdd 100644
--- a/packages/material-ui/test/Form.test.tsx
+++ b/packages/material-ui/test/Form.test.tsx
@@ -1,4 +1,4 @@
-import formTests, { SLIDER_CUSTOMIZE } from '@rjsf/core/testSnap/formTests';
+import { formTests, SLIDER_CUSTOMIZE } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/material-ui/test/Object.test.tsx b/packages/material-ui/test/Object.test.tsx
index 3caaa69282..dabe023e32 100644
--- a/packages/material-ui/test/Object.test.tsx
+++ b/packages/material-ui/test/Object.test.tsx
@@ -1,4 +1,4 @@
-import objectTests from '@rjsf/core/testSnap/objectTests';
+import { objectTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/material-ui/test/tsconfig.json b/packages/material-ui/test/tsconfig.json
new file mode 100644
index 0000000000..5db560d2c3
--- /dev/null
+++ b/packages/material-ui/test/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "include": ["./"],
+ "compilerOptions": {
+ "rootDir": "./",
+ "baseUrl": "../",
+ "noEmit": true,
+ "jsx": "react-jsx"
+ },
+ "references": [
+ {
+ "path": "../src"
+ },
+ {
+ "path": "../../snapshot-tests"
+ }
+ ]
+}
diff --git a/packages/material-ui/tsconfig.json b/packages/material-ui/tsconfig.json
index 0786a3f6bf..82462dfbeb 100644
--- a/packages/material-ui/tsconfig.json
+++ b/packages/material-ui/tsconfig.json
@@ -1,10 +1,12 @@
{
"extends": "../../tsconfig.base.json",
- "include": ["src"],
- "compilerOptions": {
- "rootDir": "./src",
- "outDir": "./lib",
- "baseUrl": "./",
- "jsx": "react-jsx"
- }
+ "files": [],
+ "references": [
+ {
+ "path": "./src"
+ },
+ {
+ "path": "./test"
+ }
+ ]
}
diff --git a/packages/mui/package.json b/packages/mui/package.json
index 37fa1a1cb6..e8bc300c17 100644
--- a/packages/mui/package.json
+++ b/packages/mui/package.json
@@ -11,11 +11,11 @@
"src"
],
"scripts": {
- "build:ts": "rimraf lib && tsc",
+ "build:ts": "tsc -b",
"build:cjs": "esbuild ./src/index.ts --bundle --outfile=dist/index.js --sourcemap --packages=external --format=cjs",
"build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/mui.esm.js --sourcemap --packages=external --format=esm",
"build:umd": "rollup dist/mui.esm.js --format=umd --file=dist/mui.umd.js --name=@rjsf/mui",
- "build": "rimraf dist && npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
+ "build": "npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
"cs-check": "prettier -l \"{src,test}/**/*.ts?(x)\"",
"cs-format": "prettier \"{src,test}/**/*.ts?(x)\" --write",
"lint": "eslint src test",
@@ -53,8 +53,10 @@
"@mui/icons-material": "^5.14.8",
"@mui/material": "^5.14.8",
"@rjsf/core": "^5.13.6",
+ "@rjsf/snapshot-tests": "^5.13.6",
"@rjsf/utils": "^5.13.6",
"@rjsf/validator-ajv8": "^5.13.6",
+ "@types/jest": "^29.5.7",
"@types/react": "^17.0.65",
"@types/react-dom": "^17.0.20",
"@types/react-test-renderer": "^17.0.3",
diff --git a/packages/mui/src/tsconfig.json b/packages/mui/src/tsconfig.json
new file mode 100644
index 0000000000..01834bf1ab
--- /dev/null
+++ b/packages/mui/src/tsconfig.json
@@ -0,0 +1,23 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "include": [
+ "./"
+ ],
+ "compilerOptions": {
+ "rootDir": "./",
+ "outDir": "../lib",
+ "baseUrl": "../",
+ "jsx": "react-jsx"
+ },
+ "references": [
+ {
+ "path": "../../core"
+ },
+ {
+ "path": "../../utils"
+ },
+ {
+ "path": "../../validator-ajv8"
+ }
+ ]
+}
diff --git a/packages/mui/test/Array.test.tsx b/packages/mui/test/Array.test.tsx
index 7709a7a692..a17060201a 100644
--- a/packages/mui/test/Array.test.tsx
+++ b/packages/mui/test/Array.test.tsx
@@ -1,4 +1,4 @@
-import arrayTests from '@rjsf/core/testSnap/arrayTests';
+import { arrayTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/mui/test/Form.test.tsx b/packages/mui/test/Form.test.tsx
index 444a933de5..fdc2b75b9e 100644
--- a/packages/mui/test/Form.test.tsx
+++ b/packages/mui/test/Form.test.tsx
@@ -1,4 +1,4 @@
-import formTests, { SLIDER_CUSTOMIZE, TEXTAREA_CUSTOMIZE } from '@rjsf/core/testSnap/formTests';
+import { formTests, SLIDER_CUSTOMIZE, TEXTAREA_CUSTOMIZE } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/mui/test/Object.test.tsx b/packages/mui/test/Object.test.tsx
index 3caaa69282..dabe023e32 100644
--- a/packages/mui/test/Object.test.tsx
+++ b/packages/mui/test/Object.test.tsx
@@ -1,4 +1,4 @@
-import objectTests from '@rjsf/core/testSnap/objectTests';
+import { objectTests } from '@rjsf/snapshot-tests';
import Form from '../src';
diff --git a/packages/mui/test/tsconfig.json b/packages/mui/test/tsconfig.json
new file mode 100644
index 0000000000..5db560d2c3
--- /dev/null
+++ b/packages/mui/test/tsconfig.json
@@ -0,0 +1,18 @@
+{
+ "extends": "../../../tsconfig.base.json",
+ "include": ["./"],
+ "compilerOptions": {
+ "rootDir": "./",
+ "baseUrl": "../",
+ "noEmit": true,
+ "jsx": "react-jsx"
+ },
+ "references": [
+ {
+ "path": "../src"
+ },
+ {
+ "path": "../../snapshot-tests"
+ }
+ ]
+}
diff --git a/packages/mui/tsconfig.json b/packages/mui/tsconfig.json
index 0786a3f6bf..82462dfbeb 100644
--- a/packages/mui/tsconfig.json
+++ b/packages/mui/tsconfig.json
@@ -1,10 +1,12 @@
{
"extends": "../../tsconfig.base.json",
- "include": ["src"],
- "compilerOptions": {
- "rootDir": "./src",
- "outDir": "./lib",
- "baseUrl": "./",
- "jsx": "react-jsx"
- }
+ "files": [],
+ "references": [
+ {
+ "path": "./src"
+ },
+ {
+ "path": "./test"
+ }
+ ]
}
diff --git a/packages/playground/package.json b/packages/playground/package.json
index 7bbc813eaf..b35857ce2e 100644
--- a/packages/playground/package.json
+++ b/packages/playground/package.json
@@ -105,6 +105,7 @@
"react-transform-hmr": "^1.0.4",
"rimraf": "^5.0.1",
"source-map-loader": "^4.0.1",
+ "typescript": "^4.9.5",
"vite": "^4.4.9"
},
"directories": {
diff --git a/packages/playground/src/app.tsx b/packages/playground/src/app.tsx
index 20cd676f3d..43ccb289d9 100644
--- a/packages/playground/src/app.tsx
+++ b/packages/playground/src/app.tsx
@@ -14,6 +14,7 @@ import Ajv2020 from 'ajv/dist/2020.js';
import Layout from './layout';
import Playground, { PlaygroundProps } from './components';
+// @ts-expect-error todo: error TS2345: Argument of type 'Localize' is not assignable to parameter of type 'Localizer'.
const esV8Validator = customizeValidator({}, localize_es);
const AJV8_2019 = customizeValidator({ AjvClass: Ajv2019 });
const AJV8_2020 = customizeValidator({ AjvClass: Ajv2020 });
diff --git a/packages/playground/src/components/Playground.tsx b/packages/playground/src/components/Playground.tsx
index 2f7a8d7840..8152d003e8 100644
--- a/packages/playground/src/components/Playground.tsx
+++ b/packages/playground/src/components/Playground.tsx
@@ -20,7 +20,7 @@ export interface PlaygroundProps {
export default function Playground({ themes, validators }: PlaygroundProps) {
const [loaded, setLoaded] = useState(false);
const [schema, setSchema] = useState
+
+
+
+
+
+ A set of snapshot tests to be used for testing RJSF themes.
+
+@rjsf/snapshot-tests
+
+
+ Explore the docs »
+
+
+ View Playground
+ ·
+ Report Bug
+ ·
+ Request Feature
+