mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-09 07:25:19 +02:00
First draft of client Storybook integration
This commit is contained in:
parent
a33cef920f
commit
4798b5a88f
6 changed files with 4563 additions and 5115 deletions
19
apps/client/.storybook/main.js
Normal file
19
apps/client/.storybook/main.js
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
const rootMain = require('../../../.storybook/main')
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
...rootMain,
|
||||||
|
|
||||||
|
core: { ...rootMain.core, builder: 'webpack5' },
|
||||||
|
stories: ['../**/*.stories.@(js|jsx|ts|tsx)'],
|
||||||
|
addons: [...rootMain.addons, '@nrwl/react/plugins/storybook'],
|
||||||
|
webpackFinal: async (config, { configType }) => {
|
||||||
|
// apply any global webpack configs that might have been specified in .storybook/main.js
|
||||||
|
if (rootMain.webpackFinal) {
|
||||||
|
config = await rootMain.webpackFinal(config, { configType })
|
||||||
|
}
|
||||||
|
|
||||||
|
// add your own webpack tweaks if needed
|
||||||
|
|
||||||
|
return config
|
||||||
|
},
|
||||||
|
}
|
18
apps/client/.storybook/tsconfig.json
Normal file
18
apps/client/.storybook/tsconfig.json
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"outDir": "",
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
"allowJs": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noEmit": false
|
||||||
|
},
|
||||||
|
"include": ["**/*.ts", "**/*.tsx", "**/**/*.ts", "**/**/*.tsx"]
|
||||||
|
}
|
11
apps/client/components/Maintenance.stories.tsx
Normal file
11
apps/client/components/Maintenance.stories.tsx
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import type { Story, Meta } from '@storybook/react'
|
||||||
|
import Maintenance from './Maintenance'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
title: 'components/Maintenance.tsx',
|
||||||
|
component: Maintenance,
|
||||||
|
} as Meta
|
||||||
|
|
||||||
|
const Template: Story = (args) => <Maintenance />
|
||||||
|
|
||||||
|
export const Base = Template.bind({})
|
|
@ -27,5 +27,17 @@
|
||||||
"next-env.d.ts",
|
"next-env.d.ts",
|
||||||
".next/types/**/*.ts"
|
".next/types/**/*.ts"
|
||||||
],
|
],
|
||||||
"exclude": ["node_modules", "jest.config.ts"]
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"jest.config.ts",
|
||||||
|
"**/*.stories.ts",
|
||||||
|
"**/*.stories.js",
|
||||||
|
"**/*.stories.jsx",
|
||||||
|
"**/*.stories.tsx"
|
||||||
|
],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./.storybook/tsconfig.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,33 @@
|
||||||
"options": {
|
"options": {
|
||||||
"command": "node tools/scripts/triggerClientDeploy.js"
|
"command": "node tools/scripts/triggerClientDeploy.js"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"storybook": {
|
||||||
|
"executor": "@nrwl/storybook:storybook",
|
||||||
|
"options": {
|
||||||
|
"uiFramework": "@storybook/react",
|
||||||
|
"port": 4400,
|
||||||
|
"configDir": "apps/client/.storybook"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"ci": {
|
||||||
|
"quiet": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"build-storybook": {
|
||||||
|
"executor": "@nrwl/storybook:build",
|
||||||
|
"outputs": ["{options.outputDir}"],
|
||||||
|
"options": {
|
||||||
|
"uiFramework": "@storybook/react",
|
||||||
|
"outputDir": "dist/storybook/client",
|
||||||
|
"configDir": "apps/client/.storybook"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"ci": {
|
||||||
|
"quiet": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tags": ["scope:app"]
|
"tags": ["scope:app"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue