Skip to content

Playground CLI: Use Blueprints v2 #2281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 100 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
667db0e
Use Blueprints v2 runner in CLI
adamziel Jun 16, 2025
3d3b077
Don't use the primary PHP instance for running CLI tasks
adamziel Jun 16, 2025
d1fbc1e
Update the blueprints runner
adamziel Jun 16, 2025
b9d13b1
Run a single Blueprints V2 test
adamziel Jun 16, 2025
2661e94
Lint
adamziel Jun 16, 2025
eaab081
shorten the comments
adamziel Jun 16, 2025
939dcf6
Pass CLI args to blueprints.php
adamziel Jun 16, 2025
2f95b96
CLI runner adjustments to report errors effectively and run subproces…
adamziel Jun 17, 2025
31d26a8
Fix content imports in the Blueprint v2 runner
adamziel Jun 17, 2025
c9a3852
Lint
adamziel Jun 17, 2025
b3dee6b
Support Blueprint v2-specific options in Playground CLI. Expand Async…
adamziel Jun 17, 2025
3d278cd
Lint tests
adamziel Jun 17, 2025
4addf5e
Remove top level await
adamziel Jun 17, 2025
20e7ccd
Rewire auto-mounts for v2 runner
adamziel Jun 18, 2025
e724215
Restore quiet: true in unit tests
adamziel Jun 18, 2025
9dcefd6
Apply WordPress override via filters, not CLI options
adamziel Jun 18, 2025
83b3a13
Rebuild blueprints.phar
adamziel Jun 18, 2025
33db4a7
Simplify the data flow leading to running blueprints.phar
adamziel Jun 19, 2025
ee3cab1
Move PHP_BINARY setup to phpwasm-emscriptem-library.js
adamziel Jun 19, 2025
2d366a2
Extract sandboxed spawn handler to a separate module
adamziel Jun 19, 2025
fc838c9
Use sandboxed spawn handler in v2.spec.ts
adamziel Jun 19, 2025
5ac3994
Cleanup
adamziel Jun 19, 2025
b2452d8
Lint
adamziel Jun 19, 2025
9d11c70
Infer PHP version from the Blueprint
adamziel Jun 19, 2025
542e7cd
Remove stale tests
adamziel Jun 19, 2025
c8e20de
Remove stale CLI options
adamziel Jun 19, 2025
423ba57
Lint
adamziel Jun 19, 2025
9bfdc6d
Move quieting the logs higher up
adamziel Jun 19, 2025
089d22d
Add a TODO
adamziel Jun 19, 2025
b311c14
Remove a done TODO
adamziel Jun 19, 2025
40976be
Restore PHP builds
adamziel Jun 19, 2025
28e4a36
Restore PHP builds
adamziel Jun 19, 2025
44d3816
Fix CLI tests
adamziel Jun 19, 2025
59a5b9b
Move process.exit(0) to cli.ts
adamziel Jun 19, 2025
5ea0b35
Unbind php.onMessage listener after cli() is finished
adamziel Jun 20, 2025
80d906c
Preserve import('node:fs') in the blueprints package
adamziel Jun 21, 2025
ac86f08
Lint
adamziel Jun 21, 2025
1b22c38
test blogname in test-built-npm-packages
adamziel Jun 21, 2025
1369ae7
Merge branch 'trunk' into use-blueprints-v2-runner-in-cli
adamziel Jun 23, 2025
628f336
Got Blueprints v2 to execute in the multi-worker setup (with a primar…
adamziel Jun 24, 2025
efc6aca
add the missing mountResources() call for primary workers
adamziel Jun 24, 2025
43c560e
Merge branch 'trunk' into use-blueprints-v2-runner-in-cli
adamziel Jun 24, 2025
7861ebc
PHP Node: Only consider NODEFS to be a shared filesystem
adamziel Jun 24, 2025
e4e9aed
Merge branch 'only-consider-nodefs-to-be-shared' into use-blueprints-…
adamziel Jun 24, 2025
68d968f
Rebuild blueprints
adamziel Jun 24, 2025
5a3a5ff
lint
adamziel Jun 24, 2025
8ec508c
lint
adamziel Jun 24, 2025
b24c0e0
Adjust the site title for unbuilt packages CI tests
adamziel Jun 25, 2025
989cf3e
Fix Playground CLI build
adamziel Jun 25, 2025
4d2e0a7
Adjust the used Blueprint reference
adamziel Jun 25, 2025
1555aa3
Import blueprints.phar using a dynamic import, not static import
adamziel Jun 25, 2025
20d6d45
Use .default on the dunamic import
adamziel Jun 25, 2025
c9b1cc1
Adjust the site title in tests
adamziel Jun 25, 2025
3e9e607
Cleanup error reporting
adamziel Jun 25, 2025
243feb8
Reduce Blueprint v2 hooks to a single onMessage callback
adamziel Jun 25, 2025
ca1e608
Lint
adamziel Jun 25, 2025
a769911
Remove blueprints.phar from the list of assets required for offline mode
adamziel Jun 25, 2025
163e962
Fix JSPI crash – prevent calling cli() and runStream() on the same PH…
adamziel Jun 25, 2025
4a81847
assertions=0
adamziel Jun 25, 2025
0b317e0
adjut test-running-unbuild-cli.sh
adamziel Jun 25, 2025
a95d8fc
adjut test-running-unbuild-cli.sh
adamziel Jun 25, 2025
dcb52d7
adjust error reporting and test-running-unbuild-cli.sh
adamziel Jun 25, 2025
709f0bd
Move blueprints v2 to the CLI package
adamziel Jun 27, 2025
b58b622
Move blueprints v2 to the CLI package
adamziel Jun 27, 2025
5ec9c71
lint
adamziel Jun 27, 2025
8914548
Keep the server alive
adamziel Jun 27, 2025
5041985
Improve built packages test script
adamziel Jun 27, 2025
b1aed59
Improve built packages test script
adamziel Jun 27, 2025
978e115
Adjust test-built-npm-packages job
adamziel Jun 27, 2025
b21b6d7
Adjust test-built-npm-packages job
adamziel Jun 27, 2025
4ee9871
Adjust test-built-npm-packages job
adamziel Jun 27, 2025
f656cbe
Adjust test-built-npm-packages job
adamziel Jun 27, 2025
f372fd9
Adjust test-built-npm-packages job
adamziel Jun 27, 2025
a733a22
Adjust test-built-npm-packages job
adamziel Jun 27, 2025
23c75c3
Improve error reporting
adamziel Jun 30, 2025
72cb63f
Improve error reporting
adamziel Jun 30, 2025
ae96fc1
Add missing file
adamziel Jun 30, 2025
987bf47
Do not require lint for running tests
adamziel Jun 30, 2025
5124c09
Build blueprint.js with actual file, not data URL
adamziel Jun 30, 2025
333e424
restore package.json
adamziel Jun 30, 2025
a7d47a8
adjust blueprints.phar build path
adamziel Jun 30, 2025
061efcf
adjust blueprints.phar build path
adamziel Jun 30, 2025
8e709a2
adjust blueprints.phar build path
adamziel Jun 30, 2025
aa936f2
adjust blueprints.phar build path
adamziel Jun 30, 2025
7c988c5
adjust wp.spec timeout
adamziel Jun 30, 2025
4dc5ae3
inline serialize-error package
adamziel Jun 30, 2025
3ba7475
inline serialize-error package
adamziel Jun 30, 2025
a44534d
lint, restore ci jobs
adamziel Jul 1, 2025
c6dc02f
merge trunk
adamziel Jul 1, 2025
e8bf04b
revert package.jsons
adamziel Jul 1, 2025
23a1a13
Update ci.yml
adamziel Jul 1, 2025
920edf3
revert package.jsons
adamziel Jul 1, 2025
f8711d8
revert package.jsons
adamziel Jul 1, 2025
7184973
Use kebab case for CLI args
adamziel Jul 1, 2025
635e635
Document sandboxedSpawnHandlerFactory()
adamziel Jul 1, 2025
9d05b20
Typecheck
adamziel Jul 1, 2025
efa6118
Fix arg name in expandAutoMounts
adamziel Jul 1, 2025
a971c61
Update blueprints.phar
adamziel Jul 1, 2025
a83b460
Fix silent crash on mount – await mount, report problems on stdout, k…
adamziel Jul 3, 2025
fe4e840
Patch older PHP versions
adamziel Jul 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ packages/playground/wordpress-builds/public
packages/playground/sync/src/test/wp-*
packages/php-wasm/node/src/test/__test*
*.timestamp-1678999213403.mjs
rollup.d.ts
.local
.vscode
.nx
Expand Down
39 changes: 22 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,23 +210,26 @@ jobs:
jq --arg version "$VERSION" '.version = $version' "$package" > "$package.tmp"
mv "$package.tmp" "$package"
done
- name: Package repository
- name: Package repository and start a local node package registry server
run: |
npx nx run-many --all --target=package-for-self-hosting -- --hostingBaseUrl="$PACKAGE_BASE_URL"
- name: Start a local node package registry server
run: |
source ~/.nvm/nvm.sh;
nvm install 22;
RUNNER_TRACKING_ID="" && ( \
nohup node \
--experimental-strip-types \
--experimental-transform-types \
--import ./packages/meta/src/node-es-module-loader/register.mts \
./packages/playground/cli/src/cli.ts server \
--port=$PORT \
--mount="$HOST_PATH:/wordpress/$VERSION" \
--quiet& \
)
cd $HOST_PATH
python3 -c "
import http.server
import socketserver
from urllib.parse import unquote

class PrefixHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
if self.path.startswith('/${{ env.VERSION }}/'):
self.path = self.path[len('/${{ env.VERSION }}'):]
elif self.path == '/${{ env.VERSION }}':
self.path = '/'
super().do_GET()

with socketserver.TCPServer(('127.0.0.1', ${{ env.PORT }}), PrefixHTTPRequestHandler) as httpd:
httpd.serve_forever()
" &
- name: Wait for the package server to be ready
run: |
for i in {1..60}; do
Expand All @@ -238,7 +241,8 @@ jobs:
done
- name: Run integration tests in an ES Modules project
run: |
cd packages/playground/test-built-npm-packages/es-modules-and-vitest
cp -r packages/playground/test-built-npm-packages/es-modules-and-vitest /tmp/es-modules-test
cd /tmp/es-modules-test
jq --arg package_url "$PACKAGE_URL" '.devDependencies["@wp-playground/cli"] = $package_url' package.json > package.json.tmp
mv package.json.tmp package.json
npm install
Expand All @@ -252,7 +256,8 @@ jobs:
npm run test
- name: Run integration tests in a CommonJS project
run: |
cd packages/playground/test-built-npm-packages/commonjs-and-jest
cp -r packages/playground/test-built-npm-packages/commonjs-and-jest /tmp/commonjs-test
cd /tmp/commonjs-test
jq --arg package_url "$PACKAGE_URL" '.devDependencies["@wp-playground/cli"] = $package_url' package.json > package.json.tmp
mv package.json.tmp package.json
npm install
Expand Down
Loading