From 3f820e5409e954ae0a42f5d239b0bf47af71d6e8 Mon Sep 17 00:00:00 2001 From: Anurag Date: Thu, 1 Oct 2020 13:48:25 +0530 Subject: [PATCH 1/3] build: ignore __examples__ folder --- babel-config.js | 2 +- tsconfig.json | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/babel-config.js b/babel-config.js index 5ff355129..e276b7784 100644 --- a/babel-config.js +++ b/babel-config.js @@ -27,5 +27,5 @@ module.exports = { }, ], ].filter(Boolean), - ignore: ["**/*/__tests__", "**/*/stories"], + ignore: ["**/*/__tests__", "**/*/stories", "**/*/__examples__"], }; diff --git a/tsconfig.json b/tsconfig.json index bb3a8dc1a..98e1bca17 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,5 +22,11 @@ "resolveJsonModule": true, "types": ["node", "jest", "@testing-library/jest-dom"] }, - "exclude": ["node_modules", "dist", "**/*/stories", "**/*/__tests__"] + "exclude": [ + "node_modules", + "dist", + "**/*/stories", + "**/*/__tests__", + "**/*/__examples__" + ] } From c84a8460df24a5133ceb32afd415ce308c2887ff Mon Sep 17 00:00:00 2001 From: Anurag Date: Thu, 1 Oct 2020 13:58:22 +0530 Subject: [PATCH 2/3] refactor: move storybook progress utils --- src/meter/__examples__/stories/CircularMeter.stories.tsx | 5 ++++- src/progress/stories/CircularProgress.stories.tsx | 5 ++++- src/progress/stories/LinearProgress.stories.tsx | 2 +- .../stories/storybook-progress-utils.tsx} | 0 src/utils/index.ts | 2 -- 5 files changed, 9 insertions(+), 5 deletions(-) rename src/{utils/storybook/index.tsx => progress/stories/storybook-progress-utils.tsx} (100%) diff --git a/src/meter/__examples__/stories/CircularMeter.stories.tsx b/src/meter/__examples__/stories/CircularMeter.stories.tsx index fae735bf7..fa544561e 100644 --- a/src/meter/__examples__/stories/CircularMeter.stories.tsx +++ b/src/meter/__examples__/stories/CircularMeter.stories.tsx @@ -3,7 +3,10 @@ import { Meta } from "@storybook/react"; import { Meter } from "../../Meter"; import { useMeterState } from "../../index"; -import { useFakeProgression, createCircularExample } from "../../../utils"; +import { + useFakeProgression, + createCircularExample, +} from "../../../progress/stories/storybook-progress-utils"; export default { title: "Component/Meter/Circular", diff --git a/src/progress/stories/CircularProgress.stories.tsx b/src/progress/stories/CircularProgress.stories.tsx index b31f44bfd..a4597f283 100644 --- a/src/progress/stories/CircularProgress.stories.tsx +++ b/src/progress/stories/CircularProgress.stories.tsx @@ -3,7 +3,10 @@ import { Meta } from "@storybook/react"; import { Progress } from "../Progress"; import { useProgressState } from "../ProgressState"; -import { useFakeProgression, createCircularExample } from "../../utils"; +import { + useFakeProgression, + createCircularExample, +} from "./storybook-progress-utils"; export default { title: "Component/Progress/Circular", diff --git a/src/progress/stories/LinearProgress.stories.tsx b/src/progress/stories/LinearProgress.stories.tsx index 93f1567cd..873862f37 100644 --- a/src/progress/stories/LinearProgress.stories.tsx +++ b/src/progress/stories/LinearProgress.stories.tsx @@ -9,7 +9,7 @@ import { generateStripe, progressBarStyle, createLinearExamples, -} from "../../utils"; +} from "./storybook-progress-utils"; export default { title: "Component/Progress/Linear", diff --git a/src/utils/storybook/index.tsx b/src/progress/stories/storybook-progress-utils.tsx similarity index 100% rename from src/utils/storybook/index.tsx rename to src/progress/stories/storybook-progress-utils.tsx diff --git a/src/utils/index.ts b/src/utils/index.ts index f4e4d758f..c10fc269c 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -19,5 +19,3 @@ export function clampValue(value: number, min: number, max: number) { return Math.min(Math.max(value, min), max); } - -export * from "./storybook"; From b60d91f409bb3cc8dad0f53a7f692c73c06562a0 Mon Sep 17 00:00:00 2001 From: Anurag Date: Thu, 1 Oct 2020 14:13:11 +0530 Subject: [PATCH 3/3] fix: fix broken tests --- src/meter/__examples__/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meter/__examples__/index.tsx b/src/meter/__examples__/index.tsx index e7cfa6240..0dddbd627 100644 --- a/src/meter/__examples__/index.tsx +++ b/src/meter/__examples__/index.tsx @@ -1,9 +1,9 @@ import * as React from "react"; import { css, cx, keyframes } from "emotion"; -import { generateStripe } from "../../utils"; import { MeterStateReturn } from "../MeterState"; import { Meter, useMeterState, UseMeterProps } from "../index"; +import { generateStripe } from "../../progress/stories/storybook-progress-utils"; export const MeterComp: React.FC = props => { const { value, low, high, optimum, min, max, ...rest } = props;