Rocky_Mountain_Vending/.pnpm-store/v10/files/3b/4cdea4b4cff58781ca6618230523ef468b63c74018aa0a23d50b07c2307815f537280a7fcd6579c9b25024e0ebd7c5a043521114f847920bb077cec15dac34
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
9.2 KiB
Text

{"version":3,"sources":["../../../src/server/use-cache/cache-life.ts"],"sourcesContent":["import { InvariantError } from '../../shared/lib/invariant-error'\nimport { workAsyncStorage } from '../app-render/work-async-storage.external'\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\n\nexport type CacheLife = {\n // How long the client can cache a value without checking with the server.\n stale?: number\n // How frequently you want the cache to refresh on the server.\n // Stale values may be served while revalidating.\n revalidate?: number\n // In the worst case scenario, where you haven't had traffic in a while,\n // how stale can a value be until you prefer deopting to dynamic.\n // Must be longer than revalidate.\n expire?: number\n}\n// The equivalent header is kind of like:\n// Cache-Control: max-age=[stale],s-max-age=[revalidate],stale-while-revalidate=[expire-revalidate],stale-if-error=[expire-revalidate]\n// Except that stale-while-revalidate/stale-if-error only applies to shared caches - not private caches.\n\n// The default revalidates relatively frequently but doesn't expire to ensure it's always\n// able to serve fast results but by default doesn't hang.\n\n// This gets overridden by the next-types-plugin\ntype CacheLifeProfiles =\n | 'default'\n | 'seconds'\n | 'minutes'\n | 'hours'\n | 'days'\n | 'weeks'\n | 'max'\n | (string & {})\n\nfunction validateCacheLife(profile: CacheLife) {\n if (profile.stale !== undefined) {\n if ((profile.stale as any) === false) {\n throw new Error(\n 'Pass `Infinity` instead of `false` if you want to cache on the client forever ' +\n 'without checking with the server.'\n )\n } else if (typeof profile.stale !== 'number') {\n throw new Error('The stale option must be a number of seconds.')\n }\n }\n if (profile.revalidate !== undefined) {\n if ((profile.revalidate as any) === false) {\n throw new Error(\n 'Pass `Infinity` instead of `false` if you do not want to revalidate by time.'\n )\n } else if (typeof profile.revalidate !== 'number') {\n throw new Error('The revalidate option must be a number of seconds.')\n }\n }\n if (profile.expire !== undefined) {\n if ((profile.expire as any) === false) {\n throw new Error(\n 'Pass `Infinity` instead of `false` if you want to cache on the server forever ' +\n 'without checking with the origin.'\n )\n } else if (typeof profile.expire !== 'number') {\n throw new Error('The expire option must be a number of seconds.')\n }\n }\n\n if (profile.revalidate !== undefined && profile.expire !== undefined) {\n if (profile.revalidate > profile.expire) {\n throw new Error(\n 'If providing both the revalidate and expire options, ' +\n 'the expire option must be greater than the revalidate option. ' +\n 'The expire option indicates how many seconds from the start ' +\n 'until it can no longer be used.'\n )\n }\n }\n}\n\nexport function cacheLife(profile: CacheLifeProfiles | CacheLife): void {\n if (!process.env.__NEXT_USE_CACHE) {\n throw new Error(\n '`cacheLife()` is only available with the `cacheComponents` config.'\n )\n }\n\n const workUnitStore = workUnitAsyncStorage.getStore()\n\n switch (workUnitStore?.type) {\n case 'prerender':\n case 'prerender-client':\n case 'prerender-runtime':\n case 'prerender-ppr':\n case 'prerender-legacy':\n case 'request':\n case 'unstable-cache':\n case undefined:\n throw new Error(\n '`cacheLife()` can only be called inside a \"use cache\" function.'\n )\n case 'cache':\n case 'private-cache':\n break\n default:\n workUnitStore satisfies never\n }\n\n if (typeof profile === 'string') {\n const workStore = workAsyncStorage.getStore()\n if (!workStore) {\n throw new Error(\n '`cacheLife()` can only be called during App Router rendering at the moment.'\n )\n }\n if (!workStore.cacheLifeProfiles) {\n throw new InvariantError('`cacheLifeProfiles` should always be provided.')\n }\n\n // TODO: This should be globally available and not require an AsyncLocalStorage.\n const configuredProfile = workStore.cacheLifeProfiles[profile]\n if (configuredProfile === undefined) {\n if (workStore.cacheLifeProfiles[profile.trim()]) {\n throw new Error(\n `Unknown \\`cacheLife()\\` profile \"${profile}\" is not configured in next.config.js\\n` +\n `Did you mean \"${profile.trim()}\" without the spaces?`\n )\n }\n throw new Error(\n `Unknown \\`cacheLife()\\` profile \"${profile}\" is not configured in next.config.js\\n` +\n 'module.exports = {\\n' +\n ' cacheLife: {\\n' +\n ` \"${profile}\": ...\\n` +\n ' }\\n' +\n '}'\n )\n }\n profile = configuredProfile\n } else if (\n typeof profile !== 'object' ||\n profile === null ||\n Array.isArray(profile)\n ) {\n throw new Error(\n 'Invalid `cacheLife()` option. Either pass a profile name or object.'\n )\n } else {\n validateCacheLife(profile)\n }\n\n if (profile.revalidate !== undefined) {\n // Track the explicit revalidate time.\n if (\n workUnitStore.explicitRevalidate === undefined ||\n workUnitStore.explicitRevalidate > profile.revalidate\n ) {\n workUnitStore.explicitRevalidate = profile.revalidate\n }\n }\n if (profile.expire !== undefined) {\n // Track the explicit expire time.\n if (\n workUnitStore.explicitExpire === undefined ||\n workUnitStore.explicitExpire > profile.expire\n ) {\n workUnitStore.explicitExpire = profile.expire\n }\n }\n if (profile.stale !== undefined) {\n // Track the explicit stale time.\n if (\n workUnitStore.explicitStale === undefined ||\n workUnitStore.explicitStale > profile.stale\n ) {\n workUnitStore.explicitStale = profile.stale\n }\n }\n}\n"],"names":["InvariantError","workAsyncStorage","workUnitAsyncStorage","validateCacheLife","profile","stale","undefined","Error","revalidate","expire","cacheLife","process","env","__NEXT_USE_CACHE","workUnitStore","getStore","type","workStore","cacheLifeProfiles","configuredProfile","trim","Array","isArray","explicitRevalidate","explicitExpire","explicitStale"],"mappings":"AAAA,SAASA,cAAc,QAAQ,mCAAkC;AACjE,SAASC,gBAAgB,QAAQ,4CAA2C;AAC5E,SAASC,oBAAoB,QAAQ,iDAAgD;AA+BrF,SAASC,kBAAkBC,OAAkB;IAC3C,IAAIA,QAAQC,KAAK,KAAKC,WAAW;QAC/B,IAAI,AAACF,QAAQC,KAAK,KAAa,OAAO;YACpC,MAAM,qBAGL,CAHK,IAAIE,MACR,mFACE,sCAFE,qBAAA;uBAAA;4BAAA;8BAAA;YAGN;QACF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