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
5.1 KiB
Text
1 line
No EOL
5.1 KiB
Text
{"version":3,"sources":["../../../src/lib/fs/rename.ts"],"sourcesContent":["/*\nMIT License\n\nCopyright (c) 2015 - present Microsoft Corporation\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n */\n\n// This file is based on https://github.com/microsoft/vscode/blob/f860fcf11022f10a992440fd54c6e45674e39617/src/vs/base/node/pfs.ts\n// See the LICENSE at the top of the file\n\nimport { renameSync as fsRenameSync, statSync } from 'node:fs'\n\n/**\n * A drop-in replacement for `fs.rename` that:\n * - allows to move across multiple disks\n * - attempts to retry the operation for certain error codes on Windows\n */\nexport function renameSync(\n source: string,\n target: string,\n windowsRetryTimeout: number | false = 60000 /* matches graceful-fs */\n): void {\n if (source === target) {\n return // simulate node.js behaviour here and do a no-op if paths match\n }\n\n if (process.platform === 'win32' && typeof windowsRetryTimeout === 'number') {\n // On Windows, a rename can fail when either source or target\n // is locked by AV software. We do leverage graceful-fs to iron\n // out these issues, however in case the target file exists,\n // graceful-fs will immediately return without retry for fs.rename().\n renameSyncWithRetry(source, target, Date.now(), windowsRetryTimeout)\n } else {\n fsRenameSync(source, target)\n }\n}\n\nfunction renameSyncWithRetry(\n source: string,\n target: string,\n startTime: number,\n retryTimeout: number,\n attempt = 0\n): void {\n try {\n return fsRenameSync(source, target)\n } catch (error: any) {\n if (\n error.code !== 'EACCES' &&\n error.code !== 'EPERM' &&\n error.code !== 'EBUSY'\n ) {\n throw error // only for errors we think are temporary\n }\n\n if (Date.now() - startTime >= retryTimeout) {\n console.error(\n `Node.js fs rename failed after ${attempt} retries with error: ${error}`\n )\n\n throw error // give up after configurable timeout\n }\n\n if (attempt > 100) {\n console.error(\n `Node.js fs rename failed after ${attempt} retries with error ${error}`\n )\n throw error\n }\n\n if (attempt === 0) {\n let abortRetry = false\n try {\n const statTarget = statSync(target)\n if (!statTarget.isFile()) {\n abortRetry = true // if target is not a file, EPERM error may be raised and we should not attempt to retry\n }\n } catch (e) {\n // Ignore\n }\n\n if (abortRetry) {\n throw error\n }\n }\n\n // Attempt again\n return renameSyncWithRetry(\n source,\n target,\n startTime,\n retryTimeout,\n attempt + 1\n )\n }\n}\n"],"names":["renameSync","fsRenameSync","statSync","source","target","windowsRetryTimeout","process","platform","renameSyncWithRetry","Date","now","startTime","retryTimeout","attempt","error","code","console","abortRetry","statTarget","isFile","e"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;CAsBC,GAED,kIAAkI;AAClI,yCAAyC;AAEzC,SAASA,cAAcC,YAAY,EAAEC,QAAQ,QAAQ,UAAS;AAE9D;;;;CAIC,GACD,OAAO,SAASF,WACdG,MAAc,EACdC,MAAc,EACdC,sBAAsC,MAAM,uBAAuB,GAAxB;IAE3C,IAAIF,WAAWC,QAAQ;QACrB,QAAO,gEAAgE;IACzE;IAEA,IAAIE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