Skip to content
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

[CLI] Add WordPress constants using CLI arguments #1811

Open
wants to merge 4 commits into
base: fix/1706-login-with-site-email-verification
Choose a base branch
from

Conversation

bgrgicak
Copy link
Collaborator

Motivation for the change, related issues

I was testing #1789 and added support for defining constants to the CLI during development.

If feels like a useful feature, so I want to include it in the CLI.

Implementation details

A new --constants argument enables users to add WordPress constants to Playground.

Testing Instructions (or ideally a Blueprint)

  • Run Playground bun ./packages/playground/cli/src/cli.ts server --constants PLAYGROUND_FORCE_AUTO_LOGIN_ENABLED=true
  • Open this URL
  • Confirm that you are logged in

@bgrgicak bgrgicak self-assigned this Sep 27, 2024
@bgrgicak bgrgicak requested a review from a team September 27, 2024 08:23
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.

This seems like a good change. A constant param isn't currently supported by the Query API, but it seems like an intuitive addition.

🤔 Eventually, maybe the Query API params could all have corresponding CLI arguments, ignoring any that don't make sense in a CLI context.

@@ -108,6 +108,12 @@ async function run() {
type: 'boolean',
default: false,
})
.option('constants', {
Copy link
Member

Choose a reason for hiding this comment

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

UX nit:
Could we make this singular like --constant and allow specifying multiple times?

@@ -108,6 +108,12 @@ async function run() {
type: 'boolean',
default: false,
})
.option('constants', {
describe: 'Define constants to be used in the Blueprint.',
Copy link
Member

Choose a reason for hiding this comment

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

Could we document the format of the argument, even if it seems intuitive?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs review
Development

Successfully merging this pull request may close these issues.

2 participants