Skip to content

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented Oct 15, 2025

Motivation for the change, related issues

Studio noted they can't easily used a local, unzipped WordPress directory:

Playground CLI always tries to download and install WordPress if we don't have the skipWordpressSetup flag

This PR separates skipping the download from skipping the installation.

  • Playground CLI options before this PR: --skip-wordpress-setup
  • Playground CLI options after this PR
    • --skip-wordpress-setup – deprecated, hidden
    • --skip-wordpress-download – Skip downloading and unzipping WordPress. Use when the /wordpress directory is already populated.
    • --skip-wordpress-install – Skip running the WordPress installer. Use when the mounted /wordpress site is already installed.

Testing instructions

Run

alias pgcli="node --no-warnings=ExperimentalWarning  --experimental-strip-types --experimental-transform-types --import ./packages/meta/src/node-es-module-loader/register.mts ./packages/playground/cli/src/cli.ts"

# This should install an already downloaded WordPress
pgcli server --skip-wordpress-download --mount-before-install=./unzipped-wp-directory:/wordpress

# This should download WordPress without installing it (and throw an error at the end)
pgcli server --skip-wordpress-install --mount-before-install=./unzipped-wp-directory:/wordpress

cc @bcotrim @brandonpayton

Copy link
Collaborator Author

@adamziel adamziel left a comment

Choose a reason for hiding this comment

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

left a comment

@adamziel adamziel marked this pull request as ready for review October 16, 2025 11:44
@adamziel
Copy link
Collaborator Author

@bcotrim is this what you had in mind? Also CC @wojtekn

Copy link
Member

@brandonpayton brandonpayton left a comment

Choose a reason for hiding this comment

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

@adamziel, instead of having multiple params that express a negative, what do you think about having a single param that positively asserts a specific behavior and has a default value?

The code in this PR maps the two "skip" args to a single "installation mode". I feel like exposing this as an arg like --wordpress-install-mode might be easier for users to think about. With a positive arg, we explicitly request a desired behavior. With the negative args, we are specifying modifiers for implicit behavior.

At least in my mind, it is simpler to just think about the desired behavior and ask for that.

The values could be something like:

  • download-and-install (documented as the default if the arg is not specified)
  • install-if-needed (install if we detect WP is not already installed)
  • do-nothing or skip-install

I don't love the above names, but hopefully they convey the idea. :) I suppose this also could be applied to SQLite database integration setup.

What do you think?

@adamziel
Copy link
Collaborator Author

I like that @brandonpayton, thank you for sharing this idea. It's indeed clearer. Let me refactor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants