@latticexyz/cli 2.0.0-alpha.94 → 2.0.0-main-0d434816
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-LFIOIY67.js +30 -0
- package/dist/chunk-LFIOIY67.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/mud.js +15 -8340
- package/dist/mud.js.map +1 -0
- package/package.json +45 -43
- package/src/commands/deploy.ts +49 -0
- package/src/commands/dev-contracts.ts +176 -0
- package/src/commands/devnode.ts +7 -2
- package/src/commands/faucet.ts +1 -1
- package/src/commands/index.ts +18 -13
- package/src/commands/set-version.ts +38 -10
- package/src/commands/tablegen.ts +5 -4
- package/src/commands/{test-v2.ts → test.ts} +5 -6
- package/src/commands/trace.ts +108 -0
- package/src/commands/tsgen.ts +4 -3
- package/src/commands/worldgen.ts +29 -28
- package/src/index.ts +2 -1
- package/src/modules.d.ts +11 -0
- package/src/mud.ts +10 -4
- package/src/render-ts/recsV1TableOptions.ts +4 -4
- package/src/render-ts/renderRecsV1Tables.ts +3 -3
- package/src/render-ts/schemaTypesToRecsTypeStrings.ts +33 -33
- package/src/render-ts/tsgen.ts +4 -4
- package/src/utils/{deploy-v2.ts → deploy.ts} +207 -123
- package/src/utils/deployHandler.ts +87 -0
- package/src/utils/errors.ts +1 -1
- package/src/utils/getExistingContracts.ts +12 -0
- package/src/utils/index.ts +7 -5
- package/src/utils/printMUD.ts +14 -0
- package/src/utils/worldtypes.ts +21 -0
- package/dist/chunk-6V563IAZ.js +0 -283
- package/dist/chunk-FPG73MVN.js +0 -71
- package/dist/chunk-L4YLJHLJ.js +0 -30
- package/dist/chunk-SKNB74MT.js +0 -726
- package/dist/chunk-T2YHSEJD.js +0 -3842
- package/dist/chunk-VQTZJIFF.js +0 -353
- package/dist/chunk-WZFXLDPK.js +0 -761
- package/dist/chunk-YL4GJLLL.js +0 -26139
- package/dist/index.d.ts +0 -2
- package/dist/mud.d.ts +0 -1
- package/dist/mud2.d.ts +0 -1
- package/dist/mud2.js +0 -25
- package/dist/render-solidity/index.d.ts +0 -171
- package/dist/render-solidity/index.js +0 -49
- package/dist/render-ts/index.d.ts +0 -26
- package/dist/render-ts/index.js +0 -14
- package/dist/utils/deprecated/index.d.ts +0 -76
- package/dist/utils/deprecated/index.js +0 -36
- package/dist/utils/index.d.ts +0 -88
- package/dist/utils/index.js +0 -39
- package/src/commands/deploy-v2.ts +0 -112
- package/src/commands/deprecated/bulkupload.ts +0 -50
- package/src/commands/deprecated/call-system.ts +0 -70
- package/src/commands/deprecated/codegen-libdeploy.ts +0 -29
- package/src/commands/deprecated/deploy-contracts.ts +0 -120
- package/src/commands/deprecated/index.ts +0 -22
- package/src/commands/deprecated/system-types.ts +0 -29
- package/src/commands/deprecated/test.ts +0 -53
- package/src/commands/deprecated/trace.ts +0 -81
- package/src/commands/deprecated/types.ts +0 -33
- package/src/commands/gas-report.ts +0 -219
- package/src/contracts/BulkUpload.sol +0 -174
- package/src/contracts/Deploy.sol +0 -23
- package/src/contracts/LibDeploy.ejs +0 -121
- package/src/contracts/LibDeploy.sol +0 -23
- package/src/contracts/LibDeployStub.sol +0 -23
- package/src/mud2.ts +0 -29
- package/src/render-solidity/common.ts +0 -138
- package/src/render-solidity/field.ts +0 -160
- package/src/render-solidity/index.ts +0 -10
- package/src/render-solidity/record.ts +0 -158
- package/src/render-solidity/renderSystemInterface.ts +0 -31
- package/src/render-solidity/renderTable.ts +0 -164
- package/src/render-solidity/renderTableIndex.ts +0 -15
- package/src/render-solidity/renderTypeHelpers.ts +0 -99
- package/src/render-solidity/renderTypes.ts +0 -19
- package/src/render-solidity/renderTypesFromConfig.ts +0 -13
- package/src/render-solidity/renderWorld.ts +0 -24
- package/src/render-solidity/tableOptions.ts +0 -107
- package/src/render-solidity/tablegen.ts +0 -35
- package/src/render-solidity/types.ts +0 -111
- package/src/render-solidity/userType.ts +0 -131
- package/src/render-solidity/worldgen.ts +0 -59
- package/src/utils/contractToInterface.ts +0 -132
- package/src/utils/deprecated/build.ts +0 -55
- package/src/utils/deprecated/codegen.ts +0 -42
- package/src/utils/deprecated/constants.ts +0 -2
- package/src/utils/deprecated/deploy.ts +0 -111
- package/src/utils/deprecated/exec.ts +0 -18
- package/src/utils/deprecated/findLog.ts +0 -8
- package/src/utils/deprecated/hsr.ts +0 -71
- package/src/utils/deprecated/ids.ts +0 -14
- package/src/utils/deprecated/index.ts +0 -8
- package/src/utils/deprecated/typegen.ts +0 -133
- package/src/utils/execLog.ts +0 -22
- package/src/utils/format.ts +0 -39
- package/src/utils/formatAndWrite.ts +0 -21
- package/src/utils/foundry.ts +0 -103
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { mkdirSync, writeFileSync } from "fs";
|
|
2
|
-
import { dirname } from "path";
|
|
3
|
-
import { formatSolidity, formatTypescript } from "./format.js";
|
|
4
|
-
|
|
5
|
-
export async function formatAndWriteSolidity(output: string, fullOutputPath: string, logPrefix: string) {
|
|
6
|
-
const formattedOutput = await formatSolidity(output);
|
|
7
|
-
|
|
8
|
-
mkdirSync(dirname(fullOutputPath), { recursive: true });
|
|
9
|
-
|
|
10
|
-
writeFileSync(fullOutputPath, formattedOutput);
|
|
11
|
-
console.log(`${logPrefix}: ${fullOutputPath}`);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export async function formatAndWriteTypescript(output: string, fullOutputPath: string, logPrefix: string) {
|
|
15
|
-
const formattedOutput = await formatTypescript(output);
|
|
16
|
-
|
|
17
|
-
mkdirSync(dirname(fullOutputPath), { recursive: true });
|
|
18
|
-
|
|
19
|
-
writeFileSync(fullOutputPath, formattedOutput);
|
|
20
|
-
console.log(`${logPrefix}: ${fullOutputPath}`);
|
|
21
|
-
}
|
package/src/utils/foundry.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { execa, Options } from "execa";
|
|
2
|
-
import { execLog } from "./execLog.js";
|
|
3
|
-
|
|
4
|
-
export interface ForgeConfig {
|
|
5
|
-
// project
|
|
6
|
-
src: string;
|
|
7
|
-
test: string;
|
|
8
|
-
script: string;
|
|
9
|
-
out: string;
|
|
10
|
-
libs: string[];
|
|
11
|
-
eth_rpc_url: string | null;
|
|
12
|
-
|
|
13
|
-
// all unspecified keys (this interface is far from comprehensive)
|
|
14
|
-
[key: string]: unknown;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Get forge config as a parsed json object.
|
|
19
|
-
*/
|
|
20
|
-
export async function getForgeConfig(profile?: string) {
|
|
21
|
-
const { stdout } = await execa("forge", ["config", "--json"], {
|
|
22
|
-
stdio: ["inherit", "pipe", "pipe"],
|
|
23
|
-
env: { FOUNDRY_PROFILE: profile },
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
return JSON.parse(stdout) as ForgeConfig;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Get the value of "src" from forge config.
|
|
31
|
-
* The path to the contract sources relative to the root of the project.
|
|
32
|
-
*/
|
|
33
|
-
export async function getSrcDirectory(profile?: string) {
|
|
34
|
-
return (await getForgeConfig(profile)).src;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Get the value of "script" from forge config.
|
|
39
|
-
* The path to the contract sources relative to the root of the project.
|
|
40
|
-
*/
|
|
41
|
-
export async function getScriptDirectory(profile?: string) {
|
|
42
|
-
return (await getForgeConfig(profile)).script;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Get the value of "test" from forge config.
|
|
47
|
-
* The path to the test contract sources relative to the root of the project.
|
|
48
|
-
*/
|
|
49
|
-
export async function getTestDirectory(profile?: string) {
|
|
50
|
-
return (await getForgeConfig(profile)).test;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Get the value of "out" from forge config.
|
|
55
|
-
* The path to put contract artifacts in, relative to the root of the project.
|
|
56
|
-
*/
|
|
57
|
-
export async function getOutDirectory(profile?: string) {
|
|
58
|
-
return (await getForgeConfig(profile)).out;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Get the value of "eth_rpc_url" from forge config, default to "http://127.0.0.1:8545"
|
|
63
|
-
* @param profile The foundry profile to use
|
|
64
|
-
* @returns The rpc url
|
|
65
|
-
*/
|
|
66
|
-
export async function getRpcUrl(profile?: string) {
|
|
67
|
-
return (await getForgeConfig(profile)).eth_rpc_url || "http://127.0.0.1:8545";
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Execute a forge command
|
|
72
|
-
* @param args The arguments to pass to forge
|
|
73
|
-
* @param options { profile?: The foundry profile to use; silent?: If true, nothing will be logged to the console }
|
|
74
|
-
*/
|
|
75
|
-
export async function forge(args: string[], options?: { profile?: string; silent?: boolean }): Promise<void> {
|
|
76
|
-
const execOptions: Options<string> = {
|
|
77
|
-
env: { FOUNDRY_PROFILE: options?.profile },
|
|
78
|
-
stdout: "inherit",
|
|
79
|
-
stderr: "pipe",
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
await (options?.silent ? execa("forge", args, execOptions) : execLog("forge", args, execOptions));
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Execute a cast command
|
|
87
|
-
* @param args The arguments to pass to cast
|
|
88
|
-
* @returns Stdout of the command
|
|
89
|
-
*/
|
|
90
|
-
export async function cast(args: string[], options?: { profile?: string }): Promise<string> {
|
|
91
|
-
return execLog("cast", args, {
|
|
92
|
-
env: { FOUNDRY_PROFILE: options?.profile },
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Start an anvil chain
|
|
98
|
-
* @param args The arguments to pass to anvil
|
|
99
|
-
* @returns Stdout of the command
|
|
100
|
-
*/
|
|
101
|
-
export async function anvil(args: string[]): Promise<string> {
|
|
102
|
-
return execLog("anvil", args);
|
|
103
|
-
}
|