From 39091b07adcd7fbf272cee87c1a3e89cfe1bfa5a Mon Sep 17 00:00:00 2001 From: Josh Black Date: Mon, 25 Oct 2021 12:33:04 -0500 Subject: [PATCH] chore(react): update to exclude stories from folders labeled next (#9920) * chore(react): update to exclude stories from folders labeled next * chore(react): update popover story to next format Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/carbon-react/.storybook/main.js | 2 ++ packages/react/.storybook/main.js | 17 ++++++++++++----- packages/react/package.json | 1 + .../components/Popover/{ => next}/Popover.mdx | 0 .../Popover.stories.js} | 6 +++--- .../components/Popover/{ => next}/story.scss | 0 yarn.lock | 1 + 7 files changed, 19 insertions(+), 8 deletions(-) rename packages/react/src/components/Popover/{ => next}/Popover.mdx (100%) rename packages/react/src/components/Popover/{Popover-story.js => next/Popover.stories.js} (98%) rename packages/react/src/components/Popover/{ => next}/story.scss (100%) diff --git a/packages/carbon-react/.storybook/main.js b/packages/carbon-react/.storybook/main.js index 2530061da1fe..1b77be58e536 100644 --- a/packages/carbon-react/.storybook/main.js +++ b/packages/carbon-react/.storybook/main.js @@ -28,6 +28,8 @@ module.exports = { './Welcome/Welcome.stories.js', '../src/**/*.stories.js', '../src/**/*.stories.mdx', + '../../react/src/**/next/*.stories.js', + '../../react/src/**/next/*.stories.mdx', ], webpack(config) { const babelLoader = config.module.rules.find((rule) => { diff --git a/packages/react/.storybook/main.js b/packages/react/.storybook/main.js index 41be2da8f11c..03822fcaf028 100644 --- a/packages/react/.storybook/main.js +++ b/packages/react/.storybook/main.js @@ -7,6 +7,7 @@ 'use strict'; +const glob = require('fast-glob'); const path = require('path'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const customProperties = require('postcss-custom-properties'); @@ -36,11 +37,17 @@ module.exports = { require.resolve('./addon-theme/register'), ], - stories: [ - './Welcome/Welcome.stories.js', - '../src/**/*-story.js', - '../src/**/*.stories.mdx', - ], + stories: glob.sync( + [ + './Welcome/Welcome.stories.js', + '../src/**/*-story.js', + '../src/**/*.stories.mdx', + ], + { + cwd: __dirname, + ignore: ['../**/next/**'], + } + ), webpack(config) { const babelLoader = config.module.rules.find((rule) => { diff --git a/packages/react/package.json b/packages/react/package.json index 4bf686a4db43..a71ebdda58c4 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -110,6 +110,7 @@ "css-loader": "^3.4.2", "cypress": "^8.1.0", "cypress-real-events": "^1.5.1", + "fast-glob": "^3.2.7", "fast-sass-loader": "^1.5.0", "gzip-size": "^6.0.0", "lcov2badge": "^0.1.0", diff --git a/packages/react/src/components/Popover/Popover.mdx b/packages/react/src/components/Popover/next/Popover.mdx similarity index 100% rename from packages/react/src/components/Popover/Popover.mdx rename to packages/react/src/components/Popover/next/Popover.mdx diff --git a/packages/react/src/components/Popover/Popover-story.js b/packages/react/src/components/Popover/next/Popover.stories.js similarity index 98% rename from packages/react/src/components/Popover/Popover-story.js rename to packages/react/src/components/Popover/next/Popover.stories.js index b7dc31515a9a..318fcf0f3b41 100644 --- a/packages/react/src/components/Popover/Popover-story.js +++ b/packages/react/src/components/Popover/next/Popover.stories.js @@ -14,10 +14,10 @@ import { } from '@carbon/icons-react'; import { withKnobs, boolean, select } from '@storybook/addon-knobs'; import React from 'react'; -import { Popover, PopoverContent } from '../Popover'; -import Button from '../Button'; +import { Popover, PopoverContent } from '../../Popover'; +import Button from '../../Button'; import mdx from './Popover.mdx'; -import { useOutsideClick } from '../../internal/useOutsideClick'; +import { useOutsideClick } from '../../../internal/useOutsideClick'; export default { title: 'Experimental/unstable_Popover', diff --git a/packages/react/src/components/Popover/story.scss b/packages/react/src/components/Popover/next/story.scss similarity index 100% rename from packages/react/src/components/Popover/story.scss rename to packages/react/src/components/Popover/next/story.scss diff --git a/yarn.lock b/yarn.lock index 552b3fee685f..3bdda11091df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10348,6 +10348,7 @@ __metadata: cypress: ^8.1.0 cypress-real-events: ^1.5.1 downshift: 5.2.1 + fast-glob: ^3.2.7 fast-sass-loader: ^1.5.0 flatpickr: 4.6.9 gzip-size: ^6.0.0