From 0cf8264d1dc0e103de996031623f1fa0f9b52f9b Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 4 May 2026 14:42:54 +0100 Subject: [PATCH 01/20] Studio Panels: scaffold @studio/panels workspace package Initial wp-build-based plugin shell that will host agent-driven wp-admin panels. Wires the new workspace into root scripts and lint. Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/studio-panels/.gitignore | 5 ++ apps/studio-panels/package.json | 34 +++++++++++ apps/studio-panels/scripts/post-build.mjs | 57 ++++++++++++++++++ apps/studio-panels/studio-panels.php | 70 +++++++++++++++++++++++ apps/studio-panels/tsconfig.json | 20 +++++++ package.json | 10 ++-- 6 files changed, 192 insertions(+), 4 deletions(-) create mode 100644 apps/studio-panels/.gitignore create mode 100644 apps/studio-panels/package.json create mode 100644 apps/studio-panels/scripts/post-build.mjs create mode 100644 apps/studio-panels/studio-panels.php create mode 100644 apps/studio-panels/tsconfig.json diff --git a/apps/studio-panels/.gitignore b/apps/studio-panels/.gitignore new file mode 100644 index 0000000000..bc6c627f23 --- /dev/null +++ b/apps/studio-panels/.gitignore @@ -0,0 +1,5 @@ +build/ +build-module/ +build-style/ +version.txt +node_modules/ diff --git a/apps/studio-panels/package.json b/apps/studio-panels/package.json new file mode 100644 index 0000000000..938416126a --- /dev/null +++ b/apps/studio-panels/package.json @@ -0,0 +1,34 @@ +{ + "name": "@studio/panels", + "version": "0.2.2", + "private": true, + "type": "module", + "description": "WordPress admin panels for Studio agent UI. Uses @wordpress/build's pages routing system; requires Gutenberg (or WP 7.0+) on the host site for the @wordpress/boot, @wordpress/route, and @wordpress/dataviews script modules.", + "license": "GPL-2.0-or-later", + "scripts": { + "build": "wp-build && node scripts/post-build.mjs", + "dev": "wp-build --watch", + "typecheck": "tsc -p tsconfig.json --noEmit" + }, + "wpPlugin": { + "name": "studio_panels", + "scriptGlobal": false, + "packageNamespace": "studio-panels", + "handlePrefix": "studio-panels", + "pages": [ "studio-panels" ] + }, + "devDependencies": { + "@types/react": "^18.3.27", + "@types/react-dom": "^18.3.7", + "@wordpress/build": "^0.13.0", + "@wordpress/components": "32.6.0", + "@wordpress/core-data": "^7.18.0", + "@wordpress/data": "^10.18.0", + "@wordpress/dataviews": "^14.2.0", + "@wordpress/element": "^6.18.0", + "@wordpress/i18n": "^6.18.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "typescript": "~5.9.3" + } +} diff --git a/apps/studio-panels/scripts/post-build.mjs b/apps/studio-panels/scripts/post-build.mjs new file mode 100644 index 0000000000..baba19c9e5 --- /dev/null +++ b/apps/studio-panels/scripts/post-build.mjs @@ -0,0 +1,57 @@ +// Post-build steps for the studio-panels plugin. +// +// 1. Drop a stub `build/modules/boot/index.min.asset.php` so wp-build's +// generated page-wp-admin.php template stops short-circuiting its enqueue. +// The template assumes you bundle your own copy of `@wordpress/boot` +// (Gutenberg's monorepo case). We don't — Gutenberg provides it. The stub +// just lists boot's classic-script dependencies so the prerequisites +// `