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
7.3 KiB
Text
1 line
No EOL
7.3 KiB
Text
{"version":3,"sources":["../../../src/lib/typescript/runTypeCheck.ts"],"sourcesContent":["import path from 'path'\nimport { getFormattedDiagnostic } from './diagnosticFormatter'\nimport { getTypeScriptConfiguration } from './getTypeScriptConfiguration'\nimport { getRequiredConfiguration } from './writeConfigurationDefaults'\n\nimport { CompileError } from '../compile-error'\nimport { warn } from '../../build/output/log'\n\nexport interface TypeCheckResult {\n hasWarnings: boolean\n warnings?: string[]\n inputFilesCount: number\n totalFilesCount: number\n incremental: boolean\n}\n\nexport async function runTypeCheck(\n typescript: typeof import('typescript'),\n baseDir: string,\n distDir: string,\n tsConfigPath: string,\n cacheDir?: string,\n isAppDirEnabled?: boolean\n): Promise<TypeCheckResult> {\n const effectiveConfiguration = await getTypeScriptConfiguration(\n typescript,\n tsConfigPath\n )\n\n if (effectiveConfiguration.fileNames.length < 1) {\n return {\n hasWarnings: false,\n inputFilesCount: 0,\n totalFilesCount: 0,\n incremental: false,\n }\n }\n const requiredConfig = getRequiredConfiguration(typescript)\n\n const options = {\n ...requiredConfig,\n ...effectiveConfiguration.options,\n declarationMap: false,\n emitDeclarationOnly: false,\n noEmit: true,\n }\n\n let program:\n | import('typescript').Program\n | import('typescript').BuilderProgram\n let incremental = false\n if ((options.incremental || options.composite) && cacheDir) {\n if (options.composite) {\n warn(\n 'TypeScript project references are not fully supported. Attempting to build in incremental mode.'\n )\n }\n incremental = true\n program = typescript.createIncrementalProgram({\n rootNames: effectiveConfiguration.fileNames,\n options: {\n ...options,\n composite: false,\n incremental: true,\n tsBuildInfoFile: path.join(cacheDir, '.tsbuildinfo'),\n },\n })\n } else {\n program = typescript.createProgram(\n effectiveConfiguration.fileNames,\n options\n )\n }\n\n const result = program.emit()\n\n const ignoreRegex = [\n // matches **/__(tests|mocks)__/**\n /[\\\\/]__(?:tests|mocks)__[\\\\/]/,\n // matches **/*.(spec|test).*\n /(?<=[\\\\/.])(?:spec|test)\\.[^\\\\/]+$/,\n ]\n const regexIgnoredFile = new RegExp(\n ignoreRegex.map((r) => r.source).join('|')\n )\n\n const allDiagnostics = typescript\n .getPreEmitDiagnostics(program as import('typescript').Program)\n .concat(result.diagnostics)\n .filter((d) => !(d.file && regexIgnoredFile.test(d.file.fileName)))\n\n const firstError =\n allDiagnostics.find(\n (d) =>\n d.category === typescript.DiagnosticCategory.Error && Boolean(d.file)\n ) ??\n allDiagnostics.find(\n (d) => d.category === typescript.DiagnosticCategory.Error\n )\n\n // In test mode, we want to check all diagnostics, not just the first one.\n if (process.env.__NEXT_TEST_MODE) {\n if (firstError) {\n const allErrors = allDiagnostics\n .filter((d) => d.category === typescript.DiagnosticCategory.Error)\n .map(\n (d) =>\n '[Test Mode] ' +\n getFormattedDiagnostic(\n typescript,\n baseDir,\n distDir,\n d,\n isAppDirEnabled\n )\n )\n\n console.error(\n '\\n\\n===== TS errors =====\\n\\n' +\n allErrors.join('\\n\\n') +\n '\\n\\n===== TS errors =====\\n\\n'\n )\n\n // Make sure all stdout is flushed before we exit.\n await new Promise((resolve) => setTimeout(resolve, 100))\n }\n }\n\n if (firstError) {\n throw new CompileError(\n getFormattedDiagnostic(\n typescript,\n baseDir,\n distDir,\n firstError,\n isAppDirEnabled\n )\n )\n }\n\n const warnings = allDiagnostics\n .filter((d) => d.category === typescript.DiagnosticCategory.Warning)\n .map((d) =>\n getFormattedDiagnostic(typescript, baseDir, distDir, d, isAppDirEnabled)\n )\n\n return {\n hasWarnings: true,\n warnings,\n inputFilesCount: effectiveConfiguration.fileNames.length,\n totalFilesCount: program.getSourceFiles().length,\n incremental,\n }\n}\n"],"names":["runTypeCheck","typescript","baseDir","distDir","tsConfigPath","cacheDir","isAppDirEnabled","effectiveConfiguration","getTypeScriptConfiguration","fileNames","length","hasWarnings","inputFilesCount","totalFilesCount","incremental","requiredConfig","getRequiredConfiguration","options","declarationMap","emitDeclarationOnly","noEmit","program","composite","warn","createIncrementalProgram","rootNames","tsBuildInfoFile","path","join","createProgram","result","emit","ignoreRegex","regexIgnoredFile","RegExp","map","r","source","allDiagnostics","getPreEmitDiagnostics","concat","diagnostics","filter","d","file","test","fileName","firstError","find","category","DiagnosticCategory","Error","Boolean","process","env","__NEXT_TEST_MODE","allErrors","getFormattedDiagnostic","console","error","Promise","resolve","setTimeout","CompileError","warnings","Warning","getSourceFiles"],"mappings":";;;;+BAgBsBA;;;eAAAA;;;6DAhBL;qCACsB;4CACI;4CACF;8BAEZ;qBACR;;;;;;AAUd,eAAeA,aACpBC,UAAuC,EACvCC,OAAe,EACfC,OAAe,EACfC,YAAoB,EACpBC,QAAiB,EACjBC,eAAyB;IAEzB,MAAMC,yBAAyB,MAAMC,IAAAA,sDAA0B,EAC7DP,YACAG;IAGF,IAAIG,uBAAuBE,SAAS,CAACC,MAAM,GAAG,GAAG;QAC/C,OAAO;YACLC,aAAa;YACbC,iBAAiB;YACjBC,iBAAiB;YACjBC,aAAa;QACf;IACF;IACA,MAAMC,iBAAiBC,IAAAA,oDAAwB,EAACf;IAEhD,MAAMgB,UAAU;QACd,GAAGF,cAAc;QACjB,GAAGR,uBAAuBU,OAAO;QACjCC,gBAAgB;QAChBC,qBAAqB;QACrBC,QAAQ;IACV;IAEA,IAAIC;IAGJ,IAAIP,cAAc;IAClB,IAAI,AAACG,CAAAA,QAAQH,WAAW,IAAIG,QAAQK,SAAS,AAAD,KAAMjB,UAAU;QAC1D,IAAIY,QAAQK,SAAS,EAAE;YACrBC,IAAAA,SAAI,EACF;QAEJ;QACAT,cAAc;QACdO,UAAUpB,WAAWuB,wBAAwB,CAAC;YAC5CC,WAAWlB,uBAAuBE,SAAS;YAC3CQ,SAAS;gBACP,GAAGA,OAAO;gBACVK,WAAW;gBACXR,aAAa;gBACbY,iBAAiBC,aAAI,CAACC,IAAI,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