From a3f55a8fb41ca48a97b581a7b186401fb1bc604e Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Tue, 24 Dec 2024 15:20:44 +0100 Subject: [PATCH 1/2] Update dependencies and package structure to support ESM --- .github/workflows/test.yml | 4 - examples/vite/.storybook/main.ts | 2 +- examples/vite/src/stories/Button.stories.tsx | 11 +- examples/vite/src/stories/Header.stories.tsx | 11 +- examples/vite/src/stories/Page.stories.tsx | 7 +- examples/vite/yarn.lock | 47 +- examples/webpack5/.storybook/main.ts | 4 +- examples/webpack5/stories/Button.stories.tsx | 29 +- examples/webpack5/stories/Header.stories.tsx | 19 +- examples/webpack5/stories/Page.stories.tsx | 19 +- package.json | 46 +- preset.js | 2 +- src/loader/webpack5-istanbul-loader.ts | 4 +- src/preset.ts | 6 +- tsconfig.json | 2 +- tsup.config.ts | 23 + yarn.lock | 5738 ++++++------------ 17 files changed, 1926 insertions(+), 4048 deletions(-) create mode 100644 tsup.config.ts diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c064d6b..73a363b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,3 @@ jobs: yarn test-storybook:ci-coverage working-directory: examples/vite - - name: Generate code coverage - uses: codecov/codecov-action@v3 - with: - verbose: true diff --git a/examples/vite/.storybook/main.ts b/examples/vite/.storybook/main.ts index 0ea9e0c..567faf0 100644 --- a/examples/vite/.storybook/main.ts +++ b/examples/vite/.storybook/main.ts @@ -1,5 +1,5 @@ export default { - stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], + stories: ["../src/**/*.stories.@(js|jsx|ts|tsx)"], addons: [ "@storybook/addon-essentials", diff --git a/examples/vite/src/stories/Button.stories.tsx b/examples/vite/src/stories/Button.stories.tsx index f410b98..e0f7cc8 100644 --- a/examples/vite/src/stories/Button.stories.tsx +++ b/examples/vite/src/stories/Button.stories.tsx @@ -1,6 +1,7 @@ import type { StoryFn, Meta } from "@storybook/react"; import { Button } from "./Button"; +import { expect } from "@storybook/test"; // More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export export default { @@ -13,9 +14,7 @@ export default { } as Meta; // More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args -const Template: StoryFn = (args) => ( -