@latticexyz/cli 2.0.0-alpha.78 → 2.0.0-alpha.79
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-DO7OWTMM.js → chunk-K25KS5QJ.js} +2 -4
- package/dist/{chunk-TPZUS44H.js → chunk-SADK4UCO.js} +1 -1
- package/dist/{chunk-KPBNUPK6.js → chunk-SKNB74MT.js} +155 -159
- package/dist/{chunk-TLEAEDUA.js → chunk-WZFBU6KC.js} +36 -36
- package/dist/{chunk-XUNWAEP7.js → chunk-YNVRICE5.js} +59 -36
- package/dist/index.d.ts +2 -4
- package/dist/index.js +0 -22
- package/dist/mud.js +5 -7
- package/dist/mud2.js +5 -7
- package/dist/render-solidity/index.d.ts +1 -2
- package/dist/render-solidity/index.js +2 -3
- package/dist/render-ts/index.d.ts +1 -2
- package/dist/render-ts/index.js +2 -3
- package/dist/utils/index.d.ts +2 -15
- package/dist/utils/index.js +3 -14
- package/package.json +12 -14
- package/src/commands/deploy-v2.ts +3 -3
- package/src/commands/set-version.ts +3 -2
- package/src/commands/tablegen.ts +1 -1
- package/src/commands/tsgen.ts +1 -1
- package/src/commands/worldgen.ts +1 -2
- package/src/index.ts +1 -15
- package/src/render-solidity/renderTypesFromConfig.ts +1 -1
- package/src/render-solidity/tableOptions.ts +1 -1
- package/src/render-solidity/tablegen.ts +1 -1
- package/src/render-solidity/userType.ts +1 -2
- package/src/render-solidity/worldgen.ts +1 -1
- package/src/render-ts/recsV1TableOptions.ts +1 -1
- package/src/render-ts/tsgen.ts +1 -1
- package/src/utils/contractToInterface.ts +1 -1
- package/src/utils/deploy-v2.ts +2 -2
- package/src/utils/errors.ts +3 -23
- package/dist/chunk-5NC2OON2.js +0 -164
- package/dist/chunk-MN3HYFJK.js +0 -442
- package/dist/config/index.d.ts +0 -409
- package/dist/config/index.js +0 -85
- package/dist/parseStoreConfig-8aa69ac9.d.ts +0 -377
- 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 -40
- package/src/config/loadStoreConfig.ts +0 -18
- package/src/config/parseStoreConfig.test-d.ts +0 -40
- package/src/config/parseStoreConfig.ts +0 -317
- 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 -56
- package/src/config/world/resolveWorldConfig.ts +0 -80
- package/src/config/world/userTypes.ts +0 -74
- package/src/utils/typeUtils.ts +0 -17
package/dist/config/index.d.ts
DELETED
|
@@ -1,409 +0,0 @@
|
|
|
1
|
-
import { R as RequireKeys, b as StringForUnion, E as ExtractUserTypes, S as StoreUserConfig, a as StoreConfig } from '../parseStoreConfig-8aa69ac9.js';
|
|
2
|
-
export { h as EnumsConfig, F as FullSchemaConfig, d as SchemaConfig, c as ShorthandSchemaConfig, a as StoreConfig, S as StoreUserConfig, T as TableConfig, f as TablesConfig, p as parseStoreConfig, s as storeConfig, i as zEnumsConfig, z as zSchemaConfig, j as zStoreConfig, e as zTableConfig, g as zTablesConfig } from '../parseStoreConfig-8aa69ac9.js';
|
|
3
|
-
import { z, RefinementCtx } from 'zod';
|
|
4
|
-
import '@latticexyz/schema-type';
|
|
5
|
-
|
|
6
|
-
declare function loadStoreConfig(configPath?: string): Promise<{
|
|
7
|
-
tables: Record<string, RequireKeys<RequireKeys<{
|
|
8
|
-
directory: string;
|
|
9
|
-
tableIdArgument: boolean;
|
|
10
|
-
storeArgument: boolean;
|
|
11
|
-
primaryKeys: Record<string, string>;
|
|
12
|
-
schema: Record<string, string>;
|
|
13
|
-
fileSelector?: string | undefined;
|
|
14
|
-
dataStruct?: boolean | undefined;
|
|
15
|
-
}, "dataStruct">, "fileSelector">>;
|
|
16
|
-
enums: Record<string, string[]>;
|
|
17
|
-
namespace: string;
|
|
18
|
-
storeImportPath: string;
|
|
19
|
-
userTypesPath: string;
|
|
20
|
-
codegenDirectory: string;
|
|
21
|
-
}>;
|
|
22
|
-
|
|
23
|
-
type SystemUserConfig = {
|
|
24
|
-
/** The full resource selector consists of namespace and fileSelector */
|
|
25
|
-
fileSelector?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Register function selectors for the system in the World.
|
|
28
|
-
* Defaults to true.
|
|
29
|
-
* Note:
|
|
30
|
-
* - For root systems all World function selectors will correspond to the system's function selectors.
|
|
31
|
-
* - For non-root systems, the World function selectors will be <namespace>_<system>_<function>.
|
|
32
|
-
*/
|
|
33
|
-
registerFunctionSelectors?: boolean;
|
|
34
|
-
} & ({
|
|
35
|
-
/** If openAccess is true, any address can call the system */
|
|
36
|
-
openAccess: true;
|
|
37
|
-
} | {
|
|
38
|
-
/** If openAccess is false, only the addresses or systems in `access` can call the system */
|
|
39
|
-
openAccess: false;
|
|
40
|
-
/** An array of addresses or system names that can access the system */
|
|
41
|
-
accessList: string[];
|
|
42
|
-
});
|
|
43
|
-
type ValueWithType = {
|
|
44
|
-
value: string | number | Uint8Array;
|
|
45
|
-
type: string;
|
|
46
|
-
};
|
|
47
|
-
type ModuleConfig = {
|
|
48
|
-
/** The name of the module */
|
|
49
|
-
name: string;
|
|
50
|
-
/** Should this module be installed as a root module? */
|
|
51
|
-
root?: boolean;
|
|
52
|
-
/** Arguments to be passed to the module's install method */
|
|
53
|
-
args?: (ValueWithType | DynamicResolution)[];
|
|
54
|
-
};
|
|
55
|
-
interface WorldUserConfig {
|
|
56
|
-
/** The namespace to register tables and systems at. Defaults to the root namespace (empty string) */
|
|
57
|
-
namespace?: string;
|
|
58
|
-
/** The name of the World contract to deploy. If no name is provided, a vanilla World is deployed */
|
|
59
|
-
worldContractName?: string;
|
|
60
|
-
/** The name of the World interface to generate. (Default `IWorld`) */
|
|
61
|
-
worldInterfaceName?: string;
|
|
62
|
-
/**
|
|
63
|
-
* Contracts named *System will be deployed by default
|
|
64
|
-
* as public systems at `namespace/ContractName`, unless overridden
|
|
65
|
-
*
|
|
66
|
-
* The key is the system name (capitalized).
|
|
67
|
-
* The value is a SystemConfig object.
|
|
68
|
-
*/
|
|
69
|
-
overrideSystems?: Record<string, SystemUserConfig>;
|
|
70
|
-
/** Systems to exclude from automatic deployment */
|
|
71
|
-
excludeSystems?: string[];
|
|
72
|
-
/**
|
|
73
|
-
* Script to execute after the deployment is complete (Default "PostDeploy").
|
|
74
|
-
* Script must be placed in the forge scripts directory (see foundry.toml) and have a ".s.sol" extension.
|
|
75
|
-
*/
|
|
76
|
-
postDeployScript?: string;
|
|
77
|
-
/** Directory to write the deployment info to (Default "./deploys") */
|
|
78
|
-
deploysDirectory?: string;
|
|
79
|
-
/** Directory to output system and world interfaces of `worldgen` (Default "world") */
|
|
80
|
-
worldgenDirectory?: string;
|
|
81
|
-
/** Path for world package imports. Default is "@latticexyz/world/src/" */
|
|
82
|
-
worldImportPath?: string;
|
|
83
|
-
/** Modules to in the World */
|
|
84
|
-
modules?: ModuleConfig[];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
declare enum DynamicResolutionType {
|
|
88
|
-
TABLE_ID = 0,
|
|
89
|
-
SYSTEM_ADDRESS = 1
|
|
90
|
-
}
|
|
91
|
-
type DynamicResolution = {
|
|
92
|
-
type: DynamicResolutionType;
|
|
93
|
-
input: string;
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Dynamically resolve a table name to a table id at deploy time
|
|
97
|
-
*/
|
|
98
|
-
declare function resolveTableId(tableName: string): {
|
|
99
|
-
type: DynamicResolutionType;
|
|
100
|
-
input: string;
|
|
101
|
-
};
|
|
102
|
-
/** Type guard for DynamicResolution */
|
|
103
|
-
declare function isDynamicResolution(value: unknown): value is DynamicResolution;
|
|
104
|
-
/**
|
|
105
|
-
* Turn a DynamicResolution object into a ValueWithType based on the provided context
|
|
106
|
-
*/
|
|
107
|
-
declare function resolveWithContext(unresolved: any, context: {
|
|
108
|
-
systemAddresses?: Record<string, Promise<string>>;
|
|
109
|
-
tableIds?: Record<string, Uint8Array>;
|
|
110
|
-
}): Promise<ValueWithType>;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Loads and resolves the world config.
|
|
114
|
-
* @param configPath Path to load the config from. Defaults to "mud.config.mts" or "mud.config.ts"
|
|
115
|
-
* @param existingContracts Optional list of existing contract names to validate system names against. If not provided, no validation is performed. Contract names ending in `System` will be added to the config with default values.
|
|
116
|
-
* @returns Promise of ResolvedWorldConfig object
|
|
117
|
-
*/
|
|
118
|
-
declare function loadWorldConfig(configPath?: string, existingContracts?: string[]): Promise<{
|
|
119
|
-
systems: Record<string, {
|
|
120
|
-
fileSelector: string;
|
|
121
|
-
registerFunctionSelectors: boolean;
|
|
122
|
-
openAccess: boolean;
|
|
123
|
-
accessListAddresses: string[];
|
|
124
|
-
accessListSystems: string[];
|
|
125
|
-
}>;
|
|
126
|
-
namespace: string;
|
|
127
|
-
worldInterfaceName: string;
|
|
128
|
-
postDeployScript: string;
|
|
129
|
-
deploysDirectory: string;
|
|
130
|
-
worldgenDirectory: string;
|
|
131
|
-
worldImportPath: string;
|
|
132
|
-
modules: {
|
|
133
|
-
name: string;
|
|
134
|
-
root: boolean;
|
|
135
|
-
args: ({
|
|
136
|
-
type: string;
|
|
137
|
-
value: (string | number | Uint8Array) & (string | number | Uint8Array | undefined);
|
|
138
|
-
} | {
|
|
139
|
-
type: DynamicResolutionType;
|
|
140
|
-
input: string;
|
|
141
|
-
})[];
|
|
142
|
-
}[];
|
|
143
|
-
worldContractName?: string | undefined;
|
|
144
|
-
}>;
|
|
145
|
-
|
|
146
|
-
declare const zWorldConfig: z.ZodObject<{
|
|
147
|
-
namespace: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
|
|
148
|
-
worldContractName: z.ZodOptional<z.ZodString>;
|
|
149
|
-
worldInterfaceName: z.ZodDefault<z.ZodString>;
|
|
150
|
-
overrideSystems: z.ZodDefault<z.ZodRecord<z.ZodEffects<z.ZodString, string, string>, z.ZodIntersection<z.ZodObject<{
|
|
151
|
-
fileSelector: z.ZodEffects<z.ZodString, string, string>;
|
|
152
|
-
registerFunctionSelectors: z.ZodDefault<z.ZodBoolean>;
|
|
153
|
-
}, "strip", z.ZodTypeAny, {
|
|
154
|
-
fileSelector: string;
|
|
155
|
-
registerFunctionSelectors: boolean;
|
|
156
|
-
}, {
|
|
157
|
-
fileSelector: string;
|
|
158
|
-
registerFunctionSelectors?: boolean | undefined;
|
|
159
|
-
}>, z.ZodDiscriminatedUnion<"openAccess", [z.ZodObject<{
|
|
160
|
-
openAccess: z.ZodLiteral<true>;
|
|
161
|
-
}, "strip", z.ZodTypeAny, {
|
|
162
|
-
openAccess: true;
|
|
163
|
-
}, {
|
|
164
|
-
openAccess: true;
|
|
165
|
-
}>, z.ZodObject<{
|
|
166
|
-
openAccess: z.ZodLiteral<false>;
|
|
167
|
-
accessList: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodString, string, string>]>, "many">>;
|
|
168
|
-
}, "strip", z.ZodTypeAny, {
|
|
169
|
-
openAccess: false;
|
|
170
|
-
accessList: string[];
|
|
171
|
-
}, {
|
|
172
|
-
openAccess: false;
|
|
173
|
-
accessList?: string[] | undefined;
|
|
174
|
-
}>]>>>>;
|
|
175
|
-
excludeSystems: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
176
|
-
postDeployScript: z.ZodDefault<z.ZodString>;
|
|
177
|
-
deploysDirectory: z.ZodDefault<z.ZodString>;
|
|
178
|
-
worldgenDirectory: z.ZodDefault<z.ZodString>;
|
|
179
|
-
worldImportPath: z.ZodDefault<z.ZodString>;
|
|
180
|
-
modules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
181
|
-
name: z.ZodEffects<z.ZodString, string, string>;
|
|
182
|
-
root: z.ZodDefault<z.ZodBoolean>;
|
|
183
|
-
args: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodObject<{
|
|
184
|
-
value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>]>;
|
|
185
|
-
type: z.ZodString;
|
|
186
|
-
}, "strip", z.ZodTypeAny, {
|
|
187
|
-
type: string;
|
|
188
|
-
value: (string | number | Uint8Array) & (string | number | Uint8Array | undefined);
|
|
189
|
-
}, {
|
|
190
|
-
type: string;
|
|
191
|
-
value: (string | number | Uint8Array) & (string | number | Uint8Array | undefined);
|
|
192
|
-
}>, z.ZodObject<{
|
|
193
|
-
type: z.ZodNativeEnum<typeof DynamicResolutionType>;
|
|
194
|
-
input: z.ZodString;
|
|
195
|
-
}, "strip", z.ZodTypeAny, {
|
|
196
|
-
type: DynamicResolutionType;
|
|
197
|
-
input: string;
|
|
198
|
-
}, {
|
|
199
|
-
type: DynamicResolutionType;
|
|
200
|
-
input: string;
|
|
201
|
-
}>]>, "many">>;
|
|
202
|
-
}, "strip", z.ZodTypeAny, {
|
|
203
|
-
name: string;
|
|
204
|
-
root: boolean;
|
|
205
|
-
args: ({
|
|
206
|
-
type: string;
|
|
207
|
-
value: (string | number | Uint8Array) & (string | number | Uint8Array | undefined);
|
|
208
|
-
} | {
|
|
209
|
-
type: DynamicResolutionType;
|
|
210
|
-
input: string;
|
|
211
|
-
})[];
|
|
212
|
-
}, {
|
|
213
|
-
name: string;
|
|
214
|
-
root?: boolean | undefined;
|
|
215
|
-
args?: ({
|
|
216
|
-
type: string;
|
|
217
|
-
value: (string | number | Uint8Array) & (string | number | Uint8Array | undefined);
|
|
218
|
-
} | {
|
|
219
|
-
type: DynamicResolutionType;
|
|
220
|
-
input: string;
|
|
221
|
-
})[] | undefined;
|
|
222
|
-
}>, "many">>;
|
|
223
|
-
}, "strip", z.ZodTypeAny, {
|
|
224
|
-
namespace: string;
|
|
225
|
-
worldInterfaceName: string;
|
|
226
|
-
overrideSystems: Record<string, {
|
|
227
|
-
fileSelector: string;
|
|
228
|
-
registerFunctionSelectors: boolean;
|
|
229
|
-
} & ({
|
|
230
|
-
openAccess: true;
|
|
231
|
-
} | {
|
|
232
|
-
openAccess: false;
|
|
233
|
-
accessList: string[];
|
|
234
|
-
})>;
|
|
235
|
-
excludeSystems: string[];
|
|
236
|
-
postDeployScript: string;
|
|
237
|
-
deploysDirectory: string;
|
|
238
|
-
worldgenDirectory: string;
|
|
239
|
-
worldImportPath: string;
|
|
240
|
-
modules: {
|
|
241
|
-
name: string;
|
|
242
|
-
root: boolean;
|
|
243
|
-
args: ({
|
|
244
|
-
type: string;
|
|
245
|
-
value: (string | number | Uint8Array) & (string | number | Uint8Array | undefined);
|
|
246
|
-
} | {
|
|
247
|
-
type: DynamicResolutionType;
|
|
248
|
-
input: string;
|
|
249
|
-
})[];
|
|
250
|
-
}[];
|
|
251
|
-
worldContractName?: string | undefined;
|
|
252
|
-
}, {
|
|
253
|
-
namespace?: string | undefined;
|
|
254
|
-
worldContractName?: string | undefined;
|
|
255
|
-
worldInterfaceName?: string | undefined;
|
|
256
|
-
overrideSystems?: Record<string, {
|
|
257
|
-
fileSelector: string;
|
|
258
|
-
registerFunctionSelectors?: boolean | undefined;
|
|
259
|
-
} & ({
|
|
260
|
-
openAccess: true;
|
|
261
|
-
} | {
|
|
262
|
-
openAccess: false;
|
|
263
|
-
accessList?: string[] | undefined;
|
|
264
|
-
})> | undefined;
|
|
265
|
-
excludeSystems?: string[] | undefined;
|
|
266
|
-
postDeployScript?: string | undefined;
|
|
267
|
-
deploysDirectory?: string | undefined;
|
|
268
|
-
worldgenDirectory?: string | undefined;
|
|
269
|
-
worldImportPath?: string | undefined;
|
|
270
|
-
modules?: {
|
|
271
|
-
name: string;
|
|
272
|
-
root?: boolean | undefined;
|
|
273
|
-
args?: ({
|
|
274
|
-
type: string;
|
|
275
|
-
value: (string | number | Uint8Array) & (string | number | Uint8Array | undefined);
|
|
276
|
-
} | {
|
|
277
|
-
type: DynamicResolutionType;
|
|
278
|
-
input: string;
|
|
279
|
-
})[] | undefined;
|
|
280
|
-
}[] | undefined;
|
|
281
|
-
}>;
|
|
282
|
-
declare function parseWorldConfig(config: unknown): Promise<{
|
|
283
|
-
namespace: string;
|
|
284
|
-
worldInterfaceName: string;
|
|
285
|
-
overrideSystems: Record<string, {
|
|
286
|
-
fileSelector: string;
|
|
287
|
-
registerFunctionSelectors: boolean;
|
|
288
|
-
} & ({
|
|
289
|
-
openAccess: true;
|
|
290
|
-
} | {
|
|
291
|
-
openAccess: false;
|
|
292
|
-
accessList: string[];
|
|
293
|
-
})>;
|
|
294
|
-
excludeSystems: string[];
|
|
295
|
-
postDeployScript: string;
|
|
296
|
-
deploysDirectory: string;
|
|
297
|
-
worldgenDirectory: string;
|
|
298
|
-
worldImportPath: string;
|
|
299
|
-
modules: {
|
|
300
|
-
name: string;
|
|
301
|
-
root: boolean;
|
|
302
|
-
args: ({
|
|
303
|
-
type: string;
|
|
304
|
-
value: (string | number | Uint8Array) & (string | number | Uint8Array | undefined);
|
|
305
|
-
} | {
|
|
306
|
-
type: DynamicResolutionType;
|
|
307
|
-
input: string;
|
|
308
|
-
})[];
|
|
309
|
-
}[];
|
|
310
|
-
worldContractName?: string | undefined;
|
|
311
|
-
}>;
|
|
312
|
-
type ParsedWorldConfig = z.output<typeof zWorldConfig>;
|
|
313
|
-
|
|
314
|
-
type ResolvedSystemConfig = ReturnType<typeof resolveSystemConfig>;
|
|
315
|
-
type ResolvedWorldConfig = ReturnType<typeof resolveWorldConfig>;
|
|
316
|
-
/**
|
|
317
|
-
* Resolves the world config by combining the default and overridden system configs,
|
|
318
|
-
* filtering out excluded systems, validate system names refer to existing contracts, and
|
|
319
|
-
* splitting the access list into addresses and system names.
|
|
320
|
-
*/
|
|
321
|
-
declare function resolveWorldConfig(config: ParsedWorldConfig, existingContracts?: string[]): {
|
|
322
|
-
systems: Record<string, {
|
|
323
|
-
fileSelector: string;
|
|
324
|
-
registerFunctionSelectors: boolean;
|
|
325
|
-
openAccess: boolean;
|
|
326
|
-
accessListAddresses: string[];
|
|
327
|
-
accessListSystems: string[];
|
|
328
|
-
}>;
|
|
329
|
-
namespace: string;
|
|
330
|
-
worldInterfaceName: string;
|
|
331
|
-
postDeployScript: string;
|
|
332
|
-
deploysDirectory: string;
|
|
333
|
-
worldgenDirectory: string;
|
|
334
|
-
worldImportPath: string;
|
|
335
|
-
modules: {
|
|
336
|
-
name: string;
|
|
337
|
-
root: boolean;
|
|
338
|
-
args: ({
|
|
339
|
-
type: string;
|
|
340
|
-
value: (string | number | Uint8Array) & (string | number | Uint8Array | undefined);
|
|
341
|
-
} | {
|
|
342
|
-
type: DynamicResolutionType;
|
|
343
|
-
input: string;
|
|
344
|
-
})[];
|
|
345
|
-
}[];
|
|
346
|
-
worldContractName?: string | undefined;
|
|
347
|
-
};
|
|
348
|
-
/**
|
|
349
|
-
* Resolves the system config by combining the default and overridden system configs,
|
|
350
|
-
* @param systemName name of the system
|
|
351
|
-
* @param config optional SystemConfig object, if none is provided the default config is used
|
|
352
|
-
* @param existingContracts optional list of existing contract names, used to validate system names in the access list. If not provided, no validation is performed.
|
|
353
|
-
* @returns ResolvedSystemConfig object
|
|
354
|
-
* Default value for fileSelector is `systemName`
|
|
355
|
-
* Default value for registerFunctionSelectors is true
|
|
356
|
-
* Default value for openAccess is true
|
|
357
|
-
* Default value for accessListAddresses is []
|
|
358
|
-
* Default value for accessListSystems is []
|
|
359
|
-
*/
|
|
360
|
-
declare function resolveSystemConfig(systemName: string, config?: SystemUserConfig, existingContracts?: string[]): {
|
|
361
|
-
fileSelector: string;
|
|
362
|
-
registerFunctionSelectors: boolean;
|
|
363
|
-
openAccess: boolean;
|
|
364
|
-
accessListAddresses: string[];
|
|
365
|
-
accessListSystems: string[];
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
/** Capitalized names of objects, like tables and systems */
|
|
369
|
-
declare const zObjectName: z.ZodEffects<z.ZodString, string, string>;
|
|
370
|
-
/** Uncapitalized names of values, like keys and columns */
|
|
371
|
-
declare const zValueName: z.ZodEffects<z.ZodString, string, string>;
|
|
372
|
-
/** Name that can start with any case */
|
|
373
|
-
declare const zAnyCaseName: z.ZodEffects<z.ZodString, string, string>;
|
|
374
|
-
/** List of unique enum member names and 0 < length < 256 */
|
|
375
|
-
declare const zUserEnum: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">, string[], string[]>;
|
|
376
|
-
/** Ordinary routes */
|
|
377
|
-
declare const zOrdinaryRoute: z.ZodEffects<z.ZodString, string, string>;
|
|
378
|
-
/** Routes with exactly 1 non-empty level */
|
|
379
|
-
declare const zSingleLevelRoute: z.ZodEffects<z.ZodString, string, string>;
|
|
380
|
-
/** Base routes (can be an empty string) */
|
|
381
|
-
declare const zBaseRoute: z.ZodEffects<z.ZodString, string, string>;
|
|
382
|
-
/** A valid Ethereum address */
|
|
383
|
-
declare const zEthereumAddress: z.ZodEffects<z.ZodString, string, string>;
|
|
384
|
-
/** A selector for namespace/file/resource */
|
|
385
|
-
declare const zSelector: z.ZodEffects<z.ZodString, string, string>;
|
|
386
|
-
|
|
387
|
-
declare function loadConfig(configPath?: string): Promise<unknown>;
|
|
388
|
-
|
|
389
|
-
declare function validateName(name: string, ctx: RefinementCtx): void;
|
|
390
|
-
declare function validateCapitalizedName(name: string, ctx: RefinementCtx): void;
|
|
391
|
-
declare function validateUncapitalizedName(name: string, ctx: RefinementCtx): void;
|
|
392
|
-
declare function validateEnum(members: string[], ctx: RefinementCtx): void;
|
|
393
|
-
declare const validateRoute: (route: string, ctx: RefinementCtx) => void;
|
|
394
|
-
declare const validateBaseRoute: (route: string, ctx: RefinementCtx) => void;
|
|
395
|
-
declare const validateSingleLevelRoute: (route: string, ctx: RefinementCtx) => void;
|
|
396
|
-
declare function validateEthereumAddress(address: string, ctx: RefinementCtx): void;
|
|
397
|
-
declare function getDuplicates<T>(array: T[]): T[];
|
|
398
|
-
declare function validateSelector(name: string, ctx: RefinementCtx): void;
|
|
399
|
-
/** Returns null if the type does not look like a static array, otherwise element and length data */
|
|
400
|
-
declare function parseStaticArray(abiType: string): {
|
|
401
|
-
elementType: string;
|
|
402
|
-
staticLength: number;
|
|
403
|
-
} | null;
|
|
404
|
-
|
|
405
|
-
type MUDUserConfig<EnumNames extends StringForUnion = StringForUnion, StaticUserTypes extends ExtractUserTypes<EnumNames> = ExtractUserTypes<EnumNames>> = StoreUserConfig<EnumNames, StaticUserTypes> & WorldUserConfig;
|
|
406
|
-
type MUDConfig = StoreConfig & ResolvedWorldConfig;
|
|
407
|
-
declare function mudConfig<EnumNames extends StringForUnion = never, StaticUserTypes extends ExtractUserTypes<EnumNames> = ExtractUserTypes<EnumNames>>(config: MUDUserConfig<EnumNames, StaticUserTypes>): MUDUserConfig<EnumNames, StaticUserTypes>;
|
|
408
|
-
|
|
409
|
-
export { DynamicResolution, DynamicResolutionType, MUDConfig, MUDUserConfig, ModuleConfig, ParsedWorldConfig, ResolvedSystemConfig, ResolvedWorldConfig, SystemUserConfig, ValueWithType, WorldUserConfig, getDuplicates, isDynamicResolution, loadConfig, loadStoreConfig, loadWorldConfig, mudConfig, parseStaticArray, parseWorldConfig, resolveSystemConfig, resolveTableId, resolveWithContext, resolveWorldConfig, validateBaseRoute, validateCapitalizedName, validateEnum, validateEthereumAddress, validateName, validateRoute, validateSelector, validateSingleLevelRoute, validateUncapitalizedName, zAnyCaseName, zBaseRoute, zEthereumAddress, zObjectName, zOrdinaryRoute, zSelector, zSingleLevelRoute, zUserEnum, zValueName, zWorldConfig };
|
package/dist/config/index.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DynamicResolutionType,
|
|
3
|
-
isDynamicResolution,
|
|
4
|
-
loadConfig,
|
|
5
|
-
loadStoreConfig,
|
|
6
|
-
loadWorldConfig,
|
|
7
|
-
mudConfig,
|
|
8
|
-
parseStoreConfig,
|
|
9
|
-
parseWorldConfig,
|
|
10
|
-
resolveSystemConfig,
|
|
11
|
-
resolveTableId,
|
|
12
|
-
resolveWithContext,
|
|
13
|
-
resolveWorldConfig,
|
|
14
|
-
storeConfig,
|
|
15
|
-
zAnyCaseName,
|
|
16
|
-
zBaseRoute,
|
|
17
|
-
zEnumsConfig,
|
|
18
|
-
zEthereumAddress,
|
|
19
|
-
zObjectName,
|
|
20
|
-
zOrdinaryRoute,
|
|
21
|
-
zSchemaConfig,
|
|
22
|
-
zSelector,
|
|
23
|
-
zSingleLevelRoute,
|
|
24
|
-
zStoreConfig,
|
|
25
|
-
zTableConfig,
|
|
26
|
-
zTablesConfig,
|
|
27
|
-
zUserEnum,
|
|
28
|
-
zValueName,
|
|
29
|
-
zWorldConfig
|
|
30
|
-
} from "../chunk-MN3HYFJK.js";
|
|
31
|
-
import {
|
|
32
|
-
getDuplicates,
|
|
33
|
-
parseStaticArray,
|
|
34
|
-
validateBaseRoute,
|
|
35
|
-
validateCapitalizedName,
|
|
36
|
-
validateEnum,
|
|
37
|
-
validateEthereumAddress,
|
|
38
|
-
validateName,
|
|
39
|
-
validateRoute,
|
|
40
|
-
validateSelector,
|
|
41
|
-
validateSingleLevelRoute,
|
|
42
|
-
validateUncapitalizedName
|
|
43
|
-
} from "../chunk-KPBNUPK6.js";
|
|
44
|
-
import "../chunk-O6HOO6WA.js";
|
|
45
|
-
export {
|
|
46
|
-
DynamicResolutionType,
|
|
47
|
-
getDuplicates,
|
|
48
|
-
isDynamicResolution,
|
|
49
|
-
loadConfig,
|
|
50
|
-
loadStoreConfig,
|
|
51
|
-
loadWorldConfig,
|
|
52
|
-
mudConfig,
|
|
53
|
-
parseStaticArray,
|
|
54
|
-
parseStoreConfig,
|
|
55
|
-
parseWorldConfig,
|
|
56
|
-
resolveSystemConfig,
|
|
57
|
-
resolveTableId,
|
|
58
|
-
resolveWithContext,
|
|
59
|
-
resolveWorldConfig,
|
|
60
|
-
storeConfig,
|
|
61
|
-
validateBaseRoute,
|
|
62
|
-
validateCapitalizedName,
|
|
63
|
-
validateEnum,
|
|
64
|
-
validateEthereumAddress,
|
|
65
|
-
validateName,
|
|
66
|
-
validateRoute,
|
|
67
|
-
validateSelector,
|
|
68
|
-
validateSingleLevelRoute,
|
|
69
|
-
validateUncapitalizedName,
|
|
70
|
-
zAnyCaseName,
|
|
71
|
-
zBaseRoute,
|
|
72
|
-
zEnumsConfig,
|
|
73
|
-
zEthereumAddress,
|
|
74
|
-
zObjectName,
|
|
75
|
-
zOrdinaryRoute,
|
|
76
|
-
zSchemaConfig,
|
|
77
|
-
zSelector,
|
|
78
|
-
zSingleLevelRoute,
|
|
79
|
-
zStoreConfig,
|
|
80
|
-
zTableConfig,
|
|
81
|
-
zTablesConfig,
|
|
82
|
-
zUserEnum,
|
|
83
|
-
zValueName,
|
|
84
|
-
zWorldConfig
|
|
85
|
-
};
|