Skip to content

[ 開発環境 ] gulp を廃止し terser + node --check に置き換え#130

Merged
kurudrive merged 2 commits intomasterfrom
remove-gulp
Apr 16, 2026
Merged

[ 開発環境 ] gulp を廃止し terser + node --check に置き換え#130
kurudrive merged 2 commits intomasterfrom
remove-gulp

Conversation

@kurudrive
Copy link
Copy Markdown
Member

@kurudrive kurudrive commented Apr 16, 2026

概要

gulp 4 → 5 のメジャーアップデートに伴うプラグイン非互換(#95)を回避するため、gulp を完全に廃止し、軽量な代替ツールに置き換えました。

変更内容

  • gulpfile.js を削除
  • gulp, gulp-jsmin, gulp-jsvalidate, gulp-replace を devDependencies から削除
  • npm run jsmin: terser CLI に置き換え(@wordpress/scripts の transitive dep として利用可能)
  • npm run test: node --check による JS 構文検証に置き換え
  • gulp replace_text_domain: inc/vk-admin/ ディレクトリが存在しないため削除(デッドコード)
  • npm run build から gulp replace_text_domain の呼び出しを削除

副次効果

  • braces 3.0.2 の脆弱性が解消(gulp 経由の依存がなくなり、残る braces は @wordpress/scripts 経由の 3.0.3 のみ)
  • package-lock.json が約 7,400 行削減

確認手順

手順

  1. npm install を実行する
    → ✓ エラーなく完了する
  2. npm run jsmin を実行する
    → ✓ js/script.min.js が生成される
  3. npm test を実行する
    → ✓ JS 構文エラーなく完了する
  4. npm run build を実行する
    → ✓ ブロックビルド + jsmin がエラーなく完了する
  5. npm ls braces を実行する
    → ✓ braces 3.0.3 のみが表示される(3.0.2 が存在しない)

🤖 Generated with Claude Code

Summary by CodeRabbit

リリースノート

  • Chores
    • ビルドスクリプトを更新し、JavaScriptの縮小処理を新しいツールに切替えました。
    • テスト手順を簡素化して構文チェックを導入しました。
    • 古いビルド関連の開発依存関係を削除し、ビルドチェーンを整理して開発プロセスを効率化しました。

gulp 4→5 のメジャーアップデートによるプラグイン非互換を避けるため、
gulp と全 gulp-* プラグインを削除し、既存タスクを以下で代替:
- jsmin: terser CLI(@wordpress/scripts の transitive dep)
- test: node --check による構文検証
- replace_text_domain: inc/vk-admin/ が存在しないため削除(デッドコード)

これにより braces の脆弱性(CVE in 3.0.2)も解消。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4eecbefc-ddf1-4dea-a296-2b4eee4b8fc7

📥 Commits

Reviewing files that changed from the base of the PR and between db34195 and 48e0db7.

📒 Files selected for processing (1)
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

Walkthrough

Gulpタスク群を削除し、gulpfile.jsを除去。package.jsonのスクリプトをGulp依存からNodeの構文チェックとTerserによるminify実行へ置き換え、関連するGulp系devDependenciesを削除した。

変更

コーホート / ファイル 概要
Gulpfile削除
gulpfile.js
testjsminreplace_text_domainタスクを含むファイル全体を削除。
ビルドスクリプト更新
package.json
buildスクリプトを gulp replace_text_domain && gulp jsmin から npm run jsmin に変更。jsmingulp jsmin から terser js/script.js -o js/script.min.js -c -m に差し替え。testgulp test から node --check js/script.js && node --check js/admin-link-dialog.js に変更。devDependencies から gulp, gulp-jsmin, gulp-jsvalidate, gulp-replace を削除。

推定レビュー時間

🎯 3 (Moderate) | ⏱️ ~20 分

ポエム

🐰 Gulpはさよなら、風が変わる
Nodeの目で確かめ、Terserで軽やかに
一歩ずつ小さくなるバンドルの夢
うさぎは跳ねて、新しい朝へ ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR タイトルは gulp から terser + node --check への置き換えという主な変更を正確に反映しており、変更セットの主要な目的を明確に伝えている。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-gulp

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Line 14: The package.json "test" script currently calls node --check with
multiple filenames which only checks the first file (js/script.js) and leaves
js/admin-link-dialog.js unchecked; update the "test" npm script (the "test"
entry in package.json) so that node --check is executed for each JS file (e.g.,
run a find/xargs loop over js/*.js files) or switch the script to use a proper
linter (e.g., eslint) to validate all JS files, ensuring js/admin-link-dialog.js
and any other files are included in the check.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9688830b-d053-4322-838b-d753d43b2284

📥 Commits

Reviewing files that changed from the base of the PR and between 7cd27b3 and db34195.

⛔ Files ignored due to path filters (2)
  • js/script.min.js is excluded by !**/*.min.js
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • gulpfile.js
  • package.json
💤 Files with no reviewable changes (1)
  • gulpfile.js

Comment thread package.json Outdated
node --check は複数ファイル引数を受け付けず最初のファイルのみ
チェックする仕様のため、&& で連結して全ファイルを検証する。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kurudrive kurudrive merged commit d8ce510 into master Apr 16, 2026
10 checks passed
@kurudrive kurudrive deleted the remove-gulp branch April 16, 2026 02:16
@kurudrive kurudrive mentioned this pull request Apr 16, 2026
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