Skip to content
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

Update core to use utils and validator #2908

Closed
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
500 changes: 0 additions & 500 deletions packages/core/index.d.ts

This file was deleted.

45,728 changes: 17,524 additions & 28,204 deletions packages/core/package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "4.2.0",
"description": "A simple React component capable of building HTML forms out of a JSON schema.",
"scripts": {
"build": "rimraf dist && tsdx build --format cjs,es && cross-env NODE_ENV=production BABEL_ENV=umd webpack --config webpack.config.dist.js",
"build-umd": "cross-env NODE_ENV=production BABEL_ENV=umd webpack --config webpack.config.dist.js",
"build": "rimraf dist && tsdx build --format cjs,es && npm run build-umd",
"cs-check": "prettier -l \"{src,test}/**/*.js\"",
"cs-format": "prettier \"{src,test}/**/*.js\" --write",
"lint": "eslint src test",
Expand All @@ -24,11 +25,10 @@
},
"main": "dist/index.js",
"module": "dist/core.esm.js",
"typings": "index.d.ts",
"typings": "dist/index.d.ts",
"files": [
"dist",
"lib",
"index.d.ts"
"lib"
],
"engineStrict": false,
"engines": {
Expand All @@ -38,16 +38,11 @@
"react": ">=16 || >=17"
},
"dependencies": {
"@types/json-schema": "^7.0.7",
"ajv": "^6.7.0",
"core-js-pure": "^3.6.5",
"json-schema-merge-allof": "^0.6.0",
"jsonpointer": "^5.0.0",
"@rjsf/utils": "^4.2.0",
"lodash": "^4.17.15",
"lodash-es": "^4.17.15",
"nanoid": "^3.1.23",
"prop-types": "^15.7.2",
"react-is": "16.9.0"
"prop-types": "^15.7.2"
},
"devDependencies": {
"@babel/cli": "^7.4.4",
Expand All @@ -59,10 +54,14 @@
"@babel/preset-env": "^7.4.5",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.4.4",
"@rjsf/utils": "^4.2.0",
"@rjsf/validator-ajv6": "^4.2.0",
"@types/lodash": "^4.14.182",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"ajv": "^6.7.0",
"atob": "^2.0.3",
"babel-loader": "^8.0.6",
"chai": "^3.3.0",
Expand Down Expand Up @@ -97,6 +96,7 @@
"rimraf": "^2.5.4",
"sinon": "^9.0.2",
"style-loader": "^2.0.0",
"tsdx": "^0.14.1",
"webpack-cli": "^3.1.2",
"webpack-dev-middleware": "^3.4.0",
"webpack-hot-middleware": "^2.13.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import React from "react";
import IconButton from "./IconButton";
import React from 'react';

export default function AddButton({ className, onClick, disabled }) {
import IconButton from './IconButton';

export interface AddButtonProps {
className?: string;
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
disabled?: boolean;
}

export default function AddButton({ className, onClick, disabled }: AddButtonProps) {
return (
<div className="row">
<p className={`col-xs-3 col-xs-offset-9 text-right ${className}`}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from "react";
import React from 'react';
import { ErrorListProps, RJSFValidationError } from '@rjsf/utils';

export default function ErrorList(props) {
const { errors } = props;
export default function ErrorList<T = any>({ errors }: ErrorListProps<T>) {
return (
<div className="panel panel-danger errors">
<div className="panel-heading">
<h3 className="panel-title">Errors</h3>
</div>
<ul className="list-group">
{errors.map((error, i) => {
{errors.map((error: RJSFValidationError, i: number) => {
return (
<li key={i} className="list-group-item text-danger">
{error.stack}
Expand Down
Loading