Rocky_Mountain_Vending/.pnpm-store/v10/files/95/cf1db624c82b0081a872d03c675c2e8507610b2ee4d0fd507de915dc45012546c8cdb06d7fbf168386a9935dd982e1a5879529f449bbe14edaf72a556ffe3a
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
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>
2026-02-12 16:22:15 -07:00

1 line
No EOL
6.6 KiB
Text

{"version":3,"sources":["../../src/lib/verify-root-layout.ts"],"sourcesContent":["import path from 'path'\nimport * as Log from '../build/output/log'\nimport { promises as fs } from 'fs'\nimport { bold } from './picocolors'\nimport { APP_DIR_ALIAS } from './constants'\nimport type { PageExtensions } from '../build/page-extensions-type'\n\nconst globOrig =\n require('next/dist/compiled/glob') as typeof import('next/dist/compiled/glob')\nconst glob = (cwd: string, pattern: string): Promise<string[]> => {\n return new Promise((resolve, reject) => {\n globOrig(pattern, { cwd }, (err, files) => {\n if (err) {\n return reject(err)\n }\n resolve(files)\n })\n })\n}\n\nfunction getRootLayout(isTs: boolean) {\n if (isTs) {\n return `export const metadata = {\n title: 'Next.js',\n description: 'Generated by Next.js',\n}\n\nexport default function RootLayout({\n children,\n}: {\n children: React.ReactNode\n}) {\n return (\n <html lang=\"en\">\n <body>{children}</body>\n </html>\n )\n}\n`\n }\n\n return `export const metadata = {\n title: 'Next.js',\n description: 'Generated by Next.js',\n}\n\nexport default function RootLayout({ children }) {\n return (\n <html lang=\"en\">\n <body>{children}</body>\n </html>\n )\n}\n`\n}\n\nexport async function verifyRootLayout({\n dir,\n appDir,\n tsconfigPath,\n pagePath,\n pageExtensions,\n}: {\n dir: string\n appDir: string\n tsconfigPath: string | undefined\n pagePath: string\n pageExtensions: PageExtensions\n}): Promise<[boolean, string | undefined]> {\n let rootLayoutPath: string | undefined\n try {\n const layoutFiles = await glob(\n appDir,\n `**/layout.{${pageExtensions.join(',')}}`\n )\n const isFileUnderAppDir = pagePath.startsWith(`${APP_DIR_ALIAS}/`)\n const normalizedPagePath = pagePath.replace(`${APP_DIR_ALIAS}/`, '')\n const pagePathSegments = normalizedPagePath.split('/')\n\n // Find an available dir to place the layout file in, the layout file can't affect any other layout.\n // Place the layout as close to app/ as possible.\n let availableDir: string | undefined\n\n if (isFileUnderAppDir) {\n if (layoutFiles.length === 0) {\n // If there's no other layout file we can place the layout file in the app dir.\n // However, if the page is within a route group directly under app (e.g. app/(routegroup)/page.js)\n // prefer creating the root layout in that route group.\n const firstSegmentValue = pagePathSegments[0]\n availableDir = firstSegmentValue.startsWith('(')\n ? firstSegmentValue\n : ''\n } else {\n pagePathSegments.pop() // remove the page from segments\n\n let currentSegments: string[] = []\n for (const segment of pagePathSegments) {\n currentSegments.push(segment)\n // Find the dir closest to app/ where a layout can be created without affecting other layouts.\n if (\n !layoutFiles.some((file) =>\n file.startsWith(currentSegments.join('/'))\n )\n ) {\n availableDir = currentSegments.join('/')\n break\n }\n }\n }\n } else {\n availableDir = ''\n }\n\n if (typeof availableDir === 'string') {\n const tsConfigFileName = tsconfigPath || 'tsconfig.json'\n const resolvedTsConfigPath = path.join(dir, tsConfigFileName)\n const hasTsConfig = await fs.access(resolvedTsConfigPath).then(\n () => true,\n () => false\n )\n\n rootLayoutPath = path.join(\n appDir,\n availableDir,\n `layout.${hasTsConfig ? 'tsx' : 'js'}`\n )\n await fs.writeFile(rootLayoutPath, getRootLayout(hasTsConfig))\n\n Log.warn(\n `Your page ${bold(\n `app/${normalizedPagePath}`\n )} did not have a root layout. We created ${bold(\n `app${rootLayoutPath.replace(appDir, '')}`\n )} for you.`\n )\n\n // Created root layout\n return [true, rootLayoutPath]\n }\n } catch (e) {\n console.error(e)\n }\n\n // Didn't create root layout\n return [false, rootLayoutPath]\n}\n"],"names":["path","Log","promises","fs","bold","APP_DIR_ALIAS","globOrig","require","glob","cwd","pattern","Promise","resolve","reject","err","files","getRootLayout","isTs","verifyRootLayout","dir","appDir","tsconfigPath","pagePath","pageExtensions","rootLayoutPath","layoutFiles","join","isFileUnderAppDir","startsWith","normalizedPagePath","replace","pagePathSegments","split","availableDir","length","firstSegmentValue","pop","currentSegments","segment","push","some","file","tsConfigFileName","resolvedTsConfigPath","hasTsConfig","access","then","writeFile","warn","e","console","error"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AACvB,YAAYC,SAAS,sBAAqB;AAC1C,SAASC,YAAYC,EAAE,QAAQ,KAAI;AACnC,SAASC,IAAI,QAAQ,eAAc;AACnC,SAASC,aAAa,QAAQ,cAAa;AAG3C,MAAMC,WACJC,QAAQ;AACV,MAAMC,OAAO,CAACC,KAAaC;IACzB,OAAO,IAAIC,QAAQ,CAACC,SAASC;QAC3BP,SAASI,SAAS;YAAED;QAAI,GAAG,CAACK,KAAKC;YAC/B,IAAID,KAAK;gBACP,OAAOD,OAAOC;YAChB;YACAF,QAAQG;QACV;IACF;AACF;AAEA,SAASC,cAAcC,IAAa;IAClC,IAAIA,MAAM;QACR,OAAO,CAAC;;;;;;;;;;;;;;;;AAgBZ,CAAC;IACC;IAEA,OAAO,CAAC;;;;;;;;;;;;AAYV,CAAC;AACD;AAEA,OAAO,eAAeC,iBAAiB,EACrCC,GAAG,EACHC,MAAM,EACNC,YAAY,EACZC,QAAQ,EACRC,cAAc,EAOf;IACC,IAAIC;IACJ,IAAI;QACF,MAAMC,cAAc,MAAMjB,KACxBY,QACA,CAAC,WAAW,EAAEG,eAAeG,IAAI,CAAC,KAAK,CAAC,CAAC;QAE3C,MAAMC,oBAAoBL,SAASM,UAAU,CAAC,GAAGvB,cAAc,CAAC,CAAC;QACjE,MAAMwB,qBAAqBP,SAASQ,OAAO,CAAC,GAAGzB,cAAc,CAAC,CAAC,EAAE;QACjE,MAAM0B,mBAAmBF,mBAAmBG,KAAK,CAAC;QAElD,oGAAoG;QACpG,iDAAiD;QACjD,IAAIC;QAEJ,IAAIN,mBAAmB;YACrB,IAAI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