You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.command('server','Start a local WordPress server')
91
-
.command(
92
-
'run-blueprint',
93
-
'Execute a Blueprint without starting a server'
94
-
)
95
-
.command(
96
-
'build-snapshot',
97
-
'Build a ZIP snapshot of a WordPress site based on a Blueprint'
98
-
)
99
-
.demandCommand(1,'Please specify a command')
100
-
.strictCommands()
101
-
.option('outfile',{
102
-
describe: 'When building, write to this output file.',
103
-
type: 'string',
104
-
default: 'wordpress.zip',
105
-
})
106
-
.option('port',{
107
-
describe: 'Port to listen on when serving.',
108
-
type: 'number',
109
-
default: 9400,
110
-
})
111
-
.option('site-url',{
88
+
constsharedOptions: Record<string,YargsOptions>={
89
+
'site-url': {
112
90
describe:
113
91
'Site URL to use for WordPress. Defaults to http://127.0.0.1:{port}',
114
92
type: 'string',
115
-
})
116
-
.option('php',{
93
+
},
94
+
php:{
117
95
describe: 'PHP version to use.',
118
96
type: 'string',
119
97
default: RecommendedPHPVersion,
120
98
choices: SupportedPHPVersions,
121
-
})
122
-
.option('wp',{
99
+
},
100
+
wp:{
123
101
describe: 'WordPress version to use.',
124
102
type: 'string',
125
103
default: 'latest',
126
-
})
104
+
},
127
105
// @TODO: Support read-only mounts, e.g. via WORKERFS, a custom
128
106
// ReadOnlyNODEFS, or by copying the files into MEMFS
129
-
.option('mount',{
107
+
mount:{
130
108
describe:
131
109
'Mount a directory to the PHP runtime (can be used multiple times). Format: /host/path:/vfs/path',
132
110
type: 'array',
133
111
string: true,
134
112
coerce: parseMountWithDelimiterArguments,
135
-
})
136
-
.option('mount-before-install',{
113
+
},
114
+
'mount-before-install':{
137
115
describe:
138
116
'Mount a directory to the PHP runtime before WordPress installation (can be used multiple times). Format: /host/path:/vfs/path',
139
117
type: 'array',
140
118
string: true,
141
119
coerce: parseMountWithDelimiterArguments,
142
-
})
143
-
.option('mount-dir',{
120
+
},
121
+
'mount-dir':{
144
122
describe:
145
123
'Mount a directory to the PHP runtime (can be used multiple times). Format: "/host/path" "/vfs/path"',
146
124
type: 'array',
147
125
nargs: 2,
148
126
array: true,
149
127
coerce: parseMountDirArguments,
150
-
})
151
-
.option('mount-dir-before-install',{
128
+
},
129
+
'mount-dir-before-install':{
152
130
describe:
153
131
'Mount a directory before WordPress installation (can be used multiple times). Format: "/host/path" "/vfs/path"',
154
132
type: 'string',
155
133
nargs: 2,
156
134
array: true,
157
135
coerce: parseMountDirArguments,
158
-
})
159
-
.option('login',{
136
+
},
137
+
login:{
160
138
describe: 'Should log the user in',
161
139
type: 'boolean',
162
140
default: false,
163
-
})
164
-
.option('blueprint',{
141
+
},
142
+
blueprint:{
165
143
describe: 'Blueprint to execute.',
166
144
type: 'string',
167
-
})
168
-
.option('blueprint-may-read-adjacent-files',{
145
+
},
146
+
'blueprint-may-read-adjacent-files':{
169
147
describe:
170
148
'Consent flag: Allow "bundled" resources in a local blueprint to read files in the same directory as the blueprint file.',
171
149
type: 'boolean',
172
150
default: false,
173
-
})
174
-
.option('wordpress-install-mode',{
151
+
},
152
+
'wordpress-install-mode':{
175
153
describe:
176
154
'Control how Playground prepares WordPress before booting.',
177
155
type: 'string',
@@ -182,71 +160,71 @@ export async function parseOptionsAndRunCLI(argsToParse: string[]) {
182
160
'install-from-existing-files-if-needed',
183
161
'do-not-attempt-installing',
184
162
]asconst,
185
-
})
186
-
.option('skip-wordpress-install',{
163
+
},
164
+
'skip-wordpress-install':{
187
165
describe: '[Deprecated] Use --wordpress-install-mode instead.',
188
166
type: 'boolean',
189
167
hidden: true,
190
-
})
191
-
.option('skip-sqlite-setup',{
168
+
},
169
+
'skip-sqlite-setup':{
192
170
describe:
193
171
'Skip the SQLite integration plugin setup to allow the WordPress site to use MySQL.',
194
172
type: 'boolean',
195
173
default: false,
196
-
})
174
+
},
197
175
// Hidden - Deprecated in favor of verbosity
198
-
.option('quiet',{
176
+
quiet:{
199
177
describe: 'Do not output logs and progress messages.',
200
178
type: 'boolean',
201
179
default: false,
202
180
hidden: true,
203
-
})
204
-
.option('verbosity',{
181
+
},
182
+
verbosity:{
205
183
describe: 'Output logs and progress messages.',
206
184
type: 'string',
207
185
choices: Object.values(LogVerbosity).map(
208
186
(verbosity)=>verbosity.name
209
187
),
210
188
default: 'normal',
211
-
})
212
-
.option('debug',{
189
+
},
190
+
debug:{
213
191
describe:
214
192
'Print PHP error log content if an error occurs during Playground boot.',
215
193
type: 'boolean',
216
194
default: false,
217
-
})
218
-
.option('auto-mount',{
195
+
},
196
+
'auto-mount':{
219
197
describe: `Automatically mount the specified directory. If no path is provided, mount the current working directory. You can mount a WordPress directory, a plugin directory, a theme directory, a wp-content directory, or any directory containing PHP and HTML files.`,
220
198
type: 'string',
221
-
})
222
-
.option('follow-symlinks',{
199
+
},
200
+
'follow-symlinks':{
223
201
describe:
224
202
'Allow Playground to follow symlinks by automatically mounting symlinked directories and files encountered in mounted directories. \nWarning: Following symlinks will expose files outside mounted directories to Playground and could be a security risk.',
225
203
type: 'boolean',
226
204
default: false,
227
-
})
228
-
.option('experimental-trace',{
205
+
},
206
+
'experimental-trace':{
229
207
describe:
230
208
'Print detailed messages about system behavior to the console. Useful for troubleshooting.',
231
209
type: 'boolean',
232
210
default: false,
233
211
// Hide this option because we want to replace with a more general log-level flag.
234
212
hidden: true,
235
-
})
236
-
.option('internal-cookie-store',{
213
+
},
214
+
'internal-cookie-store':{
237
215
describe:
238
216
'Enable internal cookie handling. When enabled, Playground will manage cookies internally using '+
239
217
'an HttpCookieStore that persists cookies across requests. When disabled, cookies are handled '+
240
218
'externally (e.g., by a browser in Node.js environments).',
241
219
type: 'boolean',
242
220
default: false,
243
-
})
244
-
.option('xdebug',{
221
+
},
222
+
xdebug:{
245
223
describe: 'Enable Xdebug.',
246
224
type: 'boolean',
247
225
default: false,
248
-
})
249
-
.option('experimental-unsafe-ide-integration',{
226
+
},
227
+
'experimental-unsafe-ide-integration':{
250
228
describe:
251
229
'Enable experimental IDE development tools. This option edits IDE config files '+
252
230
'to set Xdebug path mappings and web server details. CAUTION: If there are bugs, '+
@@ -259,39 +237,85 @@ export async function parseOptionsAndRunCLI(argsToParse: string[]) {
259
237
choices: ['','vscode','phpstorm'],
260
238
coerce: (value?: string)=>
261
239
value==='' ? ['vscode','phpstorm'] : [value],
262
-
})
263
-
.option('experimental-devtools',{
264
-
describe: 'Enable experimental browser development tools.',
265
-
type: 'boolean',
266
-
})
267
-
.conflicts(
268
-
'experimental-unsafe-ide-integration',
269
-
'experimental-devtools'
270
-
)
271
-
.option('experimental-multi-worker',{
272
-
describe:
273
-
'Enable experimental multi-worker support which requires '+
274
-
'a /wordpress directory backed by a real filesystem. '+
275
-
'Pass a positive number to specify the number of workers to use. '+
276
-
'Otherwise, default to the number of CPUs minus 1.',
277
-
type: 'number',
278
-
coerce: (value?: number)=>value??cpus().length-1,
279
-
})
280
-
.option('experimental-blueprints-v2-runner',{
240
+
},
241
+
'experimental-blueprints-v2-runner': {
281
242
describe: 'Use the experimental Blueprint V2 runner.',
282
243
type: 'boolean',
283
244
default: false,
284
245
// Remove the "hidden" flag once Blueprint V2 is fully supported
285
246
hidden: true,
286
-
})
287
-
.option('mode',{
247
+
},
248
+
mode:{
288
249
describe:
289
250
'Blueprints v2 runner mode to use. This option is required when using the --experimental-blueprints-v2-runner flag with a blueprint.',
0 commit comments