Skip to content

Undo ajv8 alias and fix Vite dev server #3371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ it according to semantic versioning. For example, if your PR adds a breaking cha
should change the heading of the (upcoming) version to include a major version bump.

-->
# 5.0.0-beta-17

## @rjsf/playground
- Change Vite `preserveSymlinks` to `true`, which provides an alternative fix for [#3228](https://github.com/rjsf-team/react-jsonschema-form/issues/3228) since the prior fix caused [#3215](https://github.com/rjsf-team/react-jsonschema-form/issues/3215).

## @rjsf/validator-ajv8
- Remove alias for ajv -> ajv8 in package.json. This fixes [#3215](https://github.com/rjsf-team/react-jsonschema-form/issues/3215).

# 5.0.0-beta-16

## @rjsf/antd
Expand Down
1 change: 1 addition & 0 deletions packages/playground/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default defineConfig({
}, // maintain the old webpack behavior in dev
plugins: [react()],
resolve: {
preserveSymlinks: true, // Fixes https://github.com/rjsf-team/react-jsonschema-form/issues/3228
alias: {
// The following is needed to allow the material ui v4 and v5 themes to properly load the css
"@mui/styles": path.resolve("./node_modules", "@mui/styles"),
Expand Down
29 changes: 1 addition & 28 deletions packages/validator-ajv8/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/validator-ajv8/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"dependencies": {
"ajv-formats": "^2.1.1",
"ajv8": "npm:ajv@^8.11.0",
"ajv": "^8.11.0",
"lodash": "^4.17.15",
"lodash-es": "^4.17.15"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/validator-ajv8/src/createAjvInstance.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Ajv, { Options } from "ajv8";
import Ajv, { Options } from "ajv";
import addFormats, { FormatsPluginOptions } from "ajv-formats";
import isObject from "lodash/isObject";

Expand Down
2 changes: 1 addition & 1 deletion packages/validator-ajv8/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Ajv, { Options, ErrorObject } from "ajv8";
import Ajv, { Options, ErrorObject } from "ajv";
import { FormatsPluginOptions } from "ajv-formats";

/** The type describing how to customize the AJV6 validator
Expand Down
2 changes: 1 addition & 1 deletion packages/validator-ajv8/src/validator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Ajv, { ErrorObject, ValidateFunction } from "ajv8";
import Ajv, { ErrorObject, ValidateFunction } from "ajv";
import toPath from "lodash/toPath";
import isObject from "lodash/isObject";
import clone from "lodash/clone";
Expand Down
8 changes: 4 additions & 4 deletions packages/validator-ajv8/test/createAjvInstance.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Ajv from "ajv8";
import Ajv2019 from "ajv8/dist/2019";
import Ajv from "ajv";
import Ajv2019 from "ajv/dist/2019";
import addFormats from "ajv-formats";

import createAjvInstance, {
Expand All @@ -9,8 +9,8 @@ import createAjvInstance, {
} from "../src/createAjvInstance";
import { CustomValidatorOptionsType } from "../src";

jest.mock("ajv8");
jest.mock("ajv8/dist/2019");
jest.mock("ajv");
jest.mock("ajv/dist/2019");
jest.mock("ajv-formats");

export const CUSTOM_OPTIONS: CustomValidatorOptionsType = {
Expand Down