-
Notifications
You must be signed in to change notification settings - Fork 43
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
wp-now: Make it possible to use WP-CLI #25
Comments
Once WP-CLI is available, we can use it to handle downloading WordPress too. |
|
Another angle on this that's come up: what if I want to run my existing It might not actually be too difficult — we may just need to tell WP-CLI where to find the WordPress files, SQLite database, and project files. At the moment however, the knowledge of this only exists in the virtualized filesystem. |
Fixes #438 ## What? Removes the magic WordPress loading for the `wp-now php` command. ## Why? It's not particularly intuitive that you get WordPress when you run `wp-now php`. It's more intuitive that WordPress will load if you run WP-CLI, so let's keep the behavior for that feature (https://github.com/WordPress/wordpress-playground/issues/269). ## Testing Instructions Tests should pass.
…395) ## What? - Add the `executeWPCli` function to download and execute `wp-cli. - In the future, we may include the command `wp-now wp`. Currently, we drop it out until we improve the pthreads execution. Currently a PR in progress: #346 - Surface `emscriptenOptions` to catch print and print error for `wp-cli` execution. ## Why? - See https://github.com/WordPress/wordpress-playground/issues/269 ## How? It downloads the wp-cli.phar file if the file doesn't exist, then uses `php.cli()` to execute it. There are some limitations in the `wp-cli` features. Some of them may not work. ## Testing Instructions - Check out this branch. - Copy your path to your theme or plugin - After installing and building the project, run: - Run the tests `npx nx test wp-now` - Observe the tests pass. <!--details> <summary>~`WP_NOW_PROJECT_PATH=/path/to/your-theme-or-plugin npx nx preview wp-now wp user list`~ </summary> ``` > nx run wp-now:preview wp user list +----+------------+--------------+--------------+--------------+---------------+ | ID | user_login | display_name | user_email | user_registe | roles | | | | | | red | | +----+------------+--------------+--------------+--------------+---------------+ | 1 | admin | admin | admin@localh | 2023-05-19 1 | administrator | | | | | ost.com | 7:33:35 | | +----+------------+--------------+--------------+--------------+---------------+ > NX Successfully ran target preview for project wp-now and 12 tasks it depends on (10s) With additional flags: wp user list ``` </details!--> --------- Co-authored-by: Daniel Bachhuber <[email protected]>
Turns out supporting pthreads offers no clear benefit. What would actually help is proc_open support. |
I reorganizes the `dev` and `build` scripts in `package.json` for more internal consistency and less duplication. The new structure is: - dev - Alias for dev:web - dev:web - Runs dev:web:\* in parallel - dev:web:app - dev:web:html - dev:web:serve - dev:web:service-worker - dev:web:web-worker - dev:node - build - Alias for build:web - build:web - Runs build:web:\* in parallel - build:web:app - build:web:html - build:web:service-worker - build:web:web-worker - build:node - build:php - Runs build:php:\* sequentially - build:php:web - build:php:node - build:wp - build:app - Runs build:web and build:node sequentially - clean - Runs clean:\* in parallel - clean:php - clean:wp
Once WordPress/wordpress-playground#242 is done, we should add some convenient shorthand for WP-CLI.
Done is:
wp-now cli
executes WP-CLI.wp-now
downloads it to its magical hidden folder.The text was updated successfully, but these errors were encountered: