Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 40 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
pull_request:
branches: [main]
branches: [main, develop]

jobs:
ci:
Expand All @@ -22,16 +22,52 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Lint
- name: Lint Check
run: pnpm lint

- name: Type Check
run: pnpm check-types

- name: Build
- name: Build Check
run: pnpm build

test-and-deploy-storybook:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.0.0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Publish to Chromatic
id: chromatic
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
workingDir: apps/web

- name: Comment PR with Storybook link
uses: thollander/actions-comment-pull-request@v3
with:
message: |
🚀 Storybook 링크: ${{ steps.chromatic.outputs.storybookUrl }}
1 change: 1 addition & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"check-types": "tsc --noEmit",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
Expand Down
3 changes: 3 additions & 0 deletions apps/web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

*storybook.log
storybook-static
26 changes: 26 additions & 0 deletions apps/web/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import type { StorybookConfig } from "@storybook/nextjs-vite";

import { dirname } from "path";

import { fileURLToPath } from "url";

/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function getAbsolutePath(value: string): any {
return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)));
}
const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
getAbsolutePath("@chromatic-com/storybook"),
getAbsolutePath("@storybook/addon-vitest"),
getAbsolutePath("@storybook/addon-a11y"),
getAbsolutePath("@storybook/addon-docs"),
],
framework: getAbsolutePath("@storybook/nextjs-vite"),
staticDirs: ["../public"],
};
export default config;
21 changes: 21 additions & 0 deletions apps/web/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { Preview } from "@storybook/nextjs-vite";

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},

a11y: {
// 'todo' - show a11y violations in the test UI only
// 'error' - fail CI on a11y violations
// 'off' - skip a11y checks entirely
test: "todo",
},
},
};

export default preview;
7 changes: 7 additions & 0 deletions apps/web/.storybook/vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview";
import { setProjectAnnotations } from "@storybook/nextjs-vite";
import * as projectAnnotations from "./preview";

// This is an important step to apply the right configuration when testing your stories.
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);
4 changes: 3 additions & 1 deletion apps/web/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { defineConfig, globalIgnores } from "eslint/config";
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format

import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
import { defineConfig, globalIgnores } from "eslint/config";

const eslintConfig = defineConfig([
...nextVitals,
Expand Down
21 changes: 19 additions & 2 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,39 @@
"dev": "next dev -p 5173",
"build": "next build",
"start": "next start",
"lint": "eslint"
"lint": "eslint",
"check-types": "tsc --noEmit",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"chromatic": "npx chromatic --project-token=chpt_4cfbab0f11a8be9"
},
"dependencies": {
"next": "16.1.0",
"react": "19.2.3",
"react-dom": "19.2.3"
},
"devDependencies": {
"@chromatic-com/storybook": "^4.1.3",
"@storybook/addon-a11y": "^10.1.11",
"@storybook/addon-docs": "^10.1.11",
"@storybook/addon-vitest": "^10.1.11",
"@storybook/nextjs-vite": "^10.1.11",
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"@vitest/browser-playwright": "^4.0.16",
"@vitest/coverage-v8": "^4.0.16",
"babel-plugin-react-compiler": "1.0.0",
"chromatic": "^13.3.4",
"eslint": "^9",
"eslint-config-next": "16.1.0",
"eslint-plugin-storybook": "^10.1.11",
"playwright": "^1.57.0",
"storybook": "^10.1.11",
"tailwindcss": "^4",
"typescript": "^5"
"typescript": "^5",
"vite": "^7.3.0",
"vitest": "^4.0.16"
}
}
Loading
Loading