@wp-playground/blueprints 1.0.29 → 1.1.1

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.
Files changed (44) hide show
  1. package/LICENSE +339 -0
  2. package/blueprint-schema-validator.js +231 -52
  3. package/blueprint-schema.json +24 -15
  4. package/index.cjs +40 -472
  5. package/index.cjs.map +1 -1
  6. package/index.d.ts +3 -2
  7. package/index.js +3011 -3289
  8. package/index.js.map +1 -1
  9. package/lib/blueprint.d.ts +17 -5
  10. package/lib/compile.d.ts +10 -12
  11. package/lib/resolve-remote-blueprint.d.ts +8 -0
  12. package/lib/resources.d.ts +44 -20
  13. package/lib/steps/activate-plugin.d.ts +1 -1
  14. package/lib/steps/activate-theme.d.ts +1 -1
  15. package/lib/steps/cp.d.ts +1 -1
  16. package/lib/steps/define-site-url.d.ts +1 -1
  17. package/lib/steps/define-wp-config-consts.d.ts +2 -3
  18. package/lib/steps/enable-multisite.d.ts +1 -1
  19. package/lib/steps/export-wxr.d.ts +1 -1
  20. package/lib/steps/import-theme-starter-content.d.ts +1 -1
  21. package/lib/steps/import-wordpress-files.d.ts +1 -1
  22. package/lib/steps/import-wxr.d.ts +1 -1
  23. package/lib/steps/index.d.ts +31 -31
  24. package/lib/steps/install-plugin.d.ts +3 -3
  25. package/lib/steps/install-theme.d.ts +3 -3
  26. package/lib/steps/login.d.ts +1 -1
  27. package/lib/steps/mkdir.d.ts +1 -1
  28. package/lib/steps/mv.d.ts +1 -1
  29. package/lib/steps/request.d.ts +2 -2
  30. package/lib/steps/reset-data.d.ts +1 -1
  31. package/lib/steps/rm.d.ts +1 -1
  32. package/lib/steps/rmdir.d.ts +1 -1
  33. package/lib/steps/run-php-with-options.d.ts +2 -2
  34. package/lib/steps/run-php.d.ts +2 -2
  35. package/lib/steps/run-sql.d.ts +1 -1
  36. package/lib/steps/run-wp-installation-wizard.d.ts +1 -1
  37. package/lib/steps/set-site-language.d.ts +6 -4
  38. package/lib/steps/site-data.d.ts +1 -1
  39. package/lib/steps/unzip.d.ts +1 -1
  40. package/lib/steps/wp-cli.d.ts +4 -5
  41. package/lib/steps/write-file.d.ts +1 -1
  42. package/lib/steps/write-files.d.ts +2 -2
  43. package/lib/steps/zip-wp-content.d.ts +1 -1
  44. package/package.json +29 -22
@@ -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 interface Blueprint {
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 { Blueprint, ExtraLibrary } from './blueprint';
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
- * Compiles Blueprint into a form that can be executed.
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>;
@@ -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 FileReference = VFSReference | LiteralReference | CoreThemeReference | CorePluginReference | UrlReference;
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 | undefined);
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 | undefined);
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 | undefined, corsProxy?: string | undefined);
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 | undefined;
182
- } | undefined);
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 | undefined, options?: {
196
- corsProxy?: string | undefined;
197
- } | undefined);
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 | undefined;
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
+ }
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc activatePlugin
4
4
  * @example
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc activateTheme
4
4
  * @example
package/lib/steps/cp.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc cp
4
4
  * @hasRunnableExample
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * Changes the site URL of the WordPress installation.
4
4
  *
@@ -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>;
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc enableMultisite
4
4
  * @hasRunnableExample
@@ -1,4 +1,4 @@
1
- import { UniversalPHP } from '@php-wasm/universal';
1
+ import type { UniversalPHP } from '@php-wasm/universal';
2
2
  /**
3
3
  * Exports the WordPress database as a WXR file using
4
4
  * the core WordPress export tool.
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc importThemeStarterContent
4
4
  * @example
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc importWordPressFiles
4
4
  * @example
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc importWxr
4
4
  * @example
@@ -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
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc login
4
4
  * @hasRunnableExample
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc mkdir
4
4
  * @hasRunnableExample
package/lib/steps/mv.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc mv
4
4
  * @hasRunnableExample
@@ -1,5 +1,5 @@
1
- import { PHPRequest, PHPResponse } from '@php-wasm/universal';
2
- import { StepHandler } from '.';
1
+ import type { PHPRequest, PHPResponse } from '@php-wasm/universal';
2
+ import type { StepHandler } from '.';
3
3
  /**
4
4
  * @private
5
5
  * @inheritDoc request
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc resetData
4
4
  * @example
package/lib/steps/rm.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc rm
4
4
  * @hasRunnableExample
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc rmdir
4
4
  * @hasRunnableExample
@@ -1,5 +1,5 @@
1
- import { StepHandler } from '.';
2
- import { PHPRunOptions } from '@php-wasm/universal';
1
+ import type { StepHandler } from '.';
2
+ import type { PHPRunOptions } from '@php-wasm/universal';
3
3
  /**
4
4
  * @inheritDoc runPHP
5
5
  * @hasRunnableExample
@@ -1,5 +1,5 @@
1
- import { PHPResponse } from '@php-wasm/universal';
2
- import { StepHandler } from '.';
1
+ import type { PHPResponse } from '@php-wasm/universal';
2
+ import type { StepHandler } from '.';
3
3
  /**
4
4
  * @inheritDoc runPHP
5
5
  * @hasRunnableExample
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc runSql
4
4
  * @hasRunnableExample
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @private
4
4
  */
@@ -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
- * Infers the translation package URL for a given WordPress version.
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 it cannot be inferred, the latest translation package will be used instead.
24
+ * If the translation package is not found, an error is thrown.
23
25
  */
24
- export declare const getWordPressTranslationUrl: (wpVersion: string, language: string, latestBetaWordPressVersion?: string, latestStableWordPressVersion?: string) => Promise<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
  */
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc setSiteOptions
4
4
  * @hasRunnableExample
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc unzip
4
4
  * @example
@@ -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
  */
@@ -1,4 +1,4 @@
1
- import { StepHandler } from '.';
1
+ import type { StepHandler } from '.';
2
2
  /**
3
3
  * @inheritDoc writeFile
4
4
  * @hasRunnableExample
@@ -1,5 +1,5 @@
1
- import { StepHandler } from '.';
2
- import { Directory } from '../resources';
1
+ import type { StepHandler } from '.';
2
+ import type { Directory } from '../resources';
3
3
  /**
4
4
  * @inheritDoc writeFiles
5
5
  * @hasRunnableExample
@@ -1,4 +1,4 @@
1
- import { UniversalPHP } from '@php-wasm/universal';
1
+ import type { UniversalPHP } from '@php-wasm/universal';
2
2
  interface ZipWpContentOptions {
3
3
  /**
4
4
  * @private