Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Move `base64` encode/decoder object to playground, remove from utils
- Add test script and config to playground
  • Loading branch information
nickgros committed Feb 16, 2024
1 parent 67f9c48 commit 3125910
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 38 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ should change the heading of the (upcoming) version to include a major version b

- Added support for `UiSchema` `"ui:rows"` option for `textarea` elements, fixing [#4070](https://github.com/rjsf-team/react-jsonschema-form/issues/4070).

# @rjsf/utils

- [#4080](https://github.com/rjsf-team/react-jsonschema-form/issues/4080) - BREAKING CHANGE: Removed the `base64` object from the `@rjsf/utils` package. Note that this is a breaking change if you relied on the `base64` object exported by `@rjsf/utils`. Since this change caused [#4080](https://github.com/rjsf-team/react-jsonschema-form/issues/4080), and was only internally used by playground code, we are shipping this change in a patch release.

## Dev / docs / playground

- [#4080](https://github.com/rjsf-team/react-jsonschema-form/issues/4080) - Moved the `base64` encoder/decoder object to the Playground package.
- Added test configuration and script to the Playground.


# 5.17.0

## @rjsf/core
Expand Down
2 changes: 2 additions & 0 deletions package-lock.json

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

30 changes: 0 additions & 30 deletions packages/playground/.babelrc

This file was deleted.

3 changes: 3 additions & 0 deletions packages/playground/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const defaultConfig = require('../../babel.config');

module.exports = defaultConfig;
6 changes: 6 additions & 0 deletions packages/playground/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
verbose: true,
testEnvironment: 'jsdom',
testMatch: ['**/test/**/*.test.[jt]s?(x)'],
transformIgnorePatterns: [`/node_modules/(?!nanoid)`],
};
7 changes: 5 additions & 2 deletions packages/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "5.17.0",
"description": "rjsf playground",
"private": true,
"type": "module",
"type": "commonjs",
"scripts": {
"cs-check": "prettier -l \"src/**/*.ts?(x)\"",
"cs-format": "prettier \"src/**/*.ts?(x)\" --write",
Expand All @@ -13,7 +13,8 @@
"publish-to-gh-pages": "npm run build && gh-pages --dist build/",
"publish-to-npm": "npm run build && npm publish",
"start": "vite --force",
"preview": "vite preview"
"preview": "vite preview",
"test": "jest"
},
"lint-staged": {
"src/**/*.ts?(x)": [
Expand Down Expand Up @@ -100,6 +101,8 @@
"gh-pages": "^3.2.3",
"html": "^1.0.0",
"html-webpack-plugin": "^5.6.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"loader-utils": "^3.2.1",
"mini-css-extract-plugin": "^2.8.0",
"prettier": "^2.8.8",
Expand Down
3 changes: 2 additions & 1 deletion packages/playground/src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useCallback } from 'react';
import Form, { IChangeEvent } from '@rjsf/core';
import { base64, RJSFSchema, UiSchema, ValidatorType } from '@rjsf/utils';
import { RJSFSchema, UiSchema, ValidatorType } from '@rjsf/utils';
import localValidator from '@rjsf/validator-ajv8';
import base64 from '../utils/base64';

import CopyLink from './CopyLink';
import ThemeSelector, { ThemesType } from './ThemeSelector';
Expand Down
3 changes: 2 additions & 1 deletion packages/playground/src/components/Playground.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ComponentType, FormEvent, useCallback, useEffect, useRef, useState } from 'react';
import { FormProps, IChangeEvent, withTheme } from '@rjsf/core';
import { base64, ErrorSchema, RJSFSchema, RJSFValidationError, UiSchema, ValidatorType } from '@rjsf/utils';
import { ErrorSchema, RJSFSchema, RJSFValidationError, UiSchema, ValidatorType } from '@rjsf/utils';
import base64 from '../utils/base64';

import { samples } from '../samples';
import Header, { LiveSettings } from './Header';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { base64 } from '../src';
import base64 from '../../src/utils/base64';

describe('base64', () => {
it('should successfully encode a ascii character', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"jsx": "react-jsx",
"types": ["vite/client"]
},
"include": ["src"],
"include": ["src", "test"],
"references": [
{ "path": "../antd" },
{ "path": "../bootstrap-4" },
Expand Down
2 changes: 0 additions & 2 deletions packages/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import utcToLocal from './utcToLocal';
import validationDataMerge from './validationDataMerge';
import withIdRefPrefix from './withIdRefPrefix';
import getOptionMatchingSimpleDiscriminator from './getOptionMatchingSimpleDiscriminator';
import base64 from './base64';

export * from './types';
export * from './enums';
Expand Down Expand Up @@ -121,5 +120,4 @@ export {
utcToLocal,
validationDataMerge,
withIdRefPrefix,
base64,
};

0 comments on commit 3125910

Please sign in to comment.