@latticexyz/world-modules 2.0.12-account-kit-27d878b7 → 2.0.12-account-kit-9160f5e1a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +0,0 @@
1
- import path from "path";
2
- import { loadConfig } from "@latticexyz/config/node";
3
- import { getRemappings, getSrcDirectory } from "@latticexyz/common/foundry";
4
- import { Store as StoreConfig } from "@latticexyz/store";
5
- import { tablegen } from "@latticexyz/store/codegen";
6
-
7
- const config = (await loadConfig()) as StoreConfig;
8
- const srcDir = await getSrcDirectory();
9
- const remappings = await getRemappings();
10
-
11
- await tablegen(config, path.join(srcDir, config.codegen.outputDirectory), remappings);
@@ -1,31 +0,0 @@
1
- import glob from "glob";
2
- import path, { basename } from "path";
3
- import { rmSync } from "fs";
4
- import { loadConfig } from "@latticexyz/config/node";
5
- import { getSrcDirectory } from "@latticexyz/common/foundry";
6
- import { World as WorldConfig } from "@latticexyz/world";
7
- import { worldgen } from "@latticexyz/world/node";
8
-
9
- // TODO dedupe this and cli's worldgen command
10
- const configPath = undefined;
11
- const clean = false;
12
- const srcDir = await getSrcDirectory();
13
-
14
- // Get a list of all contract names
15
- const existingContracts = glob.sync(`${srcDir}/**/*.sol`).map((path) => ({
16
- path,
17
- basename: basename(path, ".sol"),
18
- }));
19
-
20
- // Load and resolve the config
21
- const mudConfig = (await loadConfig(configPath)) as WorldConfig;
22
-
23
- const outputBaseDirectory = path.join(srcDir, mudConfig.codegen.outputDirectory);
24
-
25
- // clear the worldgen directory
26
- if (clean) {
27
- rmSync(path.join(outputBaseDirectory, mudConfig.codegen.worldgenDirectory), { recursive: true, force: true });
28
- }
29
-
30
- // generate new interfaces
31
- await worldgen(mudConfig, existingContracts, outputBaseDirectory);