-
Couldn't load subscription status.
- Fork 356
[Docs] Updating run cli demos #2833
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
base: trunk
Are you sure you want to change the base?
Conversation
|
|
||
| [@wp-playground/cli](https://www.npmjs.com/package/@wp-playground/cli) is a command-line tool that simplifies the WordPress development and testing flow. | ||
| Playground CLI supports auto-mounting a directory with a plugin, theme, or WordPress installation. But if you need flexibility, the CLI supports mounting commands to personalize your local environment. | ||
| [@wp-playground/cli](https://www.npmjs.com/package/@wp-playground/cli) is a command-line tool that simplifies the WordPress development and testing flow. You can use Playground CLI to auto-mount a directory with a plugin, theme, or WordPress installation. If you need flexibility, you can use mounting commands to personalize your local environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, people are probably unfamiliar with the concept of mounting/automounting in the CLI. I'd explain it first or use a different language here, e.g. "You can use Playground CLI to test a local plugin, theme, or a full WordPress installation". I know it's a carryover from the previous version but it caught my eye
packages/docs/site/docs/developers/05-local-development/04-wp-playground-cli.md
Outdated
Show resolved
Hide resolved
packages/docs/site/docs/developers/05-local-development/04-wp-playground-cli.md
Outdated
Show resolved
Hide resolved
| npx @wp-playground/cli@latest server --mount=.:/wordpress/wp-content/plugins/MY-PLUGIN-DIRECTORY | ||
| ``` | ||
|
|
||
| **Multiple mounts:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition! In the future, let's find a good name for the two-parameter mount flag and swap all those examples for that – the : symbol is problematic on windows. Nothing to do in this PR, we need to tweak the naming first.
packages/docs/site/docs/developers/05-local-development/04-wp-playground-cli.md
Outdated
Show resolved
Hide resolved
packages/docs/site/docs/developers/05-local-development/04-wp-playground-cli.md
Outdated
Show resolved
Hide resolved
| ``` | ||
|
|
||
| To execute the code above, the developer can set their preferred method. A simple way to execute this code is to save it as a `.ts` file and run it with a tool like `tsx`. For example: `tsx my-script.ts` | ||
| To execute the code above, you can set your preferred method. A simple way to execute this code is to save it as a `.ts` file and run it with a tool like `tsx`. For example: `tsx my-script.ts` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL. How do you use that tool? Let's give folks something actionable to run it, even a link.
| }); | ||
| ``` | ||
|
|
||
| **Complex blueprint with multiple configurations:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"multiple configurations"? Did you mean steps? The previous Blueprint also has multiple steps, do we need a separate example?
|
|
||
| ### Mode selection (Blueprint v2) | ||
|
|
||
| You can specify different modes when working with Blueprint v2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's link to something Blueprints v2-related, otherwise it's a bit confusing what this section is about – should I use the v2 runner? How is it better? etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was concern to add this because we don't have content yet about blueprints v2
|
|
||
| ### Integration testing with Vitest | ||
|
|
||
| The programmatic API is excellent for automated testing. Here's a complete example using Vitest: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretty cool!
| mount: [ | ||
| { | ||
| hostPath: './my-theme', | ||
| vfsPath: '/wordpress/wp-content/themes/my-theme' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't much different from one of the first examples. Also, I can't just copy&paste this snippet since I don't have ./my-theme directory locally. Could we offer a few examples that can be just copy&pasted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I will try something different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool, thank you! I've left a few comments, nothing major.
…playground-cli.md Co-authored-by: Adam Zieliński <[email protected]>
…playground-cli.md Co-authored-by: Adam Zieliński <[email protected]>
…playground-cli.md Co-authored-by: Adam Zieliński <[email protected]>
…playground-cli.md Co-authored-by: Adam Zieliński <[email protected]>
Motivation for the change, related issues
Updating the
runCLIdemos to show other ways of working with the method, applying for tests. Including more examples of the new flags. The change also included a description to improve the page SEO and apply some recommendations of the WordPress Docs handbook.New demos:
Portuguese and Spanish versions are also included.