@latticexyz/cli 2.0.0-alpha.0 → 2.0.0-alpha.2
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/chunk-6V563IAZ.js +283 -0
- package/dist/{chunk-ATAWDHWC.js → chunk-FPG73MVN.js} +5 -1
- package/dist/{chunk-O6HOO6WA.js → chunk-L4YLJHLJ.js} +1 -9
- package/dist/{chunk-J4DJQNIC.js → chunk-SKNB74MT.js} +129 -568
- package/dist/chunk-VQTZJIFF.js +353 -0
- package/dist/chunk-WZFXLDPK.js +761 -0
- package/dist/chunk-YL4GJLLL.js +26139 -0
- package/dist/chunk-ZSZDPSLH.js +3841 -0
- package/dist/index.d.ts +2 -3
- package/dist/index.js +0 -21
- package/dist/mud.d.ts +1 -1
- package/dist/mud.js +326 -4452
- package/dist/mud2.d.ts +1 -0
- package/dist/mud2.js +25 -0
- package/dist/render-solidity/index.d.ts +171 -0
- package/dist/render-solidity/index.js +49 -0
- package/dist/render-ts/index.d.ts +26 -0
- package/dist/render-ts/index.js +14 -0
- package/dist/utils/deprecated/index.js +3 -3
- package/dist/utils/index.d.ts +13 -18
- package/dist/utils/index.js +14 -16
- package/package.json +20 -21
- package/src/commands/deploy-v2.ts +80 -64
- package/src/commands/deprecated/index.ts +22 -0
- package/src/commands/deprecated/test.ts +1 -1
- package/src/commands/gas-report.ts +54 -55
- package/src/commands/index.ts +6 -17
- package/src/commands/set-version.ts +172 -0
- package/src/commands/tablegen.ts +5 -5
- package/src/commands/test-v2.ts +71 -0
- package/src/commands/tsgen.ts +33 -0
- package/src/commands/worldgen.ts +5 -4
- package/src/contracts/BulkUpload.sol +13 -20
- package/src/contracts/Deploy.sol +3 -3
- package/src/contracts/LibDeploy.sol +1 -1
- package/src/contracts/LibDeployStub.sol +1 -1
- package/src/index.ts +1 -15
- package/src/mud.ts +4 -3
- package/src/mud2.ts +29 -0
- package/src/render-solidity/common.ts +4 -4
- package/src/render-solidity/field.ts +25 -2
- package/src/render-solidity/record.ts +14 -10
- package/src/render-solidity/renderSystemInterface.ts +4 -4
- package/src/render-solidity/renderTableIndex.ts +15 -0
- package/src/render-solidity/renderTypesFromConfig.ts +1 -1
- package/src/render-solidity/tableOptions.ts +2 -2
- package/src/render-solidity/tablegen.ts +15 -13
- package/src/render-solidity/types.ts +2 -1
- package/src/render-solidity/userType.ts +1 -2
- package/src/render-solidity/worldgen.ts +8 -9
- package/src/render-ts/index.ts +5 -0
- package/src/render-ts/recsV1TableOptions.ts +39 -0
- package/src/render-ts/renderRecsV1Tables.ts +31 -0
- package/src/render-ts/schemaTypesToRecsTypeStrings.ts +202 -0
- package/src/render-ts/tsgen.ts +12 -0
- package/src/render-ts/types.ts +13 -0
- package/src/utils/contractToInterface.ts +5 -3
- package/src/utils/deploy-v2.ts +90 -84
- package/src/utils/errors.ts +3 -34
- package/src/utils/format.ts +6 -0
- package/src/utils/formatAndWrite.ts +11 -2
- package/src/utils/foundry.ts +9 -0
- package/src/utils/index.ts +1 -0
- package/dist/chunk-O57QENJ6.js +0 -23039
- package/dist/chunk-SLIMIO4Z.js +0 -14358
- package/dist/config/index.d.ts +0 -763
- package/dist/config/index.js +0 -83
- package/src/config/commonSchemas.ts +0 -34
- package/src/config/dynamicResolution.ts +0 -49
- package/src/config/index.ts +0 -24
- package/src/config/loadConfig.ts +0 -39
- package/src/config/loadStoreConfig.ts +0 -18
- package/src/config/parseStoreConfig.test-d.ts +0 -40
- package/src/config/parseStoreConfig.ts +0 -314
- package/src/config/validation.ts +0 -163
- package/src/config/world/index.ts +0 -4
- package/src/config/world/loadWorldConfig.test-d.ts +0 -11
- package/src/config/world/loadWorldConfig.ts +0 -26
- package/src/config/world/parseWorldConfig.ts +0 -55
- package/src/config/world/resolveWorldConfig.ts +0 -80
- package/src/config/world/userTypes.ts +0 -72
- package/src/utils/typeUtils.ts +0 -17
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getOutDirectory,
|
|
3
|
+
getSrcDirectory
|
|
4
|
+
} from "./chunk-FPG73MVN.js";
|
|
5
|
+
|
|
6
|
+
// src/utils/deprecated/exec.ts
|
|
7
|
+
import { execa } from "execa";
|
|
8
|
+
function execLog(command, options) {
|
|
9
|
+
console.log("Cmd:");
|
|
10
|
+
console.log([command, ...options].join(" "));
|
|
11
|
+
return execa(command, options, {
|
|
12
|
+
stdio: ["inherit", "inherit", "inherit"]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// src/utils/deprecated/ids.ts
|
|
17
|
+
import { keccak256 as keccak256Bytes, toUtf8Bytes } from "ethers/lib/utils.js";
|
|
18
|
+
import { readFileSync } from "fs";
|
|
19
|
+
var IDregex = new RegExp(/(?<=uint256 constant ID = uint256\(keccak256\(")(.*)(?="\))/);
|
|
20
|
+
function extractIdFromFile(path5) {
|
|
21
|
+
const content = readFileSync(path5).toString();
|
|
22
|
+
const regexResult = IDregex.exec(content);
|
|
23
|
+
return regexResult && regexResult[0];
|
|
24
|
+
}
|
|
25
|
+
function keccak256(data) {
|
|
26
|
+
return keccak256Bytes(toUtf8Bytes(data));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// src/utils/deprecated/codegen.ts
|
|
30
|
+
import { readFile, writeFile } from "fs/promises";
|
|
31
|
+
import ejs from "ejs";
|
|
32
|
+
import path from "path";
|
|
33
|
+
var contractsDirectory = new URL("../src/contracts", import.meta.url).pathname;
|
|
34
|
+
var stubLibDeploy = readFile(path.join(contractsDirectory, "LibDeployStub.sol"));
|
|
35
|
+
async function generateLibDeploy(configPath, out, systems) {
|
|
36
|
+
const config = JSON.parse(await readFile(configPath, { encoding: "utf8" }));
|
|
37
|
+
config.initializers ??= [];
|
|
38
|
+
if (systems) {
|
|
39
|
+
const systemsArray = Array.isArray(systems) ? systems : [systems];
|
|
40
|
+
config.systems = config.systems.filter((system) => systemsArray.includes(system.name));
|
|
41
|
+
}
|
|
42
|
+
console.log(`Deploy config:
|
|
43
|
+
`, JSON.stringify(config, null, 2));
|
|
44
|
+
console.log("Generating deployment script");
|
|
45
|
+
const LibDeploy = await ejs.renderFile(path.join(contractsDirectory, "LibDeploy.ejs"), config, { async: true });
|
|
46
|
+
const libDeployPath = path.join(out, "LibDeploy.sol");
|
|
47
|
+
await writeFile(libDeployPath, LibDeploy);
|
|
48
|
+
return libDeployPath;
|
|
49
|
+
}
|
|
50
|
+
async function resetLibDeploy(out) {
|
|
51
|
+
await writeFile(path.join(out, "LibDeploy.sol"), await stubLibDeploy);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// src/utils/deprecated/deploy.ts
|
|
55
|
+
import { constants, Wallet } from "ethers";
|
|
56
|
+
|
|
57
|
+
// src/utils/deprecated/findLog.ts
|
|
58
|
+
function findLog(deployLogLines, log) {
|
|
59
|
+
for (const logLine of deployLogLines) {
|
|
60
|
+
if (logLine.includes(log)) {
|
|
61
|
+
return logLine.split(log)[1].trim();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
throw new Error("Can not find log");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// src/utils/deprecated/typegen.ts
|
|
68
|
+
import { runTypeChain, glob as typechainGlob } from "typechain";
|
|
69
|
+
import glob from "glob";
|
|
70
|
+
import { rmSync as rmSync2, writeFileSync } from "fs";
|
|
71
|
+
import path3 from "path";
|
|
72
|
+
|
|
73
|
+
// src/utils/deprecated/build.ts
|
|
74
|
+
import { execa as execa2 } from "execa";
|
|
75
|
+
import { copyFileSync, mkdirSync, readdirSync, rmSync } from "fs";
|
|
76
|
+
import path2 from "path";
|
|
77
|
+
async function forgeBuild(options) {
|
|
78
|
+
if (options?.clear) {
|
|
79
|
+
const out = await getOutDirectory();
|
|
80
|
+
console.log("Clearing forge build output directory", out);
|
|
81
|
+
rmSync(out, { recursive: true, force: true });
|
|
82
|
+
}
|
|
83
|
+
console.log("Running forge build");
|
|
84
|
+
const child = execa2("forge", ["build"], {
|
|
85
|
+
stdio: ["inherit", "pipe", "inherit"]
|
|
86
|
+
});
|
|
87
|
+
return (await child).stdout;
|
|
88
|
+
}
|
|
89
|
+
function getContractsInDirectory(dir, exclude) {
|
|
90
|
+
return readdirSync(dir).filter((item) => item.includes(".sol")).map((item) => item.replace(".sol", "")).filter((item) => !exclude?.includes(item));
|
|
91
|
+
}
|
|
92
|
+
function copyAbi(inDir, outDir, contract) {
|
|
93
|
+
try {
|
|
94
|
+
return copyFileSync(path2.join(inDir, contract + ".sol", contract + ".json"), path2.join(outDir, contract + ".json"));
|
|
95
|
+
} catch (e) {
|
|
96
|
+
console.log("Skipping", contract);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function filterAbi(abiIn = "./out", abiOut = "./abi", exclude = ["Component", "IComponent"]) {
|
|
100
|
+
console.log(`Cleaning output directory (${abiOut}})`);
|
|
101
|
+
rmSync(abiOut, { recursive: true, force: true });
|
|
102
|
+
mkdirSync(abiOut);
|
|
103
|
+
const include = ["Component", "System", "World", "LibQuery"];
|
|
104
|
+
const contracts = getContractsInDirectory(abiIn, exclude).filter((item) => include.find((i) => item.includes(i)));
|
|
105
|
+
console.log("Selected ABIs: ", contracts);
|
|
106
|
+
for (const contract of contracts) {
|
|
107
|
+
if (contract.includes(".t"))
|
|
108
|
+
continue;
|
|
109
|
+
copyAbi(abiIn, abiOut, contract);
|
|
110
|
+
}
|
|
111
|
+
console.log("Successfully moved selected ABIs to ./abi");
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// src/utils/deprecated/constants.ts
|
|
115
|
+
var systemsDir = "systems";
|
|
116
|
+
var componentsDir = "components";
|
|
117
|
+
|
|
118
|
+
// src/utils/deprecated/typegen.ts
|
|
119
|
+
async function generateAbiTypes(inputDir, outputDir, options) {
|
|
120
|
+
if (options?.clear) {
|
|
121
|
+
console.log("Clearing typechain output directory", outputDir);
|
|
122
|
+
rmSync2(outputDir, { recursive: true, force: true });
|
|
123
|
+
}
|
|
124
|
+
const cwd = options?.cwd ?? process.cwd();
|
|
125
|
+
const allFiles = typechainGlob(cwd, [`${inputDir}/**/+([a-zA-Z0-9_]).json`]);
|
|
126
|
+
const result = await runTypeChain({
|
|
127
|
+
cwd,
|
|
128
|
+
filesToProcess: allFiles,
|
|
129
|
+
allFiles,
|
|
130
|
+
outDir: outputDir,
|
|
131
|
+
target: "ethers-v5"
|
|
132
|
+
});
|
|
133
|
+
console.log(`Successfully generated ${result.filesGenerated} files`);
|
|
134
|
+
}
|
|
135
|
+
async function generateSystemTypes(outputDir, options) {
|
|
136
|
+
if (options?.clear) {
|
|
137
|
+
console.log("Clearing system type output files", outputDir);
|
|
138
|
+
rmSync2(path3.join(outputDir, "/SystemTypes.ts"), { force: true });
|
|
139
|
+
rmSync2(path3.join(outputDir, "/SystemAbis.mts"), { force: true });
|
|
140
|
+
rmSync2(path3.join(outputDir, "/SystemAbis.mjs"), { force: true });
|
|
141
|
+
rmSync2(path3.join(outputDir, "/SystemMappings.ts"), { force: true });
|
|
142
|
+
}
|
|
143
|
+
let abis = [];
|
|
144
|
+
let systems = [];
|
|
145
|
+
let ids = [];
|
|
146
|
+
let typePaths = [];
|
|
147
|
+
const srcDir = await getSrcDirectory();
|
|
148
|
+
const systemsPath = path3.join(srcDir, systemsDir, "*.sol");
|
|
149
|
+
const matches = glob.sync(systemsPath);
|
|
150
|
+
systems = matches.map((path5) => {
|
|
151
|
+
const fragments = path5.split("/");
|
|
152
|
+
return fragments[fragments.length - 1].split(".sol")[0];
|
|
153
|
+
});
|
|
154
|
+
ids = matches.map((path5, index) => {
|
|
155
|
+
const id = extractIdFromFile(path5);
|
|
156
|
+
if (!id) {
|
|
157
|
+
console.log("Path:", path5);
|
|
158
|
+
console.log("ID:", id);
|
|
159
|
+
throw new Error(
|
|
160
|
+
"No ID found for" + matches[index] + ". Make sure your system source file includes a ID definition (uint256 constant ID = uint256(keccak256(<ID>));)"
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
return id;
|
|
164
|
+
});
|
|
165
|
+
abis = systems.map((system) => `../abi/${system}.json`);
|
|
166
|
+
typePaths = systems.map((system) => `./ethers-contracts/${system}.ts`);
|
|
167
|
+
console.log("Matches", systems);
|
|
168
|
+
console.log("Solidity", ids);
|
|
169
|
+
console.log("Type paths", typePaths);
|
|
170
|
+
console.log("ABIs", abis);
|
|
171
|
+
const SystemMappings = `// Autogenerated using mud system-types
|
|
172
|
+
export const systemToId = {
|
|
173
|
+
${systems.map((system, index) => ` ${system}: "${ids[index]}",`).join("\n")}
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export const idToSystem = {
|
|
177
|
+
${ids.map((id, index) => ` "${id}": "${systems[index]}",`).join("\n")}
|
|
178
|
+
};
|
|
179
|
+
`;
|
|
180
|
+
const SystemTypes = `// Autogenerated using mud system-types
|
|
181
|
+
${typePaths.map((path5, index) => `import { ${systems[index]} } from "${path5.replace(".ts", "")}";`).join("\n")}
|
|
182
|
+
|
|
183
|
+
export type SystemTypes = {
|
|
184
|
+
${systems.map((system, index) => ` "${ids[index]}": ${system};`).join("\n")}
|
|
185
|
+
};
|
|
186
|
+
`;
|
|
187
|
+
const SystemAbis = `// Autogenerated using mud system-types
|
|
188
|
+
${abis.map((path5, index) => `import ${systems[index]} from "${path5}";`).join("\n")}
|
|
189
|
+
|
|
190
|
+
export const SystemAbis = {
|
|
191
|
+
${systems.map((system, index) => ` "${ids[index]}": ${system}.abi,`).join("\n")}
|
|
192
|
+
};
|
|
193
|
+
`;
|
|
194
|
+
console.log("Generating files:");
|
|
195
|
+
console.log("SystemTypes.ts", SystemTypes);
|
|
196
|
+
console.log("SystemAbis.mts", SystemAbis);
|
|
197
|
+
console.log("SystemMappings.ts", SystemMappings);
|
|
198
|
+
writeFileSync(`${outputDir}/SystemTypes.ts`, SystemTypes);
|
|
199
|
+
writeFileSync(`${outputDir}/SystemAbis.mts`, SystemAbis);
|
|
200
|
+
writeFileSync(`${outputDir}/SystemAbis.mjs`, SystemAbis);
|
|
201
|
+
writeFileSync(`${outputDir}/SystemMappings.ts`, SystemMappings);
|
|
202
|
+
}
|
|
203
|
+
async function generateTypes(abiDir, outputDir = "./types", options) {
|
|
204
|
+
if (!abiDir) {
|
|
205
|
+
console.log("Compiling contracts");
|
|
206
|
+
const buildOutput = await getOutDirectory();
|
|
207
|
+
abiDir = "./abi";
|
|
208
|
+
await forgeBuild(options);
|
|
209
|
+
filterAbi(buildOutput, abiDir);
|
|
210
|
+
}
|
|
211
|
+
await generateAbiTypes(abiDir, path3.join(outputDir, "ethers-contracts"), options);
|
|
212
|
+
await generateSystemTypes(outputDir, options);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// src/utils/deprecated/deploy.ts
|
|
216
|
+
import { execa as execa3 } from "execa";
|
|
217
|
+
import { StaticJsonRpcProvider } from "@ethersproject/providers";
|
|
218
|
+
import path4 from "path";
|
|
219
|
+
var contractsDirectory2 = new URL("../src/contracts", import.meta.url).pathname;
|
|
220
|
+
async function deploy(deployerPrivateKey, rpc = "http://localhost:8545", worldAddress, reuseComponents, gasPrice) {
|
|
221
|
+
const address = deployerPrivateKey ? new Wallet(deployerPrivateKey).address : constants.AddressZero;
|
|
222
|
+
if (gasPrice == null) {
|
|
223
|
+
try {
|
|
224
|
+
console.log("Fetching gas price...");
|
|
225
|
+
const provider = new StaticJsonRpcProvider(rpc, { name: "AnyNetwork", chainId: 1234 });
|
|
226
|
+
gasPrice = (await provider.getGasPrice()).toNumber() * 1.3;
|
|
227
|
+
console.log("Gas price:", gasPrice);
|
|
228
|
+
} catch (e) {
|
|
229
|
+
console.log("Could not fetch gas price");
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const child = execa3(
|
|
233
|
+
"forge",
|
|
234
|
+
[
|
|
235
|
+
"script",
|
|
236
|
+
path4.join(contractsDirectory2, "/Deploy.sol"),
|
|
237
|
+
"--target-contract",
|
|
238
|
+
"Deploy",
|
|
239
|
+
"-vvv",
|
|
240
|
+
...!deployerPrivateKey ? [] : ["--broadcast", "--private-keys", deployerPrivateKey],
|
|
241
|
+
"--sig",
|
|
242
|
+
"broadcastDeploy(address,address,bool)",
|
|
243
|
+
address,
|
|
244
|
+
// Deployer
|
|
245
|
+
worldAddress || constants.AddressZero,
|
|
246
|
+
// World address (0 = deploy a new world)
|
|
247
|
+
reuseComponents ? "true" : "false",
|
|
248
|
+
// Reuse components?
|
|
249
|
+
"--fork-url",
|
|
250
|
+
rpc,
|
|
251
|
+
...gasPrice != null ? ["--with-gas-price", String(Math.round(gasPrice))] : []
|
|
252
|
+
],
|
|
253
|
+
{ stdio: ["inherit", "pipe", "pipe"] }
|
|
254
|
+
);
|
|
255
|
+
child.stderr?.on("data", (data) => console.log("stderr:", data.toString()));
|
|
256
|
+
child.stdout?.on("data", (data) => console.log(data.toString()));
|
|
257
|
+
const lines = (await child).stdout?.split("\n");
|
|
258
|
+
const deployedWorldAddress = findLog(lines, "world: address");
|
|
259
|
+
const initialBlockNumber = findLog(lines, "initialBlockNumber: uint256");
|
|
260
|
+
return { child: await child, deployedWorldAddress, initialBlockNumber };
|
|
261
|
+
}
|
|
262
|
+
async function generateAndDeploy(args) {
|
|
263
|
+
let libDeployPath;
|
|
264
|
+
let deployedWorldAddress;
|
|
265
|
+
let initialBlockNumber;
|
|
266
|
+
try {
|
|
267
|
+
libDeployPath = await generateLibDeploy(args.config, contractsDirectory2, args.systems);
|
|
268
|
+
await generateTypes(void 0, "./types", { clear: args.clear });
|
|
269
|
+
const result = await deploy(
|
|
270
|
+
args.deployerPrivateKey,
|
|
271
|
+
args.rpc,
|
|
272
|
+
args.worldAddress,
|
|
273
|
+
Boolean(args.reuseComponents),
|
|
274
|
+
args.gasPrice
|
|
275
|
+
);
|
|
276
|
+
deployedWorldAddress = result.deployedWorldAddress;
|
|
277
|
+
initialBlockNumber = result.initialBlockNumber;
|
|
278
|
+
} finally {
|
|
279
|
+
console.log("Cleaning up deployment script");
|
|
280
|
+
if (libDeployPath)
|
|
281
|
+
await resetLibDeploy(contractsDirectory2);
|
|
282
|
+
}
|
|
283
|
+
return { deployedWorldAddress, initialBlockNumber };
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// src/utils/deprecated/hsr.ts
|
|
287
|
+
import chokidar from "chokidar";
|
|
288
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
289
|
+
var ImportsRegex = new RegExp(/(?<=import ").*(?=";)|(?<=from ").*(?=";)/g);
|
|
290
|
+
function extractImports(path5) {
|
|
291
|
+
const content = readFileSync2(path5).toString();
|
|
292
|
+
const regexResult = [...content.matchAll(ImportsRegex)].map((match) => match[0]).map((path6) => path6.split("/").at(-1));
|
|
293
|
+
return regexResult;
|
|
294
|
+
}
|
|
295
|
+
function findDependencies(file, dependencyGraph, visited = []) {
|
|
296
|
+
const dependencies = dependencyGraph[file] ?? [];
|
|
297
|
+
const subDependencies = dependencies.flatMap((d) => {
|
|
298
|
+
if (visited.includes(d)) {
|
|
299
|
+
console.warn("Circular dependency detected: ", d, dependencyGraph[d]);
|
|
300
|
+
return [];
|
|
301
|
+
}
|
|
302
|
+
return findDependencies(d, dependencyGraph, [...visited, d]);
|
|
303
|
+
});
|
|
304
|
+
return [.../* @__PURE__ */ new Set([...dependencies, ...subDependencies])];
|
|
305
|
+
}
|
|
306
|
+
function hsr(root, replaceSystems) {
|
|
307
|
+
const dependencyGraph = {};
|
|
308
|
+
const systems = /* @__PURE__ */ new Set();
|
|
309
|
+
console.log("Watching system file changes...");
|
|
310
|
+
chokidar.watch(root).on("all", async (event, path5) => {
|
|
311
|
+
console.log(`[${event}]: ${path5}`);
|
|
312
|
+
const changedFile = path5.split("/").at(-1);
|
|
313
|
+
if (["add", "change"].includes(event)) {
|
|
314
|
+
const imports = extractImports(path5);
|
|
315
|
+
for (const importedFile of imports) {
|
|
316
|
+
dependencyGraph[importedFile] ??= [];
|
|
317
|
+
dependencyGraph[importedFile].push(changedFile);
|
|
318
|
+
}
|
|
319
|
+
if (path5.includes("systems") && path5.includes(".sol"))
|
|
320
|
+
systems.add(changedFile);
|
|
321
|
+
}
|
|
322
|
+
if (event === "change") {
|
|
323
|
+
const dependencies = findDependencies(changedFile, dependencyGraph);
|
|
324
|
+
const changedSystems = [
|
|
325
|
+
...new Set([changedFile, ...dependencies].filter((f) => systems.has(f)).map((f) => f.replace(".sol", "")))
|
|
326
|
+
];
|
|
327
|
+
console.log("Systems to replace", changedSystems);
|
|
328
|
+
if (changedSystems.length > 0)
|
|
329
|
+
await replaceSystems(changedSystems);
|
|
330
|
+
console.log("Watching system file changes...");
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export {
|
|
336
|
+
execLog,
|
|
337
|
+
IDregex,
|
|
338
|
+
extractIdFromFile,
|
|
339
|
+
keccak256,
|
|
340
|
+
generateLibDeploy,
|
|
341
|
+
resetLibDeploy,
|
|
342
|
+
findLog,
|
|
343
|
+
forgeBuild,
|
|
344
|
+
filterAbi,
|
|
345
|
+
systemsDir,
|
|
346
|
+
componentsDir,
|
|
347
|
+
generateAbiTypes,
|
|
348
|
+
generateSystemTypes,
|
|
349
|
+
generateTypes,
|
|
350
|
+
deploy,
|
|
351
|
+
generateAndDeploy,
|
|
352
|
+
hsr
|
|
353
|
+
};
|