Skip to content

Commit

Permalink
typescript project references (#3782)
Browse files Browse the repository at this point in the history
* move snapTests from core to separate package

* nx fix cycle

* wip references

* ts project references config for tests

* @types/jest

* ts-ignore

* fix types for withIdRefPrefix

* type fixes around some deepFreeze usages

* cleanup

* add readme for snapshots-test

* update changelog

* random type fixes

* more type fixes in playground

* update changelog

* update readme for snapshots package

* update readme for snapshots package
  • Loading branch information
zxbodya authored Nov 10, 2023
1 parent 86e484c commit 6769a9e
Show file tree
Hide file tree
Showing 105 changed files with 1,028 additions and 236 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,6 @@ coverage
venv
*.orig
out/

# typescript tsbuildinfo
*.tsbuildinfo
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
95 changes: 60 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"packages/semantic-ui",
"packages/utils",
"packages/validator-ajv6",
"packages/validator-ajv8"
"packages/validator-ajv8",
"packages/snapshot-tests"
]
}
6 changes: 4 additions & 2 deletions packages/antd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
23 changes: 23 additions & 0 deletions packages/antd/src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
2 changes: 1 addition & 1 deletion packages/antd/test/Array.test.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/antd/test/Form.test.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/antd/test/Object.test.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
18 changes: 18 additions & 0 deletions packages/antd/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": "../../../tsconfig.base.json",
"include": ["./"],
"compilerOptions": {
"rootDir": "./",
"baseUrl": "../",
"noEmit": true,
"jsx": "react-jsx"
},
"references": [
{
"path": "../src"
},
{
"path": "../../snapshot-tests"
}
]
}
Loading

0 comments on commit 6769a9e

Please sign in to comment.