Skip to content

Commit 7b71854

Browse files
authored
chore: temporary typo (#15329)
1 parent b1d6211 commit 7b71854

File tree

1 file changed

+11
-11
lines changed
  • packages/vite/src/node/optimizer

1 file changed

+11
-11
lines changed

packages/vite/src/node/optimizer/index.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ export function runOptimizeDeps(
462462
const depsCacheDir = getDepsCacheDir(resolvedConfig, ssr)
463463
const processingCacheDir = getProcessingDepsCacheDir(resolvedConfig, ssr)
464464

465-
// Create a temporal directory so we don't need to delete optimized deps
465+
// Create a temporary directory so we don't need to delete optimized deps
466466
// until they have been processed. This also avoids leaving the deps cache
467467
// directory in a corrupted state if there is an error
468468
fs.mkdirSync(processingCacheDir, { recursive: true })
@@ -517,7 +517,7 @@ export function runOptimizeDeps(
517517
committed = true
518518

519519
// Write metadata file, then commit the processing folder to the global deps cache
520-
// Rewire the file paths from the temporal processing dir to the final deps cache dir
520+
// Rewire the file paths from the temporary processing dir to the final deps cache dir
521521
const dataPath = path.join(processingCacheDir, '_metadata.json')
522522
debug?.(colors.green(`creating _metadata.json in ${processingCacheDir}`))
523523
fs.writeFileSync(
@@ -526,39 +526,39 @@ export function runOptimizeDeps(
526526
)
527527

528528
// In order to minimize the time where the deps folder isn't in a consistent state,
529-
// we first rename the old depsCacheDir to a temporal path, then we rename the
529+
// we first rename the old depsCacheDir to a temporary path, then we rename the
530530
// new processing cache dir to the depsCacheDir. In systems where doing so in sync
531531
// is safe, we do an atomic operation (at least for this thread). For Windows, we
532532
// found there are cases where the rename operation may finish before it's done
533533
// so we do a graceful rename checking that the folder has been properly renamed.
534534
// We found that the rename-rename (then delete the old folder in the background)
535535
// is safer than a delete-rename operation.
536-
const temporalPath = depsCacheDir + getTempSuffix()
536+
const temporaryPath = depsCacheDir + getTempSuffix()
537537
const depsCacheDirPresent = fs.existsSync(depsCacheDir)
538538
if (isWindows) {
539539
if (depsCacheDirPresent) {
540-
debug?.(colors.green(`renaming ${depsCacheDir} to ${temporalPath}`))
541-
await safeRename(depsCacheDir, temporalPath)
540+
debug?.(colors.green(`renaming ${depsCacheDir} to ${temporaryPath}`))
541+
await safeRename(depsCacheDir, temporaryPath)
542542
}
543543
debug?.(
544544
colors.green(`renaming ${processingCacheDir} to ${depsCacheDir}`),
545545
)
546546
await safeRename(processingCacheDir, depsCacheDir)
547547
} else {
548548
if (depsCacheDirPresent) {
549-
debug?.(colors.green(`renaming ${depsCacheDir} to ${temporalPath}`))
550-
fs.renameSync(depsCacheDir, temporalPath)
549+
debug?.(colors.green(`renaming ${depsCacheDir} to ${temporaryPath}`))
550+
fs.renameSync(depsCacheDir, temporaryPath)
551551
}
552552
debug?.(
553553
colors.green(`renaming ${processingCacheDir} to ${depsCacheDir}`),
554554
)
555555
fs.renameSync(processingCacheDir, depsCacheDir)
556556
}
557557

558-
// Delete temporal path in the background
558+
// Delete temporary path in the background
559559
if (depsCacheDirPresent) {
560-
debug?.(colors.green(`removing cache temp dir ${temporalPath}`))
561-
fsp.rm(temporalPath, { recursive: true, force: true })
560+
debug?.(colors.green(`removing cache temp dir ${temporaryPath}`))
561+
fsp.rm(temporaryPath, { recursive: true, force: true })
562562
}
563563
},
564564
}

0 commit comments

Comments
 (0)