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

typescript declarations emit #4375

Closed
wants to merge 2 commits into from
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
23 changes: 13 additions & 10 deletions examples/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"ra-input-rich-text": "^3.0.0",
"ra-language-english": "^3.0.0",
"ra-language-french": "^3.0.0",
"react": "^16.9.0",
"react": "^16.12.0",
"react-admin": "^3.0.0",
"react-app-polyfill": "^1.0.4",
"react-dom": "^16.9.0",
"react-redux": "^7.1.0",
"react-router": "^5.1.0",
"react-router-dom": "^5.1.0",
"react-scripts": "^3.0.0",
"react-dom": "^16.12.0",
"react-redux": "^7.1.3",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.3.1",
"recompose": "~0.26.0",
"redux-saga": "^1.0.0"
},
Expand All @@ -46,9 +46,12 @@
"@types/jest": "^24.0.23",
"@types/node": "^12.12.14",
"@types/query-string": "5.1.0",
"@types/react": "^16.9.13",
"@types/react-dom": "^16.9.4",
"source-map-explorer": "^2.0.0",
"typescript": "^3.7.2"
"@types/react": "^16.9.19",
"@types/react-dom": "^16.9.5",
"@types/react-redux": "^7.1.7",
"@typescript-eslint/eslint-plugin": "^2.19.0",
"@typescript-eslint/parser": "^2.19.0",
"source-map-explorer": "^2.2.2",
"typescript": "^3.7.5"
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const useEditStyles = makeStyles({
root: { alignItems: 'flex-start' },
});

const OrderEdit = props => {
const OrderEdit = (/** @type {any} */ props) => {
const classes = useEditStyles();
return (
<Edit
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion examples/demo/src/react-admin.d.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions examples/demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"allowJs": false,
"checkJs": false,
"skipLibCheck": false,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
// "noImplicitAny": false,
// "strictNullChecks": false,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
Expand Down
22 changes: 11 additions & 11 deletions examples/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
"author": "",
"license": "MIT",
"devDependencies": {
"@babel/cli": "^7.1.2",
"@babel/core": "^7.1.2",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.1.0",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.4",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"@babel/preset-react": "^7.8.3",
"@babel/preset-typescript": "^7.8.3",
"babel-loader": "^8.0.4",
"hard-source-webpack-plugin": "^0.11.2",
"html-loader": "~0.5.5",
Expand All @@ -34,16 +34,16 @@
"webpack-dev-server": "~3.1.11"
},
"dependencies": {
"@babel/polyfill": "^7.0.0",
"@babel/polyfill": "^7.8.3",
"@material-ui/core": "^4.9.0",
"@material-ui/icons": "^4.5.1",
"ra-data-fakerest": "^3.0.0",
"ra-i18n-polyglot": "^3.0.0",
"ra-input-rich-text": "^3.0.0",
"ra-language-english": "^3.0.0",
"ra-language-french": "^3.0.0",
"react": "^16.9.0",
"react": "^16.12.0",
"react-admin": "^3.0.0",
"react-dom": "^16.9.0"
"react-dom": "^16.12.0"
}
}
4 changes: 2 additions & 2 deletions examples/tutorial/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"dependencies": {
"@material-ui/core": "^4.9.0",
"ra-data-json-server": "^3.0.0",
"react": "^16.9.0",
"react": "^16.12.0",
"react-admin": "^3.0.0",
"react-dom": "^16.9.0",
"react-dom": "^16.12.0",
"react-scripts": "^3.0.0"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@
"cypress"
],
"dependencies": {
"typescript": "^3.5.3"
"typescript": "^3.7.5"
}
}
14 changes: 7 additions & 7 deletions packages/ra-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
"watch": "rimraf ./lib && tsc --watch"
},
"devDependencies": {
"@redux-saga/testing-utils": "^1.0.2",
"@types/history": "^4.7.2",
"@redux-saga/testing-utils": "^1.1.3",
"@types/history": "^4.7.5",
"@types/node-polyglot": "^0.4.31",
"@types/query-string": "5.1.0",
"@types/react-redux": "^7.1.1",
"@types/react-router": "^5.1.0",
"@types/react-router-dom": "^5.1.0",
"@types/react-redux": "^7.1.7",
"@types/react-router": "^5.1.4",
"@types/react-router-dom": "^5.1.3",
"@types/recompose": "^0.27.0",
"connected-react-router": "^6.5.2",
"cross-env": "^5.2.0",
Expand All @@ -49,8 +49,8 @@
"react-router": "^5.1.0",
"react-router-dom": "^5.1.0",
"react-test-renderer": "^16.9.0",
"redux": "^3.7.2 || ^4.0.3",
"redux-saga": "^1.0.0",
"redux": "^4.0.5",
"redux-saga": "^1.1.3",
"rimraf": "^2.6.3"
},
"peerDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/ra-ui-materialui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"watch": "rimraf ./lib && tsc --watch"
},
"devDependencies": {
"@material-ui/core": "^4.3.3",
"@material-ui/icons": "^4.2.1",
"@material-ui/styles": "^4.3.3",
"@material-ui/core": "^4.9.1",
"@material-ui/icons": "^4.9.1",
"@material-ui/styles": "^4.9.0",
"@testing-library/react": "^8.0.7",
"@types/query-string": "5.1.0",
"cross-env": "^5.2.0",
Expand All @@ -47,7 +47,7 @@
"react-router": "^5.1.0",
"react-router-dom": "^5.1.0",
"react-test-renderer": "~16.8.6",
"redux": "^3.7.2 || ^4.0.3",
"redux": "^4.0.5",
"rimraf": "^2.6.3"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import defaultTheme from '../defaultTheme';
import Notification from '../layout/Notification';
import DefaultLoginForm from './LoginForm';

interface Props {
export interface Props {
backgroundImage?: string;
children: ReactNode;
classes?: object;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/auth/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import CircularProgress from '@material-ui/core/CircularProgress';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { useTranslate, useLogin, useNotify, useSafeSetState } from 'ra-core';

interface Props {
export interface Props {
redirectTo?: string;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/auth/Logout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ExitIcon from '@material-ui/icons/PowerSettingsNew';
import classnames from 'classnames';
import { useTranslate, useLogout } from 'ra-core';

interface Props {
export interface Props {
className?: string;
redirectTo?: string;
icon?: ReactElement;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/button/BulkExportButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const sanitizeRestProps = ({
'exporter' | 'selectedIds' | 'resource' | 'label'
>) => rest;

interface Props {
export interface Props {
basePath?: string;
exporter?: (
data: any,
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const useStyles = makeStyles(
{ name: 'RaButton' }
);

interface Props {
export interface Props {
alignIcon?: 'left' | 'right';
children?: ReactElement;
classes?: object;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/button/CloneButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const sanitizeRestProps = ({
...rest
}: any) => rest;

interface Props {
export interface Props {
basePath?: string;
record?: Record;
icon?: ReactElement;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/button/CreateButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const useStyles = makeStyles(
{ name: 'RaCreateButton' }
);

interface Props {
export interface Props {
basePath?: string;
icon?: ReactElement;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/button/DeleteButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const DeleteButton: FC<DeleteButtonProps> = ({ undoable, ...props }) =>
<DeleteWithConfirmButton {...props} />
);

interface Props {
export interface Props {
basePath?: string;
classes?: object;
className?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const useStyles = makeStyles(
{ name: 'RaDeleteWithConfirmButton' }
);

interface Props {
export interface Props {
basePath?: string;
classes?: object;
className?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const useStyles = makeStyles(
{ name: 'RaDeleteWithUndoButton' }
);

interface Props {
export interface Props {
basePath?: string;
classes?: object;
className?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/button/EditButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const defaultIcon = <ContentCreate />;
// useful to prevent click bubbling in a datagrid with rowClick
const stopPropagation = e => e.stopPropagation();

interface Props {
export interface Props {
basePath?: string;
record?: Record;
icon?: ReactElement;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/button/ExportButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const sanitizeRestProps = ({
'sort' | 'filter' | 'maxResults' | 'resource' | 'label'
>) => rest;

interface Props {
export interface Props {
basePath?: string;
exporter?: (
data: any,
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/button/ListButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ListButton: FC<ListButtonProps> = ({

const defaultIcon = <ActionList />;

interface Props {
export interface Props {
basePath?: string;
icon?: ReactElement;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/button/RefreshButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const RefreshButton: FC<RefreshButtonProps> = ({

const defaultIcon = <NavigationRefresh />;

interface Props {
export interface Props {
label?: string;
icon?: ReactElement;
onClick?: (e: MouseEvent) => void;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/button/RefreshIconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const RefreshIconButton: FC<RefreshIconProps> = ({

const defaultIcon = <NavigationRefresh />;

interface Props {
export interface Props {
className?: string;
icon?: ReactElement;
label?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/button/SaveButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const sanitizeRestProps = ({
...rest
}: SaveButtonProps) => rest;

interface Props {
export interface Props {
classes?: object;
className?: string;
handleSubmitWithRedirect?: (redirect?: RedirectionSideEffect) => void;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/button/ShowButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const defaultIcon = <ImageEye />;
// useful to prevent click bubbling in a datagrid with rowClick
const stopPropagation = e => e.stopPropagation();

interface Props {
export interface Props {
basePath?: string;
record?: Record;
icon?: ReactElement;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/BooleanField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useTranslate } from 'ra-core';
import { FieldProps, InjectedFieldProps, fieldPropTypes } from './types';
import sanitizeRestProps from './sanitizeRestProps';

interface Props extends FieldProps {
export interface Props extends FieldProps {
valueLabelTrue?: string;
valueLabelFalse?: string;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/DateField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const toLocaleStringSupportsLocales = (() => {
return false;
})();

interface Props extends FieldProps {
export interface Props extends FieldProps {
locales?: string | string[];
options?: object;
showTime?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/FileField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const useStyles = makeStyles(
{ name: 'RaFileField' }
);

interface Props extends FieldProps {
export interface Props extends FieldProps {
src?: string;
title?: string;
target?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/FunctionField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Typography, { TypographyProps } from '@material-ui/core/Typography';
import sanitizeRestProps from './sanitizeRestProps';
import { FieldProps, InjectedFieldProps, fieldPropTypes } from './types';

interface Props extends FieldProps {
export interface Props extends FieldProps {
render: (record: object, source: string) => any;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/ImageField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const useStyles = makeStyles(
{ name: 'RaImageField' }
);

interface Props extends FieldProps {
export interface Props extends FieldProps {
src?: string;
title?: string;
classes?: object;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/NumberField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const hasNumberFormat = !!(
typeof Intl.NumberFormat === 'function'
);

interface Props extends FieldProps {
export interface Props extends FieldProps {
locales?: string | string[];
options?: object;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/RichTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { InjectedFieldProps, FieldProps, fieldPropTypes } from './types';
export const removeTags = (input: string) =>
input ? input.replace(/<[^>]+>/gm, '') : '';

interface Props extends FieldProps {
export interface Props extends FieldProps {
stripTags: boolean;
}

Expand Down
Loading