@wp-playground/blueprints 1.0.29 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +339 -0
- package/blueprint-schema-validator.js +231 -52
- package/blueprint-schema.json +24 -15
- package/index.cjs +40 -472
- package/index.cjs.map +1 -1
- package/index.d.ts +3 -2
- package/index.js +3011 -3289
- package/index.js.map +1 -1
- package/lib/blueprint.d.ts +17 -5
- package/lib/compile.d.ts +10 -12
- package/lib/resolve-remote-blueprint.d.ts +8 -0
- package/lib/resources.d.ts +44 -20
- package/lib/steps/activate-plugin.d.ts +1 -1
- package/lib/steps/activate-theme.d.ts +1 -1
- package/lib/steps/cp.d.ts +1 -1
- package/lib/steps/define-site-url.d.ts +1 -1
- package/lib/steps/define-wp-config-consts.d.ts +2 -3
- package/lib/steps/enable-multisite.d.ts +1 -1
- package/lib/steps/export-wxr.d.ts +1 -1
- package/lib/steps/import-theme-starter-content.d.ts +1 -1
- package/lib/steps/import-wordpress-files.d.ts +1 -1
- package/lib/steps/import-wxr.d.ts +1 -1
- package/lib/steps/index.d.ts +31 -31
- package/lib/steps/install-plugin.d.ts +3 -3
- package/lib/steps/install-theme.d.ts +3 -3
- package/lib/steps/login.d.ts +1 -1
- package/lib/steps/mkdir.d.ts +1 -1
- package/lib/steps/mv.d.ts +1 -1
- package/lib/steps/request.d.ts +2 -2
- package/lib/steps/reset-data.d.ts +1 -1
- package/lib/steps/rm.d.ts +1 -1
- package/lib/steps/rmdir.d.ts +1 -1
- package/lib/steps/run-php-with-options.d.ts +2 -2
- package/lib/steps/run-php.d.ts +2 -2
- package/lib/steps/run-sql.d.ts +1 -1
- package/lib/steps/run-wp-installation-wizard.d.ts +1 -1
- package/lib/steps/set-site-language.d.ts +6 -4
- package/lib/steps/site-data.d.ts +1 -1
- package/lib/steps/unzip.d.ts +1 -1
- package/lib/steps/wp-cli.d.ts +4 -5
- package/lib/steps/write-file.d.ts +1 -1
- package/lib/steps/write-files.d.ts +2 -2
- package/lib/steps/zip-wp-content.d.ts +1 -1
- package/package.json +29 -22
package/lib/blueprint.d.ts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import { SupportedPHPVersion } from '@php-wasm/universal';
|
|
2
|
-
import { StepDefinition } from './steps';
|
|
3
|
-
import { FileReference } from './resources';
|
|
1
|
+
import type { SupportedPHPVersion } from '@php-wasm/universal';
|
|
2
|
+
import type { StepDefinition } from './steps';
|
|
3
|
+
import type { FileReference } from './resources';
|
|
4
|
+
import type { StreamedFile } from '@php-wasm/stream-compression';
|
|
5
|
+
import type { Filesystem } from '@wp-playground/storage';
|
|
4
6
|
export type ExtraLibrary = 'wp-cli';
|
|
5
7
|
export type PHPConstants = Record<string, string | boolean | number>;
|
|
6
|
-
export
|
|
8
|
+
export type StreamBundledFile = (relativePath: string) => Promise<StreamedFile>;
|
|
9
|
+
export type Blueprint = BlueprintBundle | BlueprintDeclaration;
|
|
10
|
+
/**
|
|
11
|
+
* A filesystem structure containing a /blueprint.json file and any
|
|
12
|
+
* resources referenced by that blueprint.
|
|
13
|
+
*/
|
|
14
|
+
export type BlueprintBundle = Filesystem;
|
|
15
|
+
/**
|
|
16
|
+
* The Blueprint declaration, typically stored in a blueprint.json file.
|
|
17
|
+
*/
|
|
18
|
+
export type BlueprintDeclaration = {
|
|
7
19
|
/**
|
|
8
20
|
* The URL to navigate to after the blueprint has been run.
|
|
9
21
|
*/
|
|
@@ -93,4 +105,4 @@ export interface Blueprint {
|
|
|
93
105
|
* executed.
|
|
94
106
|
*/
|
|
95
107
|
steps?: Array<StepDefinition | string | undefined | false | null>;
|
|
96
|
-
}
|
|
108
|
+
};
|
package/lib/compile.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ProgressTracker } from '@php-wasm/progress';
|
|
2
2
|
import { Semaphore } from '@php-wasm/util';
|
|
3
|
-
import { SupportedPHPVersion, UniversalPHP } from '@php-wasm/universal';
|
|
4
|
-
import { StepDefinition } from './steps';
|
|
5
|
-
import {
|
|
3
|
+
import type { SupportedPHPVersion, UniversalPHP } from '@php-wasm/universal';
|
|
4
|
+
import type { StepDefinition } from './steps';
|
|
5
|
+
import type { BlueprintDeclaration, BlueprintBundle, ExtraLibrary, StreamBundledFile, Blueprint } from './blueprint';
|
|
6
6
|
export type CompiledStep = (php: UniversalPHP) => Promise<void> | void;
|
|
7
7
|
export interface CompiledBlueprint {
|
|
8
8
|
/** The requested versions of PHP and WordPress for the blueprint */
|
|
@@ -34,16 +34,14 @@ export interface CompileBlueprintOptions {
|
|
|
34
34
|
* be made to https://cors.wordpress.net/proxy.php?https://github.com/WordPress/gutenberg.git.
|
|
35
35
|
*/
|
|
36
36
|
corsProxy?: string;
|
|
37
|
+
/**
|
|
38
|
+
* A filesystem to use for the blueprint.
|
|
39
|
+
*/
|
|
40
|
+
streamBundledFile?: StreamBundledFile;
|
|
37
41
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* @param playground The PlaygroundClient to use for the compilation
|
|
42
|
-
* @param blueprint The bBueprint to compile
|
|
43
|
-
* @param options Additional options for the compilation
|
|
44
|
-
* @returns The compiled blueprint
|
|
45
|
-
*/
|
|
46
|
-
export declare function compileBlueprint(blueprint: Blueprint, { progress, semaphore, onStepCompleted, corsProxy, }?: CompileBlueprintOptions): CompiledBlueprint;
|
|
42
|
+
export declare function compileBlueprint(input: BlueprintDeclaration | BlueprintBundle, options?: Omit<CompileBlueprintOptions, 'streamBundledFile'>): Promise<CompiledBlueprint>;
|
|
43
|
+
export declare function isBlueprintBundle(input: any): input is BlueprintBundle;
|
|
44
|
+
export declare function getBlueprintDeclaration(blueprint: Blueprint): Promise<BlueprintDeclaration>;
|
|
47
45
|
export declare function validateBlueprint(blueprintMaybe: object): {
|
|
48
46
|
valid: true;
|
|
49
47
|
errors?: undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BlueprintBundle } from './blueprint';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves a remote blueprint from a URL.
|
|
4
|
+
*
|
|
5
|
+
* @param url - The URL of the blueprint to resolve.
|
|
6
|
+
* @returns A promise that resolves to the resolved blueprint.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveRemoteBlueprint(url: string): Promise<BlueprintBundle>;
|
package/lib/resources.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { ProgressTracker } from '@php-wasm/progress';
|
|
2
|
-
import { FileTree, UniversalPHP } from '@php-wasm/universal';
|
|
3
|
-
import { Semaphore } from '@php-wasm/util';
|
|
1
|
+
import type { ProgressTracker } from '@php-wasm/progress';
|
|
2
|
+
import type { FileTree, UniversalPHP } from '@php-wasm/universal';
|
|
3
|
+
import type { Semaphore } from '@php-wasm/util';
|
|
4
|
+
import { StreamedFile } from '@php-wasm/stream-compression';
|
|
5
|
+
import type { StreamBundledFile } from './blueprint';
|
|
4
6
|
export type { FileTree };
|
|
5
|
-
export declare const ResourceTypes: readonly ["vfs", "literal", "wordpress.org/themes", "wordpress.org/plugins", "url", "git:directory"];
|
|
7
|
+
export declare const ResourceTypes: readonly ["vfs", "literal", "wordpress.org/themes", "wordpress.org/plugins", "url", "git:directory", "bundled"];
|
|
6
8
|
export type VFSReference = {
|
|
7
9
|
/** Identifies the file resource as Virtual File System (VFS) */
|
|
8
10
|
resource: 'vfs';
|
|
@@ -55,7 +57,13 @@ export type DirectoryLiteralReference = Directory & {
|
|
|
55
57
|
/** Identifies the file resource as a git directory */
|
|
56
58
|
resource: 'literal:directory';
|
|
57
59
|
};
|
|
58
|
-
export type
|
|
60
|
+
export type BundledReference = {
|
|
61
|
+
/** Identifies the file resource as a Blueprint file */
|
|
62
|
+
resource: 'bundled';
|
|
63
|
+
/** The path to the file in the Blueprint */
|
|
64
|
+
path: string;
|
|
65
|
+
};
|
|
66
|
+
export type FileReference = VFSReference | LiteralReference | CoreThemeReference | CorePluginReference | UrlReference | BundledReference;
|
|
59
67
|
export type DirectoryReference = GitDirectoryReference | DirectoryLiteralReference;
|
|
60
68
|
export declare function isResourceReference(ref: any): ref is FileReference;
|
|
61
69
|
export declare abstract class Resource<T extends File | Directory> {
|
|
@@ -79,11 +87,12 @@ export declare abstract class Resource<T extends File | Directory> {
|
|
|
79
87
|
* @param options Additional options for the Resource
|
|
80
88
|
* @returns A new Resource instance
|
|
81
89
|
*/
|
|
82
|
-
static create(ref: FileReference | DirectoryReference, { semaphore, progress, corsProxy, }: {
|
|
90
|
+
static create(ref: FileReference | DirectoryReference, { semaphore, progress, corsProxy, streamBundledFile, }: {
|
|
83
91
|
/** Optional semaphore to limit concurrent downloads */
|
|
84
92
|
semaphore?: Semaphore;
|
|
85
93
|
progress?: ProgressTracker;
|
|
86
94
|
corsProxy?: string;
|
|
95
|
+
streamBundledFile?: StreamBundledFile;
|
|
87
96
|
}): Resource<File | Directory>;
|
|
88
97
|
}
|
|
89
98
|
export declare abstract class ResourceDecorator<T extends File | Directory> extends Resource<T> {
|
|
@@ -108,14 +117,13 @@ export declare abstract class ResourceDecorator<T extends File | Directory> exte
|
|
|
108
117
|
*/
|
|
109
118
|
export declare class VFSResource extends Resource<File> {
|
|
110
119
|
private resource;
|
|
111
|
-
_progress?: ProgressTracker | undefined;
|
|
112
120
|
/**
|
|
113
121
|
* Creates a new instance of `VFSResource`.
|
|
114
122
|
* @param playground The playground client.
|
|
115
123
|
* @param resource The VFS reference.
|
|
116
124
|
* @param progress The progress tracker.
|
|
117
125
|
*/
|
|
118
|
-
constructor(resource: VFSReference, _progress?: ProgressTracker
|
|
126
|
+
constructor(resource: VFSReference, _progress?: ProgressTracker);
|
|
119
127
|
/** @inheritDoc */
|
|
120
128
|
resolve(): Promise<File>;
|
|
121
129
|
/** @inheritDoc */
|
|
@@ -126,13 +134,12 @@ export declare class VFSResource extends Resource<File> {
|
|
|
126
134
|
*/
|
|
127
135
|
export declare class LiteralResource extends Resource<File> {
|
|
128
136
|
private resource;
|
|
129
|
-
_progress?: ProgressTracker | undefined;
|
|
130
137
|
/**
|
|
131
138
|
* Creates a new instance of `LiteralResource`.
|
|
132
139
|
* @param resource The literal reference.
|
|
133
140
|
* @param progress The progress tracker.
|
|
134
141
|
*/
|
|
135
|
-
constructor(resource: LiteralReference, _progress?: ProgressTracker
|
|
142
|
+
constructor(resource: LiteralReference, _progress?: ProgressTracker);
|
|
136
143
|
/** @inheritDoc */
|
|
137
144
|
resolve(): Promise<File>;
|
|
138
145
|
/** @inheritDoc */
|
|
@@ -142,13 +149,12 @@ export declare class LiteralResource extends Resource<File> {
|
|
|
142
149
|
* A base class for `Resource`s that require fetching data from a remote URL.
|
|
143
150
|
*/
|
|
144
151
|
export declare abstract class FetchResource extends Resource<File> {
|
|
145
|
-
_progress?: ProgressTracker | undefined;
|
|
146
152
|
private corsProxy?;
|
|
147
153
|
/**
|
|
148
154
|
* Creates a new instance of `FetchResource`.
|
|
149
155
|
* @param progress The progress tracker.
|
|
150
156
|
*/
|
|
151
|
-
constructor(_progress?: ProgressTracker
|
|
157
|
+
constructor(_progress?: ProgressTracker, corsProxy?: string);
|
|
152
158
|
/** @inheritDoc */
|
|
153
159
|
resolve(): Promise<File>;
|
|
154
160
|
/**
|
|
@@ -178,8 +184,8 @@ export declare class UrlResource extends FetchResource {
|
|
|
178
184
|
* @param progress The progress tracker.
|
|
179
185
|
*/
|
|
180
186
|
constructor(resource: UrlReference, progress?: ProgressTracker, options?: {
|
|
181
|
-
corsProxy?: string
|
|
182
|
-
}
|
|
187
|
+
corsProxy?: string;
|
|
188
|
+
});
|
|
183
189
|
/** @inheritDoc */
|
|
184
190
|
getURL(): string;
|
|
185
191
|
/** @inheritDoc */
|
|
@@ -190,11 +196,10 @@ export declare class UrlResource extends FetchResource {
|
|
|
190
196
|
*/
|
|
191
197
|
export declare class GitDirectoryResource extends Resource<Directory> {
|
|
192
198
|
private reference;
|
|
193
|
-
_progress?: ProgressTracker | undefined;
|
|
194
199
|
private options?;
|
|
195
|
-
constructor(reference: GitDirectoryReference, _progress?: ProgressTracker
|
|
196
|
-
corsProxy?: string
|
|
197
|
-
}
|
|
200
|
+
constructor(reference: GitDirectoryReference, _progress?: ProgressTracker, options?: {
|
|
201
|
+
corsProxy?: string;
|
|
202
|
+
});
|
|
198
203
|
resolve(): Promise<{
|
|
199
204
|
name: string;
|
|
200
205
|
files: Record<string, any>;
|
|
@@ -207,8 +212,7 @@ export declare class GitDirectoryResource extends Resource<Directory> {
|
|
|
207
212
|
*/
|
|
208
213
|
export declare class LiteralDirectoryResource extends Resource<Directory> {
|
|
209
214
|
private reference;
|
|
210
|
-
_progress?: ProgressTracker
|
|
211
|
-
constructor(reference: DirectoryLiteralReference, _progress?: ProgressTracker | undefined);
|
|
215
|
+
constructor(reference: DirectoryLiteralReference, _progress?: ProgressTracker);
|
|
212
216
|
resolve(): Promise<DirectoryLiteralReference>;
|
|
213
217
|
/** @inheritDoc */
|
|
214
218
|
get name(): string;
|
|
@@ -257,3 +261,23 @@ export declare class SemaphoreResource<T extends File | Directory> extends Resou
|
|
|
257
261
|
/** @inheritDoc */
|
|
258
262
|
resolve(): Promise<T>;
|
|
259
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* A `Resource` that represents a file bundled with the Blueprint.
|
|
266
|
+
*/
|
|
267
|
+
export declare class BundledResource extends Resource<File> {
|
|
268
|
+
private resource;
|
|
269
|
+
private streamBundledFile;
|
|
270
|
+
/**
|
|
271
|
+
* Creates a new instance of `BlueprintResource`.
|
|
272
|
+
* @param resource The blueprint reference.
|
|
273
|
+
* @param filesystem The filesystem to read from.
|
|
274
|
+
* @param progress The progress tracker.
|
|
275
|
+
*/
|
|
276
|
+
constructor(resource: BundledReference, streamBundledFile: StreamBundledFile, _progress?: ProgressTracker);
|
|
277
|
+
/** @inheritDoc */
|
|
278
|
+
resolve(): Promise<StreamedFile>;
|
|
279
|
+
/** @inheritDoc */
|
|
280
|
+
get name(): string;
|
|
281
|
+
/** @inheritDoc */
|
|
282
|
+
get isAsync(): boolean;
|
|
283
|
+
}
|
package/lib/steps/cp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StepHandler } from '.';
|
|
2
|
-
import { UniversalPHP } from '@php-wasm/universal';
|
|
1
|
+
import type { StepHandler } from '.';
|
|
2
|
+
import type { UniversalPHP } from '@php-wasm/universal';
|
|
3
3
|
/**
|
|
4
4
|
* @inheritDoc defineWpConfigConsts
|
|
5
5
|
* @hasRunnableExample
|
|
@@ -50,4 +50,3 @@ export interface DefineWpConfigConstsStep {
|
|
|
50
50
|
*/
|
|
51
51
|
export declare const defineWpConfigConsts: StepHandler<DefineWpConfigConstsStep>;
|
|
52
52
|
export declare function defineBeforeRun(playground: UniversalPHP, consts: Record<string, unknown>): Promise<void>;
|
|
53
|
-
export declare function rewriteDefineCalls(playground: UniversalPHP, phpCode: string, consts: Record<string, unknown>): Promise<string>;
|
package/lib/steps/index.d.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { ProgressTracker } from '@php-wasm/progress';
|
|
2
|
-
import { UniversalPHP } from '@php-wasm/universal';
|
|
3
|
-
import { FileReference, DirectoryReference, Directory } from '../resources';
|
|
4
|
-
import { ActivatePluginStep } from './activate-plugin';
|
|
5
|
-
import { DefineSiteUrlStep } from './define-site-url';
|
|
6
|
-
import { InstallPluginStep, InstallPluginOptions } from './install-plugin';
|
|
7
|
-
import { InstallThemeStep, InstallThemeOptions } from './install-theme';
|
|
8
|
-
import { LoginStep } from './login';
|
|
9
|
-
import { RunWpInstallationWizardStep, WordPressInstallationOptions } from './run-wp-installation-wizard';
|
|
10
|
-
import { SetSiteOptionsStep, UpdateUserMetaStep } from './site-data';
|
|
11
|
-
import { RmStep } from './rm';
|
|
12
|
-
import { CpStep } from './cp';
|
|
13
|
-
import { RmdirStep } from './rmdir';
|
|
14
|
-
import { RunSqlStep } from './run-sql';
|
|
15
|
-
import { MkdirStep } from './mkdir';
|
|
16
|
-
import { MvStep } from './mv';
|
|
17
|
-
import { RunPHPStep } from './run-php';
|
|
18
|
-
import { RunPHPWithOptionsStep } from './run-php-with-options';
|
|
19
|
-
import { RequestStep } from './request';
|
|
20
|
-
import { WriteFileStep } from './write-file';
|
|
21
|
-
import { WriteFilesStep } from './write-files';
|
|
22
|
-
import { DefineWpConfigConstsStep } from './define-wp-config-consts';
|
|
23
|
-
import { ActivateThemeStep } from './activate-theme';
|
|
24
|
-
import { UnzipStep } from './unzip';
|
|
25
|
-
import { ImportWordPressFilesStep } from './import-wordpress-files';
|
|
26
|
-
import { ImportThemeStarterContentStep } from './import-theme-starter-content';
|
|
27
|
-
import { ImportWxrStep } from './import-wxr';
|
|
28
|
-
import { EnableMultisiteStep } from './enable-multisite';
|
|
29
|
-
import { WPCLIStep } from './wp-cli';
|
|
30
|
-
import { ResetDataStep } from './reset-data';
|
|
31
|
-
import { SetSiteLanguageStep } from './set-site-language';
|
|
1
|
+
import type { ProgressTracker } from '@php-wasm/progress';
|
|
2
|
+
import type { UniversalPHP } from '@php-wasm/universal';
|
|
3
|
+
import type { FileReference, DirectoryReference, Directory } from '../resources';
|
|
4
|
+
import type { ActivatePluginStep } from './activate-plugin';
|
|
5
|
+
import type { DefineSiteUrlStep } from './define-site-url';
|
|
6
|
+
import type { InstallPluginStep, InstallPluginOptions } from './install-plugin';
|
|
7
|
+
import type { InstallThemeStep, InstallThemeOptions } from './install-theme';
|
|
8
|
+
import type { LoginStep } from './login';
|
|
9
|
+
import type { RunWpInstallationWizardStep, WordPressInstallationOptions } from './run-wp-installation-wizard';
|
|
10
|
+
import type { SetSiteOptionsStep, UpdateUserMetaStep } from './site-data';
|
|
11
|
+
import type { RmStep } from './rm';
|
|
12
|
+
import type { CpStep } from './cp';
|
|
13
|
+
import type { RmdirStep } from './rmdir';
|
|
14
|
+
import type { RunSqlStep } from './run-sql';
|
|
15
|
+
import type { MkdirStep } from './mkdir';
|
|
16
|
+
import type { MvStep } from './mv';
|
|
17
|
+
import type { RunPHPStep } from './run-php';
|
|
18
|
+
import type { RunPHPWithOptionsStep } from './run-php-with-options';
|
|
19
|
+
import type { RequestStep } from './request';
|
|
20
|
+
import type { WriteFileStep } from './write-file';
|
|
21
|
+
import type { WriteFilesStep } from './write-files';
|
|
22
|
+
import type { DefineWpConfigConstsStep } from './define-wp-config-consts';
|
|
23
|
+
import type { ActivateThemeStep } from './activate-theme';
|
|
24
|
+
import type { UnzipStep } from './unzip';
|
|
25
|
+
import type { ImportWordPressFilesStep } from './import-wordpress-files';
|
|
26
|
+
import type { ImportThemeStarterContentStep } from './import-theme-starter-content';
|
|
27
|
+
import type { ImportWxrStep } from './import-wxr';
|
|
28
|
+
import type { EnableMultisiteStep } from './enable-multisite';
|
|
29
|
+
import type { WPCLIStep } from './wp-cli';
|
|
30
|
+
import type { ResetDataStep } from './reset-data';
|
|
31
|
+
import type { SetSiteLanguageStep } from './set-site-language';
|
|
32
32
|
export type Step = GenericStep<FileReference, DirectoryReference>;
|
|
33
33
|
export type StepDefinition = Step & {
|
|
34
34
|
progress?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { StepHandler } from '.';
|
|
2
|
-
import { InstallAssetOptions } from './install-asset';
|
|
3
|
-
import { Directory } from '../resources';
|
|
1
|
+
import type { StepHandler } from '.';
|
|
2
|
+
import type { InstallAssetOptions } from './install-asset';
|
|
3
|
+
import type { Directory } from '../resources';
|
|
4
4
|
/**
|
|
5
5
|
* @inheritDoc installPlugin
|
|
6
6
|
* @hasRunnableExample
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { StepHandler } from '.';
|
|
2
|
-
import { InstallAssetOptions } from './install-asset';
|
|
3
|
-
import { Directory } from '../resources';
|
|
1
|
+
import type { StepHandler } from '.';
|
|
2
|
+
import type { InstallAssetOptions } from './install-asset';
|
|
3
|
+
import type { Directory } from '../resources';
|
|
4
4
|
/**
|
|
5
5
|
* @inheritDoc installTheme
|
|
6
6
|
* @hasRunnableExample
|
package/lib/steps/login.d.ts
CHANGED
package/lib/steps/mkdir.d.ts
CHANGED
package/lib/steps/mv.d.ts
CHANGED
package/lib/steps/request.d.ts
CHANGED
package/lib/steps/rm.d.ts
CHANGED
package/lib/steps/rmdir.d.ts
CHANGED
package/lib/steps/run-php.d.ts
CHANGED
package/lib/steps/run-sql.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StepHandler } from '.';
|
|
1
|
+
import type { StepHandler } from '.';
|
|
2
2
|
/**
|
|
3
3
|
* @inheritDoc setSiteLanguage
|
|
4
4
|
* @hasRunnableExample
|
|
@@ -17,11 +17,13 @@ export interface SetSiteLanguageStep {
|
|
|
17
17
|
language: string;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Get the translation package URL for a given WordPress version and language.
|
|
21
|
+
* The translation package URL is fetched from the WordPress.org API based on
|
|
22
|
+
* the provided WordPress version.
|
|
21
23
|
*
|
|
22
|
-
* If
|
|
24
|
+
* If the translation package is not found, an error is thrown.
|
|
23
25
|
*/
|
|
24
|
-
export declare const getWordPressTranslationUrl: (wpVersion: string, language: string
|
|
26
|
+
export declare const getWordPressTranslationUrl: (wpVersion: string, language: string) => Promise<string>;
|
|
25
27
|
/**
|
|
26
28
|
* Sets the site language and download translations.
|
|
27
29
|
*/
|
package/lib/steps/site-data.d.ts
CHANGED
package/lib/steps/unzip.d.ts
CHANGED
package/lib/steps/wp-cli.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PHPResponse, UniversalPHP } from '@php-wasm/universal';
|
|
2
|
-
import { StepHandler } from '.';
|
|
3
|
-
import { FileReference } from '../resources';
|
|
1
|
+
import type { PHPResponse, UniversalPHP } from '@php-wasm/universal';
|
|
2
|
+
import type { StepHandler } from '.';
|
|
3
|
+
import type { FileReference } from '../resources';
|
|
4
4
|
export declare const defaultWpCliPath = "/tmp/wp-cli.phar";
|
|
5
5
|
export declare const defaultWpCliResource: FileReference;
|
|
6
6
|
export declare const assertWpCli: (playground: UniversalPHP, wpCliPath?: string) => Promise<void>;
|
|
@@ -12,8 +12,7 @@ export declare const assertWpCli: (playground: UniversalPHP, wpCliPath?: string)
|
|
|
12
12
|
* <code>
|
|
13
13
|
* {
|
|
14
14
|
* "step": "wp-cli",
|
|
15
|
-
* "command": "wp post create --post_title='Test post' --post_excerpt='Some
|
|
16
|
-
* content'"
|
|
15
|
+
* "command": "wp post create --post_title='Test post' --post_excerpt='Some content'"
|
|
17
16
|
* }
|
|
18
17
|
* </code>
|
|
19
18
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-playground/blueprints",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"import": "./index.js",
|
|
@@ -21,42 +21,49 @@
|
|
|
21
21
|
"access": "public",
|
|
22
22
|
"directory": "../../../dist/packages/playground/blueprints"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "9dbbe2b22ccbacda9c0da4444c51d5739e784302",
|
|
25
25
|
"engines": {
|
|
26
|
-
"node": ">=
|
|
27
|
-
"npm": ">=
|
|
26
|
+
"node": ">=20.18.3",
|
|
27
|
+
"npm": ">=10.1.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@zip.js/zip.js": "2.7.57",
|
|
30
31
|
"ajv": "8.12.0",
|
|
31
32
|
"async-lock": "1.4.1",
|
|
32
|
-
"buffer": "6.0.3",
|
|
33
33
|
"clean-git-ref": "2.0.1",
|
|
34
34
|
"comlink": "^4.4.1",
|
|
35
35
|
"crc-32": "1.2.2",
|
|
36
36
|
"diff3": "0.0.4",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"ignore": "5.2.4",
|
|
37
|
+
"express": "4.21.2",
|
|
38
|
+
"ignore": "5.3.2",
|
|
40
39
|
"ini": "4.1.2",
|
|
41
40
|
"minimisted": "2.0.1",
|
|
42
|
-
"octokit": "3.1.
|
|
41
|
+
"octokit": "3.1.2",
|
|
43
42
|
"pako": "1.0.10",
|
|
44
|
-
"pify": "
|
|
43
|
+
"pify": "2.3.0",
|
|
45
44
|
"readable-stream": "3.6.2",
|
|
46
45
|
"sha.js": "2.4.11",
|
|
47
46
|
"simple-get": "4.0.1",
|
|
48
47
|
"wasm-feature-detect": "1.8.0",
|
|
49
|
-
"ws": "8.18.
|
|
48
|
+
"ws": "8.18.1",
|
|
50
49
|
"yargs": "17.7.2",
|
|
51
|
-
"@php-wasm/node-polyfills": "1.0
|
|
52
|
-
"@php-wasm/universal": "1.0
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@php-wasm/
|
|
57
|
-
"@php-wasm/
|
|
58
|
-
"@
|
|
59
|
-
"@php-wasm/
|
|
60
|
-
"@
|
|
50
|
+
"@php-wasm/node-polyfills": "1.1.0",
|
|
51
|
+
"@php-wasm/universal": "1.1.0",
|
|
52
|
+
"@php-wasm/stream-compression": "1.1.0",
|
|
53
|
+
"@wp-playground/storage": "1.1.0",
|
|
54
|
+
"@wp-playground/common": "1.1.0",
|
|
55
|
+
"@php-wasm/node": "1.1.0",
|
|
56
|
+
"@php-wasm/progress": "1.1.0",
|
|
57
|
+
"@php-wasm/util": "1.1.0",
|
|
58
|
+
"@php-wasm/logger": "1.1.0",
|
|
59
|
+
"@php-wasm/web": "1.1.0",
|
|
60
|
+
"@wp-playground/wordpress": "1.1.0"
|
|
61
|
+
},
|
|
62
|
+
"overrides": {
|
|
63
|
+
"rollup": "^4.34.6",
|
|
64
|
+
"react": "18.3.1",
|
|
65
|
+
"react-dom": "18.3.1",
|
|
66
|
+
"typescript": "5.4.5",
|
|
67
|
+
"ws": "^8.18.0"
|
|
61
68
|
}
|
|
62
|
-
}
|
|
69
|
+
}
|