Astro+Directus(Visual-Editing)+Snipcart Test-Stack

This commit is contained in:
2026-06-21 06:27:52 +00:00
commit 1459e99cb0
10119 changed files with 1499318 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import path from "node:path";
import url from "node:url";
import { appendForwardSlash } from "@astrojs/internal-helpers/path";
const STATIC_HEADERS_FILE = "_experimentalHeaders.json";
function resolveClientDir(options) {
const clientURLRaw = new URL(options.client);
const serverURLRaw = new URL(options.server);
const rel = path.relative(url.fileURLToPath(serverURLRaw), url.fileURLToPath(clientURLRaw));
const serverFolder = path.basename(options.server);
let serverEntryFolderURL = path.dirname(import.meta.url);
while (!serverEntryFolderURL.endsWith(serverFolder)) {
serverEntryFolderURL = path.dirname(serverEntryFolderURL);
}
const serverEntryURL = serverEntryFolderURL + "/entry.mjs";
const clientURL = new URL(appendForwardSlash(rel), serverEntryURL);
return url.fileURLToPath(clientURL);
}
export {
STATIC_HEADERS_FILE,
resolveClientDir
};