-
Notifications
You must be signed in to change notification settings - Fork 259
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
Blueprints: add support for NodeJS #576
Conversation
@adamziel , could you take a look at this PR? |
For reference, the https://nodejs.org/api/globals.html#customevent The |
For the Web API compatible File for nodejs - https://github.com/web-std/io/tree/main/packages/file |
@sejas would bumping the minimal required Node.js version to 20 solve it without the polyfills? Are there any blockers for that?
If node 20 is a no-go for any reason then let's bring the File polyfill into this PR so we can see if anything else breaks |
@eliot-akira , @adamziel Thank you for your suggestions. Nice!, Using Node version 20 fixes the error with Some Blueprint steps like Thank you!
|
@sejas DOMParser is no longer used in |
What?
Blueprint steps use some classes available only on Browser and not NodeJS.
This PR is an approach to make it possible to import the blueprints and make most of them work by declaring those classes when they are undefined.
Why?
wp-now
: wp-now: execute blueprint steps given a file path playground-tools#82How?
I declare
File
andCustomEvent
when they are undefined.The File implementation is empty, so we will need a second PR to make the steps to install themes and plugins work.
Testing Instructions
nvm use && npm run build
cd playground-tools
nvm use && npm run build
wp-now
: `node_modules/@wp-playground
wordpress-playground
dist toplayground-tools/node_modules/@wp-playground
:ln -s path/to/wordpress-playground/dist/packages/playground node_modules/@wp-playground
wp-now
:node dist/packages/wp-now/main.js start --blueprint=foo.json --port=80
wp-now
has started correctly and the blueprint was executed too.