Handle kind property in registries

This commit is contained in:
Dave Bartolomeo 2024-10-01 14:44:46 -04:00
parent e1763c0db9
commit 6682b14bf4
3 changed files with 10 additions and 5 deletions

View file

@ -63,6 +63,9 @@ export interface RegistryConfigNoCredentials {
// List of globs that determine which packs are associated with this registry.
packages: string[] | string;
// Kind of registry, either "github" or "docker". Default is "docker".
kind?: "github" | "docker";
}
interface ExcludeQueryFilter {
@ -871,8 +874,8 @@ export function parseRegistriesWithoutCredentials(
registriesInput?: string,
): RegistryConfigNoCredentials[] | undefined {
return parseRegistries(registriesInput)?.map((r) => {
const { url, packages } = r;
return { url, packages };
const { url, packages, kind } = r;
return { url, packages, kind };
});
}
@ -1039,6 +1042,7 @@ function createRegistriesBlock(registries: RegistryConfigWithCredentials[]): {
// ensure the url ends with a slash to avoid a bug in the CLI 2.10.4
url: !registry?.url.endsWith("/") ? `${registry.url}/` : registry.url,
packages: registry.packages,
kind: registry.kind,
}));
const qlconfig = {
registries: safeRegistries,