@latticexyz/cli 1.41.1-alpha.41 → 1.42.0
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-4STWSICF.js +26139 -0
- package/dist/chunk-6V563IAZ.js +283 -0
- package/dist/chunk-7KQJTK2K.js +3842 -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/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 +21 -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
package/dist/mud2.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/mud2.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
commands
|
|
4
|
+
} from "./chunk-7KQJTK2K.js";
|
|
5
|
+
import {
|
|
6
|
+
logError
|
|
7
|
+
} from "./chunk-4STWSICF.js";
|
|
8
|
+
import "./chunk-VQTZJIFF.js";
|
|
9
|
+
import "./chunk-FPG73MVN.js";
|
|
10
|
+
import "./chunk-WZFXLDPK.js";
|
|
11
|
+
import "./chunk-6V563IAZ.js";
|
|
12
|
+
import "./chunk-SKNB74MT.js";
|
|
13
|
+
import "./chunk-L4YLJHLJ.js";
|
|
14
|
+
|
|
15
|
+
// src/mud2.ts
|
|
16
|
+
import yargs from "yargs";
|
|
17
|
+
import { hideBin } from "yargs/helpers";
|
|
18
|
+
import * as dotenv from "dotenv";
|
|
19
|
+
dotenv.config();
|
|
20
|
+
yargs(hideBin(process.argv)).scriptName("mud").command(commands).strict().fail((msg, err) => {
|
|
21
|
+
console.log("");
|
|
22
|
+
logError(err);
|
|
23
|
+
console.log("");
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}).alias({ h: "help" }).argv;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { StoreConfig } from '@latticexyz/config';
|
|
2
|
+
import { SchemaType } from '@latticexyz/schema-type';
|
|
3
|
+
|
|
4
|
+
interface RenderTableOptions {
|
|
5
|
+
/** List of symbols to import, and their file paths */
|
|
6
|
+
imports: ImportDatum[];
|
|
7
|
+
/** Name of the library to render. */
|
|
8
|
+
libraryName: string;
|
|
9
|
+
/** Name of the struct to render. If undefined, struct and its methods aren't rendered. */
|
|
10
|
+
structName?: string;
|
|
11
|
+
/** Data used to statically registed the table. If undefined, all methods receive `_tableId` as an argument. */
|
|
12
|
+
staticResourceData?: StaticResourceData;
|
|
13
|
+
/** Path for store package imports */
|
|
14
|
+
storeImportPath: string;
|
|
15
|
+
primaryKeys: RenderTablePrimaryKey[];
|
|
16
|
+
fields: RenderTableField[];
|
|
17
|
+
staticFields: RenderTableStaticField[];
|
|
18
|
+
dynamicFields: RenderTableDynamicField[];
|
|
19
|
+
/** Whether to render get/set methods for the whole record */
|
|
20
|
+
withRecordMethods: boolean;
|
|
21
|
+
/** Whether to render additional methods that accept a manual `IStore` argument */
|
|
22
|
+
storeArgument: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface ImportDatum {
|
|
25
|
+
symbol: string;
|
|
26
|
+
fromPath: string;
|
|
27
|
+
usedInPath: string;
|
|
28
|
+
}
|
|
29
|
+
interface StaticResourceData {
|
|
30
|
+
/** Name of the table id constant to render. */
|
|
31
|
+
tableIdName: string;
|
|
32
|
+
namespace: string;
|
|
33
|
+
name: string;
|
|
34
|
+
}
|
|
35
|
+
interface RenderTableType {
|
|
36
|
+
typeId: string;
|
|
37
|
+
typeWithLocation: string;
|
|
38
|
+
/** The name of the enum element in SchemaType to use for schema registration (e.g. "UINT256_ARRAY") */
|
|
39
|
+
enumName: string;
|
|
40
|
+
staticByteLength: number;
|
|
41
|
+
isDynamic: boolean;
|
|
42
|
+
/** Empty for internal types. Custom `wrap` method for user defined types. */
|
|
43
|
+
typeWrap: string;
|
|
44
|
+
/** Empty for internal types. Custom `unwrap` method for user defined types. */
|
|
45
|
+
typeUnwrap: string;
|
|
46
|
+
/** Data to generate the custom wrapper and unwrapper if necessary. */
|
|
47
|
+
typeWrappingData?: RenderTableTypeWrappingData;
|
|
48
|
+
/** Same as typeId for internal types. The underlying `typeId` for user defined types. */
|
|
49
|
+
internalTypeId: string;
|
|
50
|
+
}
|
|
51
|
+
type RenderTableTypeWrappingData = {
|
|
52
|
+
kind: "staticArray";
|
|
53
|
+
elementType: string;
|
|
54
|
+
staticLength: number;
|
|
55
|
+
};
|
|
56
|
+
interface RenderTablePrimaryKey extends RenderTableType {
|
|
57
|
+
name: string;
|
|
58
|
+
isDynamic: false;
|
|
59
|
+
}
|
|
60
|
+
interface RenderTableStaticField extends RenderTableField {
|
|
61
|
+
isDynamic: false;
|
|
62
|
+
}
|
|
63
|
+
interface RenderTableDynamicField extends RenderTableField {
|
|
64
|
+
isDynamic: true;
|
|
65
|
+
}
|
|
66
|
+
interface RenderTableField extends RenderTableType {
|
|
67
|
+
arrayElement: RenderTableType | undefined;
|
|
68
|
+
name: string;
|
|
69
|
+
methodNameSuffix: string;
|
|
70
|
+
}
|
|
71
|
+
interface RenderTypesOptions {
|
|
72
|
+
/** List of enums to render */
|
|
73
|
+
enums: RenderTypesEnum[];
|
|
74
|
+
}
|
|
75
|
+
interface RenderTypesEnum {
|
|
76
|
+
name: string;
|
|
77
|
+
memberNames: string[];
|
|
78
|
+
}
|
|
79
|
+
interface RenderSystemInterfaceOptions {
|
|
80
|
+
/** List of symbols to import, and their file paths */
|
|
81
|
+
imports: ImportDatum[];
|
|
82
|
+
name: string;
|
|
83
|
+
functionPrefix: string;
|
|
84
|
+
functions: RenderSystemInterfaceFunction[];
|
|
85
|
+
}
|
|
86
|
+
interface RenderSystemInterfaceFunction {
|
|
87
|
+
name: string;
|
|
88
|
+
parameters: string[];
|
|
89
|
+
stateMutability: string;
|
|
90
|
+
returnParameters: string[];
|
|
91
|
+
}
|
|
92
|
+
interface RenderWorldOptions {
|
|
93
|
+
/** List of symbols to import, and their file paths */
|
|
94
|
+
imports: ImportDatum[];
|
|
95
|
+
/** Name of the interface to render */
|
|
96
|
+
interfaceName: string;
|
|
97
|
+
/** Path for store package imports */
|
|
98
|
+
storeImportPath: string;
|
|
99
|
+
/** Path for world package imports */
|
|
100
|
+
worldImportPath: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare const renderedSolidityHeader = "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.0;\n\n/* Autogenerated file. Do not edit manually. */";
|
|
104
|
+
/**
|
|
105
|
+
* Renders a list of lines
|
|
106
|
+
*/
|
|
107
|
+
declare function renderList<T>(list: T[], renderItem: (item: T, index: number) => string): string;
|
|
108
|
+
/**
|
|
109
|
+
* Renders a comma-separated list of arguments for solidity functions, ignoring empty and undefined ones
|
|
110
|
+
*/
|
|
111
|
+
declare function renderArguments(args: (string | undefined)[]): string;
|
|
112
|
+
declare function renderCommonData({ staticResourceData, primaryKeys, }: Pick<RenderTableOptions, "staticResourceData" | "primaryKeys">): {
|
|
113
|
+
_tableId: string;
|
|
114
|
+
_typedTableId: string;
|
|
115
|
+
_keyArgs: string;
|
|
116
|
+
_typedKeyArgs: string;
|
|
117
|
+
_primaryKeysDefinition: string;
|
|
118
|
+
};
|
|
119
|
+
/** For 2 paths which are relative to a common root, create a relative import path from one to another */
|
|
120
|
+
declare function solidityRelativeImportPath(fromPath: string, usedInPath: string): string;
|
|
121
|
+
/**
|
|
122
|
+
* Aggregates, deduplicates and renders imports for symbols per path.
|
|
123
|
+
* Identical symbols from different paths are NOT handled, they should be checked before rendering.
|
|
124
|
+
*/
|
|
125
|
+
declare function renderImports(imports: ImportDatum[]): string;
|
|
126
|
+
declare function renderWithStore(storeArgument: boolean, callback: (_typedStore: string | undefined, _store: string, _commentSuffix: string, _untypedStore: string | undefined) => string): string;
|
|
127
|
+
declare function renderTableId(staticResourceData: StaticResourceData): {
|
|
128
|
+
hardcodedTableId: string;
|
|
129
|
+
tableIdDefinition: string;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
declare function renderFieldMethods(options: RenderTableOptions): string;
|
|
133
|
+
declare function renderEncodeField(field: RenderTableField): string;
|
|
134
|
+
declare function renderDecodeValueType(field: RenderTableType, offset: number): string;
|
|
135
|
+
|
|
136
|
+
declare function renderRecordMethods(options: RenderTableOptions): string;
|
|
137
|
+
|
|
138
|
+
declare function renderTable(options: RenderTableOptions): string;
|
|
139
|
+
|
|
140
|
+
declare function renderTypes(options: RenderTypesOptions): string;
|
|
141
|
+
|
|
142
|
+
declare function renderTypesFromConfig(config: StoreConfig): string;
|
|
143
|
+
|
|
144
|
+
declare function tablegen(config: StoreConfig, outputBaseDirectory: string): Promise<void>;
|
|
145
|
+
|
|
146
|
+
interface TableOptions {
|
|
147
|
+
outputPath: string;
|
|
148
|
+
tableName: string;
|
|
149
|
+
renderOptions: RenderTableOptions;
|
|
150
|
+
}
|
|
151
|
+
declare function getTableOptions(config: StoreConfig): TableOptions[];
|
|
152
|
+
|
|
153
|
+
type UserTypeInfo = ReturnType<typeof getUserTypeInfo>;
|
|
154
|
+
/**
|
|
155
|
+
* Resolve an abi or user type into a SchemaType
|
|
156
|
+
*/
|
|
157
|
+
declare function resolveAbiOrUserType(abiOrUserType: string, config: StoreConfig): {
|
|
158
|
+
schemaType: SchemaType;
|
|
159
|
+
renderTableType: RenderTableType;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Get the required import for SchemaType|userType (`undefined` means that no import is required)
|
|
163
|
+
*/
|
|
164
|
+
declare function importForAbiOrUserType(abiOrUserType: string, usedInDirectory: string, config: StoreConfig): ImportDatum | undefined;
|
|
165
|
+
declare function getSchemaTypeInfo(schemaType: SchemaType): RenderTableType;
|
|
166
|
+
declare function getUserTypeInfo(userType: string, config: StoreConfig): {
|
|
167
|
+
schemaType: SchemaType;
|
|
168
|
+
renderTableType: RenderTableType;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export { ImportDatum, RenderSystemInterfaceFunction, RenderSystemInterfaceOptions, RenderTableDynamicField, RenderTableField, RenderTableOptions, RenderTablePrimaryKey, RenderTableStaticField, RenderTableType, RenderTableTypeWrappingData, RenderTypesEnum, RenderTypesOptions, RenderWorldOptions, StaticResourceData, TableOptions, UserTypeInfo, getSchemaTypeInfo, getTableOptions, getUserTypeInfo, importForAbiOrUserType, renderArguments, renderCommonData, renderDecodeValueType, renderEncodeField, renderFieldMethods, renderImports, renderList, renderRecordMethods, renderTable, renderTableId, renderTypes, renderTypesFromConfig, renderWithStore, renderedSolidityHeader, resolveAbiOrUserType, solidityRelativeImportPath, tablegen };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getTableOptions,
|
|
3
|
+
renderArguments,
|
|
4
|
+
renderCommonData,
|
|
5
|
+
renderDecodeValueType,
|
|
6
|
+
renderEncodeField,
|
|
7
|
+
renderFieldMethods,
|
|
8
|
+
renderImports,
|
|
9
|
+
renderList,
|
|
10
|
+
renderRecordMethods,
|
|
11
|
+
renderTable,
|
|
12
|
+
renderTableId,
|
|
13
|
+
renderTypes,
|
|
14
|
+
renderTypesFromConfig,
|
|
15
|
+
renderWithStore,
|
|
16
|
+
renderedSolidityHeader,
|
|
17
|
+
solidityRelativeImportPath,
|
|
18
|
+
tablegen
|
|
19
|
+
} from "../chunk-WZFXLDPK.js";
|
|
20
|
+
import {
|
|
21
|
+
getSchemaTypeInfo,
|
|
22
|
+
getUserTypeInfo,
|
|
23
|
+
importForAbiOrUserType,
|
|
24
|
+
resolveAbiOrUserType
|
|
25
|
+
} from "../chunk-SKNB74MT.js";
|
|
26
|
+
import "../chunk-L4YLJHLJ.js";
|
|
27
|
+
export {
|
|
28
|
+
getSchemaTypeInfo,
|
|
29
|
+
getTableOptions,
|
|
30
|
+
getUserTypeInfo,
|
|
31
|
+
importForAbiOrUserType,
|
|
32
|
+
renderArguments,
|
|
33
|
+
renderCommonData,
|
|
34
|
+
renderDecodeValueType,
|
|
35
|
+
renderEncodeField,
|
|
36
|
+
renderFieldMethods,
|
|
37
|
+
renderImports,
|
|
38
|
+
renderList,
|
|
39
|
+
renderRecordMethods,
|
|
40
|
+
renderTable,
|
|
41
|
+
renderTableId,
|
|
42
|
+
renderTypes,
|
|
43
|
+
renderTypesFromConfig,
|
|
44
|
+
renderWithStore,
|
|
45
|
+
renderedSolidityHeader,
|
|
46
|
+
resolveAbiOrUserType,
|
|
47
|
+
solidityRelativeImportPath,
|
|
48
|
+
tablegen
|
|
49
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { StoreConfig } from '@latticexyz/config';
|
|
2
|
+
import { SchemaType } from '@latticexyz/schema-type';
|
|
3
|
+
|
|
4
|
+
interface RecsV1TableOptions {
|
|
5
|
+
tables: {
|
|
6
|
+
tableName: string;
|
|
7
|
+
fields: {
|
|
8
|
+
recsTypeString: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}[];
|
|
11
|
+
staticResourceData: {
|
|
12
|
+
namespace: string;
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
}[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare function getRecsV1TableOptions(config: StoreConfig): RecsV1TableOptions;
|
|
19
|
+
|
|
20
|
+
declare function renderRecsV1Tables(options: RecsV1TableOptions): string;
|
|
21
|
+
|
|
22
|
+
declare const schemaTypesToRecsTypeStrings: Record<SchemaType, string>;
|
|
23
|
+
|
|
24
|
+
declare function tsgen(config: StoreConfig, outDirectory: string): Promise<void>;
|
|
25
|
+
|
|
26
|
+
export { RecsV1TableOptions, getRecsV1TableOptions, renderRecsV1Tables, schemaTypesToRecsTypeStrings, tsgen };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getRecsV1TableOptions,
|
|
3
|
+
renderRecsV1Tables,
|
|
4
|
+
schemaTypesToRecsTypeStrings,
|
|
5
|
+
tsgen
|
|
6
|
+
} from "../chunk-6V563IAZ.js";
|
|
7
|
+
import "../chunk-SKNB74MT.js";
|
|
8
|
+
import "../chunk-L4YLJHLJ.js";
|
|
9
|
+
export {
|
|
10
|
+
getRecsV1TableOptions,
|
|
11
|
+
renderRecsV1Tables,
|
|
12
|
+
schemaTypesToRecsTypeStrings,
|
|
13
|
+
tsgen
|
|
14
|
+
};
|
|
@@ -14,9 +14,9 @@ import {
|
|
|
14
14
|
hsr,
|
|
15
15
|
keccak256,
|
|
16
16
|
resetLibDeploy
|
|
17
|
-
} from "../../chunk-
|
|
18
|
-
import "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
17
|
+
} from "../../chunk-VQTZJIFF.js";
|
|
18
|
+
import "../../chunk-FPG73MVN.js";
|
|
19
|
+
import "../../chunk-L4YLJHLJ.js";
|
|
20
20
|
export {
|
|
21
21
|
IDregex,
|
|
22
22
|
deploy,
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ValidationError } from 'zod-validation-error';
|
|
3
|
-
import { MUDConfig } from '../config/index.js';
|
|
4
|
-
import '@latticexyz/schema-type';
|
|
1
|
+
import { MUDConfig } from '@latticexyz/config';
|
|
5
2
|
|
|
6
|
-
declare function fromZodErrorCustom(error: ZodError, prefix: string): ValidationError;
|
|
7
|
-
declare class NotInsideProjectError extends Error {
|
|
8
|
-
name: string;
|
|
9
|
-
message: string;
|
|
10
|
-
}
|
|
11
|
-
declare class NotESMConfigError extends Error {
|
|
12
|
-
name: string;
|
|
13
|
-
message: string;
|
|
14
|
-
}
|
|
15
|
-
declare class MUDError extends Error {
|
|
16
|
-
name: string;
|
|
17
|
-
}
|
|
18
|
-
declare function UnrecognizedSystemErrorFactory(path: string[], systemName: string): z.ZodError<any>;
|
|
19
3
|
declare function logError(error: unknown): void;
|
|
20
4
|
|
|
21
5
|
interface ForgeConfig {
|
|
@@ -74,8 +58,18 @@ declare function forge(args: string[], options?: {
|
|
|
74
58
|
declare function cast(args: string[], options?: {
|
|
75
59
|
profile?: string;
|
|
76
60
|
}): Promise<string>;
|
|
61
|
+
/**
|
|
62
|
+
* Start an anvil chain
|
|
63
|
+
* @param args The arguments to pass to anvil
|
|
64
|
+
* @returns Stdout of the command
|
|
65
|
+
*/
|
|
66
|
+
declare function anvil(args: string[]): Promise<string>;
|
|
77
67
|
|
|
78
68
|
declare function formatSolidity(content: string, prettierConfigPath?: string): Promise<string>;
|
|
69
|
+
declare function formatTypescript(content: string): Promise<string>;
|
|
70
|
+
|
|
71
|
+
declare function formatAndWriteSolidity(output: string, fullOutputPath: string, logPrefix: string): Promise<void>;
|
|
72
|
+
declare function formatAndWriteTypescript(output: string, fullOutputPath: string, logPrefix: string): Promise<void>;
|
|
79
73
|
|
|
80
74
|
interface DeployConfig {
|
|
81
75
|
profile?: string;
|
|
@@ -83,6 +77,7 @@ interface DeployConfig {
|
|
|
83
77
|
privateKey: string;
|
|
84
78
|
priorityFeeMultiplier: number;
|
|
85
79
|
debug?: boolean;
|
|
80
|
+
worldAddress?: string;
|
|
86
81
|
}
|
|
87
82
|
interface DeploymentInfo {
|
|
88
83
|
blockNumber: number;
|
|
@@ -90,4 +85,4 @@ interface DeploymentInfo {
|
|
|
90
85
|
}
|
|
91
86
|
declare function deploy(mudConfig: MUDConfig, deployConfig: DeployConfig): Promise<DeploymentInfo>;
|
|
92
87
|
|
|
93
|
-
export { DeployConfig, DeploymentInfo, ForgeConfig,
|
|
88
|
+
export { DeployConfig, DeploymentInfo, ForgeConfig, anvil, cast, deploy, forge, formatAndWriteSolidity, formatAndWriteTypescript, formatSolidity, formatTypescript, getForgeConfig, getOutDirectory, getRpcUrl, getScriptDirectory, getSrcDirectory, getTestDirectory, logError };
|
package/dist/utils/index.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deploy,
|
|
3
|
-
formatSolidity
|
|
4
|
-
} from "../chunk-O57QENJ6.js";
|
|
5
|
-
import {
|
|
6
|
-
MUDError,
|
|
7
|
-
NotESMConfigError,
|
|
8
|
-
NotInsideProjectError,
|
|
9
|
-
UnrecognizedSystemErrorFactory,
|
|
10
|
-
fromZodErrorCustom,
|
|
11
3
|
logError
|
|
12
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-4STWSICF.js";
|
|
13
5
|
import {
|
|
6
|
+
anvil,
|
|
14
7
|
cast,
|
|
15
8
|
forge,
|
|
16
9
|
getForgeConfig,
|
|
@@ -19,18 +12,23 @@ import {
|
|
|
19
12
|
getScriptDirectory,
|
|
20
13
|
getSrcDirectory,
|
|
21
14
|
getTestDirectory
|
|
22
|
-
} from "../chunk-
|
|
23
|
-
import
|
|
15
|
+
} from "../chunk-FPG73MVN.js";
|
|
16
|
+
import {
|
|
17
|
+
formatAndWriteSolidity,
|
|
18
|
+
formatAndWriteTypescript,
|
|
19
|
+
formatSolidity,
|
|
20
|
+
formatTypescript
|
|
21
|
+
} from "../chunk-SKNB74MT.js";
|
|
22
|
+
import "../chunk-L4YLJHLJ.js";
|
|
24
23
|
export {
|
|
25
|
-
|
|
26
|
-
NotESMConfigError,
|
|
27
|
-
NotInsideProjectError,
|
|
28
|
-
UnrecognizedSystemErrorFactory,
|
|
24
|
+
anvil,
|
|
29
25
|
cast,
|
|
30
26
|
deploy,
|
|
31
27
|
forge,
|
|
28
|
+
formatAndWriteSolidity,
|
|
29
|
+
formatAndWriteTypescript,
|
|
32
30
|
formatSolidity,
|
|
33
|
-
|
|
31
|
+
formatTypescript,
|
|
34
32
|
getForgeConfig,
|
|
35
33
|
getOutDirectory,
|
|
36
34
|
getRpcUrl,
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@latticexyz/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.0",
|
|
4
4
|
"description": "Command line interface for mud",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"bin": {
|
|
10
|
-
"mud": "./dist/mud.js"
|
|
10
|
+
"mud": "./dist/mud.js",
|
|
11
|
+
"mud2": "./dist/mud2.js"
|
|
11
12
|
},
|
|
12
13
|
"repository": {
|
|
13
14
|
"type": "git",
|
|
@@ -15,37 +16,39 @@
|
|
|
15
16
|
"directory": "packages/cli"
|
|
16
17
|
},
|
|
17
18
|
"scripts": {
|
|
18
|
-
"prepare": "
|
|
19
|
-
"codegen": "
|
|
19
|
+
"prepare": "pnpm build",
|
|
20
|
+
"codegen": "tsx ./scripts/codegen.ts",
|
|
20
21
|
"lint": "eslint . --ext .ts",
|
|
21
22
|
"dev": "tsup --watch",
|
|
22
23
|
"build": "tsup",
|
|
23
|
-
"
|
|
24
|
-
"test": "
|
|
25
|
-
"test:contracts": "yarn codegen && forge test",
|
|
26
|
-
"git:install": "bash git-install.sh",
|
|
24
|
+
"test": "tsc --noEmit && pnpm test:contracts",
|
|
25
|
+
"test:contracts": "pnpm codegen && forge test",
|
|
27
26
|
"release": "npm publish --access=public"
|
|
28
27
|
},
|
|
29
28
|
"devDependencies": {
|
|
30
|
-
"@latticexyz/store": "^1.41.1-alpha.41+efdfeb310",
|
|
31
29
|
"@types/ejs": "^3.1.1",
|
|
32
30
|
"@types/glob": "^7.2.0",
|
|
33
31
|
"@types/node": "^17.0.34",
|
|
34
32
|
"@types/openurl": "^1.0.0",
|
|
35
33
|
"@types/yargs": "^17.0.10",
|
|
36
|
-
"esbuild": "^0.15.16",
|
|
37
34
|
"tsup": "^6.6.3",
|
|
38
|
-
"
|
|
35
|
+
"tsx": "^3.12.6",
|
|
36
|
+
"vitest": "^0.29.8"
|
|
39
37
|
},
|
|
40
38
|
"dependencies": {
|
|
39
|
+
"@ethersproject/abi": "^5.7.0",
|
|
40
|
+
"@ethersproject/providers": "^5.7.2",
|
|
41
41
|
"@improbable-eng/grpc-web": "^0.15.0",
|
|
42
42
|
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
|
43
|
-
"@latticexyz/
|
|
44
|
-
"@latticexyz/
|
|
45
|
-
"@latticexyz/
|
|
46
|
-
"@latticexyz/
|
|
43
|
+
"@latticexyz/config": "1.42.0",
|
|
44
|
+
"@latticexyz/schema-type": "1.42.0",
|
|
45
|
+
"@latticexyz/services": "1.42.0",
|
|
46
|
+
"@latticexyz/solecs": "1.42.0",
|
|
47
|
+
"@latticexyz/std-contracts": "1.42.0",
|
|
48
|
+
"@latticexyz/store": "1.42.0",
|
|
49
|
+
"@latticexyz/world": "1.42.0",
|
|
47
50
|
"@solidity-parser/parser": "^0.16.0",
|
|
48
|
-
"@typechain/ethers-v5": "^10.
|
|
51
|
+
"@typechain/ethers-v5": "^10.2.0",
|
|
49
52
|
"chalk": "^5.0.1",
|
|
50
53
|
"chokidar": "^3.5.3",
|
|
51
54
|
"dotenv": "^16.0.3",
|
|
@@ -53,7 +56,6 @@
|
|
|
53
56
|
"ejs": "^3.1.8",
|
|
54
57
|
"ethers": "^5.7.2",
|
|
55
58
|
"execa": "^7.0.0",
|
|
56
|
-
"find-up": "^6.3.0",
|
|
57
59
|
"forge-std": "https://github.com/foundry-rs/forge-std.git#b4f121555729b3afb3c5ffccb62ff4b6e2818fd3",
|
|
58
60
|
"glob": "^8.0.3",
|
|
59
61
|
"nice-grpc-web": "^2.0.1",
|
|
@@ -61,14 +63,12 @@
|
|
|
61
63
|
"path": "^0.12.7",
|
|
62
64
|
"prettier": "^2.8.4",
|
|
63
65
|
"prettier-plugin-solidity": "^1.1.2",
|
|
64
|
-
"solmate": "https://github.com/Rari-Capital/solmate.git#9cf1428245074e39090dceacb0c28b1f684f584c",
|
|
65
66
|
"table": "^6.8.1",
|
|
66
|
-
"ts-node": "^10.9.1",
|
|
67
67
|
"typechain": "^8.1.1",
|
|
68
68
|
"typescript": "^4.9.5",
|
|
69
69
|
"yargs": "^17.7.1",
|
|
70
70
|
"zod": "^3.21.4",
|
|
71
|
-
"zod-validation-error": "^1.0
|
|
71
|
+
"zod-validation-error": "^1.3.0"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "ac0a61a9131ed2225a5342bd14f2d1354040511c"
|
|
74
74
|
}
|