@wp-playground/blueprints 3.1.28 → 3.1.30
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 -36
package/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { getV2Runner } from './lib/v2/get-v2-runner';
|
|
|
12
12
|
export { runBlueprintV2 } from './lib/v2/run-blueprint-v2';
|
|
13
13
|
export type { BlueprintMessage } from './lib/v2/run-blueprint-v2';
|
|
14
14
|
export { resolveRemoteBlueprint, BlueprintFetchError, } from './lib/resolve-remote-blueprint';
|
|
15
|
+
export type { ResolveRemoteBlueprintOptions } from './lib/resolve-remote-blueprint';
|
|
15
16
|
export { wpContentFilesExcludedFromExport } from './lib/utils/wp-content-files-excluded-from-exports';
|
|
16
17
|
export { resolveRuntimeConfiguration } from './lib/resolve-runtime-configuration';
|
|
17
18
|
/**
|
package/index.js
CHANGED
|
@@ -13810,44 +13810,47 @@ class Ms extends Error {
|
|
|
13810
13810
|
super(t, l), this.name = "BlueprintFetchError", this.url = n;
|
|
13811
13811
|
}
|
|
13812
13812
|
}
|
|
13813
|
-
async function ii(r) {
|
|
13814
|
-
let
|
|
13813
|
+
async function ii(r, t = {}) {
|
|
13814
|
+
let n;
|
|
13815
13815
|
try {
|
|
13816
|
-
const
|
|
13816
|
+
const u = await (t.fetch || fetch)(r, {
|
|
13817
13817
|
credentials: "omit"
|
|
13818
13818
|
});
|
|
13819
|
-
if (!
|
|
13819
|
+
if (!u.ok)
|
|
13820
13820
|
throw new Error(`Failed to fetch blueprint from ${r}`);
|
|
13821
|
-
|
|
13822
|
-
} catch (
|
|
13821
|
+
n = await u.arrayBuffer();
|
|
13822
|
+
} catch (l) {
|
|
13823
13823
|
throw new Ms(
|
|
13824
|
-
`Blueprint file could not be resolved from ${r}: ${
|
|
13824
|
+
`Blueprint file could not be resolved from ${r}: ${l instanceof Error ? l.message : String(l)}`,
|
|
13825
13825
|
r,
|
|
13826
|
-
{ cause:
|
|
13826
|
+
{ cause: l }
|
|
13827
13827
|
);
|
|
13828
13828
|
}
|
|
13829
13829
|
try {
|
|
13830
|
-
const
|
|
13831
|
-
return JSON.parse(
|
|
13830
|
+
const l = new TextDecoder().decode(n);
|
|
13831
|
+
return JSON.parse(l), new at([
|
|
13832
13832
|
new nt({
|
|
13833
|
-
"blueprint.json":
|
|
13833
|
+
"blueprint.json": l
|
|
13834
13834
|
}),
|
|
13835
13835
|
new pt({
|
|
13836
|
-
baseUrl: r
|
|
13836
|
+
baseUrl: r,
|
|
13837
|
+
corsProxy: t.corsProxy
|
|
13837
13838
|
})
|
|
13838
13839
|
]);
|
|
13839
|
-
} catch (
|
|
13840
|
-
if (await Hs(
|
|
13841
|
-
return zs(
|
|
13840
|
+
} catch (l) {
|
|
13841
|
+
if (await Hs(n))
|
|
13842
|
+
return zs(n);
|
|
13842
13843
|
throw new Error(
|
|
13843
13844
|
`Blueprint file at ${r} is neither a valid JSON nor a ZIP file.`,
|
|
13844
|
-
{ cause:
|
|
13845
|
+
{ cause: l }
|
|
13845
13846
|
);
|
|
13846
13847
|
}
|
|
13847
13848
|
}
|
|
13848
13849
|
function Vs(r) {
|
|
13849
13850
|
const t = r.map((l) => Xr(l));
|
|
13850
|
-
if (t.some(
|
|
13851
|
+
if (t.some(
|
|
13852
|
+
(l) => Or(l) === "blueprint.json" && hr(l) === ""
|
|
13853
|
+
))
|
|
13851
13854
|
return "blueprint.json";
|
|
13852
13855
|
const n = /* @__PURE__ */ new Set();
|
|
13853
13856
|
for (const l of t) {
|