Skip to content

Commit

Permalink
clean up namespace labels
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Aug 27, 2024
1 parent 88f5141 commit a4b3234
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions packages/world/ts/node/resolveSystems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { resolveNamespace } from "../config/v2/namespace";
import { resourceToLabel } from "@latticexyz/common";

export type ResolvedSystem = System & {
// TODO: move to config output
readonly namespaceLabel: string;
readonly sourcePath: string;
};

Expand All @@ -20,13 +18,7 @@ export async function resolveSystems({
const systemContracts = await getSystemContracts({ rootDir, config });

// validate every system in config refers to an existing system contract
const configSystems = Object.values(config.namespaces).flatMap((namespace) =>
Object.values(namespace.systems).map((system) => ({
...system,
// TODO: remove this once config outputs namespace labels of resources
namespaceLabel: namespace.label,
})),
);
const configSystems = Object.values(config.namespaces).flatMap((namespace) => Object.values(namespace.systems));
const missingSystems = configSystems.filter(
(system) => !systemContracts.some((s) => s.namespaceLabel === system.namespace && s.systemLabel === system.label),
);
Expand All @@ -48,8 +40,6 @@ export async function resolveSystems({
}).systems[contract.systemLabel];
return {
...systemConfig,
// TODO: move to config output
namespaceLabel: contract.namespaceLabel,
sourcePath: contract.sourcePath,
};
})
Expand Down

0 comments on commit a4b3234

Please sign in to comment.