Skip to content

feat: restore unmodified files from cache during cleanup #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Kitenite
Copy link

Description

This PR addresses the issue of large, noisy commits caused by unnecessary transformations of all .jsx/.tsx files. Now, during the cleanup process, any file that remains unchanged since the initial transform will be restored from its cached original.

Related Issues

Closes onlook-dev#1738

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Release
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes


Important

Restores unmodified .jsx/.tsx files from cache during cleanup by comparing file hashes, reducing unnecessary transformations.

  • Behavior:
    • During cleanup, unmodified .jsx/.tsx files are restored from cache instead of being transformed again.
    • checkIfFileChanged() in cleanup.ts compares file hashes to determine if a file has changed.
  • Caching:
    • cacheFile() and generateAndStoreHash() in setup.ts store original file content and hashes in .onlook/cache.
    • removeCacheDirectory() in files.ts deletes the cache directory during cleanup.
  • Models:
    • Adds HashesJson type in cache/index.ts to store file hashes and cache paths.
  • Misc:
    • Updates IGNORED_DIRECTORIES in helpers.ts to include .onlook.

This description was created by Ellipsis for e07a04f. You can customize this summary. It will automatically update as commits are pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] Restore unmodified files exactly on cleanup
2 participants