From c1949d3157ae1d6dc344e782859b69e786ab1578 Mon Sep 17 00:00:00 2001 From: Jamon Holmgren Date: Fri, 28 Feb 2025 21:41:54 -0800 Subject: [PATCH 1/2] Removed Storybook --- README.md | 3 - apps/reactotron-app/.storybook/addons.js | 3 - apps/reactotron-app/.storybook/config.js | 10 - .../.storybook/webpack.config.js | 37 - apps/reactotron-app/package.json | 7 - apps/reactotron-app/src/renderer/App.tsx | 2 - .../ConnectionSelector.story.tsx | 85 - .../components/Footer/Footer.story.tsx | 107 - .../components/SideBar/SideBar.story.tsx | 14 - .../SideBarButton/SideBarButton.story.tsx | 84 - .../src/renderer/images/index.ts | 2 - .../renderer/images/storybook-logo-color.png | Bin 21880 -> 0 bytes .../src/renderer/images/storybook-logo.png | Bin 15239 -> 0 bytes .../renderer/pages/reactNative/Overlay.tsx | 11 +- .../renderer/pages/reactNative/Storybook.tsx | 153 - docs/plugins/storybook.md | 54 - lib/reactotron-core-contract/src/command.ts | 2 - lib/reactotron-core-ui/.storybook/addons.js | 3 - lib/reactotron-core-ui/.storybook/config.js | 12 - lib/reactotron-core-ui/package.json | 7 - .../ActionButton/ActionButton.story.tsx | 13 - .../components/Checkbox/Checkbox.story.tsx | 12 - .../ContentView/ContentView.story.tsx | 22 - .../EmptyState/EmptyState.story.tsx | 15 - .../src/components/Header/Header.story.tsx | 31 - .../HeaderTabButton/SideBarButton.story.tsx | 21 - .../src/components/Modal/Modal.story.tsx | 14 - .../TimelineCommand/TimelineCommand.story.tsx | 103 - .../TimelineCommandTabButton.story.tsx | 16 - .../components/Timestamp/Timestamp.story.tsx | 9 - .../components/TreeView/TreeView.story.tsx | 21 - .../src/contexts/ReactNative/index.tsx | 11 - .../ReactNative/useStorybook.test.tsx | 78 - .../src/contexts/ReactNative/useStorybook.ts | 41 - .../DispatchActionModal.story.tsx | 16 - .../SnapshotRenameModal.story.tsx | 17 - .../SubscriptionAddModal.story.tsx | 12 - .../TimelineFilterModal.story.tsx | 123 - .../ApiResponseCommand.story.tsx | 119 - .../AsyncStorageMutationCommand.story.tsx | 31 - .../BenchmarkReportCommand.story.tsx | 35 - .../ClientIntroCommand.story.tsx | 27 - .../DisplayCommand/DisplayCommand.story.tsx | 95 - .../ImageCommand/ImageCommand.story.tsx | 32 - .../LogCommand/LogCommand.story.tsx | 176 - .../SagaTaskCompleteCommand.story.tsx | 94 - .../StateActionCompleteCommand.story.tsx | 31 - .../StateKeysResponseCommand.story.tsx | 57 - .../StateValuesChangeCommand.story.tsx | 108 - .../StateValuesResponseCommand.story.tsx | 49 - .../src/plugins/storybook/index.tsx | 33 - .../src/plugins/storybook/storybook.tsx | 43 - .../src/reactotron-react-native.ts | 8 - package.json | 2 +- yarn.lock | 6530 +---------------- 55 files changed, 337 insertions(+), 8304 deletions(-) delete mode 100644 apps/reactotron-app/.storybook/addons.js delete mode 100644 apps/reactotron-app/.storybook/config.js delete mode 100644 apps/reactotron-app/.storybook/webpack.config.js delete mode 100644 apps/reactotron-app/src/renderer/components/ConnectionSelector/ConnectionSelector.story.tsx delete mode 100644 apps/reactotron-app/src/renderer/components/Footer/Footer.story.tsx delete mode 100644 apps/reactotron-app/src/renderer/components/SideBar/SideBar.story.tsx delete mode 100644 apps/reactotron-app/src/renderer/components/SideBarButton/SideBarButton.story.tsx delete mode 100644 apps/reactotron-app/src/renderer/images/storybook-logo-color.png delete mode 100644 apps/reactotron-app/src/renderer/images/storybook-logo.png delete mode 100644 apps/reactotron-app/src/renderer/pages/reactNative/Storybook.tsx delete mode 100644 docs/plugins/storybook.md delete mode 100644 lib/reactotron-core-ui/.storybook/addons.js delete mode 100644 lib/reactotron-core-ui/.storybook/config.js delete mode 100644 lib/reactotron-core-ui/src/components/ActionButton/ActionButton.story.tsx delete mode 100644 lib/reactotron-core-ui/src/components/Checkbox/Checkbox.story.tsx delete mode 100644 lib/reactotron-core-ui/src/components/ContentView/ContentView.story.tsx delete mode 100644 lib/reactotron-core-ui/src/components/EmptyState/EmptyState.story.tsx delete mode 100644 lib/reactotron-core-ui/src/components/Header/Header.story.tsx delete mode 100644 lib/reactotron-core-ui/src/components/HeaderTabButton/SideBarButton.story.tsx delete mode 100644 lib/reactotron-core-ui/src/components/Modal/Modal.story.tsx delete mode 100644 lib/reactotron-core-ui/src/components/TimelineCommand/TimelineCommand.story.tsx delete mode 100644 lib/reactotron-core-ui/src/components/TimelineCommandTabButton/TimelineCommandTabButton.story.tsx delete mode 100644 lib/reactotron-core-ui/src/components/Timestamp/Timestamp.story.tsx delete mode 100644 lib/reactotron-core-ui/src/components/TreeView/TreeView.story.tsx delete mode 100644 lib/reactotron-core-ui/src/contexts/ReactNative/useStorybook.test.tsx delete mode 100644 lib/reactotron-core-ui/src/contexts/ReactNative/useStorybook.ts delete mode 100644 lib/reactotron-core-ui/src/modals/DispatchActionModal/DispatchActionModal.story.tsx delete mode 100644 lib/reactotron-core-ui/src/modals/SnapshotRenameModal/SnapshotRenameModal.story.tsx delete mode 100644 lib/reactotron-core-ui/src/modals/SubscriptionAddModal/SubscriptionAddModal.story.tsx delete mode 100644 lib/reactotron-core-ui/src/modals/TimelineFilterModal/TimelineFilterModal.story.tsx delete mode 100644 lib/reactotron-core-ui/src/timelineCommands/ApiResponseCommand/ApiResponseCommand.story.tsx delete mode 100644 lib/reactotron-core-ui/src/timelineCommands/AsyncStorageMutationCommand/AsyncStorageMutationCommand.story.tsx delete mode 100644 lib/reactotron-core-ui/src/timelineCommands/BenchmarkReportCommand/BenchmarkReportCommand.story.tsx delete mode 100644 lib/reactotron-core-ui/src/timelineCommands/ClientIntroCommand/ClientIntroCommand.story.tsx delete mode 100644 lib/reactotron-core-ui/src/timelineCommands/DisplayCommand/DisplayCommand.story.tsx delete mode 100644 lib/reactotron-core-ui/src/timelineCommands/ImageCommand/ImageCommand.story.tsx delete mode 100644 lib/reactotron-core-ui/src/timelineCommands/LogCommand/LogCommand.story.tsx delete mode 100644 lib/reactotron-core-ui/src/timelineCommands/SagaTaskCompleteCommand/SagaTaskCompleteCommand.story.tsx delete mode 100644 lib/reactotron-core-ui/src/timelineCommands/StateActionCompleteCommand/StateActionCompleteCommand.story.tsx delete mode 100644 lib/reactotron-core-ui/src/timelineCommands/StateKeysResponseCommand/StateKeysResponseCommand.story.tsx delete mode 100644 lib/reactotron-core-ui/src/timelineCommands/StateValuesChangeCommand/StateValuesChangeCommand.story.tsx delete mode 100644 lib/reactotron-core-ui/src/timelineCommands/StateValuesResponseCommand/StateValuesResponseCommand.story.tsx delete mode 100644 lib/reactotron-react-native/src/plugins/storybook/index.tsx delete mode 100644 lib/reactotron-react-native/src/plugins/storybook/storybook.tsx diff --git a/README.md b/README.md index e323e805d..1adb8f608 100644 --- a/README.md +++ b/README.md @@ -57,9 +57,6 @@ On the [Releases](https://github.com/infinitered/reactotron/releases?q=reactotro - [**MST**](https://docs.infinite.red/reactotron/plugins/mst/) - [**Redux**](https://docs.infinite.red/reactotron/plugins/redux/) - [**Open in Editor**](https://docs.infinite.red/reactotron/plugins/open-in-editor/) -- [**Storybook (only for React Native)**](https://docs.infinite.red/reactotron/plugins/storybook/) \ - `reactotron-react-native` ships with [Storybook](https://storybook.js.org/). - This enables you to switch to Storybook from the Reactotron app. - [**Custom Commands**](https://docs.infinite.red/reactotron/custom-commands/) ## Tips and Tricks diff --git a/apps/reactotron-app/.storybook/addons.js b/apps/reactotron-app/.storybook/addons.js deleted file mode 100644 index b4df797d0..000000000 --- a/apps/reactotron-app/.storybook/addons.js +++ /dev/null @@ -1,3 +0,0 @@ -import "@storybook/addon-actions/register" -import "@storybook/addon-links/register" -import "@storybook/addon-knobs/register" diff --git a/apps/reactotron-app/.storybook/config.js b/apps/reactotron-app/.storybook/config.js deleted file mode 100644 index 913dc83dc..000000000 --- a/apps/reactotron-app/.storybook/config.js +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react" -import { configure, addDecorator } from "@storybook/react" -import { withKnobs } from "@storybook/addon-knobs" -import { ReactotronProvider } from "reactotron-core-ui" - -const StyledDecorator = (storyFn) => {storyFn()} -addDecorator(StyledDecorator) -addDecorator(withKnobs) - -configure(require.context("../src", true, /\.story\.tsx$/), module) diff --git a/apps/reactotron-app/.storybook/webpack.config.js b/apps/reactotron-app/.storybook/webpack.config.js deleted file mode 100644 index 4cd197171..000000000 --- a/apps/reactotron-app/.storybook/webpack.config.js +++ /dev/null @@ -1,37 +0,0 @@ -module.exports = async ({ config }) => { - const newConfig = { - ...config, - module: { - ...config.module, - rules: [ - ...config.module.rules.map((rule) => { - if (!rule.use || !rule.use.some((loader) => loader.loader === "babel-loader")) return rule - - return { - ...rule, - test: /\.(mjs|jsx?|tsx?)$/, - use: [ - ...rule.use.map((loader) => { - if (loader.loader !== "babel-loader") return loader - - return { - ...loader, - options: { - ...loader.options, - presets: [...loader.options.presets, "@babel/preset-typescript"], - }, - } - }), - ], - } - }), - ], - }, - resolve: { - ...config.resolve, - extensions: [".ts", ".tsx", ...config.resolve.extensions], - }, - } - - return newConfig -} diff --git a/apps/reactotron-app/package.json b/apps/reactotron-app/package.json index 9652ce5f1..89ecb6e41 100644 --- a/apps/reactotron-app/package.json +++ b/apps/reactotron-app/package.json @@ -31,8 +31,6 @@ "format:check": "yarn format --check", "format:write": "yarn format --write", "lint": "eslint 'src/**/**.{ts,tsx}'", - "storybook": "start-storybook -p 6006", - "build-storybook": "build-storybook", "typecheck": "tsc --noEmit", "ci:test": "yarn test --runInBand" }, @@ -77,11 +75,6 @@ "@babel/preset-react": "^7.22.15", "@babel/preset-typescript": "^7.23.2", "@electron/notarize": "^2.1.0", - "@storybook/addon-actions": "^5.2.8", - "@storybook/addon-knobs": "^5.2.8", - "@storybook/addon-links": "^5.2.8", - "@storybook/addons": "^5.2.8", - "@storybook/react": "^5.2.8", "@testing-library/react": "^14.1.2", "@types/jest": "^29.5.7", "@types/react": "18.2.45", diff --git a/apps/reactotron-app/src/renderer/App.tsx b/apps/reactotron-app/src/renderer/App.tsx index bbab99b60..14453eb73 100644 --- a/apps/reactotron-app/src/renderer/App.tsx +++ b/apps/reactotron-app/src/renderer/App.tsx @@ -12,7 +12,6 @@ import Timeline from "./pages/timeline" import Subscriptions from "./pages/state/Subscriptions" import Snapshots from "./pages/state/Snapshots" import Overlay from "./pages/reactNative/Overlay" -import Storybook from "./pages/reactNative/Storybook" import CustomCommands from "./pages/customCommands" import Help from "./pages/help" @@ -62,7 +61,6 @@ function App() { {/* React Native */} } /> - } /> {/* Custom Commands */} } /> diff --git a/apps/reactotron-app/src/renderer/components/ConnectionSelector/ConnectionSelector.story.tsx b/apps/reactotron-app/src/renderer/components/ConnectionSelector/ConnectionSelector.story.tsx deleted file mode 100644 index 2b7f47204..000000000 --- a/apps/reactotron-app/src/renderer/components/ConnectionSelector/ConnectionSelector.story.tsx +++ /dev/null @@ -1,85 +0,0 @@ -/* eslint-disable @typescript-eslint/no-empty-function */ -import React from "react" -import { storiesOf } from "@storybook/react" - -import ConnectionSelector from "./index" - -storiesOf("components/ConnectionSelector", module) - .add("iOS", () => ( - {}} - /> - )) - .add("Android", () => ( - {}} - /> - )) - .add("Selected", () => ( - {}} - /> - )) - .add("Show Name", () => ( - {}} - /> - )) diff --git a/apps/reactotron-app/src/renderer/components/Footer/Footer.story.tsx b/apps/reactotron-app/src/renderer/components/Footer/Footer.story.tsx deleted file mode 100644 index 4119bb035..000000000 --- a/apps/reactotron-app/src/renderer/components/Footer/Footer.story.tsx +++ /dev/null @@ -1,107 +0,0 @@ -/* eslint-disable @typescript-eslint/no-empty-function */ -import React from "react" -import { storiesOf } from "@storybook/react" - -import { Connection } from "../../contexts/Standalone/useStandalone" - -import Footer from "./Stateless" - -const testConnections: Connection[] = [ - { - id: 0, - clientId: "1", - name: "Test 1", - commands: [], - platform: "ios", - platformVersion: "12", - connected: true, - }, - { - id: 0, - clientId: "1", - name: "Test 2", - commands: [], - platform: "ios", - platformVersion: "12", - connected: true, - }, - { - id: 0, - clientId: "1", - name: "Test 3", - commands: [], - platform: "ios", - platformVersion: "12", - connected: true, - }, - { - id: 0, - clientId: "1", - name: "Test 4", - commands: [], - platform: "ios", - platformVersion: "12", - connected: true, - }, - { - id: 0, - clientId: "1", - name: "Test 5", - commands: [], - platform: "ios", - platformVersion: "12", - connected: true, - }, -] - -storiesOf("components/Footer", module) - .add("Collpased", () => ( -