feat: scaffold monorepo

This commit is contained in:
Yangshun Tay
2022-09-29 16:23:34 +08:00
parent 27a82e8c0f
commit 523d91f920
62 changed files with 19346 additions and 712 deletions

View File

@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ['tih'],
};

View 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/'),
},
],
},
};
},
};

View 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"
}
}

View 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>