Skip to content

Conversation

@hamo-o
Copy link
Contributor

@hamo-o hamo-o commented Jun 9, 2025

#️⃣ 연관된 이슈>

📝 작업 내용> 이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)

🙏 여기는 꼭 봐주세요! > 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

Summary by CodeRabbit

  • New Features

    • Introduced shared configuration packages for build and test tools, making setup consistent across projects.
    • Added Vitest configuration files to multiple packages, enabling unified and streamlined testing.
    • Added a top-level test script to run tests across all packages.
    • Added test scripts to individual packages for easier test execution.
  • Refactor

    • Simplified and unified build and test configurations by delegating to shared configs, reducing duplication.
    • Centralized module aliasing for imports to improve code clarity and maintainability.
  • Chores

    • Updated workspace and editor settings to recognize new configuration packages.
    • Updated dependencies and scripts in several package manifests for improved tooling and compatibility.
  • Style

    • Standardized import paths using aliases for better maintainability.

@hamo-o hamo-o requested a review from dioo1461 as a code owner June 9, 2025 08:08
@coderabbitai
Copy link

coderabbitai bot commented Jun 9, 2025

Walkthrough

This change introduces centralized configuration packages for Vitest and Tsup, adds them to the workspace, and refactors all frontend apps and packages to use these shared configs for consistent testing and build processes. It also updates workspace scripts, adds project-level Vitest configs, and standardizes path aliasing across packages.

Changes

Files / Group Change Summary
frontend/configs/vitest-config/*, frontend/configs/tsup-config/* Added new shared configuration packages for Vitest and Tsup, including package manifests, TypeScript configs, and source files for Node and React environments.
frontend/pnpm-workspace.yaml, frontend/endolphin.code-workspace Included new configs/* directories in workspace and editor settings.
frontend/package.json Added a recursive test script and upgraded Vitest version.
frontend/vitest.config.ts Added a root Vitest config to aggregate project-level configs.
frontend/apps/*/package.json, frontend/packages/*/package.json Added test scripts and devDependencies for shared config usage; standardized test scripts.
frontend/apps/*/tsup.config.ts, frontend/packages/*/tsup.config.ts Refactored to use shared Tsup config (nodeConfig or reactConfig) instead of inline settings.
frontend/apps/*/vitest.config.ts, frontend/packages/*/vitest.config.ts Added or updated Vitest config files to merge shared configs with project-specific aliasing.
frontend/apps/client/vite.config.ts Removed in-file test configuration in favor of externalized Vitest config.
frontend/packages/core/src/utils/date/date.test.ts, frontend/packages/core/src/utils/date/position.ts Updated import paths to use new aliasing system.

Sequence Diagram(s)

sequenceDiagram
    participant TestRunner as Vitest CLI
    participant SharedConfig as @endolphin/vitest-config
    participant ProjectConfig as <package>/vitest.config.ts

    TestRunner->>ProjectConfig: Load vitest.config.ts
    ProjectConfig->>SharedConfig: Import base config & alias helpers
    ProjectConfig->>ProjectConfig: Define project-specific aliases
    ProjectConfig->>SharedConfig: Merge base config with project config
    ProjectConfig-->>TestRunner: Export merged config
    TestRunner->>TestRunner: Run tests with unified config
Loading

Possibly related PRs

Suggested reviewers

  • dioo1461
  • efdao

Poem

In the warren of configs, a rabbit did hop,
Centralizing tests with a skip and a plop.
With aliases clear and builds now aligned,
The codebase is tidy, robust, and refined.
🐇✨
“Let’s test and let’s build, with configs we share—
For code that is clean and easy to care!”


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 74c8fca and ab85d36.

📒 Files selected for processing (8)
  • frontend/apps/client/vitest.config.ts (1 hunks)
  • frontend/apps/server/vitest.config.ts (1 hunks)
  • frontend/configs/tsup-config/src/react.ts (1 hunks)
  • frontend/packages/calendar/vitest.config.ts (1 hunks)
  • frontend/packages/core/vitest.config.ts (1 hunks)
  • frontend/packages/date-time/vitest.config.ts (1 hunks)
  • frontend/packages/ui/vitest.config.ts (1 hunks)
  • frontend/vitest.config.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • frontend/packages/core/vitest.config.ts
🚧 Files skipped from review as they are similar to previous changes (7)
  • frontend/apps/client/vitest.config.ts
  • frontend/apps/server/vitest.config.ts
  • frontend/vitest.config.ts
  • frontend/packages/calendar/vitest.config.ts
  • frontend/packages/ui/vitest.config.ts
  • frontend/configs/tsup-config/src/react.ts
  • frontend/packages/date-time/vitest.config.ts
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hamo-o hamo-o added the 🖥️ FE Frontend label Jun 9, 2025
Copy link

@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: 5

🧹 Nitpick comments (6)
frontend/configs/vitest-config/src/createAlias.ts (1)

3-7: Complete the JSDoc documentation.

The JSDoc comment is incomplete and has formatting issues.

 /**
- * 
+ * Creates alias mappings for common source directories.
  * @param {string} dirname - 현재 패키지의 루트 디렉토리.
- * @returns 
+ * @returns {object} Object mapping alias keys to resolved paths.
  */
frontend/configs/vitest-config/package.json (1)

1-17: Consider adding missing package metadata.

The package.json is functionally correct but missing some standard fields that would improve package management and discoverability.

 {
   "name": "@endolphin/vitest-config",
   "version": "1.0.0",
+  "description": "Shared Vitest configuration for endolphin frontend projects",
+  "license": "MIT",
   "type": "module",
   "main": "./dist/index.js",
frontend/pnpm-workspace.yaml (1)

5-5: Ensure newline at EOF
YAMLlint flagged a missing newline at the end of the file. Append a blank line after the last entry to satisfy the linter.

frontend/packages/calendar/package.json (1)

12-15: Optional: Add coverage script
Consider adding a coverage script (e.g., "coverage": "vitest run --coverage") to maintain consistency with other packages and facilitate coverage reporting.

frontend/configs/tsup-config/tsconfig.json (1)

1-9: Centralized Tsup TypeScript config setup looks solid
The configuration correctly extends the base, outputs declarations, and targets the src directory.

Consider adding a rootDir for stricter file placement:

  "compilerOptions": {
+   "rootDir": "src",
    "outDir": "dist",
    "declaration": true,
    "declarationDir": "dist/types",
  },
frontend/configs/tsup-config/src/react.ts (1)

4-12: Consider enabling source maps for debugging.
Generating source maps can improve traceability when consuming the library.

 export const reactConfig = defineConfig({
+  sourcemap: true,
   format: ['esm'],
   entry: ['src/index.ts'],
   outDir: 'dist',
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 262599f and 74c8fca.

⛔ Files ignored due to path filters (1)
  • frontend/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (36)
  • frontend/apps/client/package.json (1 hunks)
  • frontend/apps/client/vite.config.ts (0 hunks)
  • frontend/apps/client/vitest.config.ts (1 hunks)
  • frontend/apps/server/package.json (1 hunks)
  • frontend/apps/server/tsup.config.ts (1 hunks)
  • frontend/apps/server/vitest.config.ts (1 hunks)
  • frontend/configs/tsup-config/package.json (1 hunks)
  • frontend/configs/tsup-config/src/index.ts (1 hunks)
  • frontend/configs/tsup-config/src/node.ts (1 hunks)
  • frontend/configs/tsup-config/src/react.ts (1 hunks)
  • frontend/configs/tsup-config/tsconfig.json (1 hunks)
  • frontend/configs/vitest-config/package.json (1 hunks)
  • frontend/configs/vitest-config/src/createAlias.ts (1 hunks)
  • frontend/configs/vitest-config/src/index.ts (1 hunks)
  • frontend/configs/vitest-config/src/node.ts (1 hunks)
  • frontend/configs/vitest-config/src/react.ts (1 hunks)
  • frontend/configs/vitest-config/tsconfig.json (1 hunks)
  • frontend/endolphin.code-workspace (1 hunks)
  • frontend/package.json (2 hunks)
  • frontend/packages/calendar/package.json (2 hunks)
  • frontend/packages/calendar/tsup.config.ts (1 hunks)
  • frontend/packages/calendar/vitest.config.ts (1 hunks)
  • frontend/packages/core/package.json (1 hunks)
  • frontend/packages/core/src/utils/date/date.test.ts (1 hunks)
  • frontend/packages/core/src/utils/date/position.ts (1 hunks)
  • frontend/packages/core/vitest.config.ts (1 hunks)
  • frontend/packages/date-time/package.json (1 hunks)
  • frontend/packages/date-time/tsup.config.ts (1 hunks)
  • frontend/packages/date-time/vitest.config.ts (1 hunks)
  • frontend/packages/theme/package.json (1 hunks)
  • frontend/packages/theme/tsup.config.ts (1 hunks)
  • frontend/packages/ui/package.json (2 hunks)
  • frontend/packages/ui/tsup.config.ts (1 hunks)
  • frontend/packages/ui/vitest.config.ts (1 hunks)
  • frontend/pnpm-workspace.yaml (1 hunks)
  • frontend/vitest.config.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • frontend/apps/client/vite.config.ts
🧰 Additional context used
🧬 Code Graph Analysis (11)
frontend/packages/date-time/tsup.config.ts (1)
frontend/configs/tsup-config/src/node.ts (1)
  • nodeConfig (3-10)
frontend/packages/calendar/tsup.config.ts (1)
frontend/configs/tsup-config/src/react.ts (1)
  • reactConfig (4-12)
frontend/apps/server/vitest.config.ts (1)
frontend/configs/vitest-config/src/node.ts (1)
  • nodeConfig (3-10)
frontend/packages/core/vitest.config.ts (1)
frontend/configs/vitest-config/src/createAlias.ts (1)
  • createAlias (8-14)
frontend/packages/ui/vitest.config.ts (1)
frontend/configs/vitest-config/src/createAlias.ts (1)
  • createAlias (8-14)
frontend/packages/date-time/vitest.config.ts (2)
frontend/configs/vitest-config/src/node.ts (1)
  • nodeConfig (3-10)
frontend/configs/vitest-config/src/createAlias.ts (1)
  • createAlias (8-14)
frontend/packages/calendar/vitest.config.ts (1)
frontend/configs/vitest-config/src/createAlias.ts (1)
  • createAlias (8-14)
frontend/apps/server/tsup.config.ts (1)
frontend/configs/tsup-config/src/node.ts (1)
  • nodeConfig (3-10)
frontend/apps/client/vitest.config.ts (1)
frontend/configs/vitest-config/src/createAlias.ts (1)
  • createAlias (8-14)
frontend/packages/theme/tsup.config.ts (1)
frontend/configs/tsup-config/src/react.ts (1)
  • reactConfig (4-12)
frontend/packages/ui/tsup.config.ts (1)
frontend/configs/tsup-config/src/react.ts (1)
  • reactConfig (4-12)
🪛 YAMLlint (1.37.1)
frontend/pnpm-workspace.yaml

[error] 4-4: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (39)
frontend/configs/vitest-config/src/node.ts (1)

1-10: LGTM! Clean and standard Vitest Node.js configuration.

The configuration follows Vitest best practices with appropriate settings for Node.js environment testing. The inclusion patterns and options are well-chosen for a shared configuration.

frontend/configs/tsup-config/src/node.ts (1)

1-11: LGTM! Well-configured Tsup setup for Node.js projects.

The configuration includes all essential options for a modern Node.js build setup with ESM output, TypeScript declarations, and proper cleanup. Good choice for a shared configuration.

frontend/configs/vitest-config/src/createAlias.ts (1)

8-14: LGTM! Well-designed alias utility function.

The function correctly uses path.resolve to create absolute paths and covers the most common alias patterns used in frontend projects. The implementation is clean and reusable.

frontend/configs/vitest-config/src/react.ts (1)

1-10: React Vitest configuration setup is correct.
The reactConfig export uses appropriate test patterns and a jsdom environment for React testing.

frontend/packages/core/src/utils/date/position.ts (1)

1-1: Alias import usage looks correct.
Ensure that the @constants/date path is configured in your TypeScript paths (tsconfig.json) and resolves at runtime.

frontend/packages/core/src/utils/date/date.test.ts (1)

1-1: Alias import updated correctly.
Confirm that the @constants/date alias is recognized by your test runner and TypeScript configuration.

frontend/apps/server/package.json (1)

16-18: Added shared config packages to devDependencies.
The new @endolphin/tsup-config and @endolphin/vitest-config entries align with other workspace packages.

frontend/packages/theme/package.json (1)

21-23: Introduced tsup-config as a devDependency.
This addition standardizes the build configuration for the theme package.

frontend/apps/client/package.json (1)

31-34: Integrate shared Vitest config
Adding @endolphin/vitest-config as a devDependency standardizes test setup across all frontend apps.

frontend/endolphin.code-workspace (1)

34-42: Include shared config packages in workspace
The new tsup-config and vitest-config folders are correctly added to the workspace, enabling IDE awareness of these packages.

frontend/pnpm-workspace.yaml (1)

3-4: Expand workspace to include config packages
Adding configs/* under packages ensures the new shared config packages are part of the pnpm workspace.

🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 4-4: no new line character at the end of file

(new-line-at-end-of-file)

frontend/configs/tsup-config/src/index.ts (1)

1-2: Re-export tsup configs
The top-level index file cleanly re-exports both nodeConfig and reactConfig. Verify that your TS config (e.g., moduleResolution) supports .js extensions in imports.

frontend/packages/calendar/package.json (2)

12-15: Add start and test scripts
Including tsup --watch for development and vitest for tests aligns this package with others in the monorepo.


24-27: Register shared build & test configs
Introducing @endolphin/tsup-config and @endolphin/vitest-config as devDependencies centralizes configuration.

frontend/packages/ui/package.json (2)

13-15: Add Vitest test script alongside build/watch commands
Including "test": "vitest" aligns this package with the shared testing setup.


23-26: Include shared config packages in devDependencies
Depend on @endolphin/tsup-config and @endolphin/vitest-config to centralize build and test settings.

frontend/package.json (2)

9-9: Add monorepo-wide recursive test script
The "test": "pnpm -r test" entry enables running Vitest across all workspace projects with a single command.


58-58: Upgrade Vitest to ^3.2.2
Ensure this bump is compatible with the new shared Vitest config and validate there are no breaking changes before merging.

frontend/configs/vitest-config/tsconfig.json (1)

1-9: Central Vitest TypeScript config is correctly defined
Extends the base config and emits declarations into dist/types for the shared Vitest package.

frontend/configs/vitest-config/src/index.ts (1)

1-3: Re-export core Vitest configuration modules
This centralizes imports (createAlias, node, react) for downstream Vitest configs.

frontend/packages/date-time/tsup.config.ts (2)

1-1: LGTM! Proper import of shared configuration.

Good refactoring to use the centralized nodeConfig from the shared @endolphin/tsup-config package.


4-6: LGTM! Clean configuration spreading.

The spread operator usage allows for future customization while leveraging the shared base configuration. This follows the DRY principle effectively.

frontend/apps/server/vitest.config.ts (2)

1-2: LGTM! Proper imports for shared Vitest configuration.

Correctly imports the shared nodeConfig and necessary Vitest utilities for configuration merging.


4-7: LGTM! Proper configuration merging pattern.

The mergeConfig approach with an empty defineProject({}) allows for future customization while inheriting the base Node.js test configuration.

frontend/configs/tsup-config/package.json (1)

1-17: LGTM! Well-structured package.json for shared configuration.

The package configuration follows best practices:

  • Proper ES module type declaration
  • Clean export configuration for both runtime and types
  • Restricted file publishing to dist directory
  • Simple and effective build script
frontend/packages/core/package.json (2)

19-19: LGTM! Test script added correctly.

The addition of the vitest test script follows the standardization effort outlined in the PR objectives.


21-23: LGTM! Proper workspace dependency configuration.

The use of workspace:^ protocol for the shared vitest config is appropriate for monorepo dependency management.

frontend/packages/date-time/package.json (2)

13-13: LGTM! Consistent test script addition.

The vitest test script addition is consistent with the standardization across packages.


18-21: LGTM! Complete shared config dependencies added.

Both tsup-config and vitest-config dependencies are appropriately added using workspace protocol, enabling the package to use shared build and test configurations.

frontend/packages/calendar/vitest.config.ts (1)

1-16: LGTM! Proper vitest configuration setup.

The configuration correctly:

  • Uses ES module directory resolution with fileURLToPath(import.meta.url)
  • Merges shared React config with project-specific aliases using createAlias
  • Follows the standardized pattern for vitest configuration across packages

The implementation aligns well with the shared configuration strategy outlined in the PR objectives.

frontend/packages/calendar/tsup.config.ts (1)

1-10: LGTM! Excellent refactoring to shared configuration.

The refactoring effectively:

  • Uses shared reactConfig from @endolphin/tsup-config to reduce duplication
  • Preserves package-specific requirements (external dependencies and CSS banner)
  • Maintains the same build functionality while improving maintainability

This aligns perfectly with the PR's goal of standardizing build configurations across packages.

frontend/packages/core/vitest.config.ts (1)

1-16: LGTM! Clean implementation of shared Vitest configuration.

The configuration correctly:

  • Uses shared reactConfig for consistent testing setup
  • Implements proper ES module path resolution with import.meta.url
  • Creates project-specific aliases for clean import paths in tests
  • Follows Vitest best practices with mergeConfig and defineProject

This approach will standardize testing across the frontend workspace while allowing package-specific customization.

frontend/apps/server/tsup.config.ts (1)

1-8: Excellent refactoring to shared configuration.

The changes appropriately:

  • Leverage shared nodeConfig for consistent Node.js build settings
  • Override dts: false which is sensible for server applications
  • Maintain bundle: false for the existing build strategy

This reduces configuration duplication while preserving server-specific requirements.

frontend/packages/theme/tsup.config.ts (1)

1-6: Perfect simplification using shared configuration.

The refactoring cleanly delegates all build configuration to the shared reactConfig, which includes appropriate settings for React packages (ES modules, TypeScript declarations, Vanilla Extract plugin, etc.). This eliminates configuration duplication while maintaining all necessary functionality.

frontend/packages/ui/tsup.config.ts (1)

1-10: Well-balanced use of shared configuration with appropriate overrides.

The implementation correctly:

  • Uses shared reactConfig for standard React package build settings
  • Preserves essential package-specific configurations:
    • external: ['@endolphin/theme'] - proper dependency externalization
    • banner with CSS import - ensures component styles are included

This demonstrates the ideal pattern of leveraging shared configs while maintaining necessary package-specific requirements.

frontend/packages/date-time/vitest.config.ts (2)

1-4: Imports and dependencies are correctly centralized.
The file cleanly pulls in shared Vitest utilities (createAlias, nodeConfig) and necessary Node.js modules.


9-16: Merging shared and project-specific configs is sound.
This follows the intended pattern for a monorepo Vitest setup—no further changes needed here.

frontend/packages/ui/vitest.config.ts (1)

1-4: Shared React Vitest config import is correct.
Leveraging the centralized reactConfig and alias helper aligns with the monorepo strategy.

frontend/apps/client/vitest.config.ts (1)

1-4: Client app Vitest imports are set up properly.
The merge of shared reactConfig with package-specific aliases is correctly structured.

Copy link
Contributor

@dioo1461 dioo1461 left a comment

Choose a reason for hiding this comment

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

에러없이 잘 작동하네요, 고생하셨습니다!!

@hamo-o hamo-o merged commit a9a05f7 into dev Jun 9, 2025
1 check passed
@hamo-o hamo-o deleted the feature/fe/config branch June 9, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🖥️ FE Frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants