@latticexyz/cli 2.0.0-alpha.38 → 2.0.0-alpha.4
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-KJTPZOUH.js +3864 -0
- package/dist/{chunk-O6HOO6WA.js → chunk-L4YLJHLJ.js} +1 -9
- package/dist/{chunk-KPBNUPK6.js → chunk-SKNB74MT.js} +155 -159
- package/dist/chunk-VQTZJIFF.js +353 -0
- package/dist/{chunk-MXDV47JM.js → chunk-WZFXLDPK.js} +75 -24
- package/dist/chunk-YL4GJLLL.js +26139 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.js +0 -22
- package/dist/mud.d.ts +1 -1
- package/dist/mud.js +319 -3972
- package/dist/mud2.d.ts +1 -0
- package/dist/mud2.js +25 -0
- package/dist/render-solidity/index.d.ts +3 -3
- package/dist/render-solidity/index.js +3 -4
- package/dist/render-ts/index.d.ts +2 -3
- package/dist/render-ts/index.js +3 -4
- package/dist/utils/deprecated/index.js +3 -3
- package/dist/utils/index.d.ts +9 -19
- package/dist/utils/index.js +7 -18
- package/package.json +19 -20
- 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 +2 -17
- package/src/commands/set-version.ts +39 -10
- package/src/commands/tablegen.ts +5 -5
- package/src/commands/test-v2.ts +71 -0
- package/src/commands/tsgen.ts +1 -1
- 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 +13 -1
- package/src/render-solidity/types.ts +2 -1
- package/src/render-solidity/userType.ts +1 -2
- package/src/render-solidity/worldgen.ts +5 -6
- package/src/render-ts/recsV1TableOptions.ts +2 -2
- package/src/render-ts/renderRecsV1Tables.ts +2 -2
- package/src/render-ts/schemaTypesToRecsTypeStrings.ts +136 -136
- package/src/render-ts/tsgen.ts +1 -1
- package/src/render-ts/types.ts +1 -1
- 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/foundry.ts +9 -0
- package/dist/chunk-3FLNCDSC.js +0 -22908
- package/dist/chunk-5NC2OON2.js +0 -164
- package/dist/chunk-7GA2K5A6.js +0 -283
- package/dist/chunk-SLIMIO4Z.js +0 -14358
- package/dist/chunk-UN37BCLQ.js +0 -453
- package/dist/config/index.d.ts +0 -400
- package/dist/config/index.js +0 -85
- package/dist/parseStoreConfig-899f574e.d.ts +0 -369
- 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
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { DynamicResolution } from "../dynamicResolution.js";
|
|
2
|
-
|
|
3
|
-
// zod doesn't preserve doc comments
|
|
4
|
-
export type SystemUserConfig =
|
|
5
|
-
| {
|
|
6
|
-
/** The full resource selector consists of namespace and fileSelector */
|
|
7
|
-
fileSelector?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Register function selectors for the system in the World.
|
|
10
|
-
* Defaults to true.
|
|
11
|
-
* Note:
|
|
12
|
-
* - For root systems all World function selectors will correspond to the system's function selectors.
|
|
13
|
-
* - For non-root systems, the World function selectors will be <namespace>_<system>_<function>.
|
|
14
|
-
*/
|
|
15
|
-
registerFunctionSelectors?: boolean;
|
|
16
|
-
} & (
|
|
17
|
-
| {
|
|
18
|
-
/** If openAccess is true, any address can call the system */
|
|
19
|
-
openAccess: true;
|
|
20
|
-
}
|
|
21
|
-
| {
|
|
22
|
-
/** If openAccess is false, only the addresses or systems in `access` can call the system */
|
|
23
|
-
openAccess: false;
|
|
24
|
-
/** An array of addresses or system names that can access the system */
|
|
25
|
-
accessList: string[];
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
export type ValueWithType = {
|
|
30
|
-
value: string | number | Uint8Array;
|
|
31
|
-
type: string;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export type ModuleConfig = {
|
|
35
|
-
/** The name of the module */
|
|
36
|
-
name: string;
|
|
37
|
-
/** Should this module be installed as a root module? */
|
|
38
|
-
root?: boolean;
|
|
39
|
-
/** Arguments to be passed to the module's install method */
|
|
40
|
-
args?: (ValueWithType | DynamicResolution)[];
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// zod doesn't preserve doc comments
|
|
44
|
-
export interface WorldUserConfig {
|
|
45
|
-
/** The namespace to register tables and systems at. Defaults to the root namespace (empty string) */
|
|
46
|
-
namespace?: string;
|
|
47
|
-
/** The name of the World contract to deploy. If no name is provided, a vanilla World is deployed */
|
|
48
|
-
worldContractName?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Contracts named *System will be deployed by default
|
|
51
|
-
* as public systems at `namespace/ContractName`, unless overridden
|
|
52
|
-
*
|
|
53
|
-
* The key is the system name (capitalized).
|
|
54
|
-
* The value is a SystemConfig object.
|
|
55
|
-
*/
|
|
56
|
-
overrideSystems?: Record<string, SystemUserConfig>;
|
|
57
|
-
/** Systems to exclude from automatic deployment */
|
|
58
|
-
excludeSystems?: string[];
|
|
59
|
-
/**
|
|
60
|
-
* Script to execute after the deployment is complete (Default "PostDeploy").
|
|
61
|
-
* Script must be placed in the forge scripts directory (see foundry.toml) and have a ".s.sol" extension.
|
|
62
|
-
*/
|
|
63
|
-
postDeployScript?: string;
|
|
64
|
-
/** Directory to write the deployment info to (Default "./deploys") */
|
|
65
|
-
deploysDirectory?: string;
|
|
66
|
-
/** Directory to output system and world interfaces of `worldgen` (Default "world") */
|
|
67
|
-
worldgenDirectory?: string;
|
|
68
|
-
/** Path for world package imports. Default is "@latticexyz/world/src/" */
|
|
69
|
-
worldImportPath?: string;
|
|
70
|
-
/** Modules to in the World */
|
|
71
|
-
modules?: ModuleConfig[];
|
|
72
|
-
}
|
package/src/utils/typeUtils.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AbiType, StaticAbiType } from "@latticexyz/schema-type";
|
|
2
|
-
|
|
3
|
-
export type RequireKeys<T extends Record<string, unknown>, P extends string> = T & Required<Pick<T, P>>;
|
|
4
|
-
|
|
5
|
-
// This allows unions between string literals and `string` without sacrificing autocompletion.
|
|
6
|
-
// Workaround for https://github.com/Microsoft/TypeScript/issues/29729
|
|
7
|
-
export type StringForUnion = string & Record<never, never>;
|
|
8
|
-
|
|
9
|
-
export type StaticArray = `${StaticAbiType}[${number}]`;
|
|
10
|
-
// static arrays and inferred enum names get mixed together - this helper separates them
|
|
11
|
-
export type ExtractUserTypes<UnknownTypes extends StringForUnion> = Exclude<UnknownTypes, AbiType | StaticArray>;
|
|
12
|
-
|
|
13
|
-
// When type inference sees multiple uses of 1 generic, it can only guess
|
|
14
|
-
// which of those are supposed to define the generic (and it will be wrong in complex situations).
|
|
15
|
-
// This helper explicitly makes a type that's dependent on some generic,
|
|
16
|
-
// and will not be inferred as the generic's definition.
|
|
17
|
-
export type AsDependent<T> = T extends infer P ? P : never;
|