@wp-playground/client 3.1.17 → 3.1.19
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/index.cjs +57 -57
- package/index.js +188 -177
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1047,7 +1047,7 @@ var Xo = {
|
|
|
1047
1047
|
parse: Dd,
|
|
1048
1048
|
stringify: Nc
|
|
1049
1049
|
};
|
|
1050
|
-
async function
|
|
1050
|
+
async function Uv(e, t) {
|
|
1051
1051
|
const r = Xo.parse(await e.readFileAsText(Ko));
|
|
1052
1052
|
for (const [i, a] of Object.entries(t))
|
|
1053
1053
|
a == null ? delete r[i] : r[i] = a;
|
|
@@ -1265,7 +1265,7 @@ const uo = [
|
|
|
1265
1265
|
"8.1",
|
|
1266
1266
|
"8.0",
|
|
1267
1267
|
"7.4"
|
|
1268
|
-
], Jd = uo[0],
|
|
1268
|
+
], Jd = uo[0], Bv = uo;
|
|
1269
1269
|
async function di(e, t, r, { rmRoot: i = !1 } = {}) {
|
|
1270
1270
|
i && await e.isDir(t) && await e.rmdir(t, { recursive: !0 });
|
|
1271
1271
|
for (const [a, s] of Object.entries(r)) {
|
|
@@ -15644,30 +15644,15 @@ class WP_Config_Transformer {
|
|
|
15644
15644
|
}
|
|
15645
15645
|
`;
|
|
15646
15646
|
async function E_(e, t) {
|
|
15647
|
-
const r = Se(t, "wp-config.php")
|
|
15648
|
-
|
|
15649
|
-
};
|
|
15650
|
-
if (!e.fileExists(r) && e.fileExists(Se(t, "wp-config-sample.php")) && await e.writeFile(
|
|
15647
|
+
const r = Se(t, "wp-config.php");
|
|
15648
|
+
!e.fileExists(r) && e.fileExists(Se(t, "wp-config-sample.php")) && await e.writeFile(
|
|
15651
15649
|
r,
|
|
15652
15650
|
await e.readFileAsBuffer(
|
|
15653
15651
|
Se(t, "wp-config-sample.php")
|
|
15654
15652
|
)
|
|
15655
|
-
),
|
|
15656
|
-
|
|
15657
|
-
|
|
15658
|
-
if ((await e.run({
|
|
15659
|
-
code: `${sd}
|
|
15660
|
-
$wp_config_path = ${a.wpConfigPath};
|
|
15661
|
-
$transformer = WP_Config_Transformer::from_file($wp_config_path);
|
|
15662
|
-
foreach ( ${a.constants} as $name => $value ) {
|
|
15663
|
-
if ( ! $transformer->constant_exists( $name ) ) {
|
|
15664
|
-
$transformer->define_constant($name, $value);
|
|
15665
|
-
}
|
|
15666
|
-
}
|
|
15667
|
-
$transformer->to_file($wp_config_path);
|
|
15668
|
-
`
|
|
15669
|
-
})).errors.length > 0)
|
|
15670
|
-
throw new Error("Failed to auto-configure wp-config.php.");
|
|
15653
|
+
), e.fileExists(r) && await T_(e, r, {
|
|
15654
|
+
DB_NAME: "wordpress"
|
|
15655
|
+
});
|
|
15671
15656
|
}
|
|
15672
15657
|
async function S_(e, t, r) {
|
|
15673
15658
|
const i = dn({ wpConfigPath: t, constants: r });
|
|
@@ -15681,10 +15666,36 @@ async function S_(e, t, r) {
|
|
|
15681
15666
|
})).errors.length > 0)
|
|
15682
15667
|
throw new Error("Failed to rewrite constants in wp-config.php.");
|
|
15683
15668
|
}
|
|
15669
|
+
async function T_(e, t, r) {
|
|
15670
|
+
const i = Object.keys(r), a = dn({ wpConfigPath: t, constantNames: i }), s = await e.run({
|
|
15671
|
+
code: `${sd}
|
|
15672
|
+
$transformer = WP_Config_Transformer::from_file(${a.wpConfigPath});
|
|
15673
|
+
$missing = [];
|
|
15674
|
+
foreach (${a.constantNames} as $name) {
|
|
15675
|
+
if (!$transformer->constant_exists($name)) {
|
|
15676
|
+
$missing[] = $name;
|
|
15677
|
+
}
|
|
15678
|
+
}
|
|
15679
|
+
echo json_encode($missing);
|
|
15680
|
+
`
|
|
15681
|
+
});
|
|
15682
|
+
if (s.errors.length > 0)
|
|
15683
|
+
throw new Error("Failed to check wp-config.php for constants.");
|
|
15684
|
+
let n;
|
|
15685
|
+
try {
|
|
15686
|
+
n = JSON.parse(s.text);
|
|
15687
|
+
} catch {
|
|
15688
|
+
throw new Error(
|
|
15689
|
+
`Failed to parse wp-config.php constant check output: ${s.text}`
|
|
15690
|
+
);
|
|
15691
|
+
}
|
|
15692
|
+
for (const o of n)
|
|
15693
|
+
await e.defineConstant(o, r[o]);
|
|
15694
|
+
}
|
|
15684
15695
|
const Bo = async (e, { consts: t, method: r = "define-before-run" }) => {
|
|
15685
15696
|
switch (r) {
|
|
15686
15697
|
case "define-before-run":
|
|
15687
|
-
await
|
|
15698
|
+
await O_(e, t);
|
|
15688
15699
|
break;
|
|
15689
15700
|
case "rewrite-wp-config": {
|
|
15690
15701
|
const i = await e.documentRoot, a = Se(i, "/wp-config.php");
|
|
@@ -15695,7 +15706,7 @@ const Bo = async (e, { consts: t, method: r = "define-before-run" }) => {
|
|
|
15695
15706
|
throw new Error(`Invalid method: ${r}`);
|
|
15696
15707
|
}
|
|
15697
15708
|
};
|
|
15698
|
-
async function
|
|
15709
|
+
async function O_(e, t) {
|
|
15699
15710
|
for (const r in t)
|
|
15700
15711
|
await e.defineConstant(r, t[r]);
|
|
15701
15712
|
}
|
|
@@ -15711,7 +15722,7 @@ const id = async (e, { options: t }) => {
|
|
|
15711
15722
|
echo "Success";
|
|
15712
15723
|
`
|
|
15713
15724
|
});
|
|
15714
|
-
},
|
|
15725
|
+
}, A_ = async (e, { meta: t, userId: r }) => {
|
|
15715
15726
|
const i = await e.documentRoot;
|
|
15716
15727
|
await e.run({
|
|
15717
15728
|
code: `<?php
|
|
@@ -15722,7 +15733,7 @@ const id = async (e, { options: t }) => {
|
|
|
15722
15733
|
}
|
|
15723
15734
|
`
|
|
15724
15735
|
});
|
|
15725
|
-
}, qo = "/tmp/wp-cli.phar",
|
|
15736
|
+
}, qo = "/tmp/wp-cli.phar", $_ = {
|
|
15726
15737
|
resource: "url",
|
|
15727
15738
|
/**
|
|
15728
15739
|
* Use compression for downloading the wp-cli.phar file.
|
|
@@ -15747,7 +15758,7 @@ const id = async (e, { options: t }) => {
|
|
|
15747
15758
|
}, od = async (e, { command: t, wpCliPath: r = qo }) => {
|
|
15748
15759
|
await ad(e, r);
|
|
15749
15760
|
let i;
|
|
15750
|
-
if (typeof t == "string" ? (t = t.trim(), i =
|
|
15761
|
+
if (typeof t == "string" ? (t = t.trim(), i = R_(t)) : i = t, i.shift() !== "wp")
|
|
15751
15762
|
throw new Error('The first argument must be "wp".');
|
|
15752
15763
|
let s = !1;
|
|
15753
15764
|
const n = i.map((c) => c.startsWith("wordpress/") ? (s = !0, `/${c}`) : c);
|
|
@@ -15813,7 +15824,7 @@ This will ensure your code works reliably regardless of the current working dire
|
|
|
15813
15824
|
throw new Error(l.errors);
|
|
15814
15825
|
return l;
|
|
15815
15826
|
};
|
|
15816
|
-
function
|
|
15827
|
+
function R_(e) {
|
|
15817
15828
|
let i = 0, a = "";
|
|
15818
15829
|
const s = [];
|
|
15819
15830
|
let n = "";
|
|
@@ -15823,7 +15834,7 @@ function $_(e) {
|
|
|
15823
15834
|
}
|
|
15824
15835
|
return n && s.push(n), s;
|
|
15825
15836
|
}
|
|
15826
|
-
const
|
|
15837
|
+
const F_ = async (e, { wpCliPath: t }) => {
|
|
15827
15838
|
await ad(e, t), await Bo(e, {
|
|
15828
15839
|
consts: {
|
|
15829
15840
|
WP_ALLOW_MULTISITE: 1
|
|
@@ -15851,7 +15862,7 @@ const R_ = async (e, { wpCliPath: t }) => {
|
|
|
15851
15862
|
$_SERVER['HTTP_HOST'] = ${mt(r.hostname)};
|
|
15852
15863
|
`
|
|
15853
15864
|
)), await e.writeFile(n, l);
|
|
15854
|
-
},
|
|
15865
|
+
}, I_ = async (e, { fromPath: t, toPath: r }) => {
|
|
15855
15866
|
(!t.startsWith("/") || !r.startsWith("/")) && Oe.error(
|
|
15856
15867
|
`
|
|
15857
15868
|
The cp() step in your Blueprint refers to a relative path.
|
|
@@ -15872,7 +15883,7 @@ This will ensure your code works reliably regardless of the current working dire
|
|
|
15872
15883
|
r,
|
|
15873
15884
|
await e.readFileAsBuffer(t)
|
|
15874
15885
|
);
|
|
15875
|
-
},
|
|
15886
|
+
}, L_ = async (e, { fromPath: t, toPath: r }) => {
|
|
15876
15887
|
(!t.startsWith("/") || !r.startsWith("/")) && Oe.error(
|
|
15877
15888
|
`
|
|
15878
15889
|
The mv() step in your Blueprint refers to a relative path.
|
|
@@ -15890,7 +15901,7 @@ Use: mv({ fromPath: '/wordpress/wp-load.php', toPath: '/wordpress/wp-loa
|
|
|
15890
15901
|
This will ensure your code works reliably regardless of the current working directory.
|
|
15891
15902
|
`.trim()
|
|
15892
15903
|
), t.startsWith("/") || (t = `/${t}`), r.startsWith("/") || (r = `/${r}`), await e.mv(t, r);
|
|
15893
|
-
},
|
|
15904
|
+
}, C_ = async (e, { path: t }) => {
|
|
15894
15905
|
t.startsWith("/") || Oe.error(
|
|
15895
15906
|
`
|
|
15896
15907
|
The mkdir() step in your Blueprint refers to a relative path.
|
|
@@ -15908,7 +15919,7 @@ Use: mkdir({ path: '/wordpress/my-new-folder' });
|
|
|
15908
15919
|
This will ensure your code works reliably regardless of the current working directory.
|
|
15909
15920
|
`.trim()
|
|
15910
15921
|
), await e.mkdir(t);
|
|
15911
|
-
},
|
|
15922
|
+
}, N_ = async (e, { path: t }) => {
|
|
15912
15923
|
t.startsWith("/") || (Oe.error(
|
|
15913
15924
|
`
|
|
15914
15925
|
The rmdir() step in your Blueprint refers to a relative path.
|
|
@@ -15944,7 +15955,7 @@ Use: writeFile({ path: '/wordpress/wp-load.php', data: '<?php echo "Hell
|
|
|
15944
15955
|
This will ensure your code works reliably regardless of the current working directory.
|
|
15945
15956
|
`.trim()
|
|
15946
15957
|
), t = `/${t}`), t.startsWith("/wordpress/wp-content/mu-plugins") && !await e.fileExists("/wordpress/wp-content/mu-plugins") && await e.mkdir("/wordpress/wp-content/mu-plugins"), await e.writeFile(t, r);
|
|
15947
|
-
},
|
|
15958
|
+
}, D_ = async (e, { writeToPath: t, filesTree: r }) => {
|
|
15948
15959
|
t.startsWith("/") || (Oe.error(
|
|
15949
15960
|
`
|
|
15950
15961
|
The writeFiles() step in your Blueprint refers to a relative path.
|
|
@@ -15969,10 +15980,10 @@ This will ensure your code works reliably regardless of the current working dire
|
|
|
15969
15980
|
WP_SITEURL: t
|
|
15970
15981
|
}
|
|
15971
15982
|
});
|
|
15972
|
-
},
|
|
15973
|
-
await
|
|
15983
|
+
}, j_ = async (e, { file: t }, r) => {
|
|
15984
|
+
await U_(e, t, r);
|
|
15974
15985
|
};
|
|
15975
|
-
async function
|
|
15986
|
+
async function U_(e, t, r) {
|
|
15976
15987
|
var i;
|
|
15977
15988
|
(i = r == null ? void 0 : r.tracker) == null || i.setCaption("Importing content"), await Mo(e, {
|
|
15978
15989
|
path: "/tmp/import.wxr",
|
|
@@ -16126,7 +16137,7 @@ const fd = async (e, { themeSlug: t = "" }, r) => {
|
|
|
16126
16137
|
"themes/twentytwentyfour",
|
|
16127
16138
|
"themes/twentytwentyfive",
|
|
16128
16139
|
"themes/twentytwentysix"
|
|
16129
|
-
],
|
|
16140
|
+
], B_ = async (e, { wordPressFilesZip: t, pathInZip: r = "" }) => {
|
|
16130
16141
|
const i = await e.documentRoot;
|
|
16131
16142
|
let a = Se("/tmp", "import");
|
|
16132
16143
|
await e.mkdir(a), await Wo(e, {
|
|
@@ -16168,7 +16179,7 @@ const fd = async (e, { themeSlug: t = "" }, r) => {
|
|
|
16168
16179
|
);
|
|
16169
16180
|
await e.rmdir(a), await E_(e, i);
|
|
16170
16181
|
const d = await e.absoluteUrl;
|
|
16171
|
-
n || (n = await
|
|
16182
|
+
n || (n = await M_(e, i)), await ld(e, {
|
|
16172
16183
|
siteUrl: d
|
|
16173
16184
|
});
|
|
16174
16185
|
const m = mt(
|
|
@@ -16179,13 +16190,13 @@ const fd = async (e, { themeSlug: t = "" }, r) => {
|
|
|
16179
16190
|
$_GET['step'] = 'upgrade_db';
|
|
16180
16191
|
require ${m};
|
|
16181
16192
|
`
|
|
16182
|
-
}), n && n !== d && await
|
|
16193
|
+
}), n && n !== d && await q_(e, i, n, d);
|
|
16183
16194
|
};
|
|
16184
16195
|
function kc(e) {
|
|
16185
16196
|
const t = e.match(/\/scope:[^/]+\/?/);
|
|
16186
16197
|
return t ? t[0].replace(/\/?$/, "/") : null;
|
|
16187
16198
|
}
|
|
16188
|
-
async function
|
|
16199
|
+
async function q_(e, t, r, i) {
|
|
16189
16200
|
const a = kc(r), s = kc(i);
|
|
16190
16201
|
!a || !s || a !== s && await e.run({
|
|
16191
16202
|
code: `<?php
|
|
@@ -16250,7 +16261,7 @@ async function B_(e, t, r, i) {
|
|
|
16250
16261
|
}
|
|
16251
16262
|
});
|
|
16252
16263
|
}
|
|
16253
|
-
async function
|
|
16264
|
+
async function M_(e, t) {
|
|
16254
16265
|
const r = dn({ documentRoot: t });
|
|
16255
16266
|
return (await e.run({
|
|
16256
16267
|
code: `<?php
|
|
@@ -16264,7 +16275,7 @@ async function q_(e, t) {
|
|
|
16264
16275
|
async function Pc(e, t) {
|
|
16265
16276
|
await e.fileExists(t) && (await e.isDir(t) ? await e.rmdir(t) : await e.unlink(t));
|
|
16266
16277
|
}
|
|
16267
|
-
async function
|
|
16278
|
+
async function W_(e) {
|
|
16268
16279
|
const t = await e.request({
|
|
16269
16280
|
url: "/wp-admin/export.php?download=true&content=all"
|
|
16270
16281
|
});
|
|
@@ -16323,7 +16334,7 @@ async function pd(e, {
|
|
|
16323
16334
|
});
|
|
16324
16335
|
}
|
|
16325
16336
|
}
|
|
16326
|
-
const
|
|
16337
|
+
const z_ = async (e, { pluginData: t, pluginZipFile: r, ifAlreadyInstalled: i, options: a = {} }, s) => {
|
|
16327
16338
|
r && (t = r, Oe.warn(
|
|
16328
16339
|
'The "pluginZipFile" option is deprecated. Use "pluginData" instead.'
|
|
16329
16340
|
));
|
|
@@ -16383,7 +16394,7 @@ const W_ = async (e, { pluginData: t, pluginZipFile: r, ifAlreadyInstalled: i, o
|
|
|
16383
16394
|
},
|
|
16384
16395
|
s
|
|
16385
16396
|
);
|
|
16386
|
-
},
|
|
16397
|
+
}, H_ = async (e, { themeData: t, themeZipFile: r, ifAlreadyInstalled: i, options: a = {} }, s) => {
|
|
16387
16398
|
r && (t = r, Oe.warn(
|
|
16388
16399
|
'The "themeZipFile" option is deprecated. Use "themeData" instead.'
|
|
16389
16400
|
));
|
|
@@ -16422,9 +16433,9 @@ const W_ = async (e, { pluginData: t, pluginZipFile: r, ifAlreadyInstalled: i, o
|
|
|
16422
16433
|
},
|
|
16423
16434
|
s
|
|
16424
16435
|
);
|
|
16425
|
-
},
|
|
16436
|
+
}, V_ = async (e, { username: t = "admin" } = {}, r) => {
|
|
16426
16437
|
r == null || r.tracker.setCaption((r == null ? void 0 : r.initialCaption) || "Logging in"), e.defineConstant("PLAYGROUND_AUTO_LOGIN_AS_USER", t);
|
|
16427
|
-
},
|
|
16438
|
+
}, Z_ = async (e, t, r) => {
|
|
16428
16439
|
var a;
|
|
16429
16440
|
(a = r == null ? void 0 : r.tracker) == null || a.setCaption("Resetting WordPress data");
|
|
16430
16441
|
const i = await e.documentRoot;
|
|
@@ -16448,7 +16459,7 @@ const W_ = async (e, { pluginData: t, pluginZipFile: r, ifAlreadyInstalled: i, o
|
|
|
16448
16459
|
$GLOBALS['@pdo']->query("UPDATE SQLITE_SEQUENCE SET SEQ=0 WHERE NAME='wp_commentmeta'");
|
|
16449
16460
|
`
|
|
16450
16461
|
});
|
|
16451
|
-
},
|
|
16462
|
+
}, G_ = async (e, { options: t }) => {
|
|
16452
16463
|
await e.request({
|
|
16453
16464
|
url: "/wp-admin/install.php?step=2",
|
|
16454
16465
|
method: "POST",
|
|
@@ -16465,7 +16476,7 @@ const W_ = async (e, { pluginData: t, pluginZipFile: r, ifAlreadyInstalled: i, o
|
|
|
16465
16476
|
admin_email: "admin@localhost.com"
|
|
16466
16477
|
}
|
|
16467
16478
|
});
|
|
16468
|
-
},
|
|
16479
|
+
}, Y_ = async (e, { selfContained: t = !1 } = {}) => {
|
|
16469
16480
|
const r = "/tmp/wordpress-playground.zip", i = "/tmp/playground-export.json", a = await e.documentRoot, s = Se(a, "wp-content"), n = await e.absoluteUrl;
|
|
16470
16481
|
await e.writeFile(
|
|
16471
16482
|
i,
|
|
@@ -16488,7 +16499,7 @@ const W_ = async (e, { pluginData: t, pluginZipFile: r, ifAlreadyInstalled: i, o
|
|
|
16488
16499
|
),
|
|
16489
16500
|
additionalPaths: l
|
|
16490
16501
|
});
|
|
16491
|
-
await
|
|
16502
|
+
await X_(
|
|
16492
16503
|
e,
|
|
16493
16504
|
`zipDir(${c.wpContentPath}, ${c.zipPath}, array(
|
|
16494
16505
|
'exclude_paths' => ${c.exceptPaths},
|
|
@@ -16498,7 +16509,7 @@ const W_ = async (e, { pluginData: t, pluginZipFile: r, ifAlreadyInstalled: i, o
|
|
|
16498
16509
|
);
|
|
16499
16510
|
const p = await e.readFileAsBuffer(r);
|
|
16500
16511
|
return e.unlink(r), e.unlink(i), p;
|
|
16501
|
-
},
|
|
16512
|
+
}, K_ = `<?php
|
|
16502
16513
|
|
|
16503
16514
|
function zipDir($root, $output, $options = array())
|
|
16504
16515
|
{
|
|
@@ -16559,12 +16570,12 @@ function join_paths()
|
|
|
16559
16570
|
return preg_replace('#/+#', '/', join('/', $paths));
|
|
16560
16571
|
}
|
|
16561
16572
|
`;
|
|
16562
|
-
async function
|
|
16573
|
+
async function X_(e, t) {
|
|
16563
16574
|
return await e.run({
|
|
16564
|
-
code:
|
|
16575
|
+
code: K_ + t
|
|
16565
16576
|
});
|
|
16566
16577
|
}
|
|
16567
|
-
const
|
|
16578
|
+
const J_ = async (e, t) => {
|
|
16568
16579
|
const a = (await (await fetch(
|
|
16569
16580
|
`https://api.wordpress.org/translations/core/1.0/?version=${e}`
|
|
16570
16581
|
)).json()).translations.find(
|
|
@@ -16575,7 +16586,7 @@ const X_ = async (e, t) => {
|
|
|
16575
16586
|
`Failed to get ${t} translation package for WordPress ${e}.`
|
|
16576
16587
|
);
|
|
16577
16588
|
return a.package;
|
|
16578
|
-
},
|
|
16589
|
+
}, Q_ = async (e, { language: t }, r) => {
|
|
16579
16590
|
r == null || r.tracker.setCaption((r == null ? void 0 : r.initialCaption) || "Translating"), await e.defineConstant("WPLANG", t);
|
|
16580
16591
|
const i = await e.documentRoot, a = (await e.run({
|
|
16581
16592
|
code: `<?php
|
|
@@ -16584,7 +16595,7 @@ const X_ = async (e, t) => {
|
|
|
16584
16595
|
`
|
|
16585
16596
|
})).text, s = [
|
|
16586
16597
|
{
|
|
16587
|
-
url: await
|
|
16598
|
+
url: await J_(a, t),
|
|
16588
16599
|
type: "core"
|
|
16589
16600
|
}
|
|
16590
16601
|
], o = (await e.run({
|
|
@@ -16668,40 +16679,40 @@ const X_ = async (e, t) => {
|
|
|
16668
16679
|
})
|
|
16669
16680
|
);
|
|
16670
16681
|
await Promise.all(d);
|
|
16671
|
-
},
|
|
16682
|
+
}, ev = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
16672
16683
|
__proto__: null,
|
|
16673
16684
|
activatePlugin: td,
|
|
16674
16685
|
activateTheme: rd,
|
|
16675
|
-
cp:
|
|
16686
|
+
cp: I_,
|
|
16676
16687
|
defineSiteUrl: ld,
|
|
16677
16688
|
defineWpConfigConsts: Bo,
|
|
16678
|
-
enableMultisite:
|
|
16679
|
-
exportWXR:
|
|
16689
|
+
enableMultisite: F_,
|
|
16690
|
+
exportWXR: W_,
|
|
16680
16691
|
importThemeStarterContent: fd,
|
|
16681
|
-
importWordPressFiles:
|
|
16682
|
-
importWxr:
|
|
16683
|
-
installPlugin:
|
|
16684
|
-
installTheme:
|
|
16685
|
-
login:
|
|
16686
|
-
mkdir:
|
|
16687
|
-
mv:
|
|
16692
|
+
importWordPressFiles: B_,
|
|
16693
|
+
importWxr: j_,
|
|
16694
|
+
installPlugin: z_,
|
|
16695
|
+
installTheme: H_,
|
|
16696
|
+
login: V_,
|
|
16697
|
+
mkdir: C_,
|
|
16698
|
+
mv: L_,
|
|
16688
16699
|
request: k_,
|
|
16689
|
-
resetData:
|
|
16700
|
+
resetData: Z_,
|
|
16690
16701
|
rm: fo,
|
|
16691
|
-
rmdir:
|
|
16702
|
+
rmdir: N_,
|
|
16692
16703
|
runPHP: b_,
|
|
16693
16704
|
runPHPWithOptions: __,
|
|
16694
16705
|
runSql: x_,
|
|
16695
|
-
runWpInstallationWizard:
|
|
16696
|
-
setSiteLanguage:
|
|
16706
|
+
runWpInstallationWizard: G_,
|
|
16707
|
+
setSiteLanguage: Q_,
|
|
16697
16708
|
setSiteOptions: id,
|
|
16698
16709
|
unzip: Wo,
|
|
16699
|
-
updateUserMeta:
|
|
16710
|
+
updateUserMeta: A_,
|
|
16700
16711
|
wpCLI: od,
|
|
16701
16712
|
writeFile: Mo,
|
|
16702
|
-
writeFiles:
|
|
16703
|
-
zipWpContent:
|
|
16704
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
16713
|
+
writeFiles: D_,
|
|
16714
|
+
zipWpContent: Y_
|
|
16715
|
+
}, Symbol.toStringTag, { value: "Module" })), tv = {
|
|
16705
16716
|
properties: {
|
|
16706
16717
|
landingPage: {
|
|
16707
16718
|
type: "string",
|
|
@@ -16832,9 +16843,9 @@ Note: PHP 7.2 and 7.3 are deprecated and will be automatically upgraded to 7.4.`
|
|
|
16832
16843
|
},
|
|
16833
16844
|
$schema: { type: "string" }
|
|
16834
16845
|
}
|
|
16835
|
-
},
|
|
16846
|
+
}, rv = {
|
|
16836
16847
|
additionalProperties: { type: ["string", "boolean", "number"] }
|
|
16837
|
-
}, ud = Object.prototype.hasOwnProperty,
|
|
16848
|
+
}, ud = Object.prototype.hasOwnProperty, nv = {
|
|
16838
16849
|
enum: ["8.5", "8.4", "8.3", "8.2", "8.1", "8.0", "7.4"]
|
|
16839
16850
|
};
|
|
16840
16851
|
function Cn(e, { instancePath: t = "", parentData: r, parentDataProperty: i, rootData: a = e } = {}) {
|
|
@@ -16857,7 +16868,7 @@ function Cn(e, { instancePath: t = "", parentData: r, parentDataProperty: i, roo
|
|
|
16857
16868
|
instancePath: t,
|
|
16858
16869
|
schemaPath: "#/definitions/SupportedPHPVersion/enum",
|
|
16859
16870
|
keyword: "enum",
|
|
16860
|
-
params: { allowedValues:
|
|
16871
|
+
params: { allowedValues: nv.enum },
|
|
16861
16872
|
message: "must be equal to one of the allowed values"
|
|
16862
16873
|
};
|
|
16863
16874
|
s === null ? s = [d] : s.push(d), n++;
|
|
@@ -16926,7 +16937,7 @@ function Cn(e, { instancePath: t = "", parentData: r, parentDataProperty: i, roo
|
|
|
16926
16937
|
}
|
|
16927
16938
|
return Cn.errors = s, n === 0;
|
|
16928
16939
|
}
|
|
16929
|
-
const Da = { validate: _e },
|
|
16940
|
+
const Da = { validate: _e }, sv = {
|
|
16930
16941
|
enum: ["branch", "tag", "commit", "refname"]
|
|
16931
16942
|
};
|
|
16932
16943
|
function st(e, { instancePath: t = "", parentData: r, parentDataProperty: i, rootData: a = e } = {}) {
|
|
@@ -17034,7 +17045,7 @@ function st(e, { instancePath: t = "", parentData: r, parentDataProperty: i, roo
|
|
|
17034
17045
|
schemaPath: "#/definitions/GitDirectoryRefType/enum",
|
|
17035
17046
|
keyword: "enum",
|
|
17036
17047
|
params: {
|
|
17037
|
-
allowedValues:
|
|
17048
|
+
allowedValues: sv.enum
|
|
17038
17049
|
},
|
|
17039
17050
|
message: "must be equal to one of the allowed values"
|
|
17040
17051
|
}
|
|
@@ -17093,7 +17104,7 @@ function st(e, { instancePath: t = "", parentData: r, parentDataProperty: i, roo
|
|
|
17093
17104
|
], !1;
|
|
17094
17105
|
return st.errors = s, n === 0;
|
|
17095
17106
|
}
|
|
17096
|
-
const
|
|
17107
|
+
const iv = {
|
|
17097
17108
|
additionalProperties: {
|
|
17098
17109
|
anyOf: [
|
|
17099
17110
|
{ $ref: "#/definitions/FileTree" },
|
|
@@ -17125,7 +17136,7 @@ function Ir(e, { instancePath: t = "", parentData: r, parentDataProperty: i, roo
|
|
|
17125
17136
|
schemaPath: "#/additionalProperties/anyOf/1/type",
|
|
17126
17137
|
keyword: "type",
|
|
17127
17138
|
params: {
|
|
17128
|
-
type:
|
|
17139
|
+
type: iv.additionalProperties.anyOf[1].type
|
|
17129
17140
|
},
|
|
17130
17141
|
message: "must be object,string"
|
|
17131
17142
|
};
|
|
@@ -20051,7 +20062,7 @@ function vt(e, { instancePath: t = "", parentData: r, parentDataProperty: i, roo
|
|
|
20051
20062
|
], !1;
|
|
20052
20063
|
return vt.errors = s, n === 0;
|
|
20053
20064
|
}
|
|
20054
|
-
const
|
|
20065
|
+
const av = {
|
|
20055
20066
|
properties: {
|
|
20056
20067
|
relativeUri: {
|
|
20057
20068
|
type: "string",
|
|
@@ -20121,7 +20132,7 @@ function We(e, { instancePath: t = "", parentData: r, parentDataProperty: i, roo
|
|
|
20121
20132
|
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
20122
20133
|
const A = n;
|
|
20123
20134
|
for (const y in e)
|
|
20124
|
-
if (!ud.call(
|
|
20135
|
+
if (!ud.call(av.properties, y))
|
|
20125
20136
|
return We.errors = [
|
|
20126
20137
|
{
|
|
20127
20138
|
instancePath: t,
|
|
@@ -26762,7 +26773,7 @@ function me(e, { instancePath: t = "", parentData: r, parentDataProperty: i, roo
|
|
|
26762
26773
|
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
26763
26774
|
const C = n;
|
|
26764
26775
|
for (const E in e)
|
|
26765
|
-
if (!ud.call(
|
|
26776
|
+
if (!ud.call(tv.properties, E))
|
|
26766
26777
|
return me.errors = [
|
|
26767
26778
|
{
|
|
26768
26779
|
instancePath: t,
|
|
@@ -27232,7 +27243,7 @@ function me(e, { instancePath: t = "", parentData: r, parentDataProperty: i, roo
|
|
|
27232
27243
|
schemaPath: "#/definitions/PHPConstants/additionalProperties/type",
|
|
27233
27244
|
keyword: "type",
|
|
27234
27245
|
params: {
|
|
27235
|
-
type:
|
|
27246
|
+
type: rv.additionalProperties.type
|
|
27236
27247
|
},
|
|
27237
27248
|
message: "must be string,boolean,number"
|
|
27238
27249
|
}
|
|
@@ -27751,17 +27762,17 @@ function Vs(e, { instancePath: t = "", parentData: r, parentDataProperty: i, roo
|
|
|
27751
27762
|
rootData: a
|
|
27752
27763
|
}) || (s = s === null ? me.errors : s.concat(me.errors), n = s.length), Vs.errors = s, n === 0;
|
|
27753
27764
|
}
|
|
27754
|
-
const { wpCLI:
|
|
27765
|
+
const { wpCLI: ov, ...Ec } = ev, lv = {
|
|
27755
27766
|
...Ec,
|
|
27756
|
-
"wp-cli":
|
|
27767
|
+
"wp-cli": ov,
|
|
27757
27768
|
importFile: Ec.importWxr
|
|
27758
27769
|
};
|
|
27759
|
-
class
|
|
27770
|
+
class fv extends Error {
|
|
27760
27771
|
constructor(t, r) {
|
|
27761
27772
|
super(t), this.name = "InvalidBlueprintError", this.validationErrors = r;
|
|
27762
27773
|
}
|
|
27763
27774
|
}
|
|
27764
|
-
class
|
|
27775
|
+
class cv extends Error {
|
|
27765
27776
|
constructor(t) {
|
|
27766
27777
|
const { stepNumber: r, step: i, cause: a } = t, s = a instanceof Error ? a : new Error(String(a)), n = `Error when executing the blueprint step #${r}`, o = s.message ? `${n}: ${s.message}` : n;
|
|
27767
27778
|
super(o, { cause: s }), this.name = "BlueprintStepExecutionError", this.stepNumber = r, this.step = i, this.messages = (s.message || "").split(`
|
|
@@ -27773,20 +27784,20 @@ async function hd(e, t = {}) {
|
|
|
27773
27784
|
...t
|
|
27774
27785
|
};
|
|
27775
27786
|
let i;
|
|
27776
|
-
return md(e) ? (i = await
|
|
27787
|
+
return md(e) ? (i = await pv(e), r.streamBundledFile = function(...a) {
|
|
27777
27788
|
return e.read(...a);
|
|
27778
|
-
}) : i = e,
|
|
27789
|
+
}) : i = e, uv(i, r);
|
|
27779
27790
|
}
|
|
27780
27791
|
function md(e) {
|
|
27781
27792
|
return e && "read" in e && typeof e.read == "function";
|
|
27782
27793
|
}
|
|
27783
|
-
async function
|
|
27794
|
+
async function pv(e) {
|
|
27784
27795
|
if (!md(e))
|
|
27785
27796
|
return e;
|
|
27786
27797
|
const r = await (await e.read("blueprint.json")).text();
|
|
27787
27798
|
return JSON.parse(r);
|
|
27788
27799
|
}
|
|
27789
|
-
function
|
|
27800
|
+
function uv(e, {
|
|
27790
27801
|
progress: t = new ui(),
|
|
27791
27802
|
semaphore: r = new es({ concurrency: 3 }),
|
|
27792
27803
|
onStepCompleted: i = () => {
|
|
@@ -27801,7 +27812,7 @@ function pv(e, {
|
|
|
27801
27812
|
var y, w, b, O, k, L, $, C, E, T;
|
|
27802
27813
|
e = structuredClone(e), e = {
|
|
27803
27814
|
...e,
|
|
27804
|
-
steps: (e.steps || []).filter(
|
|
27815
|
+
steps: (e.steps || []).filter(yv).filter(gv)
|
|
27805
27816
|
}, e.steps = [...e.steps || [], ...l || []];
|
|
27806
27817
|
for (const F of e.steps)
|
|
27807
27818
|
!F || typeof F != "object" || (F.step === "importFile" ? (F.step = "importWxr", Oe.warn(
|
|
@@ -27818,7 +27829,7 @@ function pv(e, {
|
|
|
27818
27829
|
step: "setSiteOptions",
|
|
27819
27830
|
options: e.siteOptions
|
|
27820
27831
|
}), e.plugins) {
|
|
27821
|
-
const F = e.plugins.map((P) => typeof P == "string" ?
|
|
27832
|
+
const F = e.plugins.map((P) => typeof P == "string" ? vv(P) ? {
|
|
27822
27833
|
resource: "zip",
|
|
27823
27834
|
inner: {
|
|
27824
27835
|
resource: "git:directory",
|
|
@@ -27847,7 +27858,7 @@ function pv(e, {
|
|
|
27847
27858
|
if ((w = e == null ? void 0 : e.extraLibraries) != null && w.includes("wp-cli") || c !== -1) {
|
|
27848
27859
|
const F = {
|
|
27849
27860
|
step: "writeFile",
|
|
27850
|
-
data:
|
|
27861
|
+
data: $_,
|
|
27851
27862
|
path: qo
|
|
27852
27863
|
};
|
|
27853
27864
|
c === -1 ? (b = e.steps) == null || b.push(F) : (O = e.steps) == null || O.splice(
|
|
@@ -27866,10 +27877,10 @@ function pv(e, {
|
|
|
27866
27877
|
slug: "wordpress-importer"
|
|
27867
27878
|
}
|
|
27868
27879
|
}));
|
|
27869
|
-
const d =
|
|
27880
|
+
const d = hv(e);
|
|
27870
27881
|
if (!d.valid) {
|
|
27871
|
-
const { errors: F } = d, P =
|
|
27872
|
-
throw new
|
|
27882
|
+
const { errors: F } = d, P = dv(e, F);
|
|
27883
|
+
throw new fv(
|
|
27873
27884
|
`Invalid Blueprint: The Blueprint does not conform to the schema.
|
|
27874
27885
|
|
|
27875
27886
|
Found ${F.length} validation error(s):
|
|
@@ -27888,7 +27899,7 @@ Please review your Blueprint and fix these issues. Learn more about the Blueprin
|
|
|
27888
27899
|
},
|
|
27889
27900
|
0
|
|
27890
27901
|
), A = m.map(
|
|
27891
|
-
(F) =>
|
|
27902
|
+
(F) => wv(F, {
|
|
27892
27903
|
semaphore: r,
|
|
27893
27904
|
rootProgressTracker: t,
|
|
27894
27905
|
totalProgressWeight: g,
|
|
@@ -27899,7 +27910,7 @@ Please review your Blueprint and fix these issues. Learn more about the Blueprin
|
|
|
27899
27910
|
);
|
|
27900
27911
|
return {
|
|
27901
27912
|
versions: {
|
|
27902
|
-
php:
|
|
27913
|
+
php: mv(
|
|
27903
27914
|
($ = e.preferredVersions) == null ? void 0 : $.php,
|
|
27904
27915
|
uo,
|
|
27905
27916
|
Jd
|
|
@@ -27925,7 +27936,7 @@ Please review your Blueprint and fix these issues. Learn more about the Blueprin
|
|
|
27925
27936
|
i(I, N);
|
|
27926
27937
|
} catch (I) {
|
|
27927
27938
|
const U = Number(P) + 1;
|
|
27928
|
-
throw new
|
|
27939
|
+
throw new cv({
|
|
27929
27940
|
stepNumber: U,
|
|
27930
27941
|
step: N,
|
|
27931
27942
|
cause: I
|
|
@@ -27944,7 +27955,7 @@ Please review your Blueprint and fix these issues. Learn more about the Blueprin
|
|
|
27944
27955
|
}
|
|
27945
27956
|
};
|
|
27946
27957
|
}
|
|
27947
|
-
function
|
|
27958
|
+
function dv(e, t) {
|
|
27948
27959
|
return t.map((r, i) => {
|
|
27949
27960
|
var o;
|
|
27950
27961
|
const a = r.instancePath || "/";
|
|
@@ -27987,7 +27998,7 @@ function uv(e, t) {
|
|
|
27987
27998
|
|
|
27988
27999
|
`);
|
|
27989
28000
|
}
|
|
27990
|
-
function
|
|
28001
|
+
function hv(e) {
|
|
27991
28002
|
var a;
|
|
27992
28003
|
const t = Vs(e);
|
|
27993
28004
|
if (t)
|
|
@@ -28004,20 +28015,20 @@ function dv(e) {
|
|
|
28004
28015
|
)) ?? []
|
|
28005
28016
|
};
|
|
28006
28017
|
}
|
|
28007
|
-
function
|
|
28018
|
+
function mv(e, t, r) {
|
|
28008
28019
|
return (e === "7.2" || e === "7.3") && (Oe.warn(
|
|
28009
28020
|
`PHP ${e} is no longer supported. Automatically upgrading to PHP 7.4.`
|
|
28010
28021
|
), e = "7.4"), e && t.includes(e) ? e : r;
|
|
28011
28022
|
}
|
|
28012
|
-
function
|
|
28023
|
+
function yv(e) {
|
|
28013
28024
|
return !!(typeof e == "object" && e);
|
|
28014
28025
|
}
|
|
28015
|
-
function
|
|
28026
|
+
function gv(e) {
|
|
28016
28027
|
return ["setPhpIniEntry", "request"].includes(e.step) ? (Oe.warn(
|
|
28017
28028
|
`The "${e.step}" Blueprint is no longer supported and you can remove it from your Blueprint.`
|
|
28018
28029
|
), !1) : !0;
|
|
28019
28030
|
}
|
|
28020
|
-
function
|
|
28031
|
+
function wv(e, {
|
|
28021
28032
|
semaphore: t,
|
|
28022
28033
|
rootProgressTracker: r,
|
|
28023
28034
|
totalProgressWeight: i,
|
|
@@ -28041,9 +28052,9 @@ function gv(e, {
|
|
|
28041
28052
|
const c = async (A) => {
|
|
28042
28053
|
var y;
|
|
28043
28054
|
try {
|
|
28044
|
-
return o.fillSlowly(), await
|
|
28055
|
+
return o.fillSlowly(), await lv[e.step](
|
|
28045
28056
|
A,
|
|
28046
|
-
await
|
|
28057
|
+
await bv(l),
|
|
28047
28058
|
{
|
|
28048
28059
|
tracker: o,
|
|
28049
28060
|
initialCaption: (y = e.progress) == null ? void 0 : y.caption
|
|
@@ -28067,7 +28078,7 @@ function Sc(e) {
|
|
|
28067
28078
|
}
|
|
28068
28079
|
return t;
|
|
28069
28080
|
}
|
|
28070
|
-
async function
|
|
28081
|
+
async function bv(e) {
|
|
28071
28082
|
const t = {};
|
|
28072
28083
|
for (const r in e) {
|
|
28073
28084
|
const i = e[r];
|
|
@@ -28075,13 +28086,13 @@ async function wv(e) {
|
|
|
28075
28086
|
}
|
|
28076
28087
|
return t;
|
|
28077
28088
|
}
|
|
28078
|
-
async function
|
|
28089
|
+
async function _v(e, t) {
|
|
28079
28090
|
await e.run(t);
|
|
28080
28091
|
}
|
|
28081
|
-
function
|
|
28092
|
+
function vv(e) {
|
|
28082
28093
|
return !!(/^https:\/\/.+\.git\/?$/.test(e) || /^https:\/\/github\.com\/[^/]+\/[^/]+\/?$/.test(e) || /^https:\/\/gitlab\.com\/[^/]+\/[^/]+(\/[^/]+)*\/?$/.test(e));
|
|
28083
28094
|
}
|
|
28084
|
-
async function
|
|
28095
|
+
async function xv() {
|
|
28085
28096
|
const e = (
|
|
28086
28097
|
// @ts-ignore
|
|
28087
28098
|
(await import("./blueprints-pMn3V9MZ.js")).default
|
|
@@ -28090,7 +28101,7 @@ async function vv() {
|
|
|
28090
28101
|
type: "application/zip"
|
|
28091
28102
|
});
|
|
28092
28103
|
}
|
|
28093
|
-
function
|
|
28104
|
+
function kv(e) {
|
|
28094
28105
|
if (typeof e == "object" && "type" in e && ["inline-file", "file-reference"].includes(e.type))
|
|
28095
28106
|
return e;
|
|
28096
28107
|
if (!e)
|
|
@@ -28115,7 +28126,7 @@ function xv(e) {
|
|
|
28115
28126
|
};
|
|
28116
28127
|
}
|
|
28117
28128
|
}
|
|
28118
|
-
async function
|
|
28129
|
+
async function qv(e) {
|
|
28119
28130
|
var p, d;
|
|
28120
28131
|
const t = e.cliArgs || [];
|
|
28121
28132
|
for (const m of t)
|
|
@@ -28125,12 +28136,12 @@ async function Bv(e) {
|
|
|
28125
28136
|
);
|
|
28126
28137
|
t.push("--site-path=/wordpress"), t.find((m) => m.startsWith("--db-engine=")) || t.push("--db-engine=sqlite");
|
|
28127
28138
|
const i = e.php, a = (e == null ? void 0 : e.onMessage) || (() => {
|
|
28128
|
-
}), s = await
|
|
28139
|
+
}), s = await xv();
|
|
28129
28140
|
i.writeFile(
|
|
28130
28141
|
"/tmp/blueprints.phar",
|
|
28131
28142
|
new Uint8Array(await s.arrayBuffer())
|
|
28132
28143
|
);
|
|
28133
|
-
const n =
|
|
28144
|
+
const n = kv(
|
|
28134
28145
|
e.blueprint
|
|
28135
28146
|
);
|
|
28136
28147
|
let o = "";
|
|
@@ -28253,12 +28264,12 @@ require( "/tmp/blueprints.phar" );
|
|
|
28253
28264
|
]);
|
|
28254
28265
|
return c.finished.finally(l), c;
|
|
28255
28266
|
}
|
|
28256
|
-
class
|
|
28267
|
+
class Pv extends Error {
|
|
28257
28268
|
constructor(t, r, i) {
|
|
28258
28269
|
super(t, i), this.name = "BlueprintFetchError", this.url = r;
|
|
28259
28270
|
}
|
|
28260
28271
|
}
|
|
28261
|
-
async function
|
|
28272
|
+
async function Mv(e) {
|
|
28262
28273
|
let t;
|
|
28263
28274
|
try {
|
|
28264
28275
|
const r = await fetch(e, {
|
|
@@ -28268,7 +28279,7 @@ async function qv(e) {
|
|
|
28268
28279
|
throw new Error(`Failed to fetch blueprint from ${e}`);
|
|
28269
28280
|
t = await r.arrayBuffer();
|
|
28270
28281
|
} catch (r) {
|
|
28271
|
-
throw new
|
|
28282
|
+
throw new Pv(
|
|
28272
28283
|
`Blueprint file could not be resolved from ${e}: ${r instanceof Error ? r.message : String(r)}`,
|
|
28273
28284
|
e,
|
|
28274
28285
|
{ cause: r }
|
|
@@ -28285,15 +28296,15 @@ async function qv(e) {
|
|
|
28285
28296
|
})
|
|
28286
28297
|
]);
|
|
28287
28298
|
} catch (r) {
|
|
28288
|
-
if (await
|
|
28289
|
-
return
|
|
28299
|
+
if (await Tv(t))
|
|
28300
|
+
return Sv(t);
|
|
28290
28301
|
throw new Error(
|
|
28291
28302
|
`Blueprint file at ${e} is neither a valid JSON nor a ZIP file.`,
|
|
28292
28303
|
{ cause: r }
|
|
28293
28304
|
);
|
|
28294
28305
|
}
|
|
28295
28306
|
}
|
|
28296
|
-
function
|
|
28307
|
+
function Ev(e) {
|
|
28297
28308
|
const t = e.map((i) => qr(i));
|
|
28298
28309
|
if (t.some((i) => Yo(i) === "blueprint.json" && Dn(i) === ""))
|
|
28299
28310
|
return "blueprint.json";
|
|
@@ -28315,17 +28326,17 @@ function Pv(e) {
|
|
|
28315
28326
|
"ZIP does not contain a blueprint.json. Place blueprint.json at the ZIP root or inside a single top-level directory."
|
|
28316
28327
|
);
|
|
28317
28328
|
}
|
|
28318
|
-
async function
|
|
28319
|
-
const t = fi.fromArrayBuffer(e), r = await t.getAllFilePaths(), i =
|
|
28329
|
+
async function Sv(e) {
|
|
28330
|
+
const t = fi.fromArrayBuffer(e), r = await t.getAllFilePaths(), i = Ev(r), a = Dn(i);
|
|
28320
28331
|
return a === "" ? t : new Hb(a, t);
|
|
28321
28332
|
}
|
|
28322
|
-
async function
|
|
28333
|
+
async function Tv(e) {
|
|
28323
28334
|
if (e.byteLength < 4)
|
|
28324
28335
|
return !1;
|
|
28325
28336
|
const t = new Uint8Array(e, 0, 4);
|
|
28326
28337
|
return t[0] === 80 && t[1] === 75 && t[2] === 3 && t[3] === 4;
|
|
28327
28338
|
}
|
|
28328
|
-
async function
|
|
28339
|
+
async function Ov(e) {
|
|
28329
28340
|
if ((await Nn.create(e)).getVersion() === 1) {
|
|
28330
28341
|
const r = await hd(
|
|
28331
28342
|
e
|
|
@@ -28357,10 +28368,10 @@ async function Tv(e) {
|
|
|
28357
28368
|
extraLibraries: []
|
|
28358
28369
|
};
|
|
28359
28370
|
}
|
|
28360
|
-
function
|
|
28371
|
+
function Wv() {
|
|
28361
28372
|
}
|
|
28362
|
-
const
|
|
28363
|
-
class
|
|
28373
|
+
const Av = [], $v = "127.0.0.1", Rv = 4400;
|
|
28374
|
+
class Fv {
|
|
28364
28375
|
constructor(t) {
|
|
28365
28376
|
this.options = t;
|
|
28366
28377
|
}
|
|
@@ -28383,7 +28394,7 @@ class Rv {
|
|
|
28383
28394
|
t.ownerDocument.defaultView
|
|
28384
28395
|
);
|
|
28385
28396
|
await O.isConnected(), r.pipe(O);
|
|
28386
|
-
const k = await
|
|
28397
|
+
const k = await Ov(b);
|
|
28387
28398
|
if (await O.onDownloadProgress(w.loadingListener), await O.boot({
|
|
28388
28399
|
mounts: o,
|
|
28389
28400
|
sapiName: l,
|
|
@@ -28405,12 +28416,12 @@ class Rv {
|
|
|
28405
28416
|
corsProxy: s,
|
|
28406
28417
|
gitAdditionalHeadersCallback: n
|
|
28407
28418
|
});
|
|
28408
|
-
await
|
|
28419
|
+
await _v($, O);
|
|
28409
28420
|
}
|
|
28410
28421
|
return k.networking && await O.prefetchUpdateChecks(), O;
|
|
28411
28422
|
}
|
|
28412
28423
|
}
|
|
28413
|
-
class
|
|
28424
|
+
class Iv {
|
|
28414
28425
|
constructor(t) {
|
|
28415
28426
|
this.options = t;
|
|
28416
28427
|
}
|
|
@@ -28463,29 +28474,29 @@ class Fv {
|
|
|
28463
28474
|
}), await m.isReady(), p.finish(), Rc(Oe, m), a == null || a(m), m.goTo("/"), m;
|
|
28464
28475
|
}
|
|
28465
28476
|
}
|
|
28466
|
-
async function
|
|
28477
|
+
async function zv(e) {
|
|
28467
28478
|
const {
|
|
28468
28479
|
iframe: t,
|
|
28469
28480
|
progressTracker: r = new ui(),
|
|
28470
28481
|
disableProgressBar: i
|
|
28471
28482
|
} = e;
|
|
28472
28483
|
let { remoteUrl: a } = e;
|
|
28473
|
-
|
|
28484
|
+
Nv(a), Lv(t), a = Dv(a, {
|
|
28474
28485
|
progressbar: !i,
|
|
28475
28486
|
"blueprints-runner": e.experimentalBlueprintsV2Runner ? "v2" : "v1"
|
|
28476
28487
|
}), r.setCaption("Preparing WordPress"), await new Promise((o) => {
|
|
28477
28488
|
t.src = a, t.addEventListener("load", o, !1);
|
|
28478
28489
|
});
|
|
28479
|
-
const n = await (e.experimentalBlueprintsV2Runner ? new
|
|
28490
|
+
const n = await (e.experimentalBlueprintsV2Runner ? new Iv(e) : new Fv(e)).bootPlayground(t, r);
|
|
28480
28491
|
return r.finish(), n;
|
|
28481
28492
|
}
|
|
28482
|
-
function
|
|
28493
|
+
function Lv(e) {
|
|
28483
28494
|
var t, r;
|
|
28484
28495
|
(t = e.sandbox) != null && t.length && !((r = e.sandbox) != null && r.contains("allow-storage-access-by-user-activation")) && e.sandbox.add("allow-storage-access-by-user-activation");
|
|
28485
28496
|
}
|
|
28486
|
-
const yd = "https://playground.wordpress.net",
|
|
28497
|
+
const yd = "https://playground.wordpress.net", Cv = `http://${$v}:${Rv}`, Tc = [
|
|
28487
28498
|
yd,
|
|
28488
|
-
|
|
28499
|
+
Cv,
|
|
28489
28500
|
// An older origin that's still used by some plugins.
|
|
28490
28501
|
"https://wasm.wordpress.net",
|
|
28491
28502
|
// Allow hosting remote from same origin
|
|
@@ -28498,9 +28509,9 @@ const yd = "https://playground.wordpress.net", Lv = `http://${Av}:${$v}`, Tc = [
|
|
|
28498
28509
|
"http://127.0.0.1",
|
|
28499
28510
|
"http://127.0.0.1:5400",
|
|
28500
28511
|
"https://127.0.0.1",
|
|
28501
|
-
...
|
|
28512
|
+
...Av
|
|
28502
28513
|
], gd = yd;
|
|
28503
|
-
function
|
|
28514
|
+
function Nv(e) {
|
|
28504
28515
|
const t = new URL(e, gd);
|
|
28505
28516
|
if (!(Tc.includes(t.origin) && t.pathname === "/remote.html"))
|
|
28506
28517
|
throw new Error(
|
|
@@ -28511,7 +28522,7 @@ function Cv(e) {
|
|
|
28511
28522
|
)}`
|
|
28512
28523
|
);
|
|
28513
28524
|
}
|
|
28514
|
-
function
|
|
28525
|
+
function Dv(e, t) {
|
|
28515
28526
|
const r = new URL(e, gd), i = new URLSearchParams(r.search);
|
|
28516
28527
|
for (const [a, s] of Object.entries(t))
|
|
28517
28528
|
if (s != null && s !== !1)
|
|
@@ -28523,62 +28534,62 @@ function Nv(e, t) {
|
|
|
28523
28534
|
return r.search = i.toString(), r.toString();
|
|
28524
28535
|
}
|
|
28525
28536
|
export {
|
|
28526
|
-
|
|
28537
|
+
Pv as BlueprintFetchError,
|
|
28527
28538
|
Qb as BlueprintFilesystemRequiredError,
|
|
28528
28539
|
Nn as BlueprintReflection,
|
|
28529
|
-
|
|
28530
|
-
|
|
28540
|
+
cv as BlueprintStepExecutionError,
|
|
28541
|
+
fv as InvalidBlueprintError,
|
|
28531
28542
|
Jd as LatestSupportedPHPVersion,
|
|
28532
28543
|
Na as ResourceDownloadError,
|
|
28533
28544
|
uo as SupportedPHPVersions,
|
|
28534
|
-
|
|
28545
|
+
Bv as SupportedPHPVersionsList,
|
|
28535
28546
|
td as activatePlugin,
|
|
28536
28547
|
rd as activateTheme,
|
|
28537
28548
|
hd as compileBlueprint,
|
|
28538
28549
|
hd as compileBlueprintV1,
|
|
28539
|
-
|
|
28550
|
+
I_ as cp,
|
|
28540
28551
|
ld as defineSiteUrl,
|
|
28541
28552
|
Bo as defineWpConfigConsts,
|
|
28542
|
-
|
|
28543
|
-
|
|
28544
|
-
|
|
28545
|
-
|
|
28553
|
+
F_ as enableMultisite,
|
|
28554
|
+
W_ as exportWXR,
|
|
28555
|
+
pv as getBlueprintDeclaration,
|
|
28556
|
+
xv as getV2Runner,
|
|
28546
28557
|
fd as importThemeStarterContent,
|
|
28547
|
-
|
|
28548
|
-
|
|
28549
|
-
|
|
28550
|
-
|
|
28558
|
+
B_ as importWordPressFiles,
|
|
28559
|
+
j_ as importWxr,
|
|
28560
|
+
z_ as installPlugin,
|
|
28561
|
+
H_ as installTheme,
|
|
28551
28562
|
md as isBlueprintBundle,
|
|
28552
|
-
|
|
28553
|
-
|
|
28554
|
-
|
|
28555
|
-
|
|
28563
|
+
yv as isStepDefinition,
|
|
28564
|
+
V_ as login,
|
|
28565
|
+
C_ as mkdir,
|
|
28566
|
+
L_ as mv,
|
|
28556
28567
|
mt as phpVar,
|
|
28557
28568
|
dn as phpVars,
|
|
28558
28569
|
k_ as request,
|
|
28559
|
-
|
|
28560
|
-
|
|
28561
|
-
|
|
28570
|
+
Z_ as resetData,
|
|
28571
|
+
Mv as resolveRemoteBlueprint,
|
|
28572
|
+
Ov as resolveRuntimeConfiguration,
|
|
28562
28573
|
fo as rm,
|
|
28563
|
-
|
|
28564
|
-
|
|
28565
|
-
|
|
28566
|
-
|
|
28574
|
+
N_ as rmdir,
|
|
28575
|
+
_v as runBlueprintSteps,
|
|
28576
|
+
_v as runBlueprintV1Steps,
|
|
28577
|
+
qv as runBlueprintV2,
|
|
28567
28578
|
b_ as runPHP,
|
|
28568
28579
|
__ as runPHPWithOptions,
|
|
28569
28580
|
x_ as runSql,
|
|
28570
|
-
|
|
28571
|
-
|
|
28572
|
-
|
|
28573
|
-
|
|
28581
|
+
G_ as runWpInstallationWizard,
|
|
28582
|
+
Uv as setPhpIniEntries,
|
|
28583
|
+
Wv as setPluginProxyURL,
|
|
28584
|
+
Q_ as setSiteLanguage,
|
|
28574
28585
|
id as setSiteOptions,
|
|
28575
|
-
|
|
28586
|
+
zv as startPlaygroundWeb,
|
|
28576
28587
|
Wo as unzip,
|
|
28577
|
-
|
|
28578
|
-
|
|
28588
|
+
A_ as updateUserMeta,
|
|
28589
|
+
hv as validateBlueprint,
|
|
28579
28590
|
od as wpCLI,
|
|
28580
28591
|
cd as wpContentFilesExcludedFromExport,
|
|
28581
28592
|
Mo as writeFile,
|
|
28582
|
-
|
|
28583
|
-
|
|
28593
|
+
D_ as writeFiles,
|
|
28594
|
+
Y_ as zipWpContent
|
|
28584
28595
|
};
|