Skip to content

Commit

Permalink
Merge branch 'docs/guide-for-plugin-developers' of github.com:wordpre…
Browse files Browse the repository at this point in the history
…ss-juanmaguitar/wordpress-playground into docs/guide-for-plugin-developers
  • Loading branch information
juanmaguitar committed Sep 11, 2024
2 parents 5911e1f + 127541b commit 9667bdc
Show file tree
Hide file tree
Showing 42 changed files with 100 additions and 56 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to this project are documented in this file by a CI job
that runs on every NPM release. The file follows the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
format.

## [v0.9.39] (2024-09-09)

### Bug Fixes

- Use the correct imports in the generated .d.ts files. ([#1742](https://github.com/WordPress/wordpress-playground/pull/1742))

### Contributors

The following contributors merged PRs in this release:

@adamziel


## [v0.9.38] (2024-09-09)

### Internal
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.9.38",
"version": "0.9.39",
"useWorkspaces": true,
"useNx": true
}
36 changes: 18 additions & 18 deletions package-lock.json

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

33 changes: 17 additions & 16 deletions packages/docs/site/docs/blueprints/04-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ slug: /blueprints/steps/resources

# Resources References

Resource References allow you use external files in Blueprints
"Resource References" allow you use external files in Blueprints

:::info
Blueprints steps such as [[`installPlugin`](/blueprints/steps#InstallPluginStep)] or [`installTheme`](/blueprints/steps#InstallThemeStep) require a location of the plugin or theme to be installed.
Blueprints steps such as [`installPlugin`](/blueprints/steps#InstallPluginStep) or [`installTheme`](/blueprints/steps#InstallThemeStep) require a location of the plugin or theme to be installed.

That location can be defined as [a `URL` resource](#urlreference) of the `.zip` file containg the theme or plugin. It can also be defined as a [`wordpress.org/plugins`](#corepluginreference) or [`wordpress.org/themes`](#corethemereference) resource for thouse plugins/themes published in the official WordPress directories.
That location can be defined as [a `URL` resource](#urlreference) of the `.zip` file containing the theme or plugin. It can also be defined as a [`wordpress.org/plugins`](#corepluginreference) or [`wordpress.org/themes`](#corethemereference) resource for those plugins/themes published in the official WordPress directories.
:::

The following resource references are available:
Expand All @@ -20,7 +20,7 @@ import TOCInline from '@theme/TOCInline';

### URLReference

The URLReference resource is used to reference files that are stored on a remote server. The URLReference resource is defined as follows:
The `URLReference` resource is used to reference files that are stored on a remote server. The `URLReference` resource is defined as follows:

```typescript
type URLReference = {
Expand All @@ -29,7 +29,7 @@ type URLReference = {
};
```

To use the URLReference resource, you need to provide the URL of the file. For example, to reference a file named "index.html" that is stored on a remote server, you can create a URLReference as follows:
To use the `URLReference` resource, you need to provide the URL of the file. For example, to reference a file named "index.html" that is stored on a remote server, you can create a `URLReference` as follows:

```json
{
Expand All @@ -39,17 +39,18 @@ To use the URLReference resource, you need to provide the URL of the file. For e
```

The resource `url` type works really in combination with blueprint steps such as [`installPlugin`](/blueprints/steps#InstallPluginStep) or
[`installTheme`](http://localhost:3000/wordpress-playground/blueprints/steps#InstallThemeStep). These steps require a `ResourceType` to define the location of the plugin or the theme to install.
[`installTheme`](http://localhost:3000/wordpress-playground/blueprints/steps#InstallThemeStep).
These steps require a `ResourceType` to define the location of the plugin or the theme to install.

With a `"resource": "url"` we can define the location of a `.zip` containing the plugin/theme via a URL that can point direclty to a GitHub repo.
With a `"resource": "url"` we can define the location of a `.zip` containing the plugin/theme via a URL that can point directly to a GitHub repo.

:::tip
The Playground project provides a [GitHub Proxy](https://playground.wordpress.net/proxy) that allows you to generate a `.zip` from a repository (or even a folder inside a repo) containing your plugin or theme. This tool is very useful for avoiding CORS issues, among others..
The Playground project provides a [GitHub Proxy](https://playground.wordpress.net/proxy) that allows you to generate a `.zip` from a repository (or even a folder inside a repo) containing your plugin or theme. This tool is very useful for avoiding CORS issues, among others.
:::

### CoreThemeReference

The CoreThemeReference resource is used to reference WordPress core themes. The CoreThemeReference resource is defined as follows:
The _CoreThemeReference_ resource is used to reference WordPress core themes. The _CoreThemeReference_ resource is defined as follows:

```typescript
type CoreThemeReference = {
Expand All @@ -59,7 +60,7 @@ type CoreThemeReference = {
};
```

To use the CoreThemeReference resource, you need to provide the slug of the theme. For example, to reference the "Twenty Twenty-One" theme, you can create a CoreThemeReference as follows:
To use the _CoreThemeReference_ resource, you need to provide the slug of the theme. For example, to reference the "Twenty Twenty-One" theme, you can create a _CoreThemeReference_ as follows:

```json
{
Expand All @@ -70,7 +71,7 @@ To use the CoreThemeReference resource, you need to provide the slug of the them

### CorePluginReference

The CorePluginReference resource is used to reference WordPress core plugins. The CorePluginReference resource is defined as follows:
The _CorePluginReference_ resource is used to reference WordPress core plugins. The _CorePluginReference_ resource is defined as follows:

```typescript
type CorePluginReference = {
Expand All @@ -80,7 +81,7 @@ type CorePluginReference = {
};
```

To use the CorePluginReference resource, you need to provide the slug of the plugin. For example, to reference the "Akismet" plugin, you can create a CorePluginReference as follows:
To use the _CorePluginReference_ resource, you need to provide the slug of the plugin. For example, to reference the "Akismet" plugin, you can create a _CorePluginReference_ as follows:

```json
{
Expand All @@ -91,7 +92,7 @@ To use the CorePluginReference resource, you need to provide the slug of the plu

### VFSReference

The VFSReference resource is used to reference files that are stored in a virtual file system (VFS). The VFS is a file system that is stored in memory and can be used to store files that are not part of the file system of the operating system. The VFSReference resource is defined as follows:
The _VFSReference_ resource is used to reference files that are stored in a virtual file system (VFS). The VFS is a file system that is stored in memory and can be used to store files that are not part of the file system of the operating system. The _VFSReference_ resource is defined as follows:

```typescript
type VFSReference = {
Expand All @@ -100,7 +101,7 @@ type VFSReference = {
};
```

To use the VFSReference resource, you need to provide the path to the file in the VFS. For example, to reference a file named "index.html" that is stored in the root of the VFS, you can create a VFSReference as follows:
To use the _VFSReference_ resource, you need to provide the path to the file in the VFS. For example, to reference a file named "index.html" that is stored in the root of the VFS, you can create a _VFSReference_ as follows:

```json
{
Expand All @@ -111,7 +112,7 @@ To use the VFSReference resource, you need to provide the path to the file in th

### LiteralReference

The LiteralReference resource is used to reference files that are stored as literals in the code. The LiteralReference resource is defined as follows:
The _LiteralReference_ resource is used to reference files that are stored as literals in the code. The _LiteralReference_ resource is defined as follows:

```typescript
type LiteralReference = {
Expand All @@ -121,7 +122,7 @@ type LiteralReference = {
};
```

To use the LiteralReference resource, you need to provide the name of the file and its contents. For example, to reference a file named "index.html" that contains the text "Hello, World!", you can create a LiteralReference as follows:
To use the _LiteralReference_ resource, you need to provide the name of the file and its contents. For example, to reference a file named "index.html" that contains the text "Hello, World!", you can create a _LiteralReference_ as follows:

```json
{
Expand Down
13 changes: 13 additions & 0 deletions packages/docs/site/docs/main/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ All notable changes to this project are documented in this file by a CI job
that runs on every NPM release. The file follows the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
format.

## [v0.9.39] (2024-09-09)

### Bug Fixes

- Use the correct imports in the generated .d.ts files. ([#1742](https://github.com/WordPress/wordpress-playground/pull/1742))

### Contributors

The following contributors merged PRs in this release:

@adamziel


## [v0.9.38] (2024-09-09)

### Internal
Expand Down
2 changes: 1 addition & 1 deletion packages/php-wasm/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@php-wasm/cli",
"version": "0.9.38",
"version": "0.9.39",
"description": "PHP.wasm CLI for node.js",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/php-wasm/fs-journal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@php-wasm/fs-journal",
"version": "0.9.38",
"version": "0.9.39",
"description": "Bindings to journal the PHP filesystem",
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions packages/php-wasm/fs-journal/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default defineConfig({
dts({
entryRoot: 'src',
tsconfigPath: join(__dirname, 'tsconfig.lib.json'),
pathsToAliases: false,
}),

viteTsConfigPaths({
Expand Down
2 changes: 1 addition & 1 deletion packages/php-wasm/logger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@php-wasm/logger",
"version": "0.9.38",
"version": "0.9.39",
"description": "A logger for PHP-wasm clients like Playground and WP-now.",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UniversalPHP, PHPRequestErrorEvent } from '../../universal';
import type { UniversalPHP, PHPRequestErrorEvent } from '../types';
import { Logger } from '../logger';

let lastPHPLogLength = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface UniversalPHP {

addEventListener(
event: string,
listener: (event: PHPRequestEndEvent | PHPRequestErrorEvent) => void
listener: (event: PHPRequestErrorEvent) => void
): void;
}

Expand Down
3 changes: 2 additions & 1 deletion packages/php-wasm/logger/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"src/**/*.spec.js",
"src/**/*.test.jsx",
"src/**/*.spec.jsx",
"src/**/*.d.ts"
"src/**/*.d.ts",
"src/types.ts"
]
}
1 change: 1 addition & 0 deletions packages/php-wasm/logger/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default defineConfig({
dts({
entryRoot: 'src',
tsconfigPath: join(__dirname, 'tsconfig.lib.json'),
pathsToAliases: false,
}),

viteTsConfigPaths({
Expand Down
2 changes: 1 addition & 1 deletion packages/php-wasm/node-polyfills/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@php-wasm/node-polyfills",
"version": "0.9.38",
"version": "0.9.39",
"description": "PHP.wasm – polyfills for Node.js",
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 9667bdc

Please sign in to comment.