Skip to content

[Fix] #67 - resolve storybook/build 이슈 해결 및 npm lockfile 제거#68

Merged
sebeeeen merged 1 commit into
devfrom
fix/storybook-build-lockfile
Mar 23, 2026
Merged

[Fix] #67 - resolve storybook/build 이슈 해결 및 npm lockfile 제거#68
sebeeeen merged 1 commit into
devfrom
fix/storybook-build-lockfile

Conversation

@sebeeeen
Copy link
Copy Markdown
Member

@sebeeeen sebeeeen commented Mar 23, 2026

📝 Changes

  • package-lock.json 제거
  • Storybook 설정에서 불필요한 mdx 패턴 제거
  • Storybook 실행 경로에서 Vitest/Playwright 설정이 직접 섞이지 않도록 vite.config.ts 분리
  • 비어 있던 lists.tsx, lists.stories.tsx 제거
  • HomePage의 불필요한 Header 참조 제거
  • pagination.tsx의 unused React import 제거

✔ Checklist

  • pnpm build 성공
  • pnpm build-storybook 성공

🙏 Request

우리 프로젝트는 pnpm 기준으로 의존성을 관리합니다.

이번 이슈는 npm 실행으로 package-lock.json이 유입되면서 의존성 관리 기준이 섞였고 그 상태에서 Storybook/빌드 관련 문제가 함께 드러난 케이스였습니다.
이 프로젝트에서는 반드시 pnpm만 사용해야 하며 npm install 또는 npm i 명령어 대신 pnpm install 또는 pnpm i를 사용해주세요~

Summary by CodeRabbit

  • Refactor
    • Removed header component from the home page
    • Streamlined internal configuration and dependencies
    • Optimized build settings for improved testing workflow

@sebeeeen sebeeeen self-assigned this Mar 23, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 23, 2026

📝 Walkthrough

Walkthrough

This pull request removes Storybook/Vitest integration by updating addon and configuration settings, eliminates the Header widget from HomePage and its barrel export, removes an unused React import from pagination, and converts the Vite configuration to an async factory with conditional test setup based on environment variables.

Changes

Cohort / File(s) Summary
Storybook & Vite Configuration
.storybook/main.ts, vite.config.ts
Narrowed Storybook story globs to exclude MDX files, removed @storybook/addon-vitest addon, and restructured Vite config as async factory with conditional Vitest/Playwright test setup based on VITEST environment variable.
Header Widget Removal
src/pages/home/home.tsx, src/widgets/index.ts
Removed Header component import, associated User type, and user state management from HomePage; removed Header barrel export from widgets index.
Import Cleanup
src/shared/ui/pagination/pagination.tsx
Removed unused default React import.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Suggested labels

dependencies

Suggested reviewers

  • kimsman06
  • jaeu5325

Poem

🐰 Out with Vitest, away with the Header,
Configuration clean makes the code much better!
Async Vite flows where conditions now lead,
No unused imports—just what projects need! 🌿✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title references issue #67 and mentions resolving Storybook/build issues and npm lockfile removal, which aligns with the main changes in the PR.
Description check ✅ Passed The description includes the required 'Changes' section with clear bullet points and 'Checklist' with completed items, but the core 'What is this PR?' section is missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/storybook-build-lockfile

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@vite.config.ts`:
- Line 11: The code checks process.env.VITEST via the isVitest variable (const
isVitest) so Storybook's Vitest-gated config (the browser test registration
guarded by isVitest) never runs unless VITEST is set; add a test entry in
package.json (or update your CI/test workflow) that exports VITEST=true when
running Vitest (for example a "test:storybook" script that sets VITEST=true
before invoking vitest) so isVitest becomes true and the Storybook Vitest
integration tests are registered and executed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8f51f796-6ed8-427b-9b0f-9f8cfac48f38

📥 Commits

Reviewing files that changed from the base of the PR and between f51b190 and 4133605.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • .storybook/main.ts
  • src/pages/home/home.tsx
  • src/shared/ui/lists/lists.stories.tsx
  • src/shared/ui/lists/lists.tsx
  • src/shared/ui/pagination/pagination.tsx
  • src/widgets/index.ts
  • vite.config.ts
💤 Files with no reviewable changes (3)
  • src/widgets/index.ts
  • src/shared/ui/pagination/pagination.tsx
  • src/pages/home/home.tsx

Comment thread vite.config.ts
alias: {
"@": path.resolve(dirname, "./src"),
export default defineConfig(async () => {
const isVitest = process.env.VITEST === "true";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Scanning package.json scripts for vitest/storybook/VITEST usage..."
fd '^package\.json$' --type f | while read -r file; do
  echo ""
  echo "== $file =="
  jq -r '.scripts // {} | to_entries[] | "\(.key): \(.value)"' "$file" \
    | rg -n 'vitest|storybook|VITEST|test' || true
done

Repository: ajou-industry-matching/aim-frontend

Length of output: 235


🏁 Script executed:

# First, let's check the vite.config.ts file at the relevant lines
cat -n vite.config.ts | head -50

Repository: ajou-industry-matching/aim-frontend

Length of output: 1758


🏁 Script executed:

# Check for vitest configuration files
fd -e 'vitest\.config\.(ts|js)$|\.vitest\.*' --type f

Repository: ajou-industry-matching/aim-frontend

Length of output: 61


🏁 Script executed:

# Search for all test-related scripts or env setup
rg -i 'VITEST|vitest.*config' --type ts --type js --max-count 20

Repository: ajou-industry-matching/aim-frontend

Length of output: 589


🏁 Script executed:

# Search for vitest config with all possible extensions
fd -i 'vitest' -e 'config' -e 'mts' -e 'cjs' --type f

Repository: ajou-industry-matching/aim-frontend

Length of output: 61


🏁 Script executed:

# Get the complete package.json to see all scripts
cat -n package.json

Repository: ajou-industry-matching/aim-frontend

Length of output: 2172


🏁 Script executed:

# Check for CI/CD configuration files
fd -e 'yml' -e 'yaml' -e 'json' --path '*/.github/*' --type f | head -20

Repository: ajou-industry-matching/aim-frontend

Length of output: 312


🏁 Script executed:

# Check for CI/CD files
find .github -type f 2>/dev/null | head -20

Repository: ajou-industry-matching/aim-frontend

Length of output: 287


🏁 Script executed:

# Search for any file that might set VITEST environment
rg 'VITEST' --type-list | head -5
rg 'VITEST\s*=' -r . --type yaml --type json --type sh 2>/dev/null || echo "No matches in YAML/JSON/SH files"

Repository: ajou-industry-matching/aim-frontend

Length of output: 518


🏁 Script executed:

# Check the GitHub Actions workflows for VITEST env setup
cat -n .github/workflows/firebase-hosting-merge.yml

Repository: ajou-industry-matching/aim-frontend

Length of output: 830


🏁 Script executed:

# Also check the pull request workflow
cat -n .github/workflows/firebase-hosting-pull-request.yml

Repository: ajou-industry-matching/aim-frontend

Length of output: 938


Add a test script that sets VITEST=true to enable Storybook Vitest integration tests.

The vite.config.ts conditionally gates the Storybook browser test configuration (lines 20–45) on process.env.VITEST === "true", but no npm script currently sets this environment variable. As a result, these tests will not be registered or executed. Either add a test script like "test:storybook": "VITEST=true vitest" to package.json, or update the existing build/test workflow to set the environment variable when running tests.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@vite.config.ts` at line 11, The code checks process.env.VITEST via the
isVitest variable (const isVitest) so Storybook's Vitest-gated config (the
browser test registration guarded by isVitest) never runs unless VITEST is set;
add a test entry in package.json (or update your CI/test workflow) that exports
VITEST=true when running Vitest (for example a "test:storybook" script that sets
VITEST=true before invoking vitest) so isVitest becomes true and the Storybook
Vitest integration tests are registered and executed.

@sebeeeen sebeeeen merged commit f9195e7 into dev Mar 23, 2026
1 check passed
@sebeeeen sebeeeen deleted the fix/storybook-build-lockfile branch March 23, 2026 23:46
@sebeeeen sebeeeen linked an issue Mar 23, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] Storybook 실행 불가 및 pnpm 워크스페이스 오염 정리

1 participant