Skip to content

fix(plugins): declare engines and bound the host peer ranges - #940

Open
owjs3901 wants to merge 1 commit into
mainfrom
fix/package-engines-peers
Open

owjs3901 wants to merge 1 commit into
mainfrom
fix/package-engines-peers

Conversation

@owjs3901

Copy link
Copy Markdown
Contributor

Summary

INF-23: 빌드 타임 패키지에 engines가 하나도 없고, vite / next / @rsbuild/core / typescript-eslint 피어가 모두 *였습니다.

근거 수집

  • CI(publish.yml)는 모든 잡에서 node-version: '*'(최신 Node), bun-version: latest만 씁니다. 버전 매트릭스는 없습니다.
  • apps/, e2e/release/consumer.mjs의 packed-consumer 테스트도 apps/vite, apps/next 등에 설치된 버전(Vite ^8.3.8, Next ^16.4.6, Rsbuild ^2.3.2, typescript-eslint ^8.72.2)을 그대로 씁니다.
  • 그래서 CI가 증명하는 건 "최신 메이저가 된다"뿐입니다. 하한은 코드가 실제로 요구하는 API로 잡고, 상한은 두지 않았습니다. 상한을 두면 새 메이저가 나오는 날 npm 7+에서 ERESOLVE로 설치가 막히는데, CI는 항상 최신 메이저를 테스트하므로 그 상한을 뒷받침할 근거가 없습니다.

peerDependencies

피어 이전 이후 근거
vite * >=5.0.0 vite-plugin/src/plugin.ts가 Vite 5 경로를 명시적으로 유지합니다. handleHotUpdate는 "Vite 5 fallback" 주석과 함께 hotUpdate와 공존하고, this.environment?., server.environments ?? {}, this?.meta(Vite 6.1+에만 있음) 없을 때 rollupOptions.output.manualChunks로 폴백합니다. plugin.test.ts에 "compiles every module again on a Vite 5 hot update" 테스트도 있습니다. Vite 6 environment API는 필수가 아닙니다. Vite 4 이하는 이런 대응이 없어 제외했습니다.
next * >=13.0.0 webpack 경로는 config.webpack(config, { dev, buildId })만 씁니다. Turbopack 경로는 최상위 config.turbopack.rules(Next 15.3+)와 TURBOPACK=auto(Next 16)에 기대므로 Turbopack은 사실상 15.3+/16이지만, webpack 모드까지 막지 않도록 하한은 @devup-ui/react의 React ^18 || ^19 피어와 맞는 Next 13으로 두었습니다.
@rsbuild/core * >=1.0.0 api.onBeforeBuild(({ environments }) => ...)와 api.transform 핸들러의 environment 인자를 씁니다. 둘 다 Rsbuild 1.0의 environment API입니다. api.onCloseBuild?.()는 옵셔널 호출이라 하한에 영향이 없습니다.
typescript-eslint, @typescript-eslint/utils * >=8.0.0 둘 다 dependencies에 ^8.72.2로 들어 있고 규칙 코드가 v8 ESLintUtils/RuleContext 타입으로 작성되어 있습니다. 피어를 dependency와 같은 메이저 하한으로 맞췄습니다.

engines.node

패키지 값 근거
@devup-ui/vite-plugin >=22.0.0 refreshConfig/closeBundle이 Promise.withResolvers를 씁니다(Node 22+). bun build --target node 출력에서도 그대로 남는 것을 확인했습니다(using은 Symbol.for("Symbol.dispose") 폴백으로 내려감). Node 20에서는 설정 로드 시점에 실패합니다.
plugin-utils, webpack-plugin, next-plugin, rsbuild-plugin >=18.0.0 배포 소스를 Node 20+ 전용 API(import.meta.dirname, fs.globSync, Object.groupBy, Set 메서드, iterator helper, Promise.withResolvers, RegExp v 플래그 등)로 검색했지만 나오지 않았습니다. 보수적으로 18을 남겼습니다. 호스트(Next 16, Rsbuild 2)가 각자 더 높은 Node를 요구하면 그쪽이 먼저 걸립니다.
@devup-ui/eslint-plugin ^18.18.0 || ^20.9.0 || >=21.1.0 의존하는 typescript-eslint 8의 engines를 그대로 따랐습니다.

의도적으로 손대지 않은 것

  • @devup-ui/react, components, reset-css: 브라우저 런타임/타입 패키지라 engines.node가 의미가 맞지 않습니다.
  • @devup-ui/bun-plugin: Bun에서 돌고, 필요한 최소 Bun 버전 근거가 없습니다.
  • @devup-ui/wasm, @devup-ui/binding*: wasm 빌드가 globalThis.crypto.getRandomValues를 import하는데(Node 19+ 전역), 런타임에 실제로 불리는지 확인하지 못했습니다. native binding은 napi6이라 Node 하한이 매우 낮습니다. 근거가 불충분해 이번에는 두지 않았습니다.
  • next-plugin의 @devup-ui/webpack-plugin: "*" 피어, eslint-plugin에 eslint 피어가 없는 점은 이번 범위 밖입니다.

Test plan

  • bun install --ignore-scripts: bun.lock의 워크스페이스 peer spec만 갱신, 설치 변경 없음 (no changes)
  • CI가 쓰는 최신 Node / Vite 8 / Next 16 / Rsbuild 2 / typescript-eslint 8은 모든 새 범위를 만족
  • git diff --stat: 라인 엔딩 churn 없음

Refs #691

🤖 Generated with Claude Code

No manifest declared the Node.js versions it runs on, and the vite,
next, @rsbuild/core and typescript-eslint peers accepted any version.

- engines.node: >=18 for plugin-utils, webpack, Next and Rsbuild
  plugins; >=22 for the Vite plugin, whose shipped code calls
  Promise.withResolvers; the eslint plugin mirrors typescript-eslint 8.
- peers take the oldest major each plugin is written against, with no
  upper cap so a new host major is not refused at install time:
  vite >=5 (it keeps the Vite 5 handleHotUpdate fallback), next >=13,
  @rsbuild/core >=1 (environment API), typescript-eslint >=8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant