chore(deps): 未使用の jsurl を外し、paper-css をパッケージ名で読む - #58
Merged
Conversation
knip と depcheck のクロスチェックで未使用と判定され、リポジトリ全体を検索しても package.json / package-lock.json 以外に jsurl の参照は無かった。 URL へのクエリ組み立ては query-string が担っている(src/App.tsx)。 外した前後で vite build の成果物(CSS・JS)が SHA256 まで一致することを確認済み。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`@import '../node_modules/paper-css/paper.min.css'` は node_modules の物理的な 位置を決め打ちしていて、index.sass の置き場が変わると壊れる。index.tsx が fomantic-ui-css を `import 'fomantic-ui-css/semantic.css'` と書いているのと同じく、 パッケージ名から解決させれば十分(.css で終わるので sass は plain CSS の @import として素通しし、実際の解決は Vite が行う)。 vite build と vite dev の両方で解決されることを確認済み。 成果物 CSS は変更前と SHA256 まで一致する。 なお、この @import を index.tsx 側の `import 'paper-css/paper.min.css'` へ移す案も 試したが、成果物での paper-css の位置が index.sass の後ろへ回り、 paper-css の `@media screen { body { background: #e0e0e0 } }` が index.sass の `background-color: #ffffff` に勝ってしまう(画面表示の背景が白から灰へ変わる)。 カスケード順を保つため、読み込みは index.sass の先頭に残している。 Co-Authored-By: Claude Opus 5 (1M context) <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.
何をしたか
未使用の
jsurlを依存から外したknip + depcheck のクロスチェックで未使用と出たもの。リポジトリ全体を検索しても
package.json/package-lock.json以外に参照は無い。URL のクエリ組み立てはquery-stringが担っている(src/App.tsx)。paper-cssの読み込みを node_modules 相対パスからパッケージ名に変えた@import '../node_modules/paper-css/paper.min.css'→@import 'paper-css/paper.min.css'index.tsxがimport 'fomantic-ui-css/semantic.css'と書いているのと同じ流儀に揃えた。.cssで終わるので sass は plain CSS の@importとして素通しし、実際の解決は Vite が行う。確認したこと
npm ci && npm run buildが通るindex-oVwo4yYR.css/index-DLcc7pV1.js)vite devでもpaper-cssが展開される(/src/index.sassの応答に.sheetが34件、@importの残留は0件)検討したが採らなかった案
paper-cssの読み込みをindex.sassからindex.tsxへ移す案(import 'paper-css/paper.min.css')も試したが、成果物での
paper-cssの位置がindex.sassの後ろへ回ってしまう。paper-cssには@media screen { body { background: #e0e0e0 } }があり、これがindex.sassのbody { background-color: #ffffff }に勝つため、画面表示の背景が白から灰色に変わる。カスケード順を保つため読み込みは
index.sassの先頭に残した。付随して気づいたこと(このPRでは直していない)
src/index.sass19・20行目の@import './sass/App.sass'/@import './sass/Steps.sass'はDart Sass 3.0 で削除される非推奨の Sass
@import。ビルド時に DEPRECATION WARNING が出ている。どちらの partial も変数・mixin を持たないただの規則集合なので
@useへの置き換えは容易。(1行目の
paper-cssは plain CSS の@importなので非推奨の対象ではない)vite.config.tsが CommonJS として読まれており、Vite の将来の既定configLoader: 'native'では動かないという警告が出ている。
🤖 Generated with Claude Code