Skip to content

fix: process.exit(1) 대신 Rollup 에러 처리 메커니즘 사용#98

Merged
yceffort-naver merged 2 commits intomainfrom
claude/issue-89-20260311-0103
Mar 11, 2026
Merged

fix: process.exit(1) 대신 Rollup 에러 처리 메커니즘 사용#98
yceffort-naver merged 2 commits intomainfrom
claude/issue-89-20260311-0103

Conversation

@yceffort-naver
Copy link
Contributor

@yceffort-naver yceffort-naver commented Mar 11, 2026

요약

publint 플러그인에서 process.exit(1) 호출 시 Node.js 프로세스가 즉시 종료되어, severity: 'error'(기본값) 설정 환경에서 다른 플러그인의 에러가 출력되지 않는 문제를 수정합니다.

변경 내용

buildStart 훅 (src/plugins/rollup-plugin-publint.ts):

  • 변경 전: severity === 'error' && process.exit(1)
  • 변경 후: if (severity === 'error') { this.error(...) } — Rollup 공식 플러그인 에러 API 사용

closeBundle 핸들러 (src/plugins/rollup-plugin-publint.ts):

  • 변경 전: severity === 'error' && process.exit(1)
  • 변경 후: if (severity === 'error') { throw new Error('publint check failed after build') } — Rollup이 처리할 수 있도록 에러를 throw

.changeset/fix-publint-process-exit.md:

  • @naverpay/pite patch 버전 변경을 위한 changeset 파일 추가

개선 효과

항목 변경 전 변경 후
에러 처리 방식 process.exit(1) 프로세스 즉시 종료 Rollup 에러 파이프라인을 통해 처리
다른 플러그인 에러 노출 숨겨짐 (e.g. preserve-directives RangeError) 정상적으로 표시됨
외부 인터페이스 변경 없음 (severity 옵션 동일)

Closes #89

Generated with Claude Code

github-actions bot and others added 2 commits March 11, 2026 01:06
publint 플러그인에서 process.exit(1) 호출 시 프로세스가 즉시 종료되어
다른 플러그인(e.g. preserve-directives)의 에러가 출력되지 않는 문제를 수정합니다.

- buildStart: this.error()를 사용하여 Rollup의 공식 에러 처리 파이프라인을 활용
- closeBundle: throw new Error()를 사용하여 Rollup이 에러를 적절히 처리하도록 변경

외부 인터페이스(publint.severity 옵션)는 변경 없음.

Fixes #89

Co-authored-by: yceffort_naver <yceffort-naver@users.noreply.github.com>
@yceffort-naver yceffort-naver self-assigned this Mar 11, 2026
@yceffort-naver yceffort-naver requested a review from a team as a code owner March 11, 2026 01:32
@npayfebot
Copy link
Contributor

✅ Changeset detected

Latest commit: e61dc8c

@naverpay/pite package have detected changes.

If no version change is needed, please add skip-detect-change to the label.

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

This PR includes changesets to release 1 package
Name Type
@naverpay/pite 🐛 Patch
powered by: naverpay changeset detect-add actions

@npayfebot
Copy link
Contributor

NPM Packages

📦 @naverpay/pite

Total Sizes: 10.3 kB

Total Changes: +78 B (+1%) (Size Increased)

File Status Previous Size Updated Size Changed
/dist/plugins/rollup-plugin-publint.mjs 🛠️ 704 B 742 B +38 B (+5%)
/dist/plugins/rollup-plugin-publint.js 🛠️ 709 B 749 B +40 B (+6%)
ℹ️ View Unchanged Files
File Status Previous Size Updated Size Changed
/dist/vite-tsup-plugin.mjs - 678 B 678 B -
/dist/vite-tsup-plugin.js - 681 B 681 B -
/dist/util.mjs - 295 B 295 B -
/dist/util.js - 352 B 352 B -
/dist/polyfill.mjs - 520 B 520 B -
/dist/polyfill.js - 576 B 576 B -
/dist/index.mjs - 1.48 kB 1.48 kB -
/dist/index.js - 1.56 kB 1.56 kB -
/dist/get-vite-entry.mjs - 637 B 637 B -
/dist/get-vite-entry.js - 695 B 695 B -
/dist/dependencies.mjs - 337 B 337 B -
/dist/dependencies.js - 389 B 389 B -
/dist/browserslist.mjs - 264 B 264 B -
/dist/browserslist.js - 323 B 323 B -

powered by: naverpay size-action

Copy link
Member

@2-one-week 2-one-week left a comment

Choose a reason for hiding this comment

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

thanks

@yceffort-naver yceffort-naver merged commit e0421a6 into main Mar 11, 2026
10 checks passed
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.

publint.serverity: 'off' 처리를 하지 않으면 다른 플러그인 오류가 보이지 않습니다.

3 participants