@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
|
@@ -12,6 +12,8 @@ export declare namespace DataSources {
|
|
|
12
12
|
* optionally contain usernames and passwords if needed.
|
|
13
13
|
*
|
|
14
14
|
* @see https://url.spec.whatwg.org/
|
|
15
|
+
* @asType string
|
|
16
|
+
* @pattern ^[Hh][Tt][Tt][Pp][Ss]?://[^/?#]+
|
|
15
17
|
*/
|
|
16
18
|
export type URLReference = `http://${string}` | `https://${string}`;
|
|
17
19
|
/**
|
|
@@ -27,6 +29,9 @@ export declare namespace DataSources {
|
|
|
27
29
|
* still the directory where blueprint.json is located.
|
|
28
30
|
*
|
|
29
31
|
* It is not possible to escape the Blueprint Execution Context via "../" sequences.
|
|
32
|
+
*
|
|
33
|
+
* @asType string
|
|
34
|
+
* @pattern ^(?!.*(?:^|/)\.\.(?:/|$))(?:\./|/).*$
|
|
30
35
|
*/
|
|
31
36
|
export type ExecutionContextPath = `/${string}` | `./${string}`;
|
|
32
37
|
/**
|
|
@@ -42,6 +47,7 @@ export declare namespace DataSources {
|
|
|
42
47
|
* ```
|
|
43
48
|
*/
|
|
44
49
|
export type InlineFile = {
|
|
50
|
+
/** @pattern ^(?!(?:\.|\.\.)$)[^/]+$ */
|
|
45
51
|
filename: string;
|
|
46
52
|
content: InlineFileContent;
|
|
47
53
|
};
|
|
@@ -66,8 +72,19 @@ export declare namespace DataSources {
|
|
|
66
72
|
* ```
|
|
67
73
|
*/
|
|
68
74
|
export type InlineDirectory = {
|
|
75
|
+
/** @pattern ^(?!(?:\.|\.\.)$)[^/]+$ */
|
|
69
76
|
directoryName: string;
|
|
70
|
-
|
|
77
|
+
/** @propertyNames { "pattern": "^(?!(?:\\.|\\.\\.)$)[^/]+$" } */
|
|
78
|
+
files: Record<string, InlineFileContent | NestedInlineDirectory>;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* A child directory inside an inline directory.
|
|
82
|
+
*
|
|
83
|
+
* Its directory name comes from the parent `files` record key.
|
|
84
|
+
*/
|
|
85
|
+
export type NestedInlineDirectory = {
|
|
86
|
+
/** @propertyNames { "pattern": "^(?!(?:\\.|\\.\\.)$)[^/]+$" } */
|
|
87
|
+
files: Record<string, InlineFileContent | NestedInlineDirectory>;
|
|
71
88
|
};
|
|
72
89
|
/**
|
|
73
90
|
* A reference to a remote git repository.
|
|
@@ -87,6 +104,8 @@ export declare namespace DataSources {
|
|
|
87
104
|
* A path inside the git repository this data reference points to.
|
|
88
105
|
*
|
|
89
106
|
* Defaults to the root of the repository.
|
|
107
|
+
*
|
|
108
|
+
* @pattern ^(?!.*(?:^|/)\.\.(?:/|$)).*$
|
|
90
109
|
*/
|
|
91
110
|
pathInRepository?: string;
|
|
92
111
|
};
|
|
@@ -94,6 +113,10 @@ export declare namespace DataSources {
|
|
|
94
113
|
* A union of all general data reference types.
|
|
95
114
|
*/
|
|
96
115
|
export type DataReference = URLReference | ExecutionContextPath | InlineFile | InlineDirectory | GitPath;
|
|
116
|
+
/**
|
|
117
|
+
* A data reference that must resolve to a single file.
|
|
118
|
+
*/
|
|
119
|
+
export type FileDataReference = URLReference | ExecutionContextPath | TargetSitePath | InlineFile;
|
|
97
120
|
/**
|
|
98
121
|
* }}}
|
|
99
122
|
*/
|
|
@@ -105,20 +128,40 @@ export declare namespace DataSources {
|
|
|
105
128
|
*/
|
|
106
129
|
/** Helper types {{{ */
|
|
107
130
|
/**
|
|
108
|
-
* A
|
|
109
|
-
*
|
|
110
|
-
* ```
|
|
111
|
-
* ^[a-zA-Z0-9_-]+$
|
|
112
|
-
* ```
|
|
131
|
+
* A WordPress.org directory slug.
|
|
113
132
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* string matching the above regex.
|
|
133
|
+
* Slugs are intentionally treated as opaque strings. Playground should not
|
|
134
|
+
* reject future WordPress.org slug formats just because they do not match the
|
|
135
|
+
* directory conventions common today.
|
|
118
136
|
*/
|
|
119
137
|
export type Slug = string;
|
|
138
|
+
/**
|
|
139
|
+
* @asType string
|
|
140
|
+
* @pattern ^(?:latest|\d+\.\d+(?:\.\d+)?)$
|
|
141
|
+
*/
|
|
120
142
|
export type SimpleVersionExpression = 'latest' | `${number}.${number}` | `${number}.${number}.${number}`;
|
|
121
|
-
export type
|
|
143
|
+
export type VersionNumberComponent = `${bigint}`;
|
|
144
|
+
/**
|
|
145
|
+
* @asType string
|
|
146
|
+
* @pattern ^\d+\.\d+(?:\.\d+)?$
|
|
147
|
+
*/
|
|
148
|
+
export type ComparableVersionExpression = `${VersionNumberComponent}.${VersionNumberComponent}` | `${VersionNumberComponent}.${VersionNumberComponent}.${VersionNumberComponent}`;
|
|
149
|
+
export type WordPressVersionSuffix = `beta${VersionNumberComponent}` | `rc${VersionNumberComponent}`;
|
|
150
|
+
/**
|
|
151
|
+
* @asType string
|
|
152
|
+
* @pattern ^\d+\.\d+(?:\.\d+)?(?:-(?:beta\d+|[Rr][Cc]\d+))?$
|
|
153
|
+
*/
|
|
154
|
+
export type WordPressVersionConstraintVersion = ComparableVersionExpression | `${ComparableVersionExpression}-${WordPressVersionSuffix}`;
|
|
155
|
+
/**
|
|
156
|
+
* @asType string
|
|
157
|
+
* @pattern ^(?:latest|\d+\.\d+(?:\.\d+)?(?:-(?:beta\d+|[Rr][Cc]\d+))?)$
|
|
158
|
+
*/
|
|
159
|
+
export type WordPressVersionPreferredVersion = 'latest' | WordPressVersionConstraintVersion;
|
|
160
|
+
/**
|
|
161
|
+
* @asType string
|
|
162
|
+
* @pattern ^(?:latest|\d+\.\d+(?:\.\d+)?)$
|
|
163
|
+
*/
|
|
164
|
+
export type PHPVersionConstraintVersion = SimpleVersionExpression;
|
|
122
165
|
/** }}} Helper types */
|
|
123
166
|
/**
|
|
124
167
|
* Plugin directory reference, e.g. "jetpack", "jetpack@6.4", or "akismet@6.4.3".
|
|
@@ -149,30 +192,46 @@ export declare namespace DataSources {
|
|
|
149
192
|
*/
|
|
150
193
|
export type ThemeDirectoryReference = Slug | `${Slug}@${SimpleVersionExpression}`;
|
|
151
194
|
/**
|
|
152
|
-
* WordPress version, e.g. "
|
|
195
|
+
* WordPress version, e.g. "latest", "beta", "trunk", "none", "6.4",
|
|
196
|
+
* "6.4.3", "6.8-RC1", or "6.7-beta2".
|
|
153
197
|
*
|
|
154
198
|
* These refer to slugs of specific WordPress releases as listed in
|
|
155
199
|
* the first table column on https://wordpress.org/download/releases/.
|
|
200
|
+
* "none" is not a release. It means the Blueprint runs PHP without
|
|
201
|
+
* installing WordPress.
|
|
156
202
|
*
|
|
157
203
|
* The WordPressVersion type is only meaningful in the top-level
|
|
158
204
|
* `wordpressVersion` property.
|
|
205
|
+
*
|
|
206
|
+
* @asType string
|
|
207
|
+
* @pattern ^(?:latest|beta|trunk|nightly|none|\d+\.\d+(?:\.\d+)?(?:-(?:beta\d+|[Rr][Cc]\d+))?)$
|
|
159
208
|
*/
|
|
160
|
-
export type WordPressVersion = SimpleVersionExpression | `${SimpleVersionExpression}-${WordPressVersionSuffix}`;
|
|
209
|
+
export type WordPressVersion = 'none' | 'beta' | 'trunk' | 'nightly' | SimpleVersionExpression | `${SimpleVersionExpression}-${WordPressVersionSuffix}`;
|
|
161
210
|
/**
|
|
162
|
-
* PHP version, e.g. "8.1"
|
|
211
|
+
* PHP version, e.g. "8.1", "8.1.3", or "next".
|
|
163
212
|
*
|
|
164
213
|
* These refer to PHP versions as listed in https://www.php.net/releases/.
|
|
214
|
+
* `next` previews the php-src development branch and is currently
|
|
215
|
+
* supported by the web runtime only.
|
|
165
216
|
*
|
|
166
217
|
* The PHPVersion type is only meaningful in the top-level
|
|
167
218
|
* `phpVersion` property.
|
|
219
|
+
*
|
|
220
|
+
* @asType string
|
|
221
|
+
* @pattern ^(?:latest|next|\d+\.\d+(?:\.\d+)?)$
|
|
168
222
|
*/
|
|
169
|
-
export type PHPVersion = SimpleVersionExpression;
|
|
223
|
+
export type PHPVersion = SimpleVersionExpression | 'next';
|
|
170
224
|
/**
|
|
171
|
-
* A path within the
|
|
225
|
+
* A path within the target WordPress site, relative to the WordPress root
|
|
172
226
|
* directory. For example, site:wp-content/uploads/2024/01/image.jpg.
|
|
173
227
|
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
228
|
+
* Unlike an execution-context path, this path is resolved from the mutable
|
|
229
|
+
* target filesystem when the consuming step runs. Earlier steps may therefore
|
|
230
|
+
* create the referenced file. The runner must keep the path inside the target
|
|
231
|
+
* WordPress root; it never names a file on the host filesystem.
|
|
232
|
+
*
|
|
233
|
+
* @asType string
|
|
234
|
+
* @pattern ^site:(?!\/*$)(?!\.\.(?:/|$))(?!.*\/\.\.(?:/|$)).+$
|
|
176
235
|
*/
|
|
177
236
|
export type TargetSitePath = `site:${string}`;
|
|
178
237
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type BlueprintValidationResult } from './v1/compile';
|
|
2
|
+
/**
|
|
3
|
+
* Validates either Blueprint declaration version without loading the v2
|
|
4
|
+
* validator for v1 declarations.
|
|
5
|
+
*/
|
|
6
|
+
export declare function validateBlueprintDeclaration(blueprintMaybe: unknown): Promise<BlueprintValidationResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-playground/blueprints",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.45",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"import": "./index.js",
|
|
@@ -25,22 +25,22 @@
|
|
|
25
25
|
"access": "public",
|
|
26
26
|
"directory": "../../../dist/packages/playground/blueprints"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "d8132e032daf7c1ac2fd568af48444d84a59ced2",
|
|
29
29
|
"engines": {
|
|
30
30
|
"node": ">=20.10.0",
|
|
31
31
|
"npm": ">=10.2.3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"ajv": "8.18.0",
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@php-wasm/logger": "3.1.
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@php-wasm/web-service-worker": "3.1.
|
|
43
|
-
"@php-wasm/stream-compression": "3.1.
|
|
35
|
+
"@php-wasm/universal": "3.1.45",
|
|
36
|
+
"@wp-playground/storage": "3.1.45",
|
|
37
|
+
"@php-wasm/util": "3.1.45",
|
|
38
|
+
"@php-wasm/logger": "3.1.45",
|
|
39
|
+
"@wp-playground/wordpress": "3.1.45",
|
|
40
|
+
"@php-wasm/progress": "3.1.45",
|
|
41
|
+
"@wp-playground/common": "3.1.45",
|
|
42
|
+
"@php-wasm/web-service-worker": "3.1.45",
|
|
43
|
+
"@php-wasm/stream-compression": "3.1.45"
|
|
44
44
|
},
|
|
45
45
|
"packageManager": "npm@10.9.2",
|
|
46
46
|
"overrides": {
|
package/schema-readme.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
The JSON schema stored in this directory describes
|
|
2
|
-
|
|
1
|
+
The public JSON schema stored in this directory describes both Blueprint
|
|
2
|
+
declaration versions and is autogenerated from the Blueprint TypeScript types.
|
|
3
3
|
|
|
4
|
-
The
|
|
5
|
-
|
|
4
|
+
The existing `blueprint-schema-validator.js` remains the v1 runtime validator.
|
|
5
|
+
Blueprint v2 has its own validator, so adding one version cannot silently
|
|
6
|
+
change validation of the other.
|
|
6
7
|
|
|
7
|
-
Whenever the types are modified, the
|
|
8
|
+
Whenever the types are modified, the schemas and validators need to be
|
|
8
9
|
rebuilt using `nx build playground-blueprints` and then committed to
|
|
9
10
|
the repository.
|
|
10
11
|
|