Skip to content

Commit

Permalink
Merge pull request #21 from route06inc/add-ui-package
Browse files Browse the repository at this point in the history
feat: add ui package and sample component
  • Loading branch information
MH4GF authored Oct 9, 2024
2 parents e39488f + 6200b03 commit 2a1f4d3
Show file tree
Hide file tree
Showing 14 changed files with 106 additions and 10 deletions.
8 changes: 7 additions & 1 deletion frontend/apps/service-site/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import type { StorybookConfig } from '@storybook/nextjs'

const config: StorybookConfig = {
framework: '@storybook/nextjs',
stories: ['../src/**/*.stories.@(ts|tsx)'],
stories: [
'../src/**/*.stories.@(ts|tsx)',
{
directory: path.resolve(__dirname, '../../../packages/ui/src'),
titlePrefix: 'UI',
},
],
features: {
experimentalRSC: true,
},
Expand Down
1 change: 1 addition & 0 deletions frontend/apps/service-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"fmt:biome": "biome check --write --unsafe ."
},
"dependencies": {
"@packages/ui": "workspace:*",
"clsx": "^2.1.1",
"contentlayer2": "^0.5.1",
"date-fns": "^4.1.0",
Expand Down
2 changes: 2 additions & 0 deletions frontend/packages/ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# typed-css-modules
*.css.d.ts
3 changes: 3 additions & 0 deletions frontend/packages/ui/biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["../../packages/configs/biome.jsonc"]
}
23 changes: 23 additions & 0 deletions frontend/packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "@packages/ui",
"main": "src/index.ts",
"scripts": {
"dev": "conc -c auto pnpm:dev:*",
"dev:css": "tcm src --watch",
"gen": "conc -c auto pnpm:gen:*",
"gen:css": "tcm src",
"lint": "conc -c auto pnpm:lint:*",
"lint:biome": "biome check .",
"lint:tsc": "tsc --noEmit",
"fmt": "conc -c auto pnpm:fmt:*",
"fmt:biome": "biome check --write --unsafe ."
},
"devDependencies": {
"@biomejs/biome": "1.9.3",
"@packages/configs": "workspace:*",
"@storybook/react": "^8.3.4",
"@types/react": "^18",
"typed-css-modules": "^0.9.1",
"typescript": "^5"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* biome-ignore lint/suspicious/noEmptyBlock: TODO */
.wrapper {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { Meta, StoryObj } from '@storybook/react'

import { DropdownMenu } from './'

const meta = {
component: DropdownMenu,
args: {},
} satisfies Meta<typeof DropdownMenu>

export default meta
type Story = StoryObj<typeof meta>

export const Default: Story = {}
10 changes: 10 additions & 0 deletions frontend/packages/ui/src/components/DropdownMenu/DropdownMenu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { FC } from 'react'
import styles from './DropdownMenu.module.css'

export const DropdownMenu: FC = () => {
return (
<div className={styles.wrapper}>
<h1>DropdownMenu Component</h1>
</div>
)
}
1 change: 1 addition & 0 deletions frontend/packages/ui/src/components/DropdownMenu/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './DropdownMenu'
1 change: 1 addition & 0 deletions frontend/packages/ui/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './DropdownMenu'
1 change: 1 addition & 0 deletions frontend/packages/ui/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './components'
7 changes: 7 additions & 0 deletions frontend/packages/ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "@packages/configs/tsconfig/base.json",
"compilerOptions": {
"baseUrl": "."
},
"include": ["src/**/*"]
}
42 changes: 33 additions & 9 deletions frontend/pnpm-lock.yaml

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

1 change: 1 addition & 0 deletions frontend/turbo/generators/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void {
choices: [
...listDirectories('apps/service-site/src/features'),
...listDirectories('apps/service-site/src/components'),
...listDirectories('packages/ui/src/components'),
],
},
{
Expand Down

0 comments on commit 2a1f4d3

Please sign in to comment.