Skip to content

v0.4

@claude claude tagged this 27 Apr 17:17
Follow-up to #248: #248 shipped the prebuilt panel SPA as a Composer
package but didn't wire it into the in-framework install path, so
PanelController and ToolbarInjector still pointed at the GitHub Pages
CDN and kept hitting 404s on toolbar bundles and hashed panel chunks.

This change:

- Adds AssetsController in libs/API that serves files from
  FrontendAssets::path() (resolved via class_exists + string FQCN so the
  api module stays independent of frontend-assets per modulite).
- Registers GET /debug/static/{path+} before the panel catchall; the
  catchall now also excludes /debug/static/* in addition to /debug/api/*.
- Flips PanelConfig::DEFAULT_STATIC_URL from the GitHub Pages CDN to
  /debug/static and keeps the CDN URL available as a new
  CDN_STATIC_URL constant for users who want the hosted build.
- Updates split.yml so CI copies both panel and toolbar dist into
  libs/FrontendAssets/dist/ (toolbar under dist/toolbar/).

Cache policy matches what Vite emits: hashed chunks under assets/
(including toolbar/assets/) get public,max-age=31536000,immutable;
stable names like bundle.js get public,max-age=3600,must-revalidate
so composer update app-dev-panel/frontend-assets isn't masked by a
year-long cache. Files stream from disk via createStreamFromFile()
rather than being buffered through file_get_contents(). MIME lookup
delegates to Guzzle MimeType with a tiny charset-override map for
text types. Assets root is realpath'd and memoised once per request.

Also fixes two bugs in the standalone binaries that blocked PHAR/
Composer installs from working:

- libs/Cli/bin/adp and libs/McpServer/bin/adp-mcp now prefer
  $GLOBALS['_composer_autoload_path'] (set by the composer bin proxy)
  and fall back to ../../../autoload.php (vendor/app-dev-panel/<pkg>/bin
  → vendor/autoload.php) before the monorepo-layout paths. The old
  paths only worked when invoked from the monorepo checkout.
- libs/Cli/bin/adp wraps command registration in a callable that uses
  Application::addCommand() on Symfony Console 8 and falls back to
  add() on 7.x/6.x. Templates like yiisoft/app allow ^8.0.7 where
  add() was removed.

Documentation:

- website/guide/adapters/yii3.md (+ ru mirror): spells out the three
  ADP middleware (ToolbarMiddleware, YiiApiMiddleware) and includes a
  ready-to-copy application.php for the stock yiisoft/app template —
  the previous "no manual wiring needed" claim was wrong for the
  middleware stack.
- website/guide/debug-panel.md (+ ru mirror): static assets source is
  now the local Composer bundle; CDN is a fallback.
- libs/API/CLAUDE.md, libs/Cli/CLAUDE.md, libs/McpServer/CLAUDE.md,
  libs/FrontendAssets/CLAUDE.md: document the new route, new constant,
  autoloader lookup order, toolbar bundle layout.

make modulite: 0 violations. make test-php: 839/839 API tests pass.

https://claude.ai/code/session_01MuQLDdsZbk3q2jTZasMAxj
Assets 2
Loading