Skip to content

Commit

Permalink
Remove wp-now from the repository. See #473.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed May 30, 2023
1 parent ac78a84 commit 6d88529
Show file tree
Hide file tree
Showing 90 changed files with 38 additions and 2,406 deletions.
38 changes: 34 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,40 @@ only pull the latest revision of the trunk branch:
git clone -b trunk --single-branch --depth 1 [email protected]:WordPress/wordpress-playground.git
```

## Vision

Make WordPress instantly accessible for users, learners, extenders, and contributors by building foundational software tools developers can use to create interactive, zero-setup, JavaScript applications with WordPress.

More specifically, here is a preliminary outline of the areas Playground will focus on. These items are not set in stone, and your feedback and contributions are crucial to help shape the direction.

### Learning WordPress Through Exploration

Playground aims to shift the WordPress learning journey from following screenshots and videos into engaging with a live site where it's safe and easy to creatively explore the concepts being taught.

Imagine live Playgrounds that guide users through building their first website, customizing a theme, or setting up an e-commerce store. Furthermore, users would have the freedom to take a detour and explore on their own. The goal is to not to create specific tutorials or apps, but rather to empower developers with the tools necessary to build them.

Key features include support for pre-defining an initial site setup and the ability to provide step-by-step interactive instructions.


### Learning WordPress Development Through Writing Code

Playground aims to encourage and accelerate learning WordPress development.

Imagine an in-browser code editor with an instant preview of everything you build. New developers would be guided through building their first WordPress extensions, and experienced developers would hone their WordPress skills with live code snippets and interactive examples embedded in the documentation and tutorials. Furthermore, developers would be able to start developing locally with zero or almost zero setup steps.

The goal is not to build such a full-featured code editor in Playground, but rather to provide the tools necessary to build one.

Key features include running PHP code in Playground, an abstraction for synchronizing files with a Playground instance, and a PHP binary that supports CLI tools like wp-cli or phpunit.


### Instant access to WordPress ecosystem

Playground aims to empower developers to build WordPress applications that are available in an instant and without any server infrastructure.

WordPress ecosystem consists of many powerful extensions that could become accessible without any pre-requisites. Imagine using WordPress as a notes app, getting acquainted with plugins and themes through official live demos, or starting a full-featured development environment with a single-click. The goal is not to build such applications, but to empower the ecosystem to make them available on demand.

Key features include abstraction for integrating a custom filesystems, in-browser support for network requests, and the ability to use and configure specific PHP extensions.

## Contributing

You also can run WordPress Playground locally as follows:
Expand Down Expand Up @@ -139,10 +173,6 @@ Another strong inspiration was the [Drupal in the browser demo](https://seanmorr

A worthy mention is Wasm Labs’s closed-source [WordPress in the browser](https://wordpress.wasmlabs.dev/) shared before this project was first published. There is no public repository available, but their [technical overview](https://wasmlabs.dev/articles/wordpress-in-the-browser/) gives a breakdown of the technical decisions that project took. WordPress Playground draws inspiration from the same PHP in the browser projects and makes similar technical choices.

## Using WP-NOW for local environment

WordPress Playground comes with `wp-now`. `wp-now` is a Command Line Interface (CLI) tool designed to streamline the process of setting up a local WordPress environment by using only Node.js. If you are looking to set up `wp-now` specifically, you can follow [this README.md](/packages/wp-now/README.md).

## Contributing

WordPress Playground is an ambitious project in its early days. If the feature you need is missing, you are more than welcome to start a discussion, open an issue, and even propose a Pull Request to implement it.
19 changes: 0 additions & 19 deletions bin/wp-now

This file was deleted.

1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,7 @@
},
"workspaces": [
"packages/nx-extensions",
"packages/wp-now",
"packages/php-wasm/*",
"packages/playground/*"
],
"bin": {
"wp-now": "bin/wp-now"
}
]
}
20 changes: 0 additions & 20 deletions packages/docs/site/docs/04-nodejs/01-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,6 @@ import vsCodeScreenshot from '@site/static/img/start-wordpress-server.png';

<div style={{maxWidth:350}}><Image img={vsCodeScreenshot} /></div>

## Run WordPress via the `wp-now` CLI tool

import WPNowOverview from '@site/docs/\_fragments/\_wp_now_overview.mdx';

<WPNowOverview />

## Build an app with Playground npm packages

WordPress Playground ships with a set of npm packages that you can use to build your own tools on top of it.

### Use `wp-now` as a library

[The `@wp-now/wp-now` package](https://npmjs.org/@wp-now/wp-now) is not only a CLI tool but also a library providing tools for serving WordPress, setting up the SQLite support, and many more. It is a great package to use when you want to get started with WordPress Playground in Node.js.

### Use JSON Blueprints for Node.js

You can control the WebAssembly PHP using the same [JSON Blueprints](../09-blueprints-api/01-index.md) as in the web version. [They're isomorphic](../09-blueprints-api/06-isomorphic.md).

The [`@wp-playground/blueprints`](https://npmjs.org/@wp-playground/blueprints) package can run Blueprints and exposes many useful helpers you can use in your code. See [Getting Started with Blueprints](../09-blueprints-api/01-index.md) to learn more.

### Work directly with WebAssembly PHP for Node.js

And if you need a low-level control over the underlying WebAssembly PHP build, take a look at the [`@php-wasm/node` package](https://npmjs.org/@php-wasm/node) which ships the PHP WebAssembly runtime. This package is at the core of all WordPress Playground tools for Node.js.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@ The following Playground APIs are available in Node.js:

- [JSON Blueprints API](../09-blueprints-api/01-index.md)
- [JavaScript API](../10-javascript-api/01-index.md)
- [wp-now API](https://www.npmjs.com/package/@wp-now/wp-now)

These APIs are very similar to their web counterparts, but, unsurprisingly, they are not based or links or iframes.
2 changes: 1 addition & 1 deletion packages/docs/site/docs/09-blueprints-api/06-isomorphic.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ await login(phpInSameThread);
// ^ @TODO: Still fails unless you provide a DOMParser polyfill
```

This opens the door to using Blueprints in the VS Code extension, wp-now, and other tools.
This opens the door to using Blueprints in Node.js tools.

## Implementation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The PHP module has its own filesystem separate from your computer's filesystem.

In general, WordPress Playground uses an in-memory virtual filesystem.

However, in Node.js, you can also mount a real directory from the host filesystem into the PHP filesystem. This is what `wp-now` and the VS Code extension do to access your local WordPress installation.
However, in Node.js, you can also mount a real directory from the host filesystem into the PHP filesystem.

Here's how to interact with the filesystem in WordPress Playground:

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/site/docs/11-architecture/15-wordpress.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ WordPress Playground ships a [bundled WordPress](./06-wasm-php-data-dependencies

## WordPress in Node.js

In Node.js, you'll typically want to [mount WordPress](./05-wasm-php-filesystem.md) from a disk directory. Since [wp-now](https://npmjs.com/package/@wp-now/wp-now) does that, you can reuse the utilities it provides.
In Node.js, you'll typically want to [mount WordPress](./05-wasm-php-filesystem.md) from a disk directory.
2 changes: 0 additions & 2 deletions packages/docs/site/docs/13-contributing/05-publishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Each package identifies a distinct organization in its `package.json` file. To p

- `@wp-playground`
- `@php-wasm`
- `@wp-now`

To initiate the publishing process for the all the modified packages, execute the following commands:

Expand All @@ -36,7 +35,6 @@ npm run release
To verify the publishing process went correctly:

1. Please verify https://translate.wordpress.org/projects/wp-plugins/contact-form-7/dev/de/default/playground/ loads as expected. If it doesn't load, something broke.
2. Please run `npm install -g @wp-now/wp-now`. Verify you have the latest version with `wp-now --version`. Try `wp-now start` in a couple of modes to make sure everything is loaded as expected.

### When publishing packages goes wrong

Expand Down
18 changes: 0 additions & 18 deletions packages/wp-now/.eslintrc.json

This file was deleted.

53 changes: 0 additions & 53 deletions packages/wp-now/CONTRIBUTING.md

This file was deleted.

113 changes: 0 additions & 113 deletions packages/wp-now/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions packages/wp-now/esbuild.mjs

This file was deleted.

27 changes: 0 additions & 27 deletions packages/wp-now/package.json

This file was deleted.

Loading

0 comments on commit 6d88529

Please sign in to comment.