Skip to content

Conversation

ariskataoka
Copy link
Member

@ariskataoka ariskataoka commented Sep 3, 2025

Description


Part of # https://linear.app/a8c/issue/BSKY-1041/integrate-site-spec-in-wordpresscom-environments

This pull request introduces a new system for integrating the SiteSpec lib into Calypso, including configuration, script/CSS loading utils, and a "Site Step" in the AI Site Builder flow that leverages SiteSpec as a test. The changes are grouped into three main areas: feature integration, configuration and env support, and utility/testing infrastructure.

This PR depends on wordpress.com PR 191598.

Why are these changes being made?

We need to replace the current AI site builder with site-spec, also bringing over the ability to build the site specification within Calypso.
Note: This PR does not remove the existing site builder, it just adds a new way to do that. Let's remove the existing one in a separate PR.

Testing Instructions

  1. Point your sandbox to the PR 191598 branch, Proxy your public-api and widgets.wp.com hosts
  2. In development, the feature is already enabled in config/development.json
  3. Navigate to the new AI site builder page: http://calypso.localhost:3000/setup/ai-site-builder/site-spec and
  • Verify Site-Spec loads correctly
  • Verify CSS styles are applied
  • Confirm the Site-Spec interface renders properly
  • Verify that you're site is built correctly after adding the prompt
calypso.mp4

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@ariskataoka ariskataoka requested a review from a team as a code owner September 3, 2025 17:12
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 3, 2025
Copy link

github-actions bot commented Sep 3, 2025

@matticbot
Copy link
Contributor

matticbot commented Sep 3, 2025

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • blaze-dashboard
  • happy-blocks
  • help-center
  • notifications
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug try/site-spec-integration-cdn on your sandbox.

@ariskataoka
Copy link
Member Author

ariskataoka commented Sep 3, 2025

@aagam-shah @dereksmart just to clarify this piece is the site spec lib only, so auth is still not addressed. But I believe it can be a base to turn into an app where we can add the auth layer.

@ariskataoka ariskataoka changed the title BSKY-1041: Try add site-spec integration BSKY-1042: Try add site-spec integration Sep 4, 2025
Copy link

@aswasif007 aswasif007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code reviewed and tested. I have left some minor comments, plus we want to use the latest version of the site-spec bundle.

Approving as I don't see any major change required.

@saroshaga saroshaga changed the title BSKY-1042: Try add site-spec integration BSKY-1042: site-spec integration for AI site builder Sep 10, 2025
@ariskataoka ariskataoka marked this pull request as draft September 11, 2025 07:00
@ariskataoka ariskataoka marked this pull request as ready for review September 11, 2025 07:14
Copy link
Contributor

@dereksmart dereksmart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is causing the default root http://calypso.localhost:3000/setup/ai-site-builder/ start at /site-spec, whether it's enabled in config or not. When it's not, it just lands on a white page.

The entrypoints in prod go to http://calypso.localhost:3000/setup/ai-site-builder/ and would be broken.

package.json Outdated
@@ -108,10 +108,10 @@
"reformat-files": "./node_modules/.bin/prettier --ignore-path .eslintignore --write \"**/*.{js,jsx,json,ts,tsx}\"",
"search:storybook:start": "echo 'Deprecated, run `yarn workspace @automattic/search run storybook:start` instead'",
"site-admin:storybook:start": "yarn workspace @automattic/site-admin run storybook:start",
"start": "npx check-node-version --package && node bin/welcome.js && yarn run build && yarn run start-build",
"start": "npx check-node-version --package && node --max-old-space-size=8192 bin/welcome.js && yarn run build && yarn run start-build",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am very not sure about updating the whole project's start script. Why is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're very right to be unsure about this being for the whole project. Thanks for calling this out.
And no, we shouldn’t force this in the project-wide start - prod/CI already run with higher limits (e.g. TC is set to 16 GB), and hard-coding in the project could unintended cap those. The flag was only to unblock a local js heap out of memory for the welcome.js.
I'm reverting this change in this PR and we can raise a follow-up PR adding a start with higher memory/or per environment memory set.

@@ -174,6 +174,7 @@
"signup/social-first": true,
"site-indicator": true,
"site-profiler/metrics": true,
"site-spec": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can enable this in stage.json too (easier to test internally)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ariskataoka
Copy link
Member Author

this is causing the default root http://calypso.localhost:3000/setup/ai-site-builder/ start at /site-spec, whether it's enabled in config or not. When it's not, it just lands on a white page.

The entrypoints in prod go to http://calypso.localhost:3000/setup/ai-site-builder/ and would be broken.

Thanks for taking the time to review this, @dereksmart !
I've addressed the above in e9126d2

@dereksmart
Copy link
Contributor

@ariskataoka can we please not make it the default starting point for http://calypso.localhost:3000/setup/ai-site-builder/ in general?

It would be great to have this in staging for internal folks to test it easily without also breaking the current site creation flows.

Until we are ready to get this in a production setting, I think the standalone spec should only be accessible with a direct link to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants