mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-08-01 17:35:08 +08:00
feat: scaffold monorepo
This commit is contained in:
4
apps/storybook/.eslintrc.js
Normal file
4
apps/storybook/.eslintrc.js
Normal file
@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: ['tih'],
|
||||
};
|
24
apps/storybook/.storybook/main.js
Normal file
24
apps/storybook/.storybook/main.js
Normal file
@ -0,0 +1,24 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
stories: ['../stories/**/*.stories.mdx', '../stories/**/*.stories.tsx'],
|
||||
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
|
||||
framework: '@storybook/react',
|
||||
core: {
|
||||
builder: '@storybook/builder-vite',
|
||||
},
|
||||
async viteFinal(config, { configType }) {
|
||||
// customize the Vite config here
|
||||
return {
|
||||
...config,
|
||||
resolve: {
|
||||
alias: [
|
||||
{
|
||||
find: '@tih/ui',
|
||||
replacement: path.resolve(__dirname, '../../../packages/ui/'),
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
30
apps/storybook/package.json
Normal file
30
apps/storybook/package.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "@tih/storybook",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "start-storybook -p 6001",
|
||||
"build": "build-storybook --docs",
|
||||
"preview-storybook": "serve storybook-static",
|
||||
"clean": "rm -rf .turbo && rm -rf node_modules"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tih/ui": "*",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/addon-actions": "^6.4.18",
|
||||
"@storybook/addon-docs": "^6.4.22",
|
||||
"@storybook/addon-essentials": "^6.4.18",
|
||||
"@storybook/addon-links": "^6.4.18",
|
||||
"@storybook/builder-vite": "^0.1.33",
|
||||
"@storybook/react": "^6.4.18",
|
||||
"@tih/tsconfig": "*",
|
||||
"@vitejs/plugin-react": "^1.3.2",
|
||||
"eslint-config-tih": "*",
|
||||
"serve": "^13.0.2",
|
||||
"typescript": "^4.8.3",
|
||||
"vite": "^2.9.9"
|
||||
}
|
||||
}
|
20
apps/storybook/stories/button.stories.mdx
Normal file
20
apps/storybook/stories/button.stories.mdx
Normal file
@ -0,0 +1,20 @@
|
||||
import { CounterButton } from '@tih/ui';
|
||||
import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
|
||||
|
||||
<Meta title="Components/Button" component={CounterButton} />
|
||||
|
||||
# Button
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec euismod, nisl eget consectetur tempor, nisl nunc egestas nisi, euismod aliquam nisl nunc euismod.
|
||||
|
||||
## Props
|
||||
|
||||
<ArgsTable of={CounterButton} />
|
||||
|
||||
## Examples
|
||||
|
||||
<Canvas>
|
||||
<Story name="Default">
|
||||
<CounterButton>Hello</CounterButton>
|
||||
</Story>
|
||||
</Canvas>
|
Reference in New Issue
Block a user