Skip to content

Add .crate and .vsix extension aliases - #26

Merged
andrew merged 1 commit into
mainfrom
crate-vsix-apk-aliases
Aug 3, 2026
Merged

Add .crate and .vsix extension aliases#26
andrew merged 1 commit into
mainfrom
crate-vsix-apk-aliases

Conversation

@andrew

@andrew andrew commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Routes .crate to the gzipped-tar reader and .vsix to the zip reader in detectFormat so they open without falling back to content sniffing.

.apk is deliberately left out of the extension switch since Android packages are zip and Alpine packages are gzipped tar; it falls through to the content-sniff path added in #20, which handles both. TestOpenRegistryArtifactExtensions pins the concrete reader type for all four cases so a regression in the sniff routing shows up.

README format list updated and now also mentions the unrecognised-extension sniff behaviour from #20.

Closes #21.

Route .crate to the gzipped-tar reader and .vsix to the zip reader in
detectFormat so they open without falling back to content sniffing.
.apk is left to the sniff fallback since Android packages are zip and
Alpine packages are gzipped tar; add tests pinning both variants and
document all three in the README.

Closes #21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes support for common package-registry artifact extensions explicit by mapping .crate and .vsix directly to the existing tar.gz and zip readers (respectively), while keeping .apk on the content-sniff path because it’s physically ambiguous (Android ZIP vs Alpine tar.gz). It also updates documentation and adds targeted tests to prevent regressions in extension routing vs sniff routing.

Changes:

  • Route .vsix to the ZIP reader and .crate to the gzipped-tar reader via detectFormat.
  • Add TestOpenRegistryArtifactExtensions to pin concrete reader types for .crate, .vsix, and both .apk variants across Open and OpenBytes.
  • Update README and package docs to list the new aliases and document the unrecognised-extension sniff fallback.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
README.md Documents .vsix, .crate, .apk handling and the unrecognised-extension content sniff behavior.
archives.go Extends detectFormat extension routing for .vsix and .crate, and clarifies .apk behavior in docs/comments.
archives_test.go Adds tests that lock in expected routing behavior and reader concrete types for registry artifact extensions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andrew
andrew merged commit 90bbcd3 into main Aug 3, 2026
6 checks passed
@andrew
andrew deleted the crate-vsix-apk-aliases branch August 3, 2026 15:35
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.

Add extension aliases for .crate, .vsix, .apk

2 participants