Skip to content
This repository was archived by the owner on Jun 27, 2020. It is now read-only.
This repository was archived by the owner on Jun 27, 2020. It is now read-only.

Creating a new Dummy plugin #2

@StevePain

Description

@StevePain

Hi there

I am new to supersert and very interested in understanding how front end plugins work.

I followed the guide reported here:
https://github.com/apache-superset/superset-ui-plugins-template

I just wanted to add another "dummy" plugin,
so i copied the /packages/superset-ui-plugin-chart-dummy/
in another folder:
/packages/another/

then

i copied the
/packages/superset-ui-plugins-demo/storybook/stories/plugin-chart-dummy/
in
/packages/superset-ui-plugins-demo/storybook/stories/another/

and in stories/another/index.js i did:
new DummyChartPlugin().configure({ key: 'anotherdummy' }).register();

then i run yarn storybook, only to get such errors:

ERROR in ../another/src/transformProps.ts 21:49
Module parse failed: Unexpected token (21:49)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| * under the License.
| */

export default function transformProps(chartProps: ChartProps) {
| const { width, height, formData, queryData } = chartProps;
| const { color } = formData;
@ ../another/src/index.ts 21:0-46 35:6-20
@ ./storybook/stories/another/index.js
@ ./storybook/stories sync index.jsx?$
@ ./storybook/stories/index.js
@ ./.storybook/config.js
@ multi /home/stevepain/superset-ui-plugins-template/node_modules/@storybook/core/dist/server/common/polyfills.js /home/stevepain/superset-ui-plugins-template/node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/config.js (webpack)-hot-middleware/client.js?reload=true&quiet=true

ERROR in ../another/src/DummyChart.tsx 21:7
Module parse failed: Unexpected token (21:7)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import React from 'react';
|

export type DummyChartProps = {
| height: number;
| width: number;
@ ../another/src/index.ts 33:23-45
@ ./storybook/stories/another/index.js
@ ./storybook/stories sync index.jsx?$
@ ./storybook/stories/index.js
@ ./.storybook/config.js
@ multi /home/stevepain/superset-ui-plugins-template/node_modules/@storybook/core/dist/server/common/polyfills.js /home/stevepain/superset-ui-plugins-template/node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/config.js (webpack)-hot-middleware/client.js?reload=true&quiet=true

what am i doing wrong?

thank you
Steve

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions