add a way to prefer cached files over remote files#5
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new method to handle caching and asset management for packages in the
ImportMapstructure. It also adds a supporting method in thePackagestructure to retrieve asset files. These changes aim to improve the handling of package assets and their integration into the application's import structure.New functionality for caching and asset management:
CacheOrFetchmethod inimportmap.go:Added a new method to the
ImportMapstructure to check for cached and asset files for packages. If files are missing, it fetches or builds them as needed, ensuring theStructure.Importsmap is updated with the correct asset paths. This method also includes logging for better traceability.Error handling improvements in
importmap.go:Introduced the
errorspackage to provide more descriptive error messages when cache or asset directories are not set.Supporting method for asset retrieval:
Assetsmethod inlibrary/package.go:Added a new method to the
Packagestructure to list all asset files in a package's directory or retrieve a specific file. This method ensures proper error handling and returns detailed file information, including paths and types.