Skip to content

Commit fbe9a3a

Browse files
authored
Merge pull request #17 from openscript/develop
Upgrade dependencies
2 parents 9764aa6 + 0121d2c commit fbe9a3a

9 files changed

+2591
-2758
lines changed

.storybook/main.js

+9-15
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
module.exports = {
22
stories: [
3-
'../docs/**/*.stories.([tj]sx|mdx)',
4-
'../src/**/*.stories.([tj]sx|mdx)'
3+
'../docs/start.stories.mdx',
4+
'../src/**/*.stories.@([tj]sx|mdx)',
5+
'../docs/**/*.stories.@([tj]sx|mdx)'
56
],
67
addons: [
7-
'@storybook/preset-typescript',
88
'@storybook/addon-actions/register',
9-
'@storybook/addon-storysource',
10-
'@storybook/addon-docs'
11-
],
12-
webpackFinal: async config => {
13-
config.module.rules.push({
14-
test: /\.(ts|tsx)$/,
15-
loader: require.resolve('babel-loader'),
9+
'@storybook/addon-storysource',
10+
{
11+
name: '@storybook/addon-docs',
1612
options: {
17-
presets: [['react-app', { flow: false, typescript: true }]],
13+
configureJSX: true,
1814
},
19-
});
20-
config.resolve.extensions.push('.ts', '.tsx');
21-
return config;
22-
},
15+
}
16+
]
2317
};

docs/antd-integration.stories.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Meta, Description, Source } from '@storybook/addon-docs/blocks';
22
import Readme from '../README.md';
33

4-
<Meta title="Usage|Integrations/Ant Design" />
4+
<Meta title="Integrations/Ant Design" />
55

66
# Ant Design integration
77
This page shows how an input and a preview component with Ant Design (`>= 4`) can be built and connected to this component.

docs/material-integration.stories.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Meta, Description, Source } from '@storybook/addon-docs/blocks';
22

3-
<Meta title="Usage|Integrations/Material UI" />
3+
<Meta title="Integrations/Material UI" />
44

55
# Material UI integration
66
This page shows how an input and a preview component with Material UI can be built and connected to this component. It's possible to put everything into one file.

docs/start.stories.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Meta, Description } from '@storybook/addon-docs/blocks';
22
import Readme from '../README.md';
33

4-
<Meta title="Start|Readme" />
4+
<Meta title="Start" />
55

66
<Description markdown={Readme} />

package.json

+25-26
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,47 @@
77
"react"
88
],
99
"homepage": "https://openscript.github.io/react-dsv-import/",
10-
"version": "0.3.4",
10+
"version": "0.3.5",
1111
"main": "dist/index.js",
1212
"module": "dist/es/index.js",
1313
"types": "dist/index.d.ts",
14-
"dependencies": {},
1514
"devDependencies": {
16-
"@babel/core": "^7.10.2",
15+
"@babel/core": "^7.10.5",
1716
"@emotion/core": "^10.0.28",
1817
"@emotion/styled": "^10.0.27",
19-
"@rollup/plugin-typescript": "^4.1.2",
20-
"@storybook/addon-actions": "^5.3.19",
21-
"@storybook/addon-docs": "^5.3.19",
22-
"@storybook/addon-info": "^5.3.19",
23-
"@storybook/addon-links": "^5.3.19",
24-
"@storybook/addon-storysource": "^5.3.19",
25-
"@storybook/addons": "^5.3.19",
26-
"@storybook/preset-typescript": "^3.0.0",
27-
"@storybook/react": "^5.3.19",
28-
"@testing-library/jest-dom": "^5.9.0",
29-
"@testing-library/react": "^10.2.1",
18+
"@rollup/plugin-typescript": "^5.0.2",
19+
"@storybook/addon-actions": "^6.0.0-rc.5",
20+
"@storybook/addon-docs": "^6.0.0-rc.5",
21+
"@storybook/addon-links": "^6.0.0-rc.5",
22+
"@storybook/addon-storysource": "^6.0.0-rc.5",
23+
"@storybook/addons": "^6.0.0-rc.5",
24+
"@storybook/react": "^6.0.0-rc.5",
25+
"@testing-library/jest-dom": "^5.11.1",
26+
"@testing-library/react": "^10.4.7",
3027
"@testing-library/react-hooks": "^3.3.0",
31-
"@types/jest": "^25.2.3",
32-
"@types/node": "^14.0.11",
33-
"@types/react": "^16.9.35",
28+
"@types/jest": "^26.0.4",
29+
"@types/node": "^14.0.23",
30+
"@types/react": "^16.9.43",
3431
"@types/react-dom": "^16.9.8",
35-
"@typescript-eslint/eslint-plugin": "^3.1.0",
36-
"@typescript-eslint/parser": "^3.1.0",
32+
"@typescript-eslint/eslint-plugin": "^3.6.1",
33+
"@typescript-eslint/parser": "^3.6.1",
3734
"babel-loader": "^8.1.0",
3835
"babel-preset-react-app": "^9.1.2",
39-
"eslint": "^7.2.0",
36+
"eslint": "^7.4.0",
4037
"eslint-config-prettier": "^6.11.0",
41-
"eslint-plugin-prettier": "^3.1.3",
42-
"eslint-plugin-react": "^7.20.0",
43-
"jest": "^26.0.1",
38+
"eslint-plugin-prettier": "^3.1.4",
39+
"eslint-plugin-react": "^7.20.3",
40+
"jest": "^26.1.0",
4441
"prettier": "^2.0.5",
42+
"react-docgen": "^5.3.0",
4543
"react-is": "^16.13.1",
4644
"react-test-renderer": "^16.13.1",
47-
"rollup": "^2.15.0",
48-
"ts-jest": "^26.1.0",
45+
"rollup": "^2.21.0",
46+
"ts-jest": "^26.1.2",
47+
"ts-loader": "^8.0.1",
4948
"ts-node": "^8.10.2",
5049
"tslib": "^2.0.0",
51-
"typescript": "^3.9.5"
50+
"typescript": "^3.9.6"
5251
},
5352
"scripts": {
5453
"build": "yarn build:rollup",

src/DSVImport.stories.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import { DSVImport, ColumnType } from './';
33
import { action } from '@storybook/addon-actions';
44
import styled from '@emotion/styled';
55

6-
export default { title: 'Usage|Examples' };
6+
export default {
7+
title: 'Components/DSVImport',
8+
component: DSVImport,
9+
parameters: {
10+
componentSubtitle: 'Wrapping component'
11+
}
12+
};
713

814
type BasicType = { forename: string; surname: string; email: string };
915

@@ -22,7 +28,7 @@ export const BasicUsage = () => {
2228
</DSVImport>
2329
);
2430
};
25-
BasicUsage.story = { name: 'Basic usage' };
31+
BasicUsage.story = { name: 'Basic usage', parameters: { docs: { storyDescription: 'Hello' } } };
2632

2733
export const UsingOnChangeCallback = () => {
2834
const columns: ColumnType<BasicType>[] = [

src/DSVImport.tsx

+19-4
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,29 @@ const EventListener = <T extends GenericColumnType>(props: EventListenerProps<T>
3232
return null;
3333
};
3434

35-
export interface Props<T> {
35+
export type Props<T> = {
36+
/**
37+
* Description of the expected columns
38+
*/
3639
columns: ColumnType<T>[];
40+
/**
41+
* Callback which is called after parsing the input
42+
*/
3743
onChange?: (value: T[]) => void;
44+
/**
45+
* Callback which is called if there are validation errors
46+
*/
3847
onValidation?: (errors: ValidationError<T>[]) => void;
48+
/**
49+
* Globally applied transformers
50+
*/
3951
transformers?: Transformer[];
40-
}
52+
};
4153

42-
export const DSVImport = <T extends GenericColumnType>(props: PropsWithChildren<Props<T>>) => {
54+
/**
55+
* Hello
56+
*/
57+
export function DSVImport<T extends GenericColumnType>(props: PropsWithChildren<Props<T>>) {
4358
const DSVImportContext = getDSVImportContext<T>();
4459
const initialValues: State<T> = { columns: props.columns, transformers: props.transformers };
4560
const [state, dispatch] = useReducer(createReducer<T>(), initialValues);
@@ -57,4 +72,4 @@ export const DSVImport = <T extends GenericColumnType>(props: PropsWithChildren<
5772
{props.children}
5873
</DSVImportContext.Provider>
5974
);
60-
};
75+
}

src/middlewares/middleware.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const applyMiddlewares = <T, A>(state: State<T>, dispatch: Dispatch<A>, .
1818
nextMiddlewares.forEach((m, i) => {
1919
m(state, next(without(nextMiddlewares, i)), value);
2020
});
21-
}
21+
};
2222

2323
call(middlewares, action);
2424
};

0 commit comments

Comments
 (0)