@latticexyz/world-modules 2.0.12-main-d7526607 → 2.0.12-main-96e7bf43
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.
- package/dist/mud.config.d.ts +2 -0
- package/package.json +14 -15
- package/cache/solidity-files-cache.json +0 -1
- package/ts/scripts/tablegen.ts +0 -11
- package/ts/scripts/worldgen.ts +0 -31
package/ts/scripts/tablegen.ts
DELETED
@@ -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);
|
package/ts/scripts/worldgen.ts
DELETED
@@ -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);
|