Refactor `copyFile` operations to preserve accessed and modified timestamps by jpc-ae · Pull Request #18386 · withastro/astro · GitHub
Skip to content

Refactor copyFile operations to preserve accessed and modified timestamps - #18386

Open
jpc-ae wants to merge 11 commits into
withastro:mainfrom
jpc-ae:patch-1
Open

jpc-ae wants to merge 11 commits into
withastro:mainfrom
jpc-ae:patch-1

Conversation

@jpc-ae

@jpc-ae jpc-ae commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Refactor file system operations on cached build files to preserve accessed and modified timestamps during file copy on all systems. Previously, these timestamps would only be preserved on static builds on MacOS.

This allows for faster and leaner synchronization of cached assets (fonts, images, etc.), and is especially useful when propagating incremental builds with many cached files.

Changes

  • Preserves last access and modified timestamps when copying files whenever fs.promises.copyFile is called

Testing

All current tests pass.
Built astro package linked to local repository and used for build; cached assets now maintain their modified date.
Unsure how to build a new test for this case specifically.
Edit: test has been added confirming that built assets maintain their cached version's modified date

Docs

No changes to docs as this is purely a file system optimization

@changeset-bot

changeset-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

@github-actions github-actions Bot added the pkg: astro Related to the core `astro` package (scope) label Oct 15, 2026
@codspeed

codspeed Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant