Experiment: create Studio sites from static artifacts#3952
Draft
chubes4 wants to merge 12 commits into
Draft
Conversation
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.
Summary
studio create --from <source>CLI path for creating a new Studio site from a Static Site Importer source..figfiles, URLs, and website artifact JSON by shaping the source as SSI expects.wordpress-studio/figma-source/v1payload into SSI's generic Figma scenegraph request before import.Static_Site_Importer_Figma_Import::import()when SSI provides the Figma adapter, while keeping website artifact payload support for tests/debug.Why
This explores a generic Studio import primitive outside the AI loop: any producer can hand Studio an import source, and Studio can create a new local site from it. Static site directories, HTML exports, ZIPs, website artifacts, Figma exports, AI-generated outputs, and future source adapters can all target the same Studio create/import path.
The CLI remains the regression-friendly primitive. The Figma loopback endpoint is the product handoff layer: when Studio is running locally, a Figma plugin can send a source payload to Studio. Studio creates the site, starts it, and opens the new local site URL in the browser.
Current shape
Optional for testing pinned SSI builds:
Figma plugin handoff shape:
Canonical website artifact payloads remain accepted for tests/debug:
{ "siteName": "Imported Artifact Site", "artifact": { "schema": "blocks-engine/php-transformer/site-artifact/v1", "entrypoint": "website/index.html", "files": [] } }Successful handoff response includes
siteId,siteName,sitePath, andsiteUrl.Import engine lifecycle
End-to-end proof
Latest lifecycle rig run passed in Lab with a source matrix from the merged
blocks-engine/fixtures/websitescorpus:ac9dfea0-482c-46e7-856d-4fc764c12ca5homeboy bench --rig studio-artifact-import-lifecycle --scenario studio-artifact-import-lifecycle --iterations 1 --shared-state /tmp/studio-artifact-import-lifecycle --runner homeboy-lab --lab-only --jsonsource_count=2,success_rate=1,import_success=1,importer_removed=1,active_theme_present=12-onepager-coffeedirectory and20-switchback-woocommerce-extra-hard.zipThe proof created brand-new Studio sites from import sources, confirmed the generated theme was active, confirmed the stored import result reported success, and confirmed SSI was no longer installed after import.
Testing
npx vitest run apps/cli/commands/site/tests/create.test.tsnpm -w wp-studio run typechecknpx eslint apps/cli/commands/site/create.ts apps/cli/commands/site/tests/create.test.ts apps/cli/lib/native-php/php-process.ts apps/cli/lib/native-php/blueprints.tsnpx eslint apps/studio/src/lib/figma-import-handoff-server.ts apps/studio/src/index.tsnpm run cli:buildnode apps/cli/dist/cli/main.mjs create --helpnpx vitest run apps/studio/src/lib/tests/figma-import-handoff-server.test.tsnpx eslint apps/studio/src/lib/figma-import-handoff-server.ts apps/studio/src/lib/tests/figma-import-handoff-server.test.tsnpm -w studio-app run typecheckNotes
AI assistance