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

ci(package.json): lint by publint #93

Merged
merged 3 commits into from
May 18, 2024
Merged

ci(package.json): lint by publint #93

merged 3 commits into from
May 18, 2024

Conversation

manudeli
Copy link
Member

@manudeli manudeli commented May 17, 2024

Overview

publishConfig의 불필요한 필드를 제거합니다
publint를 통해 package.json lint를 합니다

publint는 https://publint.dev/ 패키지가 잘 퍼블리싱되고 있는지 린팅하는 툴입니다.

  1. 웹사이트에서 배포된 패키지의 package.json이 잘 정의되어있는지 체크합니다.
  2. cli로 ci에 사용해 안정성을 높일 수 있습니다.
  3. TanStack Query 등 사용량이 많은 패키지들에서 안정성을 위해서 사용하고 있습니다.

AS-IS

아래 publint에서 제공되는 링크로 [email protected]의 package.json의 제안사항을 확인할 수도 있습니다
https://publint.dev/[email protected]

image

TO-BE

  • publint cli(yarn publint)로도 확인할 수 있게 스크립트 필드에 추가했습니다. 이를 활용해 ci에서도 항상 체크됩니다.
  • publint로 체크
    • type필드 누락
    • publintConfig필드의 불필요한 필드
    • exports필드에서 import, require시 바라볼 타입스크립트 파일을 각각 index.d.mts, index.d.ts로 지정되도록 변경
  • 앞으로도 build 설정 파일(tsup)의 변경으로 달라질 때 publint가 ci에서 배포전에 잡아주게 됩니다

참고

PR Checklist

  • I read and included theses actions below
  1. I have read the Contributing Guide
  2. I have written documents and tests, if needed.

Copy link

vercel bot commented May 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
es-hangul ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 17, 2024 11:52pm

Copy link

changeset-bot bot commented May 17, 2024

🦋 Changeset detected

Latest commit: 86a9c0a

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@codecov-commenter
Copy link

codecov-commenter commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.51%. Comparing base (e8b9a20) to head (86a9c0a).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #93   +/-   ##
=======================================
  Coverage   99.51%   99.51%           
=======================================
  Files          13       13           
  Lines         206      206           
  Branches       46       46           
=======================================
  Hits          205      205           
  Misses          1        1           

@@ -38,6 +46,7 @@
"changeset:publish": "changeset publish",
"changeset:version": "changeset version",
"packlint": "packlint sort -R",
"publint": "publint --strict",
Copy link
Member

Choose a reason for hiding this comment

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

혹시 --strict 옵션이 어떤 역할을 해주나요?
publint가 문서가 잘 되어있지는 �않은것 같아서 strict 옵션에 대한 설명을 찾지 못했습니당 ㅠ

Copy link
Member Author

Choose a reason for hiding this comment

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

strict옵션이 있으면 warning도 error로 체크할 수 있게 됩니다 그래서 더 엄격히 검사할 수 있는 장점이 있어요
https://github.com/bluwy/publint/blob/master/pkg/src/index.js#L381-L387

문서화가 잘 되어있지 않네요..! 이 부분 저 레포에 기여해보아야겠어요👍

Copy link
Member

@okinawaa okinawaa left a comment

Choose a reason for hiding this comment

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

굿입니다~!

@okinawaa okinawaa merged commit 4195df5 into main May 18, 2024
9 checks passed
@github-actions github-actions bot mentioned this pull request May 18, 2024
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.

None yet

3 participants