@wp-playground/blueprints 3.1.27 → 3.1.29
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 +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +20 -17
- package/index.js.map +1 -1
- package/lib/resolve-remote-blueprint.d.ts +5 -1
- package/package.json +11 -35
package/index.cjs
CHANGED
|
@@ -871,5 +871,5 @@ function playground_progress_reporter() {
|
|
|
871
871
|
}
|
|
872
872
|
playground_add_filter('blueprint.progress_reporter', 'playground_progress_reporter');
|
|
873
873
|
require( "/tmp/blueprints.phar" );
|
|
874
|
-
`));const h=await l.cli(["/internal/shared/bin/php","/tmp/run-blueprints.php","exec",p,...t]);return h.finished.finally(d),h}class vt extends Error{constructor(t,n,l){super(t,l),this.name="BlueprintFetchError",this.url=n}}async function Ps(r){let
|
|
874
|
+
`));const h=await l.cli(["/internal/shared/bin/php","/tmp/run-blueprints.php","exec",p,...t]);return h.finished.finally(d),h}class vt extends Error{constructor(t,n,l){super(t,l),this.name="BlueprintFetchError",this.url=n}}async function Ps(r,t={}){let n;try{const u=await(t.fetch||fetch)(r,{credentials:"omit"});if(!u.ok)throw new Error(`Failed to fetch blueprint from ${r}`);n=await u.arrayBuffer()}catch(l){throw new vt(`Blueprint file could not be resolved from ${r}: ${l instanceof Error?l.message:String(l)}`,r,{cause:l})}try{const l=new TextDecoder().decode(n);return JSON.parse(l),new be.OverlayFilesystem([new be.InMemoryFilesystem({"blueprint.json":l}),new be.FetchFilesystem({baseUrl:r,corsProxy:t.corsProxy})])}catch(l){if(await Os(n))return ks(n);throw new Error(`Blueprint file at ${r} is neither a valid JSON nor a ZIP file.`,{cause:l})}}function _s(r){const t=r.map(l=>D.normalizePath(l));if(t.some(l=>D.basename(l)==="blueprint.json"&&D.dirname(l)===""))return"blueprint.json";const n=new Set;for(const l of t){const u=l.split("/")[0];u&&u!==D.basename(l)&&u!=="__MACOSX"&&n.add(u)}if(n.size>1)throw new Error("ZIP contains multiple top-level directories. Bundle ZIPs must contain blueprint.json at the root or inside a single top-level directory.");if(n.size===1){const u=`${[...n][0]}/blueprint.json`;if(t.includes(u))return u}throw new Error("ZIP does not contain a blueprint.json. Place blueprint.json at the ZIP root or inside a single top-level directory.")}async function ks(r){const t=be.ZipFilesystem.fromArrayBuffer(r),n=await t.getAllFilePaths(),l=_s(n),u=D.dirname(l);return u===""?t:new be.ChrootFilesystem(u,t)}async function Os(r){if(r.byteLength<4)return!1;const t=new Uint8Array(r,0,4);return t[0]===80&&t[1]===75&&t[2]===3&&t[3]===4}async function Ts(r){if((await Me.create(r)).getVersion()===1){const n=await Sr(r);return{wpVersion:n.versions.wp,phpVersion:n.versions.php,intl:n.features.intl,networking:n.features.networking,extraLibraries:n.extraLibraries,constants:{}}}else return{phpVersion:vr.RecommendedPHPVersion,wpVersion:"latest",intl:!1,networking:!0,constants:{},extraLibraries:[]}}function Es(){}exports.BlueprintFetchError=vt;exports.BlueprintFilesystemRequiredError=Ir;exports.BlueprintReflection=Me;exports.BlueprintStepExecutionError=mt;exports.InvalidBlueprintError=Ar;exports.ResourceDownloadError=ar;exports.activatePlugin=_r;exports.activateTheme=kr;exports.compileBlueprint=Sr;exports.compileBlueprintV1=Sr;exports.cp=Gr;exports.defineSiteUrl=$r;exports.defineWpConfigConsts=fr;exports.enableMultisite=Yr;exports.exportWXR=st;exports.getBlueprintDeclaration=yt;exports.getV2Runner=bt;exports.importThemeStarterContent=jr;exports.importWordPressFiles=tt;exports.importWxr=rt;exports.installPlugin=ot;exports.installTheme=at;exports.isBlueprintBundle=Rr;exports.isStepDefinition=gt;exports.login=nt;exports.mkdir=Xr;exports.mv=Jr;exports.request=Hr;exports.resetData=pt;exports.resolveRemoteBlueprint=Ps;exports.resolveRuntimeConfiguration=Ts;exports.rm=pr;exports.rmdir=Kr;exports.runBlueprintSteps=wt;exports.runBlueprintV1Steps=wt;exports.runBlueprintV2=vs;exports.runPHP=Mr;exports.runPHPWithOptions=Vr;exports.runSql=zr;exports.runWpInstallationWizard=lt;exports.setPluginProxyURL=Es;exports.setSiteLanguage=ut;exports.setSiteOptions=Or;exports.unzip=dr;exports.updateUserMeta=Zr;exports.validateBlueprint=ht;exports.wpCLI=Er;exports.wpContentFilesExcludedFromExport=qr;exports.writeFile=ur;exports.writeFiles=et;exports.zipWpContent=ft;
|
|
875
875
|
//# sourceMappingURL=index.cjs.map
|