Skip to content

Conversation

@hamo-o
Copy link
Contributor

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

#️⃣ 연관된 이슈>

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

  • 개발환경 의존성을 제외시켜, EC2에서 workspace를 인식하지 못했던 에러를 수정합니다.
  • 윈도우 호환을 위해 서버 시작 명령어를 수정합니다.

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

Summary by CodeRabbit

  • Chores
    • Deployment workflow now installs only production dependencies, improving deployment efficiency.
    • TypeScript configuration updated to include additional config files in the build process.
    • Build and start scripts now set environment variables in a cross-platform way.
    • Build process conditionally runs the server after successful builds based on environment settings.

@hamo-o hamo-o requested a review from dioo1461 as a code owner June 10, 2025 01:42
@coderabbitai
Copy link

coderabbitai bot commented Jun 10, 2025

Walkthrough

The updates adjust the Node.js dependency installation command in the deployment workflow, standardize environment variable handling in build/start scripts using cross-env, expand TypeScript compilation to include root-level config files, and make the tsup bundler's post-build execution conditional based on the NODE_ENV environment variable.

Changes

File(s) Change Summary
.github/workflows/fe-cd.yml Changed dependency installation from pnpm install --frozen-lockfile to pnpm install --prod in deployment.
frontend/apps/server/package.json Updated build/start scripts to use cross-env for NODE_ENV; removed onSuccess hook from start script.
frontend/apps/server/tsconfig.json Included root-level *.config.ts files in TypeScript compilation.
frontend/apps/server/tsup.config.ts Made onSuccess post-build command conditional on NODE_ENV === 'start'.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant CI/CD Workflow
    participant EC2 Server

    Developer->>CI/CD Workflow: Push code / trigger deployment
    CI/CD Workflow->>EC2 Server: SSH and deploy code
    EC2 Server->>EC2 Server: pnpm install --prod (production deps only)
    EC2 Server->>EC2 Server: cross-env NODE_ENV=build tsup (build)
    EC2 Server->>EC2 Server: cross-env NODE_ENV=start tsup --watch (start with conditional onSuccess)
    Note over EC2 Server: If NODE_ENV=start, runs node dist/index.js after build
Loading

Poem

In the warren where code does grow,
We hop with cross-env, setting envs just so.
Only prod deps now take the ride,
While tsup’s onSuccess waits to decide.
Config files join the TypeScript parade—
A carrot-shaped upgrade, perfectly made! 🥕


📜 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 a9a05f7 and 083a05d.

📒 Files selected for processing (4)
  • .github/workflows/fe-cd.yml (1 hunks)
  • frontend/apps/server/package.json (1 hunks)
  • frontend/apps/server/tsconfig.json (1 hunks)
  • frontend/apps/server/tsup.config.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
frontend/apps/server/tsup.config.ts (2)
frontend/configs/tsup-config/src/node.ts (1)
  • nodeConfig (3-10)
frontend/configs/vitest-config/src/node.ts (1)
  • nodeConfig (3-10)
🔇 Additional comments (6)
frontend/apps/server/tsconfig.json (1)

13-13: Good addition to support config file compilation.

Including "*.config.ts" ensures that the tsup.config.ts file (which now contains conditional logic) is properly compiled by TypeScript. This change aligns well with the updates made to the tsup configuration.

.github/workflows/fe-cd.yml (1)

90-90: Excellent fix for the workspace recognition issue.

Changing to pnpm install --prod correctly excludes devDependencies (including workspace dependencies like @endolphin/tsup-config) during production deployment. This resolves the EC2 workspace recognition error mentioned in the PR objectives while following deployment best practices.

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

8-9:

Details

✅ Verification successful

Good cross-platform improvement, but verify cross-env dependency.

Using cross-env properly addresses the Windows single quote error mentioned in the PR objectives by providing consistent environment variable setting across platforms. Moving the onSuccess logic to tsup.config.ts with conditional execution is also a cleaner approach.

However, I don't see cross-env listed in the dependencies or devDependencies.


🏁 Script executed:

#!/bin/bash
# Check if cross-env is available as a dependency in the workspace
rg -A 5 -B 5 "cross-env" --type json

Length of output: 1401


cross-env Dependency Confirmed

The cross-env package (v7.0.3) is declared in the root frontend/package.json, so it will be available to all workspaces, including apps/server.

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

1-2: Modern import syntax for Node.js built-in module.

Using import process from 'node:process' follows the modern Node.js convention for importing built-in modules with the node: prefix.


6-6: Clean conditional logic for environment-based behavior.

The isStart variable provides a clear way to conditionally control the post-build execution based on the environment, which aligns with the script changes in package.json.


12-12: Effective conditional onSuccess implementation.

Moving the onSuccess logic from the CLI to the config file with conditional execution is a cleaner approach. The server will only auto-start when NODE_ENV=start (development), but not during builds (NODE_ENV=build).

✨ 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 10, 2025
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 4fba60a into dev Jun 10, 2025
5 checks passed
@hamo-o hamo-o deleted the bugfix/fe/server-package branch June 10, 2025 09:56
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.

[Bug] 서버 의존성 설치 오류 해결

3 participants