Skip to content

Conversation

donseba
Copy link
Owner

@donseba donseba commented Jun 17, 2025

This pull request introduces enhancements to file processing in the importmap and library/package modules, including support for recursive directory traversal and improved handling of CSS and JS files. The changes aim to make the code more robust and extend its functionality for managing assets.

Enhancements to file processing:

  • Support for recursive directory traversal:

    • Introduced a helper function, getFilesRecursively, in library/package.go to scan directories and their subdirectories for files, enabling recursive asset discovery. This replaces the previous approach of skipping directories.
    • Updated the logic in Assets to use getFilesRecursively, improving modularity and readability.
  • Improved handling of asset paths and file types:

    • Adjusted the LocalPath attribute in the File struct to use currentRelativePath, ensuring accurate relative paths for assets.
    • Enhanced the CacheOrFetch function in importmap.go to differentiate between CSS and JS files, storing them in separate structures (Styles and Imports, respectively).

@donseba donseba merged commit c134a3b into main Jun 18, 2025
1 check passed
@donseba donseba deleted the resolve-nested-assets-on-load branch June 18, 2025 08:57
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.

1 participant