@wp-playground/blueprints 3.1.43 → 3.1.45
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/blueprint-schema-validator.d.ts +4 -1
- package/blueprint-schema-validator.js +2814 -1768
- package/blueprint-schema.json +3110 -1
- package/blueprint-v2-schema-validator.d.ts +5 -0
- package/blueprint-v2-schema-validator.js +37821 -0
- package/index.cjs +1044 -150
- package/index.cjs.map +1 -1
- package/index.d.ts +9 -4
- package/index.js +7853 -4819
- package/index.js.map +1 -1
- package/lib/compile.d.ts +32 -0
- package/lib/invalid-blueprint-error.d.ts +5 -0
- package/lib/is-git-repo-url.d.ts +8 -0
- package/lib/reflection.d.ts +1 -1
- package/lib/resolve-runtime-configuration.d.ts +13 -1
- package/lib/steps/import-wxr.d.ts +44 -0
- package/lib/steps/install-plugin.d.ts +12 -0
- package/lib/steps/install-theme.d.ts +9 -0
- package/lib/steps/reset-data.d.ts +9 -2
- package/lib/v1/compile.d.ts +3 -5
- package/lib/v2/blueprint-v2-declaration.d.ts +0 -10
- package/lib/v2/compile.d.ts +138 -0
- package/lib/v2/resolve-runtime-configuration.d.ts +20 -0
- package/lib/v2/validate-blueprint-v2.d.ts +17 -0
- package/lib/v2/wep-1-blueprint-v2-schema/appendix-A-blueprint-v2-schema.d.ts +202 -103
- package/lib/v2/wep-1-blueprint-v2-schema/appendix-B-data-sources.d.ts +77 -18
- package/lib/validate-blueprint-declaration.d.ts +6 -0
- package/package.json +11 -11
- package/schema-readme.md +6 -5
- package/tests/v2/schema-conformance-fixtures.d.ts +2033 -0
- package/validate-blueprint-v2-C3rgpKFU.js +17393 -0
- package/validate-blueprint-v2-C3rgpKFU.js.map +1 -0
- package/validate-blueprint-v2-CJ8Xbxyz.cjs +201 -0
- package/validate-blueprint-v2-CJ8Xbxyz.cjs.map +1 -0
- package/blueprints-Gs5fAvvo.cjs +0 -2
- package/blueprints-Gs5fAvvo.cjs.map +0 -1
- package/blueprints-pMn3V9MZ.js +0 -5
- package/blueprints-pMn3V9MZ.js.map +0 -1
- package/lib/v2/get-v2-runner.d.ts +0 -1
- package/lib/v2/run-blueprint-v2.d.ts +0 -36
package/lib/compile.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { UniversalPHP } from '@php-wasm/universal';
|
|
2
|
+
import type { Blueprint, BlueprintBundle, BlueprintDeclaration } from './types';
|
|
3
|
+
import { type CompileBlueprintV1Options, type CompiledBlueprintV1 } from './v1/compile';
|
|
4
|
+
import type { BlueprintV1Declaration } from './v1/types';
|
|
5
|
+
import type { BlueprintV2Declaration } from './v2/blueprint-v2-declaration';
|
|
6
|
+
import { type CompiledBlueprintV2 } from './v2/compile';
|
|
7
|
+
import type { ResolveRuntimeConfigurationOptions } from './resolve-runtime-configuration';
|
|
8
|
+
export type BlueprintExecutionPath = 'v1' | 'v2';
|
|
9
|
+
export type CompiledBlueprintForExecution = {
|
|
10
|
+
version: 1;
|
|
11
|
+
declaration: BlueprintV1Declaration;
|
|
12
|
+
compiled: CompiledBlueprintV1;
|
|
13
|
+
run: (playground: UniversalPHP) => Promise<void>;
|
|
14
|
+
} | {
|
|
15
|
+
version: 2;
|
|
16
|
+
declaration: BlueprintV2Declaration;
|
|
17
|
+
compiled: CompiledBlueprintV2;
|
|
18
|
+
run: (playground: UniversalPHP) => Promise<void>;
|
|
19
|
+
};
|
|
20
|
+
export interface CompileBlueprintForExecutionOptions extends Omit<CompileBlueprintV1Options, 'onBlueprintValidated' | 'streamBundledFile'>, ResolveRuntimeConfigurationOptions {
|
|
21
|
+
onBlueprintValidated?: (blueprint: BlueprintDeclaration) => void;
|
|
22
|
+
}
|
|
23
|
+
type BlueprintExecutionInput = Blueprint | BlueprintBundle | string;
|
|
24
|
+
/**
|
|
25
|
+
* Compiles a Blueprint into the shape consumers need before execution.
|
|
26
|
+
*
|
|
27
|
+
* The legacy `compileBlueprint()` export intentionally remains v1-only for
|
|
28
|
+
* backwards compatibility. This helper is the version-aware entrypoint that
|
|
29
|
+
* newer callers can migrate to as Blueprint v2 support grows.
|
|
30
|
+
*/
|
|
31
|
+
export declare function compileBlueprintForExecution(input: BlueprintExecutionInput, options?: CompileBlueprintForExecutionOptions): Promise<CompiledBlueprintForExecution>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Heuristically indicates whether a URL looks like a Git repository.
|
|
3
|
+
*
|
|
4
|
+
* Blueprint compilers use this to distinguish plugin/theme repository URLs
|
|
5
|
+
* from downloadable ZIP URLs. This is intentionally a small allowlist of URL
|
|
6
|
+
* shapes Playground can clone, not a general Git remote detector.
|
|
7
|
+
*/
|
|
8
|
+
export declare function seemsLikeGitRepoUrl(url: string): boolean;
|
package/lib/reflection.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Blueprint, BlueprintBundle } from './types';
|
|
|
2
2
|
import type { BlueprintV1Declaration } from './v1/types';
|
|
3
3
|
import type { BlueprintV2Declaration } from './v2/blueprint-v2-declaration';
|
|
4
4
|
export declare function isBlueprintBundle(input: any): input is BlueprintBundle;
|
|
5
|
-
export declare function getBlueprintDeclaration(blueprint: Blueprint): Promise<BlueprintV1Declaration | BlueprintV2Declaration>;
|
|
5
|
+
export declare function getBlueprintDeclaration(blueprint: Blueprint | string): Promise<BlueprintV1Declaration | BlueprintV2Declaration>;
|
|
6
6
|
export type BlueprintType = 'bundle' | 'declaration';
|
|
7
7
|
export declare class BlueprintReflection {
|
|
8
8
|
private readonly declaration;
|
|
@@ -1,2 +1,14 @@
|
|
|
1
1
|
import type { Blueprint, RuntimeConfiguration } from './types';
|
|
2
|
-
|
|
2
|
+
import { type BlueprintV2SiteMode } from './v2/resolve-runtime-configuration';
|
|
3
|
+
export type ResolveRuntimeConfigurationOptions = {
|
|
4
|
+
/** Determines whether WordPress is selected for download or checked in place. */
|
|
5
|
+
siteMode?: BlueprintV2SiteMode;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Resolves the runtime settings required before executing a Blueprint.
|
|
9
|
+
*
|
|
10
|
+
* Blueprint v1 settings come from its compiled form. Blueprint v2 settings are
|
|
11
|
+
* delegated to the v2 runtime configuration resolver. Existing-site mode
|
|
12
|
+
* validates WordPress constraints without selecting a release to download.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveRuntimeConfiguration(blueprint: Blueprint, options?: ResolveRuntimeConfigurationOptions): Promise<RuntimeConfiguration>;
|
|
@@ -17,6 +17,50 @@ export interface ImportWxrStep<ResourceType> {
|
|
|
17
17
|
step: 'importWxr';
|
|
18
18
|
/** The file to import */
|
|
19
19
|
file: ResourceType;
|
|
20
|
+
/**
|
|
21
|
+
* Whether to fetch and import attachment files referenced by the WXR file.
|
|
22
|
+
*
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
fetchAttachments?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to rewrite imported URLs to the current site URL.
|
|
28
|
+
*
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
rewriteUrls?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Explicit URL replacements to apply when URL rewriting is enabled.
|
|
34
|
+
*/
|
|
35
|
+
urlMapping?: Record<string, string>;
|
|
36
|
+
/**
|
|
37
|
+
* Whether to import comments from the WXR file.
|
|
38
|
+
*
|
|
39
|
+
* @default true
|
|
40
|
+
*/
|
|
41
|
+
importComments?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The fallback local user for imported authors that cannot be mapped.
|
|
44
|
+
*
|
|
45
|
+
* @default "admin"
|
|
46
|
+
*/
|
|
47
|
+
defaultAuthorUsername?: string;
|
|
48
|
+
/**
|
|
49
|
+
* How to assign imported WXR authors to local WordPress users.
|
|
50
|
+
*
|
|
51
|
+
* @default "default-author"
|
|
52
|
+
*/
|
|
53
|
+
authorsMode?: 'create' | 'default-author' | 'map';
|
|
54
|
+
/**
|
|
55
|
+
* Remote WXR author usernames keyed to existing local usernames.
|
|
56
|
+
*/
|
|
57
|
+
authorsMap?: Record<string, string>;
|
|
58
|
+
/**
|
|
59
|
+
* Whether to create local users for imported WXR authors.
|
|
60
|
+
*
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
importUsers?: boolean;
|
|
20
64
|
/**
|
|
21
65
|
* The importer to use. Possible values:
|
|
22
66
|
*
|
|
@@ -62,10 +62,22 @@ export interface InstallPluginOptions {
|
|
|
62
62
|
* Whether to activate the plugin after installing it.
|
|
63
63
|
*/
|
|
64
64
|
activate?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Parameters to expose to the plugin during its activation hook.
|
|
67
|
+
*/
|
|
68
|
+
activationOptions?: Record<string, unknown>;
|
|
69
|
+
/**
|
|
70
|
+
* Whether installation/activation failures should abort the Blueprint.
|
|
71
|
+
*/
|
|
72
|
+
onError?: 'skip-plugin' | 'throw';
|
|
65
73
|
/**
|
|
66
74
|
* The name of the folder to install the plugin to. Defaults to guessing from pluginData
|
|
67
75
|
*/
|
|
68
76
|
targetFolderName?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Human-readable plugin name for progress captions and skip warnings.
|
|
79
|
+
*/
|
|
80
|
+
humanReadableName?: string;
|
|
69
81
|
}
|
|
70
82
|
/**
|
|
71
83
|
* Installs a WordPress plugin in the Playground.
|
|
@@ -49,10 +49,19 @@ export interface InstallThemeOptions {
|
|
|
49
49
|
* Whether to import the theme's starter content after installing it.
|
|
50
50
|
*/
|
|
51
51
|
importStarterContent?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Whether installation, activation, or starter-content failures should
|
|
54
|
+
* abort the Blueprint.
|
|
55
|
+
*/
|
|
56
|
+
onError?: 'skip-theme' | 'throw';
|
|
52
57
|
/**
|
|
53
58
|
* The name of the folder to install the theme to. Defaults to guessing from themeData
|
|
54
59
|
*/
|
|
55
60
|
targetFolderName?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Human-readable theme name for the progress caption and skip warning.
|
|
63
|
+
*/
|
|
64
|
+
humanReadableName?: string;
|
|
56
65
|
}
|
|
57
66
|
/**
|
|
58
67
|
* Installs a WordPress theme in the Playground.
|
|
@@ -11,10 +11,17 @@ import type { StepHandler } from '.';
|
|
|
11
11
|
*/
|
|
12
12
|
export interface ResetDataStep {
|
|
13
13
|
step: 'resetData';
|
|
14
|
+
/**
|
|
15
|
+
* Content types to remove. When omitted, all posts, pages, custom post
|
|
16
|
+
* types, and comments are removed.
|
|
17
|
+
*/
|
|
18
|
+
contentTypes?: Array<'posts' | 'pages' | 'comments'>;
|
|
14
19
|
}
|
|
15
20
|
/**
|
|
16
|
-
* Deletes
|
|
17
|
-
*
|
|
21
|
+
* Deletes the selected WordPress content through WordPress APIs so dependent
|
|
22
|
+
* records are removed with it. Empty tables have their sequences reset so
|
|
23
|
+
* later imports receive the identifiers they would on a site without the
|
|
24
|
+
* removed content.
|
|
18
25
|
*
|
|
19
26
|
* @param playground Playground client.
|
|
20
27
|
*/
|
package/lib/v1/compile.d.ts
CHANGED
|
@@ -5,10 +5,8 @@ import type { Step, StepDefinition } from '../steps';
|
|
|
5
5
|
import type { BlueprintV1Declaration, ExtraLibrary, StreamBundledFile, BlueprintV1 } from './types';
|
|
6
6
|
import type { BlueprintBundle } from '../types';
|
|
7
7
|
import type { ErrorObject } from 'ajv';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
constructor(message: string, validationErrors?: unknown);
|
|
11
|
-
}
|
|
8
|
+
import { InvalidBlueprintError } from '../invalid-blueprint-error';
|
|
9
|
+
export { InvalidBlueprintError };
|
|
12
10
|
/**
|
|
13
11
|
* Error thrown when a single Blueprint step fails during execution.
|
|
14
12
|
*
|
|
@@ -75,7 +73,7 @@ export interface CompileBlueprintV1Options {
|
|
|
75
73
|
*/
|
|
76
74
|
additionalSteps?: any[];
|
|
77
75
|
}
|
|
78
|
-
export declare function compileBlueprintV1(input: BlueprintV1Declaration | BlueprintBundle, options?:
|
|
76
|
+
export declare function compileBlueprintV1(input: BlueprintV1Declaration | BlueprintBundle, options?: CompileBlueprintV1Options): Promise<CompiledBlueprintV1>;
|
|
79
77
|
export declare function isBlueprintBundle(input: any): input is BlueprintBundle;
|
|
80
78
|
export declare function getBlueprintDeclaration(blueprint: BlueprintV1 | BlueprintBundle): Promise<BlueprintV1Declaration>;
|
|
81
79
|
export type BlueprintValidationResult = {
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import type { BlueprintBundle } from '../types';
|
|
2
|
-
import type { BlueprintV1Declaration } from '../v1/types';
|
|
3
2
|
import type { V2Schema } from './wep-1-blueprint-v2-schema/appendix-A-blueprint-v2-schema';
|
|
4
3
|
type BlueprintV2Declaration = V2Schema.BlueprintV2;
|
|
5
4
|
export type BlueprintV2 = BlueprintV2Declaration | BlueprintBundle;
|
|
6
5
|
export type { BlueprintV2Declaration };
|
|
7
|
-
export type RawBlueprintV2Data = string | BlueprintV2Declaration | undefined;
|
|
8
|
-
export type ParsedBlueprintV1orV2String = {
|
|
9
|
-
type: 'inline-file';
|
|
10
|
-
contents: string;
|
|
11
|
-
} | {
|
|
12
|
-
type: 'file-reference';
|
|
13
|
-
reference: string;
|
|
14
|
-
};
|
|
15
|
-
export declare function parseBlueprintDeclaration(source: RawBlueprintV2Data | ParsedBlueprintV1orV2String | BlueprintV1Declaration): ParsedBlueprintV1orV2String;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { UniversalPHP } from '@php-wasm/universal';
|
|
2
|
+
import type { RuntimeConfiguration } from '../types';
|
|
3
|
+
import type { ResolveRuntimeConfigurationOptions } from '../resolve-runtime-configuration';
|
|
4
|
+
import { type CompileBlueprintV1Options } from '../v1/compile';
|
|
5
|
+
import type { StepDefinition } from '../steps';
|
|
6
|
+
import type { BlueprintV2Declaration } from './blueprint-v2-declaration';
|
|
7
|
+
import { type BlueprintV2SiteMode } from './resolve-runtime-configuration';
|
|
8
|
+
export declare class UnsupportedBlueprintV2FeatureError extends Error {
|
|
9
|
+
readonly featurePath: string;
|
|
10
|
+
constructor(featurePath: string, message?: string);
|
|
11
|
+
}
|
|
12
|
+
type BlueprintV2ApplicationOptions = BlueprintV2Declaration['applicationOptions'];
|
|
13
|
+
type BlueprintV2ContentBaseline = NonNullable<BlueprintV2Declaration['contentBaseline']>;
|
|
14
|
+
type BlueprintV2Constants = NonNullable<BlueprintV2Declaration['constants']>;
|
|
15
|
+
type BlueprintV2SiteOptions = NonNullable<BlueprintV2Declaration['siteOptions']>;
|
|
16
|
+
type BlueprintV2MuPlugin = NonNullable<BlueprintV2Declaration['muPlugins']>[number];
|
|
17
|
+
type BlueprintV2Theme = NonNullable<BlueprintV2Declaration['themes']>[number];
|
|
18
|
+
type BlueprintV2ActiveTheme = NonNullable<BlueprintV2Declaration['activeTheme']>;
|
|
19
|
+
type BlueprintV2Plugin = NonNullable<BlueprintV2Declaration['plugins']>[number];
|
|
20
|
+
type BlueprintV2Fonts = NonNullable<BlueprintV2Declaration['fonts']>;
|
|
21
|
+
type BlueprintV2Media = NonNullable<BlueprintV2Declaration['media']>[number];
|
|
22
|
+
type BlueprintV2Role = NonNullable<BlueprintV2Declaration['roles']>[number];
|
|
23
|
+
type BlueprintV2User = NonNullable<BlueprintV2Declaration['users']>[number];
|
|
24
|
+
type BlueprintV2PostTypes = NonNullable<BlueprintV2Declaration['postTypes']>;
|
|
25
|
+
type BlueprintV2Content = NonNullable<BlueprintV2Declaration['content']>[number];
|
|
26
|
+
type BlueprintV2Step = NonNullable<BlueprintV2Declaration['additionalStepsAfterExecution']>[number];
|
|
27
|
+
export type BlueprintV2ExecutionPlan = BlueprintV2ExecutionPlanItem[];
|
|
28
|
+
export type BlueprintV2StepPlan = StepDefinition[];
|
|
29
|
+
export type BlueprintV2StepPlanLoweringResult = {
|
|
30
|
+
steps: BlueprintV2StepPlan;
|
|
31
|
+
unsupportedPlan: BlueprintV2ExecutionPlan;
|
|
32
|
+
};
|
|
33
|
+
export type BlueprintV2ExecutionPlanItem = {
|
|
34
|
+
type: 'applyContentBaseline';
|
|
35
|
+
contentBaseline: BlueprintV2ContentBaseline;
|
|
36
|
+
sourcePath: '/contentBaseline';
|
|
37
|
+
} | {
|
|
38
|
+
type: 'applyUsersBaseline';
|
|
39
|
+
sourcePath: '/usersBaseline';
|
|
40
|
+
} | {
|
|
41
|
+
type: 'defineWpConfigConsts';
|
|
42
|
+
consts: BlueprintV2Constants;
|
|
43
|
+
} | {
|
|
44
|
+
type: 'setSiteOptions';
|
|
45
|
+
options: BlueprintV2SiteOptions;
|
|
46
|
+
} | {
|
|
47
|
+
type: 'installMuPlugin';
|
|
48
|
+
muPlugin: BlueprintV2MuPlugin;
|
|
49
|
+
sourcePath: string;
|
|
50
|
+
} | {
|
|
51
|
+
type: 'installTheme';
|
|
52
|
+
theme: BlueprintV2Theme;
|
|
53
|
+
active: false;
|
|
54
|
+
sourcePath: string;
|
|
55
|
+
} | {
|
|
56
|
+
type: 'installTheme';
|
|
57
|
+
theme: BlueprintV2ActiveTheme;
|
|
58
|
+
active: true;
|
|
59
|
+
sourcePath: string;
|
|
60
|
+
} | {
|
|
61
|
+
type: 'installPlugin';
|
|
62
|
+
plugin: BlueprintV2Plugin;
|
|
63
|
+
sourcePath: string;
|
|
64
|
+
} | {
|
|
65
|
+
type: 'installFonts';
|
|
66
|
+
fonts: BlueprintV2Fonts;
|
|
67
|
+
} | {
|
|
68
|
+
type: 'importMedia';
|
|
69
|
+
media: BlueprintV2Media;
|
|
70
|
+
sourcePath: string;
|
|
71
|
+
} | {
|
|
72
|
+
type: 'setSiteLanguage';
|
|
73
|
+
language: string;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'defineRoles';
|
|
76
|
+
roles: BlueprintV2Role[];
|
|
77
|
+
} | {
|
|
78
|
+
type: 'defineUsers';
|
|
79
|
+
users: BlueprintV2User[];
|
|
80
|
+
} | {
|
|
81
|
+
type: 'definePostTypes';
|
|
82
|
+
postTypes: BlueprintV2PostTypes;
|
|
83
|
+
} | {
|
|
84
|
+
type: 'importContent';
|
|
85
|
+
content: BlueprintV2Content;
|
|
86
|
+
sourcePath: string;
|
|
87
|
+
} | {
|
|
88
|
+
type: 'runStep';
|
|
89
|
+
step: BlueprintV2Step;
|
|
90
|
+
sourcePath: string;
|
|
91
|
+
};
|
|
92
|
+
export type CompiledBlueprintV2 = {
|
|
93
|
+
runtime: RuntimeConfiguration;
|
|
94
|
+
applicationOptions?: BlueprintV2ApplicationOptions;
|
|
95
|
+
plan: BlueprintV2ExecutionPlan;
|
|
96
|
+
steps: BlueprintV2StepPlan;
|
|
97
|
+
unsupportedPlan: BlueprintV2ExecutionPlan;
|
|
98
|
+
run: (playground: UniversalPHP) => Promise<void>;
|
|
99
|
+
};
|
|
100
|
+
export type CompileBlueprintV2Options = Pick<CompileBlueprintV1Options, 'progress' | 'streamBundledFile'> & ResolveRuntimeConfigurationOptions & {
|
|
101
|
+
onBlueprintValidated?: (blueprint: BlueprintV2Declaration) => void;
|
|
102
|
+
};
|
|
103
|
+
export type ResolveBlueprintV2WordPressSourceOptions = Pick<CompileBlueprintV1Options, 'corsProxy' | 'gitAdditionalHeadersCallback' | 'progress' | 'semaphore' | 'streamBundledFile'>;
|
|
104
|
+
/**
|
|
105
|
+
* Compiles a Blueprint v2 declaration into the pieces the TypeScript runner can
|
|
106
|
+
* understand today.
|
|
107
|
+
*
|
|
108
|
+
* It resolves runtime options, creates an ordered v2 execution plan, and lowers
|
|
109
|
+
* supported plan items into v1 step records. Fully lowered plans run through the
|
|
110
|
+
* existing v1 runner; unsupported items stay visible and block execution before
|
|
111
|
+
* any partial work is applied.
|
|
112
|
+
*/
|
|
113
|
+
export declare function compileBlueprintV2(declaration: BlueprintV2Declaration, options?: CompileBlueprintV2Options): Promise<CompiledBlueprintV2>;
|
|
114
|
+
/**
|
|
115
|
+
* Loads a custom WordPress source into the file expected by the boot API.
|
|
116
|
+
*
|
|
117
|
+
* Built-in versions and HTTP(S) ZIP URLs already use each consumer's normal
|
|
118
|
+
* WordPress download path. Execution-context, inline, and Git references need
|
|
119
|
+
* the Blueprint resource loader to turn them into a concrete archive first.
|
|
120
|
+
*/
|
|
121
|
+
export declare function resolveBlueprintV2WordPressSource(declaration: BlueprintV2Declaration, options?: ResolveBlueprintV2WordPressSourceOptions): Promise<File | undefined>;
|
|
122
|
+
/**
|
|
123
|
+
* Converts the top-level Blueprint v2 fields into a simple ordered plan.
|
|
124
|
+
*
|
|
125
|
+
* The plan keeps the original v2 data intact. It only decides execution order
|
|
126
|
+
* and records where each item came from, which makes unsupported items visible
|
|
127
|
+
* instead of silently dropping them during lowering.
|
|
128
|
+
*/
|
|
129
|
+
export declare function createBlueprintV2ExecutionPlan(declaration: BlueprintV2Declaration, siteMode?: BlueprintV2SiteMode): BlueprintV2ExecutionPlan;
|
|
130
|
+
/**
|
|
131
|
+
* Converts the supported v2 plan items into v1-compatible step records.
|
|
132
|
+
*
|
|
133
|
+
* The v1 step runner already knows how to install plugins, install themes, set
|
|
134
|
+
* options, and run several imperative steps. This function reuses those shapes
|
|
135
|
+
* while keeping unsupported v2-only work in `unsupportedPlan` for future PRs.
|
|
136
|
+
*/
|
|
137
|
+
export declare function lowerBlueprintV2ExecutionPlan(plan: BlueprintV2ExecutionPlan): BlueprintV2StepPlanLoweringResult;
|
|
138
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BlueprintDeclaration, RuntimeConfiguration } from '../types';
|
|
2
|
+
import type { BlueprintV2Declaration } from './blueprint-v2-declaration';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the runtime settings required by a Blueprint v2 declaration.
|
|
5
|
+
*
|
|
6
|
+
* This module owns the v2 support boundary: unsupported declarations and
|
|
7
|
+
* runtime sources are rejected here instead of falling back to v1 behavior.
|
|
8
|
+
* The validation callback runs before any runtime source is resolved.
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveBlueprintV2RuntimeConfiguration(declaration: BlueprintDeclaration, siteMode?: BlueprintV2SiteMode, onBlueprintValidated?: (declaration: BlueprintV2Declaration) => void): Promise<RuntimeConfiguration>;
|
|
11
|
+
/** Describes whether Playground creates a site or applies to mounted files. */
|
|
12
|
+
export type BlueprintV2SiteMode = 'create-new-site' | 'apply-to-existing-site';
|
|
13
|
+
/**
|
|
14
|
+
* Verifies that an existing site satisfies its Blueprint v2 WordPress version.
|
|
15
|
+
*
|
|
16
|
+
* Only constraint objects restrict an existing site. Shorthand versions,
|
|
17
|
+
* including `latest` and concrete releases, are new-site selection hints.
|
|
18
|
+
* `preferred` is also a selection hint and does not narrow compatibility.
|
|
19
|
+
*/
|
|
20
|
+
export declare function assertBlueprintV2WordPressVersionCompatibility(declaration: BlueprintV2Declaration, installedVersion: string): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BlueprintValidationResult } from '../v1/compile';
|
|
2
|
+
export type BlueprintV2ValidationError = {
|
|
3
|
+
path: string;
|
|
4
|
+
message: string;
|
|
5
|
+
};
|
|
6
|
+
export type BlueprintV2ValidationResult = {
|
|
7
|
+
valid: true;
|
|
8
|
+
} | {
|
|
9
|
+
valid: false;
|
|
10
|
+
errors: BlueprintV2ValidationError[];
|
|
11
|
+
};
|
|
12
|
+
/** Validates an unknown value against the complete Blueprint v2 schema. */
|
|
13
|
+
export declare function validateBlueprintV2(blueprintMaybe: unknown): BlueprintV2ValidationResult;
|
|
14
|
+
/** Returns actionable AJV errors with location data for editors and tooling. */
|
|
15
|
+
export declare function validateBlueprintV2Declaration(blueprintMaybe: unknown): BlueprintValidationResult;
|
|
16
|
+
/** Rejects an invalid value before any Blueprint v2 runtime work begins. */
|
|
17
|
+
export declare function assertValidBlueprintV2Declaration(blueprintMaybe: unknown): void;
|