Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(template): add private:true package.json in template #113

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

froggy1014
Copy link
Contributor

@froggy1014 froggy1014 commented Jan 22, 2025

Changes

--ignore flag를 세워도 진행되지 않았습니다. changeset쪽에서도 Monorepo 쪽에서는 커스터마이징이 의도처럼 안될 수 있으니 private: true를 추가해보라고 나와있어서 이 방법을 시도해보려고합니다.

Visuals

image

.templates/component/package.json

{
 ...package.json,
 "private": true
}

scripts/createComponent.ts

private async updatePackageJson(targetDir: string): Promise<void> {
    const packageJsonPath = path.join(targetDir, 'package.json');
    const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));

    const { private: _, ...newPackageJson } = packageJson;
    await fs.writeFile(
      packageJsonPath,
      JSON.stringify(newPackageJson, null, 2),
    );
  }

script를 통해서 컴포넌트를 생성할때, private는 제거토록 했습니다.

Checklist

  • Have you written the functional specifications?
  • Have you written the test code?

Additional Discussion Points

Summary by CodeRabbit

  • 워크플로우 변경

    • GitHub Actions 릴리스 워크플로우의 버전 결정 프로세스 업데이트
    • 특정 패키지 제외 옵션 제거
  • 패키지 설정

    • 일부 컴포넌트 템플릿 패키지를 비공개로 표시
    • 패키지 게시 설정 조정
  • 개발 도구

    • Lint-staged 구성 파일 타입 필터링 변경
    • 특정 파일 유형에 대한 포맷 및 린트 규칙 업데이트
  • 스크립트 개선

    • 컴포넌트 생성 스크립트에 패키지 JSON 업데이트 기능 추가

Copy link

changeset-bot bot commented Jan 22, 2025

⚠️ No Changeset found

Latest commit: 91aad41

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

coderabbitai bot commented Jan 22, 2025

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

scripts/createComponent.ts

Oops! Something went wrong! :(

ESLint: 9.17.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

워크스루

이 풀 리퀘스트는 세 개의 주요 파일 (release.yaml, package.json, createComponent.ts)에 대한 변경 사항을 포함하고 있습니다. GitHub Actions 릴리스 워크플로우에서 버전 결정 명령을 수정하고, 컴포넌트 템플릿의 package.jsonprivate 속성을 추가하며, 컴포넌트 생성 스크립트에 package.json 업데이트 메서드를 도입했습니다.

변경 사항

파일 변경 요약
.github/workflows/release.yaml 패키지 버전 결정 시 --ignore @sipe-team/package-name 옵션 제거
.templates/component/package.json "private": true 속성 추가
package.json lint-staged 구성에서 yml, yaml 파일 타입 제거
scripts/createComponent.ts updatePackageJson 비공개 메서드 추가

가능한 관련 PR

제안된 리뷰어

  • bae-sh
  • heeji289
  • synuns
  • yeojini
  • hy57in
  • kimdaeyeobbb
  • developerjhp
  • SEMIN-97
  • noahluftyang

시퀀스 다이어그램

sequenceDiagram
    participant Dev as 개발자
    participant Script as createComponent.ts
    participant Template as 컴포넌트 템플릿
    participant PackageJson as package.json

    Dev->>Script: 컴포넌트 생성 명령 실행
    Script->>Template: 템플릿 파일 복사
    Script->>PackageJson: private 속성 업데이트
    Script-->>Dev: 컴포넌트 생성 완료
Loading

토끼의 시

🐰 코드의 변화, 조용히 흐르네
워크플로우 춤추고 패키지 노래해
비공개 속성, 스크립트의 마법
우리의 개발, 토끼처럼 날아가네! 🚀

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

@froggy1014 froggy1014 self-assigned this Jan 22, 2025
@froggy1014 froggy1014 changed the title Fix/ci release chore(template): add private:true package.json in template Jan 22, 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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8e8c260 and 91aad41.

📒 Files selected for processing (4)
  • .github/workflows/release.yaml (1 hunks)
  • .templates/component/package.json (1 hunks)
  • package.json (1 hunks)
  • scripts/createComponent.ts (2 hunks)
🔇 Additional comments (4)
scripts/createComponent.ts (2)

82-91: updatePackageJson 메서드 구현이 깔끔합니다!

비구조화 할당을 사용하여 private 속성을 제거하는 방식이 우아합니다.


130-130: 실행 순서가 적절합니다.

템플릿 복사 후 package.json을 업데이트하는 순서가 논리적입니다.

.github/workflows/release.yaml (1)

31-31: --ignore 플래그 제거가 적절합니다.

PR 목적에 맞게 --ignore 플래그를 제거하여 모든 패키지가 버전 관리에 포함되도록 수정되었습니다.

package.json (1)

62-62: YAML 파일이 린트 대상에서 제외되었습니다.

ymlyaml 파일이 린트 대상에서 제외되어 워크플로우 파일들의 일관성이 저하될 수 있습니다.

다음 스크립트로 영향을 받는 YAML 파일들을 확인해보세요:

Comment on lines +61 to +62
"sideEffects": false,
"private": true
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

private 플래그와 publishConfig 설정이 충돌됩니다.

"private": truepublishConfig.access: "public"이 서로 상충됩니다. 이는 패키지의 가시성에 혼란을 줄 수 있습니다.

다음 중 하나의 방법으로 해결해주세요:

  1. private 플래그 제거 (패키지를 공개하려는 경우)
  2. publishConfig 섹션 제거 (패키지를 비공개로 유지하려는 경우)

@froggy1014 froggy1014 enabled auto-merge (squash) January 23, 2025 03:57
Copy link
Member

@synuns synuns left a comment

Choose a reason for hiding this comment

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

일단은 approve 안되면 같이 살펴봅시당

@froggy1014 froggy1014 merged commit 9126afd into main Jan 23, 2025
6 of 7 checks passed
@froggy1014 froggy1014 deleted the fix/ci-release branch January 23, 2025 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] - Release workflow fails due to version conflict on @sipe-team/package-name
2 participants