Modernize asset build pipeline (gulp → grab-deps + sass/postcss) (#12)#16
Merged
Conversation
- Replace gulp@4/node-sass/webpack@4 toolchain with @kunoichi/grab-deps (+ @wordpress/scripts) for JS and sass/postcss for CSS. - Restructure to kunoichi standard: src/js, src/scss (sources) build into assets/js, assets/css; drop dist/. - Bump CI Node 14 -> 20; modernize eslint/stylelint via wp-scripts. - Add bin/copy.sh to vendor FontAwesome 5 (kept at v5). - Fold in #3: block category common -> media. Public API preserved: script/style handles, dependency arrays, the wp.kicon.IconSelector global, register_block_type, and the block save() output are all unchanged. Verified in wp-env that existing saved blocks remain valid (no block-validation errors). Closes #12 Closes #3 Co-authored-by: Claude <noreply@anthropic.com>
bin/install-wp-tests.sh checks out the WP test suite via svn, which is no longer pre-installed on ubuntu-latest runners (the phpunit matrix was failing with 'svn: command not found', exit 127). Pre-existing breakage, fixed here since this PR already modernizes the CI workflow. Co-authored-by: Claude <noreply@anthropic.com>
Replace the svn + MySQL-service + install-wp-tests.sh phpunit setup (which relied on subversion that ubuntu-latest no longer ships) with the org-standard approach used by tarosky/* plugins: - phpunit now runs inside wp-env (npx wp-env start && npm test) -- no svn, no MySQL service container, no install-wp-tests.sh. - PHP lint uses the reusable tarosky/workflows phpcs.yml (PHP 7.4). - Add short-open-tag check via the reusable php-short-open-tag.yml. - assets job now also runs 'npm run build' to catch build breakage. - tests/bootstrap.php defaults WP_TESTS_DIR to wp-env's /wordpress-phpunit. - Add npm 'test'/'cli:test' scripts; give the phpunit testsuite a name. Verified locally: 'npm test' runs phpunit 9.6 in the tests-cli container and passes (OK, 1 test, 1 assertion). Co-authored-by: Claude <noreply@anthropic.com>
7ecc99a to
664416c
Compare
actions/checkout@v4 and setup-node@v4 run on Node 20, which GitHub forces to Node 24 from 2026-06-16. v5 supports Node 24 natively and clears the deprecation annotation. Co-authored-by: Claude <noreply@anthropic.com>
WPCS 2.0's I18n sniff crashes on PHP 8.x; 3.0 runs on PHP 8 and matches the tarosky standard. The dealerdirect/phpcodesniffer-composer-installer plugin (pulled by WPCS 3) auto-registers the standard paths, so the 'phpcs --config-set installed_paths' dance is gone; lint now also covers icon.php. Updated two ruleset sniff names that moved to the Universal standard in WPCS 3 (DisallowShortTernary, DisallowShortArraySyntax) and applied phpcbf autofixes (brace placement; dirname nesting -> dirname($p, 3)). Verified: composer lint passes on PHP 8.3; npm test (wp-env phpunit) still OK. Co-authored-by: Claude <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.
概要
Closes #12
Closes #3
壊れた gulp 系ビルド(
gulp@4+node-sass+webpack@4、CI Node 14)を一掃し、kunoichi 標準ツールチェーンへ全面移行する破壊的移行です。あわせて #3(ブロックカテゴリcommon→media)を畳み込みました。ビルド
@kunoichi/grab-deps(+@wordpress/scripts、JSX対応)sass(Dart) +postcss/autoprefixerassets/(src) →dist/(out)src/js・src/scss(src) →assets/(out)、dist/廃止wp-scripts lint-js/lint-stylebin/copy.sh)CI(tarosky 標準ワークフローへ)
install-wp-tests.sh+ svn + MySQL サービスコンテナの phpunit 構成(svn が ubuntu ランナーから消えて壊れていた)を、tarosky/* プラグインと同じ方式に置き換え:npx wp-env start→npm test)。svn・MySQLサービス・install-wp-tests.sh 不要tarosky/workflows/.github/workflows/phpcs.yml@main(PHP 7.4)php-short-open-tag.ymlによる短縮開始タグチェックを追加assetsジョブにnpm run buildを追加(ビルド破壊を検知)actions/checkout/setup-nodeを v5 へ(Node24対応)公開APIは不変(後方互換)
wp.kicon.IconSelectorグローバル、register_block_type、ブロックのsave()出力 DOM をすべて維持@wordpress/dependency-extractionにより外部化(window.React)。旧 dist も同じ global React のため挙動同一検証
npm install→npm run build(全アセット生成)、npm run lint(eslint+stylelint)、npm test(wp-env で phpunit 9.6 → OK, 1 test)assets/パスで HTTP 200、ブロック登録 OK、Media カテゴリ表示(Change Icon block category to media #3)isValid: true→ 既存コンテンツ無傷備考
package-lock.json非コミット方針のためassets/phpunitジョブはnpm install。core/icon)を Media へ追加しており、インサーターでタイトルが衝突します。スコープ外ですが将来「Kunoichi Icon」等への改名検討余地あり(別issue推奨)。🤖 Generated with Claude Code