全テンプレートの依存を最新化(npm audit 21件 → 0件) - #64
Merged
Merged
Conversation
Brings every template up to the current release of its dependencies, which clears the outstanding npm audit findings: 21 vulnerabilities across the repo down to 0. The driver was adm-zip <0.6.0 (GHSA-xcpc-8h2w-3j85, high: a crafted ZIP triggers a 4GB allocation), which every template pulled in through scripts/archive_dist.js. CustomExitScreen carried a further 10, having pinned its dependencies exactly and drifted behind. Notable major bumps: vite 6 -> 8, typescript 5 -> 7, vitest 3 -> 4, @testing-library/react 11 -> 16, @vitejs/plugin-react 5 -> 6, @module-federation/vite 1.9 -> 1.20, biome 2.3 -> 2.5, jsdom 28 -> 30, uuid 13 -> 14, and in CustomTutorial react-joyride 2 -> 3 plus @tsparticles 3 -> 4. react, react-dom and their @types are deliberately held at 18. They are declared as Module Federation singletons and shared with the metatell host, so bumping them here without knowing the host's version would break every plugin at runtime. react-toastify is held for the same reason (CustomMegaphoneButton shares it). Three breaking changes needed code: - TypeScript 7 removed the `baseUrl` option, so it is dropped from all ten tsconfig.json files. Nothing used `paths`, so it was inert. - react-joyride 3 dropped its default export and restructured props: `options` moved out of `styles`, `hideCloseButton`/`hideBackButton`/ `styles.buttonNext` collapse into `options.buttons: []`, `disableOverlay` -> `options.hideOverlay`, `disableOverlayClose` -> `options.overlayClickAction: false`, `disableCloseOnEsc` -> `options.dismissKeyAction: false`, `floaterProps` -> `floatingOptions`. - @tsparticles/react 4 replaced `initParticlesEngine` with a `ParticlesProvider` + `useParticlesProvider` pair, so ParticleEffect now renders through the provider instead of an effect-driven flag. Verified per template: build, tests and lint. CustomTutorial was also checked in a browser, since neither library migration is covered by tests — the tour tooltip keeps its dark styling with no back/close/next buttons and no overlay, and the confetti canvas renders. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
全11テンプレートの依存を最新版に更新し、
npm auditの指摘を 21件 → 0件 にしました。きっかけは
adm-zip <0.6.0の脆弱性です。全テンプレートがscripts/archive_dist.js経由で取り込んでいました。audit の変化
CustomExitScreen だけ 11件あったのは、依存を exact pin していて取り残されていたためです(
@babel/core/postcss/rollup/nanoid/vite/minimatchなど)。今回 caret に統一したので他10プラグインと同じ更新経路に乗ります。主なメジャーアップデート
vite 6 → 8/typescript 5 → 7/vitest 3 → 4/@testing-library/react 11 → 16/@vitejs/plugin-react 5 → 6/@module-federation/vite 1.9 → 1.20/biome 2.3 → 2.5/jsdom 28 → 30/uuid 13 → 14、CustomTutorial はreact-joyride 2 → 3と@tsparticles 3 → 4。意図的に据え置いた依存
react/react-dom/@types/react/@types/react-domは 18 のままにしています。これらは Module Federation の
shared: { singleton: true }で metatell ホストと共有される依存です。ホストが React 18 のままテンプレート側だけ 19 に上げると、requiredVersionが食い違い全プラグインが実行時に壊れます。ホストの React バージョンが確認できてから、別PRで上げるのが安全です。react-toastifyも同じ理由で据え置きです(CustomMegaphoneButton が shared に入れています)。コード修正が必要だった破壊的変更
1. TypeScript 7 が
baseUrlを廃止error TS5102: Option 'baseUrl' has been removed.により全テンプレートのlint:tscが失敗しました。pathsを使っている箇所は無く単に無効化されていたオプションだったので、10ファイルから削除しています。2. react-joyride 3 の API 再編
default export が廃止され、props が大きく変わりました。
import Joyride fromimport { Joyride } fromstyles.optionsoptions(トップレベルの prop に昇格)hideCloseButton/hideBackButton/styles.buttonNext: {display:none}options.buttons: []disableOverlayoptions.hideOverlaydisableOverlayCloseoptions.overlayClickAction: falsedisableCloseOnEscoptions.dismissKeyAction: falsefloaterPropsfloatingOptionsボタン3種を個別に隠していた指定は
buttons: []に集約できました(このチュートリアルは実際の操作で進む設計で、ボタンを一切出さないため)。3. @tsparticles/react 4 の初期化方式変更
initParticlesEngineが廃止され、ParticlesProvider+useParticlesProviderに置き換わりました。ParticleEffectを effect でフラグを立てる方式から Provider 経由に書き直しています。動作確認
全11テンプレートで build ✅ / test ✅ / lint ✅。
CustomTutorial の2つのライブラリ移行はテストで担保されていないため、ブラウザで実際に確認しました。
ParticleEffectを一時的に直接描画して確認、検証後に復元済み)レビュー時の注意
typescript 7とvite 8はどちらもメジャー2つ分の飛躍です。ビルド・型チェックは全テンプレートで通っていますが、テンプレート利用者が独自に追加したコードでは別の破壊的変更を踏む可能性があります。🤖 Generated with Claude Code