@tokenoftrust/storefront-runner 4.6.0 → 4.6.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/storefront-runner",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.1",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"description": "World-shareable storefront runner: multi-tenant renderer on Astro/Cloudflare. No control plane.",
|
|
6
6
|
"packageManager": "pnpm@11.9.0",
|
|
@@ -276,6 +276,10 @@ function assertFixtureTree(path) {
|
|
|
276
276
|
if (info.isDirectory()) for (const name of readdirSync(path)) assertFixtureTree(join(path, name));
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
+
export function assertPreviewBuildConfig(config) {
|
|
280
|
+
if (config.targetEnvironment !== "preview" || config.no_bundle !== true) throw fixedError("refresh_build_config_invalid");
|
|
281
|
+
}
|
|
282
|
+
|
|
279
283
|
function embedsSha(path, sha) {
|
|
280
284
|
for (const entry of readdirSync(path, { withFileTypes: true })) {
|
|
281
285
|
const file = join(path, entry.name);
|
|
@@ -373,10 +377,10 @@ export const realEffects = {
|
|
|
373
377
|
for (const [path, hash] of Object.entries(pin.files)) {
|
|
374
378
|
if (digest(execFileSync("git", ["-C", catalog, "show", `${options.catalogSha}:${path}`], { stdio: ["ignore", "pipe", "pipe"], maxBuffer: 8 * 1024 * 1024 })) !== hash) throw fixedError("refresh_contract_hash_mismatch");
|
|
375
379
|
}
|
|
376
|
-
if (prior.storefrontSha === options.storefrontSha) return {};
|
|
377
380
|
for (const rel of e2eCatalogFixtures(prior.preview)) {
|
|
378
381
|
if (existsSync(join(prior.preview, rel)) && git(prior.preview, "ls-tree", "-r", "--name-only", options.storefrontSha, "--", rel)) throw fixedError("refresh_fixture_tracked_collision");
|
|
379
382
|
}
|
|
383
|
+
if (prior.storefrontSha === options.storefrontSha) return {};
|
|
380
384
|
let checkout;
|
|
381
385
|
let catalogCheckout;
|
|
382
386
|
try {
|
|
@@ -409,7 +413,7 @@ export const realEffects = {
|
|
|
409
413
|
if (git(checkout, "rev-parse", "HEAD") !== options.storefrontSha || git(checkout, "status", "--porcelain", "--untracked-files=no")) throw fixedError("refresh_build_source_changed");
|
|
410
414
|
const config = JSON.parse(readFileSync(join(checkout, "apps/storefront/dist/server/wrangler.json"), "utf8"));
|
|
411
415
|
if (!embedsSha(join(checkout, "apps/storefront/dist/server"), options.storefrontSha)) throw fixedError("refresh_build_ref_missing");
|
|
412
|
-
|
|
416
|
+
assertPreviewBuildConfig(config);
|
|
413
417
|
const priorConfig = JSON.parse(readFileSync(join(prior.checkout, "apps/storefront/dist/server/wrangler.json"), "utf8"));
|
|
414
418
|
for (const key of ["d1_databases", "kv_namespaces", "r2_buckets", "durable_objects", "migrations"]) {
|
|
415
419
|
if (JSON.stringify(config[key] ?? null) !== JSON.stringify(priorConfig[key] ?? null)) throw fixedError("refresh_state_bindings_changed");
|