Skip to content
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

Ignore file system meta files like .DS_Store #25

Open
svoop opened this issue Mar 19, 2024 · 1 comment
Open

Ignore file system meta files like .DS_Store #25

svoop opened this issue Mar 19, 2024 · 1 comment

Comments

@svoop
Copy link
Contributor

svoop commented Mar 19, 2024

On macOS filesystems (HFS and APFS), finder metadata is written to .DS_Store which causes loads of fun in many places. Other filesystems might have similar reserved metadata files as well, but I'm not aware of any since the only other filesystem I'm really familiar with is ext on Linux.

When building the assets on macOS, these .DS_Store directories are processed as well:

image

And as a consequence, they also show up in the assets.json manifest:

  ".DS_Store": {
    "url": "/assets/.DS_Store-49C419DE"
  },

If the assets are compiled during development and not during deployment (maybe not a common scenario, but certainly not impossible) or when deploying to such a filesystem, this finder metadata is exposed to the public. There might not be critical information in there, but .DS_Store is a black box and who knows what Apple decides to persist there in the future.

Maybe, there should be a short denylist with known files like .DS_Store which should never be processed.

@svoop
Copy link
Contributor Author

svoop commented Mar 19, 2024

I did some research on this, unfortunately, there doesn't seem to be any way to ignore certain files or directories using esbuildOptions. Maybe marking those files as external in order not to bundle them could work, but currently this mechanism is used for all assets but those in css/ and js/. This might change with #24 though.

Otherwise, the only alternative would be the removal of those .DS_Store files prior to the run. That's certainly too invasive to be built into Hanami and would have to be done hooking in some code into assets.js or even by sweeping them manually before compiling the assets.

I'll reach out to the esbuild community to see what they'd suggest.

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

No branches or pull requests

1 participant