feat: add Flathub mirror support

This commit is contained in:
xixu-me committed 2026-03-14 16:23:38 +08:00
1 parent 6c7b15454d
commit 88c351a9ac
10 files changed
+474 -19

No files matched your search

+12
View File
@@ -16,6 +16,7 @@ describe('Platform Configuration', () => {
'npm',
'pypi',
'conda',
'flathub',
'homebrew'
];
@@ -134,6 +135,13 @@ describe('Platform Configuration', () => {
).toBe('/conda-forge/linux-64/repodata.json');
});
it('should transform Flathub paths correctly', () => {
expect(transformPath('/flathub/repo/summary', 'flathub')).toBe('/repo/summary');
expect(transformPath('/flathub/repo/flathub.flatpakrepo', 'flathub')).toBe(
'/repo/flathub.flatpakrepo'
);
});
it('should transform container registry paths correctly', () => {
expect(
transformPath('/cr/ghcr/v2/nginxinc/nginx-unprivileged/manifests/latest', 'cr-ghcr')
@@ -191,6 +199,10 @@ describe('Platform Configuration', () => {
expect(PLATFORMS['conda-community']).toBe('https://conda.anaconda.org');
});
it('should have correct Flathub base URL', () => {
expect(PLATFORMS.flathub).toBe('https://dl.flathub.org');
});
it('should have correct container registry base URLs', () => {
expect(PLATFORMS['cr-ghcr']).toBe('https://ghcr.io');
expect(PLATFORMS['cr-gcr']).toBe('https://gcr.io');