Skip to content

Conversation

@ramong26
Copy link
Owner

📝 PR 제목

1차 배포 테스트 pr


🛠 변경 내용

  • 깃허브 액션을 이용한 CI & Release pnpm으로

🎯 목적 / 이유

  • main에 하기 전 브랜치 pr 올림

✅ 확인 사항

  • 빌드 통과 ✅
  • 테스트 통과 ✅
  • 불필요한 console.log 제거 ✅

@ramong26 ramong26 requested a review from Copilot September 22, 2025 02:51
@ramong26 ramong26 self-assigned this Sep 22, 2025
@ramong26 ramong26 added the feat This issue or pull request a new feature label Sep 22, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @ramong26, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 첫 번째 배포 테스트를 위한 것으로, GitHub Actions와 pnpm을 활용한 CI/CD 릴리즈 워크플로우를 설정하는 데 중점을 둡니다. 또한, 컴포넌트 라이브러리 배포를 위한 package.json 메타데이터를 업데이트하고, 캐러셀 컴포넌트의 테스트 코드를 개선하여 비동기 동작의 안정성을 확보합니다. 이는 main 브랜치에 병합하기 전 변경 사항을 검증하기 위한 목적입니다.

Highlights

  • 패키지 메타데이터 업데이트: package.json 파일이 업데이트되어 패키지 이름이 "@ramong23/recomponent"로 변경되었고, 버전이 "1.0.0"으로 설정되었으며, 배포를 위한 다양한 메타데이터 필드(예: "main", "module", "types", "exports", "keywords", "repository")가 추가되었습니다.
  • 캐러셀 테스트 개선: Carousel.test.tsx 파일에서 캐러셀 컴포넌트 테스트 로직이 개선되었습니다. 특히, "act" 유틸리티를 사용하여 비동기 타이머 기반 테스트의 안정성을 높였고, 슬라이드 클릭 테스트 시 인디케이터를 통한 탐색 및 슬라이드 존재 여부 확인 로직이 추가되었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR sets up GitHub Actions CI/CD pipeline for automated testing and npm package publishing using pnpm. The changes prepare the project for first deployment by configuring package metadata and workflow automation.

  • Updated package.json with proper npm package configuration including exports, repository info, and new package name
  • Added comprehensive GitHub Actions workflow for CI testing and automated npm publishing on tag releases
  • Enhanced Carousel component tests with better async handling using act() wrapper

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
package.json Configured package metadata for npm publishing with new name, version, and exports
.github/workflows/npm-publish.yml Added complete CI/CD workflow for testing and automated npm releases
src/components/Carousel/Carousel.test.tsx Improved test reliability with proper async handling and act() wrapper

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

repo: context.repo.repo,
tag_name: tagName,
name: `Release ${tagName}`,
body: `🚀 Package successfully published to NPM!\n\n**Version:** ${tagName}\n**Package:** [recomponent](https://www.npmjs.com/package/recomponent)`,
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

The package name in the NPM link should be '@ramong23/recomponent' to match the actual package name defined in package.json.

Suggested change
body: `🚀 Package successfully published to NPM!\n\n**Version:** ${tagName}\n**Package:** [recomponent](https://www.npmjs.com/package/recomponent)`,
body: `🚀 Package successfully published to NPM!\n\n**Version:** ${tagName}\n**Package:** [@ramong23/recomponent](https://www.npmjs.com/package/@ramong23/recomponent)`,

Copilot uses AI. Check for mistakes.
Your package has been successfully published to NPM!
Version: ${{ github.ref_name }}
Package: recomponent
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

The package name should be '@ramong23/recomponent' to match the actual package name defined in package.json.

Suggested change
Package: recomponent
Package: @ramong23/recomponent

Copilot uses AI. Check for mistakes.
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 배포 테스트를 위한 변경 사항으로, package.json의 배포 관련 설정을 추가하고 Carousel 컴포넌트의 테스트 코드를 개선했습니다. 전반적으로 좋은 방향의 수정이지만, 몇 가지 개선점을 제안합니다. package.json에 있는 저장소 관련 URL에 오타가 있는 것으로 보이며, 이를 수정해야 합니다. 또한, Carousel.test.tsx 파일의 두 테스트 케이스 모두에 반복적인 코드가 있어, 이를 루프로 리팩토링하여 가독성과 유지보수성을 향상시킬 수 있습니다. 자세한 내용은 각 파일에 남긴 주석을 확인해주세요.

Comment on lines +27 to +34
"repository": {
"type": "git",
"url": "https://github.com/ramong26/xp-components.git"
},
"homepage": "https://github.com/ramong26/xp-components",
"bugs": {
"url": "https://github.com/ramong26/xp-components/issues"
},

Choose a reason for hiding this comment

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

high

repository, homepage, bugs URL에 오타가 있는 것 같습니다. 사용자 이름이 ramong26으로 되어 있는데, author 필드와 패키지 이름을 보면 ramong23이 맞는 것 같습니다. 일관성을 위해 수정하는 것을 권장합니다.

  "repository": {
    "type": "git",
    "url": "https://github.com/ramong23/xp-components.git"
  },
  "homepage": "https://github.com/ramong23/xp-components",
  "bugs": {
    "url": "https://github.com/ramong23/xp-components/issues"
  }

Comment on lines 35 to 47
expect(screen.getByRole('heading', { name: /Slide 1/i })).toBeInTheDocument();
await userEvent.click(screen.getByRole('heading', { name: /Slide 1/i }));
expect(items[0].onClick).toHaveBeenCalled();
await userEvent.click(slide2);

await userEvent.click(indicators[1]);
expect(screen.getByRole('heading', { name: /Slide 2/i })).toBeInTheDocument();
await userEvent.click(screen.getByRole('heading', { name: /Slide 2/i }));
expect(items[1].onClick).toHaveBeenCalled();
await userEvent.click(slide3);

await userEvent.click(indicators[2]);
expect(screen.getByRole('heading', { name: /Slide 3/i })).toBeInTheDocument();
await userEvent.click(screen.getByRole('heading', { name: /Slide 3/i }));
expect(items[2].onClick).toHaveBeenCalled();

Choose a reason for hiding this comment

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

medium

이 테스트 케이스의 로직이 여러 번 반복되고 있습니다. 각 슬라이드에 대한 확인 및 클릭 로직을 루프로 만들어 코드를 더 간결하고 유지보수하기 쉽게 만들 수 있습니다. 이렇게 하면 캐러셀 아이템이 추가되거나 변경될 때 테스트 코드를 더 쉽게 확장할 수 있습니다.

Suggested change
expect(screen.getByRole('heading', { name: /Slide 1/i })).toBeInTheDocument();
await userEvent.click(screen.getByRole('heading', { name: /Slide 1/i }));
expect(items[0].onClick).toHaveBeenCalled();
await userEvent.click(slide2);
await userEvent.click(indicators[1]);
expect(screen.getByRole('heading', { name: /Slide 2/i })).toBeInTheDocument();
await userEvent.click(screen.getByRole('heading', { name: /Slide 2/i }));
expect(items[1].onClick).toHaveBeenCalled();
await userEvent.click(slide3);
await userEvent.click(indicators[2]);
expect(screen.getByRole('heading', { name: /Slide 3/i })).toBeInTheDocument();
await userEvent.click(screen.getByRole('heading', { name: /Slide 3/i }));
expect(items[2].onClick).toHaveBeenCalled();
for (const [index, item] of items.entries()) {
if (index > 0) {
await userEvent.click(indicators[index]);
}
const slide = screen.getByRole('heading', { name: new RegExp(item.title, 'i') });
expect(slide).toBeInTheDocument();
await userEvent.click(slide);
expect(item.onClick).toHaveBeenCalled();
}

Comment on lines 58 to 77
await act(async () => {
vi.advanceTimersByTime(1000);
});

expect(indicators[0]).not.toHaveClass('active');
expect(indicators[1]).toHaveClass('active');

vi.advanceTimersByTime(1000);
await act(async () => {
vi.advanceTimersByTime(1000);
});

expect(indicators[1]).not.toHaveClass('active');
expect(indicators[2]).toHaveClass('active');

vi.advanceTimersByTime(1000);
await act(async () => {
vi.advanceTimersByTime(1000);
});

expect(indicators[2]).not.toHaveClass('active');
expect(indicators[0]).toHaveClass('active');

Choose a reason for hiding this comment

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

medium

자동 슬라이드 동작을 검증하는 테스트 코드에 반복되는 로직이 있습니다. actexpect 호출이 여러 번 반복되는데, 이를 루프로 리팩토링하면 코드가 더 간결해지고 유지보수하기 쉬워집니다. 예를 들어, 캐러셀 아이템 개수가 변경되어도 테스트 코드를 수정할 필요가 없어집니다.

Suggested change
await act(async () => {
vi.advanceTimersByTime(1000);
});
expect(indicators[0]).not.toHaveClass('active');
expect(indicators[1]).toHaveClass('active');
vi.advanceTimersByTime(1000);
await act(async () => {
vi.advanceTimersByTime(1000);
});
expect(indicators[1]).not.toHaveClass('active');
expect(indicators[2]).toHaveClass('active');
vi.advanceTimersByTime(1000);
await act(async () => {
vi.advanceTimersByTime(1000);
});
expect(indicators[2]).not.toHaveClass('active');
expect(indicators[0]).toHaveClass('active');
for (let i = 0; i < items.length; i++) {
const currentIndex = i;
const nextIndex = (i + 1) % items.length;
await act(async () => {
vi.advanceTimersByTime(1000);
});
expect(indicators[currentIndex]).not.toHaveClass('active');
expect(indicators[nextIndex]).toHaveClass('active');
}

@ramong26 ramong26 linked an issue Sep 22, 2025 that may be closed by this pull request
@ramong26 ramong26 merged commit 56d838d into main Sep 22, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat This issue or pull request a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat/test-deploy] - 배포 테스트

2 participants