Skip to content

Commit

Permalink
update storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
shlokamin committed Feb 16, 2024
1 parent 69553ce commit 2280817
Show file tree
Hide file tree
Showing 9 changed files with 2,158 additions and 2,645 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
'plugin:react/recommended',
'prettier',
'plugin:json/recommended',
'plugin:storybook/recommended',
],

plugins: ['react', 'react-hooks', 'json', 'jest', 'testing-library'],
Expand Down
19 changes: 10 additions & 9 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
'use strict'

const { baseConfig } = require('@opentrons/webpack-config')

module.exports = {
webpackFinal: config => ({
...config,
module: { ...config.module, rules: baseConfig.module.rules },
plugins: [...config.plugins, ...baseConfig.plugins],
}),
stories: [
'../components/**/*.stories.@(js|jsx|ts|tsx)',
'../app/**/*.stories.@(js|jsx|ts|tsx)',
],

addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'storybook-addon-pseudo-states',
],

framework: {
name: '@storybook/react-vite',
options: {}
},

docs: {
autodocs: true
}
}
File renamed without changes.
49 changes: 49 additions & 0 deletions components/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import path from 'path'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import postCssImport from 'postcss-import'
import postCssApply from 'postcss-apply'
import postColorModFunction from 'postcss-color-mod-function'
import postCssPresetEnv from 'postcss-preset-env'
import lostCss from 'lost'

export default defineConfig({
build: {
// Relative to the root
outDir: 'dist',
},
plugins: [
react({
include: '**/*.tsx',
babel: {
// Use babel.config.js files
configFile: true,
},
}),
],
optimizeDeps: {
esbuildOptions: {
target: 'es2020',
},
},
css: {
postcss: {
plugins: [
postCssImport({ root: 'src/' }),
postCssApply(),
postColorModFunction(),
postCssPresetEnv({ stage: 0 }),
lostCss(),
],
},
},
define: {
'process.env': process.env,
global: 'globalThis',
},
resolve: {
alias: {
'@opentrons/shared-data': path.resolve('../shared-data/js/index.ts'),
},
},
})
7 changes: 2 additions & 5 deletions labware-designer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ SHELL := bash
# add node_modules/.bin to PATH
PATH := $(shell cd .. && pnpm bin):$(PATH)

# override webpack's default hashing algorithm for node 18: https://github.com/webpack/webpack/issues/14532
export NODE_OPTIONS := --openssl-legacy-provider

# standard targets
#####################################################################

Expand All @@ -29,15 +26,15 @@ clean:
.PHONY: dist
dist: export NODE_ENV := production
dist:
webpack --profile
vite build

# development
#####################################################################

.PHONY: dev
dev: export NODE_ENV := development
dev:
webpack-dev-server --hot --host=::
vite serve --host=::

.PHONY: test
test:
Expand Down
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"@rollup/plugin-replace": "^2.4.2",
"@storybook/addon-actions": "^6.5.12",
"@storybook/addon-essentials": "^6.5.12",
"@storybook/addon-links": "^6.5.12",
"@storybook/react": "^6.5.12",
"@storybook/addon-actions": "^7.6.16",
"@storybook/addon-essentials": "^7.6.16",
"@storybook/addon-links": "^7.6.16",
"@storybook/react": "^7.6.16",
"@storybook/react-vite": "^7.6.16",
"@testing-library/jest-dom": "6.4.0",
"@testing-library/react": "13.4.0",
"@testing-library/user-event": "13.5.0",
Expand All @@ -43,9 +44,9 @@
"@types/react-router-dom": "5.3.3",
"@types/redux-mock-store": "^1.0.2",
"@types/semver": "^7.3.6",
"@vitejs/plugin-react": "4.2.0",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"@vitejs/plugin-react": "4.2.0",
"ajv": "6.12.3",
"aws-sdk": "^2.493.0",
"babel-jest": "^26.6.3",
Expand Down Expand Up @@ -76,6 +77,7 @@
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-standard": "^5.0.0",
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-testing-library": "^6.2.0",
"express": "^4.16.4",
"file-loader": "^5.0.2",
Expand Down Expand Up @@ -116,6 +118,7 @@
"semver": "^7.3.8",
"shx": "^0.3.3",
"simple-git": "^3.15.1",
"storybook": "^7.6.16",
"storybook-addon-pseudo-states": "^1.15.5",
"style-loader": "^1.1.3",
"stylelint": "^11.0.0",
Expand Down
Loading

0 comments on commit 2280817

Please sign in to comment.