@wp-playground/blueprints 2.0.22 → 3.0.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.
- package/blueprint-schema-validator.js +2 -2
- package/blueprint-schema.json +2 -2
- package/index.cjs +75 -66
- package/index.cjs.map +1 -1
- package/index.d.ts +6 -5
- package/index.js +1234 -1219
- package/index.js.map +1 -1
- package/lib/resolve-remote-blueprint.d.ts +1 -1
- package/lib/steps/index.d.ts +1 -1
- package/lib/steps/install-plugin.d.ts +1 -1
- package/lib/steps/install-theme.d.ts +1 -1
- package/lib/steps/wp-cli.d.ts +1 -1
- package/lib/steps/write-files.d.ts +1 -1
- package/lib/types.d.ts +11 -0
- package/lib/{compile.d.ts → v1/compile.d.ts} +11 -8
- package/lib/{resources.d.ts → v1/resources.d.ts} +1 -1
- package/lib/{blueprint.d.ts → v1/types.d.ts} +4 -9
- package/lib/v2/blueprint-v2-declaration.d.ts +4 -4
- package/lib/v2/run-blueprint-v2.d.ts +2 -2
- package/lib/v2/wep-1-blueprint-v2-schema/appendix-A-blueprint-v2-schema.d.ts +1400 -0
- package/lib/v2/wep-1-blueprint-v2-schema/appendix-B-data-sources.d.ts +179 -0
- package/package.json +13 -13
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
export declare namespace DataSources {
|
|
2
|
+
/**
|
|
3
|
+
* General data sources {{{
|
|
4
|
+
*
|
|
5
|
+
* These types can be used anywhere in the Blueprint schema where a
|
|
6
|
+
* file or a directory is expected.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A reference to a HTTP or HTTPS URL.
|
|
10
|
+
*
|
|
11
|
+
* The URLs are parsed using the WHATWG URL standard, which means they can
|
|
12
|
+
* optionally contain usernames and passwords if needed.
|
|
13
|
+
*
|
|
14
|
+
* @see https://url.spec.whatwg.org/
|
|
15
|
+
*/
|
|
16
|
+
export type URLReference = `http://${string}` | `https://${string}`;
|
|
17
|
+
/**
|
|
18
|
+
* A reference to a file in the Blueprint Execution Context – see the
|
|
19
|
+
* main proposal document for more context.
|
|
20
|
+
*
|
|
21
|
+
* The path must start with either ./ or / to distinguish it from a
|
|
22
|
+
* plugin or theme slug. Regardless of the prefix (./ or /), the path
|
|
23
|
+
* is relative to the Blueprint Execution Context root:
|
|
24
|
+
*
|
|
25
|
+
* * Relative paths (./) are relative to the location of blueprint.json file.
|
|
26
|
+
* * Absolute paths (/) are chrooted at the Blueprint Execution Context root which is
|
|
27
|
+
* still the directory where blueprint.json is located.
|
|
28
|
+
*
|
|
29
|
+
* It is not possible to escape the Blueprint Execution Context via "../" sequences.
|
|
30
|
+
*/
|
|
31
|
+
export type ExecutionContextPath = `/${string}` | `./${string}`;
|
|
32
|
+
/**
|
|
33
|
+
* A file that is inlined within the Blueprint JSON document.
|
|
34
|
+
*
|
|
35
|
+
* Example:
|
|
36
|
+
*
|
|
37
|
+
* ```json
|
|
38
|
+
* {
|
|
39
|
+
* "filename": "index.php",
|
|
40
|
+
* "content": "<?php echo 'Hello, world!'; ?>"
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export type InlineFile = {
|
|
45
|
+
filename: string;
|
|
46
|
+
content: InlineFileContent;
|
|
47
|
+
};
|
|
48
|
+
type InlineFileContent = string;
|
|
49
|
+
/**
|
|
50
|
+
* A directory that is inlined within the Blueprint JSON document.
|
|
51
|
+
*
|
|
52
|
+
* Example:
|
|
53
|
+
*
|
|
54
|
+
* ```json
|
|
55
|
+
* {
|
|
56
|
+
* "directoryName": "my-directory",
|
|
57
|
+
* "files": {
|
|
58
|
+
* "index.php": "<?php echo 'Hello, world!'; ?>",
|
|
59
|
+
* "my-sub-directory": {
|
|
60
|
+
* "files": {
|
|
61
|
+
* "index.php": "<?php echo 'Hello, world!'; ?>"
|
|
62
|
+
* }
|
|
63
|
+
* }
|
|
64
|
+
* }
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export type InlineDirectory = {
|
|
69
|
+
directoryName: string;
|
|
70
|
+
files: Record<string, InlineFileContent | InlineDirectory>;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* A reference to a remote git repository.
|
|
74
|
+
*/
|
|
75
|
+
export type GitPath = {
|
|
76
|
+
/**
|
|
77
|
+
* A HTTP or HTTPS URL of the remote git repository.
|
|
78
|
+
*/
|
|
79
|
+
gitRepository: URLReference;
|
|
80
|
+
/**
|
|
81
|
+
* A branch name, commit hash, or tag name.
|
|
82
|
+
*
|
|
83
|
+
* Defaults to HEAD.
|
|
84
|
+
*/
|
|
85
|
+
ref?: string;
|
|
86
|
+
/**
|
|
87
|
+
* A path inside the git repository this data reference points to.
|
|
88
|
+
*
|
|
89
|
+
* Defaults to the root of the repository.
|
|
90
|
+
*/
|
|
91
|
+
pathInRepository?: string;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* A union of all general data reference types.
|
|
95
|
+
*/
|
|
96
|
+
export type DataReference = URLReference | ExecutionContextPath | InlineFile | InlineDirectory | GitPath;
|
|
97
|
+
/**
|
|
98
|
+
* }}}
|
|
99
|
+
*/
|
|
100
|
+
/**
|
|
101
|
+
* Contextual data sources {{{
|
|
102
|
+
*
|
|
103
|
+
* These types are only meaningful in specific, well-known parts of
|
|
104
|
+
* the Blueprint schema.
|
|
105
|
+
*/
|
|
106
|
+
/** Helper types {{{ */
|
|
107
|
+
/**
|
|
108
|
+
* A slug is a string matching the following regex:
|
|
109
|
+
*
|
|
110
|
+
* ```
|
|
111
|
+
* ^[a-zA-Z0-9_-]+$
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* This constraint may be expressed in TypeScript, but it would come at the
|
|
115
|
+
* expense of readability. This document will thus alias the general `string`
|
|
116
|
+
* type to `Slug`. Every reference to the `Slug` type should be treated as a
|
|
117
|
+
* string matching the above regex.
|
|
118
|
+
*/
|
|
119
|
+
export type Slug = string;
|
|
120
|
+
export type SimpleVersionExpression = 'latest' | `${number}.${number}` | `${number}.${number}.${number}`;
|
|
121
|
+
export type WordPressVersionSuffix = `beta${number}` | `rc${number}`;
|
|
122
|
+
/** }}} Helper types */
|
|
123
|
+
/**
|
|
124
|
+
* Plugin directory reference, e.g. "jetpack", "jetpack@6.4", or "akismet@6.4.3".
|
|
125
|
+
*
|
|
126
|
+
* These refer to a specific plugin slugs in the WordPress.org plugin repository.
|
|
127
|
+
*
|
|
128
|
+
* For example, a reference to "wordpress-seo" means the Yoast SEO plugin as
|
|
129
|
+
* seen on https://wordpress.org/plugins/wordpress-seo/.
|
|
130
|
+
*
|
|
131
|
+
* The Plugin Directory Reference are only meaningful in:
|
|
132
|
+
*
|
|
133
|
+
* * The top-level `plugins` array
|
|
134
|
+
* * The `installPlugin` imperative step
|
|
135
|
+
*/
|
|
136
|
+
export type PluginDirectoryReference = Slug | `${Slug}@${SimpleVersionExpression}`;
|
|
137
|
+
/**
|
|
138
|
+
* Theme directory reference, e.g. "twentytwentythree", "adventurer@4.6.0", or "twentytwentyfour@latest".
|
|
139
|
+
*
|
|
140
|
+
* These refer to specific theme slugs in the WordPress.org theme repository.
|
|
141
|
+
*
|
|
142
|
+
* For example, a reference to "adventurer" means the Adventurer theme as
|
|
143
|
+
* seen on https://wordpress.org/themes/adventurer/.
|
|
144
|
+
*
|
|
145
|
+
* These references are only meaningful in:
|
|
146
|
+
*
|
|
147
|
+
* * The top-level `themes` array
|
|
148
|
+
* * The `installTheme` imperative step
|
|
149
|
+
*/
|
|
150
|
+
export type ThemeDirectoryReference = Slug | `${Slug}@${SimpleVersionExpression}`;
|
|
151
|
+
/**
|
|
152
|
+
* WordPress version, e.g. "6.4", "6.4.3", "6.8-RC1", or "6.7-beta2".
|
|
153
|
+
*
|
|
154
|
+
* These refer to slugs of specific WordPress releases as listed in
|
|
155
|
+
* the first table column on https://wordpress.org/download/releases/.
|
|
156
|
+
*
|
|
157
|
+
* The WordPressVersion type is only meaningful in the top-level
|
|
158
|
+
* `wordpressVersion` property.
|
|
159
|
+
*/
|
|
160
|
+
export type WordPressVersion = SimpleVersionExpression | `${SimpleVersionExpression}-${WordPressVersionSuffix}`;
|
|
161
|
+
/**
|
|
162
|
+
* PHP version, e.g. "8.1" or "8.1.3".
|
|
163
|
+
*
|
|
164
|
+
* These refer to PHP versions as listed in https://www.php.net/releases/.
|
|
165
|
+
*
|
|
166
|
+
* The PHPVersion type is only meaningful in the top-level
|
|
167
|
+
* `phpVersion` property.
|
|
168
|
+
*/
|
|
169
|
+
export type PHPVersion = SimpleVersionExpression;
|
|
170
|
+
/**
|
|
171
|
+
* A path within the built WordPress site, relative to the WordPress root
|
|
172
|
+
* directory. For example, site:wp-content/uploads/2024/01/image.jpg.
|
|
173
|
+
*
|
|
174
|
+
* This type is only meaningful in imperative Blueprint steps for operations
|
|
175
|
+
* such as creating new files or moving files and directories.
|
|
176
|
+
*/
|
|
177
|
+
export type TargetSitePath = `site:${string}`;
|
|
178
|
+
export {};
|
|
179
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-playground/blueprints",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"import": "./index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"access": "public",
|
|
22
22
|
"directory": "../../../dist/packages/playground/blueprints"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "9a65507f4294f48d98953edb9fc91392a8fab759",
|
|
25
25
|
"engines": {
|
|
26
26
|
"node": ">=20.18.3",
|
|
27
27
|
"npm": ">=10.1.0"
|
|
@@ -46,17 +46,17 @@
|
|
|
46
46
|
"wasm-feature-detect": "1.8.0",
|
|
47
47
|
"ws": "8.18.1",
|
|
48
48
|
"yargs": "17.7.2",
|
|
49
|
-
"@php-wasm/node-polyfills": "
|
|
50
|
-
"@
|
|
51
|
-
"@php-wasm/
|
|
52
|
-
"@wp-playground/
|
|
53
|
-
"@
|
|
54
|
-
"@php-wasm/node": "
|
|
55
|
-
"@
|
|
56
|
-
"@php-wasm/
|
|
57
|
-
"@php-wasm/
|
|
58
|
-
"@php-wasm/
|
|
59
|
-
"@
|
|
49
|
+
"@php-wasm/node-polyfills": "3.0.1",
|
|
50
|
+
"@wp-playground/storage": "3.0.1",
|
|
51
|
+
"@php-wasm/universal": "3.0.1",
|
|
52
|
+
"@wp-playground/common": "3.0.1",
|
|
53
|
+
"@php-wasm/util": "3.0.1",
|
|
54
|
+
"@php-wasm/node": "3.0.1",
|
|
55
|
+
"@wp-playground/wordpress": "3.0.1",
|
|
56
|
+
"@php-wasm/logger": "3.0.1",
|
|
57
|
+
"@php-wasm/progress": "3.0.1",
|
|
58
|
+
"@php-wasm/stream-compression": "3.0.1",
|
|
59
|
+
"@php-wasm/web": "3.0.1"
|
|
60
60
|
},
|
|
61
61
|
"overrides": {
|
|
62
62
|
"rollup": "^4.34.6",
|