@@ -462,7 +462,7 @@ export function runOptimizeDeps(
|
462 | 462 | const depsCacheDir = getDepsCacheDir(resolvedConfig, ssr)
|
463 | 463 | const processingCacheDir = getProcessingDepsCacheDir(resolvedConfig, ssr)
|
464 | 464 |
|
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 |
466 | 466 | // until they have been processed. This also avoids leaving the deps cache
|
467 | 467 | // directory in a corrupted state if there is an error
|
468 | 468 | fs.mkdirSync(processingCacheDir, { recursive: true })
|
@@ -517,7 +517,7 @@ export function runOptimizeDeps(
|
517 | 517 | committed = true
|
518 | 518 |
|
519 | 519 | // 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 |
521 | 521 | const dataPath = path.join(processingCacheDir, '_metadata.json')
|
522 | 522 | debug?.(colors.green(`creating _metadata.json in ${processingCacheDir}`))
|
523 | 523 | fs.writeFileSync(
|
@@ -526,39 +526,39 @@ export function runOptimizeDeps(
|
526 | 526 | )
|
527 | 527 |
|
528 | 528 | // 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 |
530 | 530 | // new processing cache dir to the depsCacheDir. In systems where doing so in sync
|
531 | 531 | // is safe, we do an atomic operation (at least for this thread). For Windows, we
|
532 | 532 | // found there are cases where the rename operation may finish before it's done
|
533 | 533 | // so we do a graceful rename checking that the folder has been properly renamed.
|
534 | 534 | // We found that the rename-rename (then delete the old folder in the background)
|
535 | 535 | // is safer than a delete-rename operation.
|
536 |
| -const temporalPath = depsCacheDir + getTempSuffix() |
| 536 | +const temporaryPath = depsCacheDir + getTempSuffix() |
537 | 537 | const depsCacheDirPresent = fs.existsSync(depsCacheDir)
|
538 | 538 | if (isWindows) {
|
539 | 539 | 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) |
542 | 542 | }
|
543 | 543 | debug?.(
|
544 | 544 | colors.green(`renaming ${processingCacheDir} to ${depsCacheDir}`),
|
545 | 545 | )
|
546 | 546 | await safeRename(processingCacheDir, depsCacheDir)
|
547 | 547 | } else {
|
548 | 548 | 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) |
551 | 551 | }
|
552 | 552 | debug?.(
|
553 | 553 | colors.green(`renaming ${processingCacheDir} to ${depsCacheDir}`),
|
554 | 554 | )
|
555 | 555 | fs.renameSync(processingCacheDir, depsCacheDir)
|
556 | 556 | }
|
557 | 557 |
|
558 |
| -// Delete temporal path in the background |
| 558 | +// Delete temporary path in the background |
559 | 559 | 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 }) |
562 | 562 | }
|
563 | 563 | },
|
564 | 564 | }
|
|
0 commit comments