From f2b0f9821fef464fb73d93911e61f47aacd9ed8a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 20 Jul 2023 13:52:39 -0500 Subject: [PATCH 01/17] Remove storybook --- .storybook/main.ts | 43 - .storybook/preview.tsx | 22 - package.json | 14 +- stories/Button.stories.tsx | 48 - stories/Header.stories.tsx | 25 - stories/Header.tsx | 57 - stories/Introduction.stories.mdx | 211 - stories/Page.stories.tsx | 27 - stories/Page.tsx | 73 - stories/assets/code-brackets.svg | 1 - stories/assets/colors.svg | 1 - stories/assets/comments.svg | 1 - stories/assets/direction.svg | 1 - stories/assets/flow.svg | 1 - stories/assets/plugin.svg | 1 - stories/assets/repo.svg | 1 - stories/assets/stackalt.svg | 1 - stories/header.css | 32 - stories/page.css | 69 - stories/theme.css | 68 - yarn.lock | 6619 ++---------------------------- 21 files changed, 271 insertions(+), 7045 deletions(-) delete mode 100644 .storybook/main.ts delete mode 100644 .storybook/preview.tsx delete mode 100644 stories/Button.stories.tsx delete mode 100644 stories/Header.stories.tsx delete mode 100644 stories/Header.tsx delete mode 100644 stories/Introduction.stories.mdx delete mode 100644 stories/Page.stories.tsx delete mode 100644 stories/Page.tsx delete mode 100644 stories/assets/code-brackets.svg delete mode 100644 stories/assets/colors.svg delete mode 100644 stories/assets/comments.svg delete mode 100644 stories/assets/direction.svg delete mode 100644 stories/assets/flow.svg delete mode 100644 stories/assets/plugin.svg delete mode 100644 stories/assets/repo.svg delete mode 100644 stories/assets/stackalt.svg delete mode 100644 stories/header.css delete mode 100644 stories/page.css delete mode 100644 stories/theme.css diff --git a/.storybook/main.ts b/.storybook/main.ts deleted file mode 100644 index bb4c1d232..000000000 --- a/.storybook/main.ts +++ /dev/null @@ -1,43 +0,0 @@ -import sharedConfig from '../webpack/shared'; - -import type { StorybookConfig } from '@storybook/core-common'; - -const config: StorybookConfig = { - stories: [ - '../stories/**/*.stories.mdx', - '../stories/**/*.stories.@(js|jsx|ts|tsx)' - ], - addons: [ - '@storybook/addon-links', - '@storybook/addon-essentials', - '@storybook/addon-interactions', - 'storybook-react-intl', - { - name: '@storybook/addon-postcss', - options: { - postcssLoaderOptions: { - implementation: require('postcss'), - }, - }, - }, - ], - framework: '@storybook/react', - core: { - builder: '@storybook/builder-webpack5', - }, - webpackFinal: async (config) => { - config.resolve!.alias = { - ...sharedConfig.resolve!.alias, - ...config.resolve!.alias, - }; - - config.resolve!.modules = [ - ...sharedConfig.resolve!.modules!, - ...config.resolve!.modules!, - ]; - - return config; - }, -}; - -export default config; \ No newline at end of file diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx deleted file mode 100644 index df2195f0c..000000000 --- a/.storybook/preview.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import '../app/styles/tailwind.css'; -import '../stories/theme.css'; - -import { addDecorator, Story } from '@storybook/react'; -import { IntlProvider } from 'react-intl'; -import React from 'react'; - -const withProvider = (Story: Story) => ( - -); - -addDecorator(withProvider); - -export const parameters = { - actions: { argTypesRegex: '^on[A-Z].*' }, - controls: { - matchers: { - color: /(background|color)$/i, - date: /Date$/, - }, - }, -}; diff --git a/package.json b/package.json index f4e602788..afe01b473 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,7 @@ "lint": "${npm_execpath} run lint:js && ${npm_execpath} run lint:sass", "lint:js": "npx eslint --ext .js,.jsx,.cjs,.mjs,.ts,.tsx . --cache", "lint:sass": "npx stylelint app/styles/**/*.scss", - "prepare": "husky install", - "storybook": "start-storybook -p 6006", - "build-storybook": "build-storybook" + "prepare": "husky install" }, "license": "AGPL-3.0-or-later", "browserslist": [ @@ -199,15 +197,6 @@ "@gitbeaker/node": "^35.8.0", "@jedmao/redux-mock-store": "^3.0.5", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10", - "@storybook/addon-actions": "^6.5.16", - "@storybook/addon-essentials": "^6.5.16", - "@storybook/addon-interactions": "^6.5.16", - "@storybook/addon-links": "^6.5.16", - "@storybook/addon-postcss": "^2.0.0", - "@storybook/builder-webpack5": "^6.5.16", - "@storybook/manager-webpack5": "^6.5.16", - "@storybook/react": "^6.5.16", - "@storybook/testing-library": "^0.0.13", "@tailwindcss/aspect-ratio": "^0.4.2", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react-hooks": "^8.0.1", @@ -236,7 +225,6 @@ "raf": "^3.4.1", "react-intl-translations-manager": "^5.0.3", "react-refresh": "^0.14.0", - "storybook-react-intl": "^1.1.1", "stylelint": "^14.0.0", "stylelint-config-standard-scss": "^6.1.0", "tailwindcss": "^3.3.1", diff --git a/stories/Button.stories.tsx b/stories/Button.stories.tsx deleted file mode 100644 index 796d17e96..000000000 --- a/stories/Button.stories.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { ComponentStory, ComponentMeta } from '@storybook/react'; -import React from 'react'; - -import { Button } from 'soapbox/components/ui'; - -// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export -export default { - title: 'UI/Button', - component: Button, - // More on argTypes: https://storybook.js.org/docs/react/api/argtypes - argTypes: { - text: { type: 'string', defaultValue: 'Button' }, - theme: { defaultValue: 'primary' }, - size: { defaultValue: 'md' }, - disabled: { defaultValue: false }, - block: { defaultValue: false }, - children: { table: { disable: true } }, - className: { table: { disable: true } }, - type: { table: { disable: true } }, - to: { table: { disable: true } }, - icon: { table: { disable: true } }, - onClick: { table: { disable: true } }, - }, -} as ComponentMeta; - -// More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args -const Template: ComponentStory = (args) =>