diff --git a/.distignore b/.distignore index a49a3a4..2d2421a 100644 --- a/.distignore +++ b/.distignore @@ -10,7 +10,9 @@ /graphify-out/ /node_modules/ /scripts/ -/src/ +/src/blocks/ +/src/css/ +/src/js/ /tests/ /*.config.js /*.config.mjs diff --git a/docs/internal/maintenance.md b/docs/internal/maintenance.md index f7811c3..d0a5149 100644 --- a/docs/internal/maintenance.md +++ b/docs/internal/maintenance.md @@ -170,7 +170,6 @@ None at the moment. Keep implementation follow-ups out of documentation pull requests; record each with a reproduction and revision when it is picked up. -- **Release zip:** no `.distignore` ships, so `release:zip` includes `src/`, `docs/`, `graphify-out/`, AI files and dotfiles. - **Scaffold wiring targets:** `wp/rest` and `wp/cli` suggest `inc/Modules/Rest.php` and `inc/Modules/Cli.php`, but this skeleton's modules are `REST.php` and `CLI.php`, which are different files on case-sensitive filesystems. Keep the uppercase names (they match WordPress acronym style and the framework's `AbstractRESTController` / `CLICommand`); the skill adapts, and CLI users edit the existing file. Fix upstream in wp-tooling. - **Block scaffolder:** `npm run create:block` writes meta blocks to `src/blocks/meta-blocks/`, which `Assets::STATIC_BLOCKS` cannot register. - **Dangling references:** `PluginSetup::deactivate()` mentions a root `uninstall.php` and `Util::get_data()` reads `inc/data/`; neither ships. diff --git a/docs/local-development.md b/docs/local-development.md index 44e046a..ea039b4 100644 --- a/docs/local-development.md +++ b/docs/local-development.md @@ -98,7 +98,7 @@ If your host deploys from a build step or a site repository instead, run the fir `release:zip` packs the working tree as it is on disk and never reads `.gitignore`. That is how the built `vendor/` and `assets/build/` get in, but it also means: -- The plugin ships a `.distignore` that leaves out development files: dotfiles (including the gitignored `.env.local` and `.wp-env.override.json`), `src/`, `docs/`, `scripts/`, `tests/`, `bin/`, `graphify-out/`, build and lint configs, and the lock files. +- The plugin ships a `.distignore` that leaves out development files: dotfiles (including the gitignored `.env.local` and `.wp-env.override.json`), `src/` (except `src/components/`), `docs/`, `scripts/`, `tests/`, `bin/`, `graphify-out/`, build and lint configs, and the lock files. - A `.distignore` replaces the built-in default list rather than extending it, and does not support `!` negation, so it must list everything to leave out. Keep it up to date when you add files that should not ship. - Without a `.distignore`, only `.git/`, `dist/`, `tests/`, `node_modules/`, `bin/`, `.github/`, `*.config.js` and `package-lock.json` would be left out. @@ -113,7 +113,10 @@ The shipped `.distignore`: /graphify-out/ /node_modules/ /scripts/ -/src/ +# Build sources only: src/components/ ships, its PHP is loaded at runtime. +/src/blocks/ +/src/css/ +/src/js/ /tests/ /*.config.js /*.config.mjs @@ -127,7 +130,7 @@ The shipped `.distignore`: /package-lock.json ``` -It keeps the main plugin file, `inc/`, `templates/`, `languages/`, `assets/`, `vendor/`, `composer.json`, `README.md`, `CHANGELOG.md` and `LICENSE.md`. Check the result with `unzip -l dist/*.zip`. +It keeps the main plugin file, `inc/`, `templates/`, `src/components/` (component PHP loaded at runtime), `languages/`, `assets/`, `vendor/`, `composer.json`, `README.md`, `CHANGELOG.md` and `LICENSE.md`. Check the result with `unzip -l dist/*.zip`. ### Release scripts diff --git a/inc/Core/Assets.php b/inc/Core/Assets.php index c200285..f8f5940 100644 --- a/inc/Core/Assets.php +++ b/inc/Core/Assets.php @@ -32,6 +32,7 @@ final class Assets extends AssetLoader implements Registrable, Shareable { * Dynamic blocks are registered via their own AbstractBlock subclasses. */ private const STATIC_BLOCKS = [ + // Directory names under assets/build/blocks/. // wp:example:blocks 'example-block', 'example-block-interactive', diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 8e789eb..9e7f629 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -22,3 +22,7 @@ parameters: # Optional: absent until `npm install` runs (a Composer-only checkout). - node_modules (?) - tests + ignoreErrors: + - identifier: foreach.emptyArray + path: inc/Core/Assets.php + reportUnmatched: false