Rocky_Mountain_Vending/.pnpm-store/v10/files/82/29ff4dfc83f3266d64e7374738ea90d7a64676c8d4d3890765c6ef129bbb1b51d15aaf1c927a9b9d276c9511a516a7a2bf5ce5b3a4dc96a8d039f57206e872
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
8.9 KiB
Text

{"version":3,"sources":["../../../src/server/typescript/utils.ts"],"sourcesContent":["import path from 'path'\n\nimport type tsModule from 'typescript/lib/tsserverlibrary'\ntype TypeScript = typeof import('typescript/lib/tsserverlibrary')\n\nlet ts: TypeScript\nlet info: tsModule.server.PluginCreateInfo\nlet appDirRegExp: RegExp\n\nexport function log(message: string) {\n info.project.projectService.logger.info('[next] ' + message)\n}\n\n// This function has to be called initially.\nexport function init(opts: {\n ts: TypeScript\n info: tsModule.server.PluginCreateInfo\n}) {\n const projectDir = opts.info.project.getCurrentDirectory()\n ts = opts.ts\n info = opts.info\n appDirRegExp = new RegExp(\n '^' + (projectDir + '(/src)?/app').replace(/[\\\\/]/g, '[\\\\/]')\n )\n\n log('Initialized Next.js TypeScript plugin: ' + projectDir)\n}\n\nexport function getTs() {\n return ts\n}\n\nexport function getInfo() {\n return info\n}\n\nexport function getTypeChecker() {\n const program = info.languageService.getProgram()\n if (!program) {\n log('Failed to get program while while running getTypeChecker.')\n return\n }\n const typeChecker = program.getTypeChecker()\n if (!typeChecker) {\n log('Failed to get type checker while running getTypeChecker.')\n return\n }\n return typeChecker\n}\n\nexport function getSource(fileName: string) {\n const program = info.languageService.getProgram()\n if (!program) {\n log('Failed to get program while running getSource for: ' + fileName)\n return\n }\n\n const sourceFile = program.getSourceFile(fileName)\n if (!sourceFile) {\n log('Failed to get source file while running getSource for: ' + fileName)\n return\n }\n\n return sourceFile\n}\n\nexport function removeStringQuotes(str: string): string {\n return str.replace(/^['\"`]|['\"`]$/g, '')\n}\n\nexport const isPositionInsideNode = (position: number, node: tsModule.Node) => {\n const start = node.getFullStart()\n return start <= position && position <= node.getFullWidth() + start\n}\n\nexport const isDefaultFunctionExport = (\n node: tsModule.Node\n): node is tsModule.FunctionDeclaration => {\n if (ts.isFunctionDeclaration(node)) {\n let hasExportKeyword = false\n let hasDefaultKeyword = false\n\n if (node.modifiers) {\n for (const modifier of node.modifiers) {\n if (modifier.kind === ts.SyntaxKind.ExportKeyword) {\n hasExportKeyword = true\n } else if (modifier.kind === ts.SyntaxKind.DefaultKeyword) {\n hasDefaultKeyword = true\n }\n }\n }\n\n // `export default function`\n if (hasExportKeyword && hasDefaultKeyword) {\n return true\n }\n }\n return false\n}\n\nexport const isInsideApp = (filePath: string) => {\n return appDirRegExp.test(filePath)\n}\nexport const isAppEntryFile = (filePath: string) => {\n return (\n appDirRegExp.test(filePath) &&\n /^(page|layout)\\.(mjs|js|jsx|ts|tsx)$/.test(path.basename(filePath))\n )\n}\nexport const isPageFile = (filePath: string) => {\n return (\n appDirRegExp.test(filePath) &&\n /^page\\.(mjs|js|jsx|ts|tsx)$/.test(path.basename(filePath))\n )\n}\n\n// Check if a module is a client entry.\nexport function getEntryInfo(\n fileName: string,\n throwOnInvalidDirective?: boolean\n) {\n const source = getSource(fileName)\n if (source) {\n let isDirective = true\n let isClientEntry = false\n let isServerEntry = false\n\n ts.forEachChild(source!, (node) => {\n if (\n ts.isExpressionStatement(node) &&\n ts.isStringLiteral(node.expression)\n ) {\n if (node.expression.text === 'use client') {\n if (isDirective) {\n isClientEntry = true\n } else {\n if (throwOnInvalidDirective) {\n const e = {\n messageText:\n 'The `\"use client\"` directive must be put at the top of the file.',\n start: node.expression.getStart(),\n length: node.expression.getWidth(),\n }\n throw e\n }\n }\n } else if (node.expression.text === 'use server') {\n if (isDirective) {\n isServerEntry = true\n } else {\n if (throwOnInvalidDirective) {\n const e = {\n messageText:\n 'The `\"use server\"` directive must be put at the top of the file.',\n start: node.expression.getStart(),\n length: node.expression.getWidth(),\n }\n throw e\n }\n }\n }\n\n if (isClientEntry && isServerEntry) {\n const e = {\n messageText:\n 'Cannot use both \"use client\" and \"use server\" directives in the same file.',\n start: node.expression.getStart(),\n length: node.expression.getWidth(),\n }\n throw e\n }\n } else {\n isDirective = false\n }\n })\n\n return { client: isClientEntry, server: isServerEntry }\n }\n\n return { client: false, server: false }\n}\n"],"names":["getEntryInfo","getInfo","getSource","getTs","getTypeChecker","init","isAppEntryFile","isDefaultFunctionExport","isInsideApp","isPageFile","isPositionInsideNode","log","removeStringQuotes","ts","info","appDirRegExp","message","project","projectService","logger","opts","projectDir","getCurrentDirectory","RegExp","replace","program","languageService","getProgram","typeChecker","fileName","sourceFile","getSourceFile","str","position","node","start","getFullStart","getFullWidth","isFunctionDeclaration","hasExportKeyword","hasDefaultKeyword","modifiers","modifier","kind","SyntaxKind","ExportKeyword","DefaultKeyword","filePath","test","path","basename","throwOnInvalidDirective","source","isDirective","isClientEntry","isServerEntry","forEachChild","isExpressionStatement","isStringLiteral","expression","text","e","messageText","getStart","length","getWidth","client","server"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IAqHgBA,YAAY;eAAZA;;IArFAC,OAAO;eAAPA;;IAkBAC,SAAS;eAATA;;IAtBAC,KAAK;eAALA;;IAQAC,cAAc;eAAdA;;IAtBAC,IAAI;eAAJA;;IAyFHC,cAAc;eAAdA;;IA5BAC,uBAAuB;eAAvBA;;IAyBAC,WAAW;eAAXA;;IASAC,UAAU;eAAVA;;IAvCAC,oBAAoB;eAApBA;;IA7DGC,GAAG;eAAHA;;IAyDAC,kBAAkB;eAAlBA;;;6DAlEC;;;;;;AAKjB,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AAEG,SAASJ,IAAIK,OAAe;IACjCF,KAAKG,OAAO,CAACC,cAAc,CAACC,MAAM,CAACL,IAAI,CAAC,YAAYE;AACtD;AAGO,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