Skip to content

Commit

Permalink
Remove storybook (#467)
Browse files Browse the repository at this point in the history
* Remove storybook
* Delete all stories files and references to stories in config files
Fixes #459
  • Loading branch information
mofojed authored Mar 4, 2022
1 parent 95138fd commit f87903b
Show file tree
Hide file tree
Showing 63 changed files with 7,631 additions and 52,260 deletions.
1 change: 0 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module.exports = api => {
ignore: [
!isTest ? /\.test.(tsx?|jsx?)$/ : false,
!isTest ? '**/__mocks__/*' : false,
/\.stories.(tsx?|jsx?|mdx?)$/,
'**/*.scss',
].filter(Boolean),
};
Expand Down
10 changes: 0 additions & 10 deletions examples/component-template/.storybook/main.js

This file was deleted.

10 changes: 0 additions & 10 deletions examples/component-template/.storybook/preview.js

This file was deleted.

10 changes: 2 additions & 8 deletions examples/component-template/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @deephaven/component-template

This is an example which is setup to build components using Typescript, React, and Sass with Jest for testing and Storybook for isolated component development. Plain Javascript is also allowed, but for new components Typescript is preferred.
This is an example which is setup to build components using Typescript, React, and Sass with Jest for testing. Plain Javascript is also allowed, but for new components Typescript is preferred.

## Usage

Expand Down Expand Up @@ -29,7 +29,7 @@ The build step will transpile TS to JS (using Babel), compile Sass to CSS (using

All JS/TS/JSX/TSX files you want in the output MUST be in `./src` since it is set as the `rootDir` in `tsconfig.json`

If you need another type of file copied, you will need to add it to the build process (Babel can be used with `--copy-files --no-copy-ignored` which should work since it ignores all the test/sass/storybook files)
If you need another type of file copied, you will need to add it to the build process (Babel can be used with `--copy-files --no-copy-ignored` which should work since it ignores all the test/sass files)

If for some reason you need to build somewhere that isn't `dist`, you must update `tsconfig.json` and `package.json` to replace everywhere that `dist` is used with whatever you decide to build with.

Expand All @@ -49,12 +49,6 @@ ESLint, Prettier, and Stylelint configs are all set at the root level of the web

You can add an `.eslintignore` file if needed.

## Storybook

You can use [Storybook](https://storybook.js.org/) to isolate your component for development. Just use `npm run storybook` to start a Storybook server for this component.

Storybook is setup with a default config in this template. Any `.stories.(jsx?|tsx?|mdx)` file should be picked up by Storybook and ignored by the build process.

## Best Practices

### Removing Unused Dependencies
Expand Down
8 changes: 1 addition & 7 deletions examples/component-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
"watch:babel": "npm run babel -- -w --skip-initial-build",
"watch:sass": "npm run sass -- --watch --update",
"prestart": "npm run build-dev",
"start": "cross-env NODE_ENV=development npm run watch",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
"start": "cross-env NODE_ENV=development npm run watch"
},
"dependencies": {
"prop-types": "^15.7.2"
Expand All @@ -39,10 +37,6 @@
"devDependencies": {
"@babel/cli": "^7.16.0",
"@deephaven/tsconfig": "^0.3.1",
"@storybook/addon-actions": "^6.2.3",
"@storybook/addon-essentials": "^6.2.3",
"@storybook/addon-links": "^6.2.3",
"@storybook/react": "^6.2.3",
"@testing-library/react": "^11.2.7",
"@types/jest": "^26.0.23",
"@types/react": "^17.0.2",
Expand Down
20 changes: 5 additions & 15 deletions examples/component-template/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,13 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src/",
"outDir": "dist/",
"outDir": "dist/"
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.js",
"src/**/*.jsx",
],
"exclude": [
"node_modules",
"src/**/*.test.*",
"src/**/*.stories.*",
"src/**/__mocks__/*"
],
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx"],
"exclude": ["node_modules", "src/**/*.test.*", "src/**/__mocks__/*"],
"references": [
{
"path": "../log"
},
}
]
}
}
6 changes: 3 additions & 3 deletions packages/chart/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 4 additions & 14 deletions packages/chart/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,10 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src/",
"outDir": "dist/",
"outDir": "dist/"
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.js",
"src/**/*.jsx",
],
"exclude": [
"node_modules",
"src/**/*.test.*",
"src/**/*.stories.*",
"src/**/__mocks__/*"
],
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx"],
"exclude": ["node_modules", "src/**/*.test.*", "src/**/__mocks__/*"],
"references": [
{
"path": "../iris-grid"
Expand All @@ -27,4 +17,4 @@
"path": "../log"
}
]
}
}
11 changes: 0 additions & 11 deletions packages/code-studio/.storybook/main.js

This file was deleted.

5 changes: 0 additions & 5 deletions packages/code-studio/.storybook/manager.js

This file was deleted.

9 changes: 0 additions & 9 deletions packages/code-studio/.storybook/preview-head.html

This file was deleted.

30 changes: 0 additions & 30 deletions packages/code-studio/.storybook/preview.js

This file was deleted.

6 changes: 1 addition & 5 deletions packages/code-studio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,7 @@ When new functions are added to the API, ideally stubs returning a generic succe

## Styleguide/Component Development

The styleguide uses [Storybook](https://storybook.js.org/) and can be accessed using `npm run storybook`. This runs independently of the dev server. Storybook can be used to develop components in isolation. The styleguide displays many common components and how to use them. When creating a new component, it should be added to the styleguide to show usage using a `component.stories.jsx` file.

### Legacy Style Guide

When running in development mode (`npm run start`), a style guide is served up at http://localhost:4000/styleguide. This is for legacy purposes now while everything is ported over to Storybook. Do NOT add new components to this styleguide, only use it for reference if things are missing in Storybook.
When running in development mode (`npm run start`), a style guide is served up at http://localhost:4000/styleguide. Styleguide can be used to develop components. The styleguide displays many common components and how to use them. When creating a new component, it should be added to the [styleguide](./src/styleguide/).

## Architecture

Expand Down
Loading

0 comments on commit f87903b

Please sign in to comment.