From be04310810e730d8a551b9d8e98b6ea69aa31a8d Mon Sep 17 00:00:00 2001 From: James Date: Thu, 24 Dec 2020 10:28:41 -0500 Subject: [PATCH] flattens dist folder --- auth.d.ts | 2 +- auth.js | 2 +- bin.js | 2 +- config.d.ts | 4 ++-- config.js | 2 +- errors.js | 2 +- package.json | 6 ++--- .../RadioGroup/RadioInput/index.tsx | 22 ++----------------- .../RadioGroup/RadioInput/types.ts | 9 ++++++++ tsconfig.json | 2 +- types.d.ts | 2 +- types.js | 2 +- 12 files changed, 24 insertions(+), 33 deletions(-) create mode 100644 src/admin/components/forms/field-types/RadioGroup/RadioInput/types.ts diff --git a/auth.d.ts b/auth.d.ts index a553523fa0..2128052614 100644 --- a/auth.d.ts +++ b/auth.d.ts @@ -1 +1 @@ -export * from './dist/src/auth'; +export * from './dist/auth'; diff --git a/auth.js b/auth.js index 28c1e42558..111985a3a0 100644 --- a/auth.js +++ b/auth.js @@ -1 +1 @@ -module.exports = require('./dist/src/auth'); +module.exports = require('./dist/auth'); diff --git a/bin.js b/bin.js index 317b4712e6..86541f4154 100755 --- a/bin.js +++ b/bin.js @@ -1,2 +1,2 @@ #!/usr/bin/env node -require('./dist/src/bin'); +require('./dist/bin'); diff --git a/config.d.ts b/config.d.ts index 65e94d1529..ae147d4692 100644 --- a/config.d.ts +++ b/config.d.ts @@ -1,2 +1,2 @@ -export { buildConfig } from './dist/src/config/build'; -export * from './dist/src/config/types'; +export { buildConfig } from './dist/config/build'; +export * from './dist/config/types'; diff --git a/config.js b/config.js index 90e02f8e1e..7175995485 100644 --- a/config.js +++ b/config.js @@ -1 +1 @@ -exports.buildConfig = require('./dist/src/config/build').buildConfig; +exports.buildConfig = require('./dist/config/build').buildConfig; diff --git a/errors.js b/errors.js index e42732f69b..d242e03069 100644 --- a/errors.js +++ b/errors.js @@ -1,4 +1,4 @@ -const { APIError, Forbidden } = require('./dist/src/errors'); +const { APIError, Forbidden } = require('./dist/errors'); module.exports = { APIError, diff --git a/package.json b/package.json index 34aa5da46b..0d83a615ae 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "CMS and Application Framework", "license": "ISC", "author": "Payload CMS LLC", - "main": "./dist/src/index.js", - "typings": "./dist/src/index.d.ts", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", "sideEffects": false, "bin": { "payload": "./bin.js" @@ -13,7 +13,7 @@ "scripts": { "copyfiles": "copyfiles src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png} dist/", "build:components": "webpack --config src/webpack/components.config.js", - "build": "cross-env PAYLOAD_CONFIG_PATH=demo/payload.config.ts node dist/src/bin/build", + "build": "cross-env PAYLOAD_CONFIG_PATH=demo/payload.config.ts node dist/bin/build", "build:tsc": "tsc", "build:watch": "nodemon --watch 'src/**' --ext 'ts' --exec 'yarn build:tsc'", "build:analyze": "cross-env PAYLOAD_CONFIG_PATH=demo/payload.config.js PAYLOAD_ANALYZE_BUNDLE=true node src/bin/build", diff --git a/src/admin/components/forms/field-types/RadioGroup/RadioInput/index.tsx b/src/admin/components/forms/field-types/RadioGroup/RadioInput/index.tsx index 95dfa8ae44..c0fa71c382 100644 --- a/src/admin/components/forms/field-types/RadioGroup/RadioInput/index.tsx +++ b/src/admin/components/forms/field-types/RadioGroup/RadioInput/index.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import PropTypes from 'prop-types'; +import { Props } from './types'; import './index.scss'; const baseClass = 'radio-input'; -const RadioInput = (props) => { +const RadioInput: React.FC = (props) => { const { isSelected, option, onChange, path } = props; const classes = [ @@ -33,22 +33,4 @@ const RadioInput = (props) => { ); }; -RadioInput.defaultProps = { - isSelected: false, - onChange: undefined, -}; - -RadioInput.propTypes = { - isSelected: PropTypes.bool, - option: PropTypes.shape({ - label: PropTypes.string, - value: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.number, - ]), - }).isRequired, - onChange: PropTypes.func, - path: PropTypes.string.isRequired, -}; - export default RadioInput; diff --git a/src/admin/components/forms/field-types/RadioGroup/RadioInput/types.ts b/src/admin/components/forms/field-types/RadioGroup/RadioInput/types.ts new file mode 100644 index 0000000000..38ac30a71a --- /dev/null +++ b/src/admin/components/forms/field-types/RadioGroup/RadioInput/types.ts @@ -0,0 +1,9 @@ +export type Props = { + isSelected: boolean + option: { + label: string + value: string + } + onChange: (val: string) => void + path: string +} diff --git a/tsconfig.json b/tsconfig.json index 8a71a8ad96..d503931fe7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -38,7 +38,7 @@ "dist", "build", "tests", - "**/*.spec.ts", + "**/*.spec.js", "node_modules" ] } diff --git a/types.d.ts b/types.d.ts index 06cf1c1543..7236c51a0f 100644 --- a/types.d.ts +++ b/types.d.ts @@ -1 +1 @@ -export * from './dist/src/types'; +export * from './dist/types'; diff --git a/types.js b/types.js index ccbd847171..d94f7183d0 100644 --- a/types.js +++ b/types.js @@ -1 +1 @@ -module.exports = require('./dist/src/types'); +module.exports = require('./dist/types');