Skip to content

Commit

Permalink
feat: add hasVault to Metadata spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Delusoire committed Aug 20, 2024
1 parent 21375a1 commit 888cab3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface Metadata {
css?: string;
};
hasMixins: boolean;
hasVault: boolean;
dependencies: Record<string, string>;
}

Expand Down Expand Up @@ -362,7 +363,7 @@ export abstract class ModuleInstanceBase<
public metadata: Metadata | null,
public artifacts: Array<string>,
public checksum: string,
) {}
) { }

// ?
public updateMetadata(metadata: Metadata) {
Expand All @@ -374,7 +375,12 @@ export abstract class ModuleInstanceBase<

export class ModuleInstance extends ModuleInstanceBase<Module>
implements MixinLoader {
// assumes installed & enabled
public async loadProviders() {
if (!this.metadata!.hasVault) {
return;
}

const vault = await fetchJson<_Vault>(this.getRelPath("vault.json")!)
.catch(() => null);
const provider = vault?.modules ?? {};
Expand Down

0 comments on commit 888cab3

Please sign in to comment.