Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
1 line
No EOL
4.1 KiB
Text
1 line
No EOL
4.1 KiB
Text
{"version":3,"sources":["../../../src/server/lib/chrome-devtools-workspace.ts"],"sourcesContent":["import type { ServerResponse } from 'http'\nimport type { NextConfigComplete } from '../config-shared'\nimport type { NextUrlWithParsedQuery } from '../request-meta'\n\nimport { randomUUID } from 'crypto'\nimport * as fs from 'fs'\nimport * as path from 'path'\nimport { getStorageDirectory } from '../cache-dir'\n\n// Keep the uuid in memory as it should never change during the lifetime of the server.\nlet workspaceUUID: string | null = null\n\nexport function isChromeDevtoolsWorkspaceUrl(\n url: NextUrlWithParsedQuery\n): boolean {\n return url.pathname === '/.well-known/appspecific/com.chrome.devtools.json'\n}\n\nexport async function handleChromeDevtoolsWorkspaceRequest(\n response: ServerResponse,\n opts: { dir: string },\n config: NextConfigComplete\n): Promise<void> {\n response.setHeader('Content-Type', 'application/json')\n response.end(\n JSON.stringify(\n await getChromeDevtoolsWorkspace(opts.dir, config.distDir),\n null,\n 2\n )\n )\n}\n\n/**\n * https://developer.chrome.com/docs/devtools/workspaces#generate-json\n */\ninterface ChromeDevtoolsWorkspace {\n workspace: {\n uuid: string\n root: string\n }\n}\n\n/**\n * For https://developer.chrome.com/docs/devtools/workspaces\n */\nasync function getChromeDevtoolsWorkspace(\n root: string,\n configDistDir: string\n): Promise<ChromeDevtoolsWorkspace> {\n if (workspaceUUID === null) {\n const distDir = path.join(root, configDistDir)\n const cacheBaseDir = getStorageDirectory(distDir)\n\n if (cacheBaseDir === undefined) {\n workspaceUUID = randomUUID()\n } else {\n const cachedUUIDPath = path.join(\n cacheBaseDir,\n 'chrome-devtools-workspace-uuid'\n )\n try {\n workspaceUUID = await fs.promises.readFile(cachedUUIDPath, 'utf8')\n } catch {\n // TODO: Why does this need to be v4 and not v5?\n // With v5 we could base it off of the `distDir` and `root` which would\n // allow us to persist the workspace across .next wipes.\n workspaceUUID = randomUUID()\n\n try {\n await fs.promises.writeFile(cachedUUIDPath, workspaceUUID, 'utf8')\n } catch (cause) {\n console.warn(\n new Error(\n 'Failed to persist Chrome DevTools workspace UUID. The Chrome DevTools Workspace needs to be reconnected after the next page reload.',\n { cause }\n )\n )\n }\n }\n }\n }\n\n return {\n workspace: {\n uuid: workspaceUUID,\n root,\n },\n }\n}\n"],"names":["handleChromeDevtoolsWorkspaceRequest","isChromeDevtoolsWorkspaceUrl","workspaceUUID","url","pathname","response","opts","config","setHeader","end","JSON","stringify","getChromeDevtoolsWorkspace","dir","distDir","root","configDistDir","path","join","cacheBaseDir","getStorageDirectory","undefined","randomUUID","cachedUUIDPath","fs","promises","readFile","writeFile","cause","console","warn","Error","workspace","uuid"],"mappings":";;;;;;;;;;;;;;;IAkBsBA,oCAAoC;eAApCA;;IANNC,4BAA4B;eAA5BA;;;wBARW;4DACP;8DACE;0BACc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEpC,uFAAuF;AACvF,IAAIC,gBAA+B;AAE5B,SAASD,6BACdE,GAA2B;IAE3B,OAAOA,IAAIC,QAAQ,KAAK;AAC1B;AAEO,eAAeJ,qCACpBK,QAAwB,EACxBC,IAAqB,EACrBC,MAA0B;IAE1BF,SAASG,SAAS,CAAC,gBAAgB;IACnCH,SAASI,GAAG,CACVC,KAAKC,SAAS,CACZ,MAAMC,2BAA2BN,KAAKO,GAAG,EAAEN,OAAOO,OAAO,GACzD,MACA;AAGN;AAYA;;CAEC,GACD,eAAeF,2BACbG,IAAY,EACZC,aAAqB;IAErB,IAAId,kBAAkB,MAAM;QAC1B,MAAMY,UAAUG,MAAKC,IAAI,CAACH,MAAMC;QAChC,MAAMG,eAAeC,IAAAA,6BAAmB,EAACN;QAEzC,IAAIK,iBAAiBE,WAAW;YAC9BnB,gBAAgBoB,IAAAA,kBAAU;QAC5B,OAAO;Y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