@latticexyz/world 2.0.0-main-20ffc95f → 2.0.0-main-252a1852
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-APK5Q6HQ.js +2 -0
- package/dist/chunk-APK5Q6HQ.js.map +1 -0
- package/dist/chunk-IOPGO3X3.js +2 -0
- package/dist/chunk-IOPGO3X3.js.map +1 -0
- package/dist/mud.config.d.ts +363 -79
- package/dist/mud.config.js +1 -1
- package/dist/mud.config.js.map +1 -1
- package/dist/output-6d21492a.d.ts +76 -0
- package/dist/ts/config/v2/index.d.ts +36 -76
- package/dist/ts/config/v2/index.js +1 -1
- package/dist/ts/config/v2/index.js.map +1 -1
- package/dist/ts/index.d.ts +2 -2
- package/dist/ts/index.js +1 -1
- package/dist/ts/node/index.d.ts +3 -7
- package/dist/ts/node/index.js +16 -16
- package/dist/ts/node/index.js.map +1 -1
- package/dist/ts/register/index.d.ts +1 -1
- package/dist/ts/register/index.js +1 -1
- package/dist/ts/register/index.js.map +1 -1
- package/mud.config.ts +40 -43
- package/package.json +7 -7
- package/ts/config/v2/index.ts +1 -0
- package/ts/node/render-solidity/worldgen.ts +4 -3
- package/ts/scripts/generate-test-tables.ts +19 -12
- package/ts/scripts/list-tables-from-store-and-world-configs.ts +8 -24
- package/ts/scripts/tablegen.ts +2 -2
- package/ts/scripts/worldgen.ts +6 -5
- package/dist/chunk-JSMM3O2L.js +0 -2
- package/dist/chunk-JSMM3O2L.js.map +0 -1
- package/dist/{types-85e6291a.d.ts → types-0e530577.d.ts} +10 -10
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as y}from"./chunk-RF4HOV37.js";import{extendedScope as v,get as I,resolveTable as U,validateTable as b,mergeIfUndefined as l,validateTables as O,resolveStore as F,hasOwnKey as S,validateStore as L,isObject as W}from"@latticexyz/store/config/v2";var t={worldInterfaceName:"IWorld",worldgenDirectory:"world",worldImportPath:"@latticexyz/world/src/"},r={customWorldContract:void 0,postDeployScript:"PostDeploy",deploysDirectory:"./deploys",worldsFile:"./worlds.json"},d={systems:{},tables:{},excludeSystems:[],modules:[],codegen:t,deploy:r};import{mapObject as D}from"@latticexyz/common/utils";import{mergeIfUndefined as E}from"@latticexyz/store/config/v2";function c(e){return D(e,o=>E(o,y))}import{isObject as g,mergeIfUndefined as T}from"@latticexyz/store/config/v2";function i(e){return g(e)?T(e,t):t}import{mergeIfUndefined as k,isObject as w}from"@latticexyz/store/config/v2";function f(e){return w(e)?k(e,r):r}function _(e){let o=v(e);if(L(e),S(e,"namespaces")){if(!W(e.namespaces))throw new Error(`Expected namespaces, received ${JSON.stringify(e.namespaces)}`);for(let s of Object.values(e.namespaces))S(s,"tables")&&O(s.tables,o)}}function A(e){let o=v(e),s=e.namespaces??{},u=Object.fromEntries(Object.entries(s).map(([p,x])=>Object.entries(x.tables??{}).map(([m,a])=>(b(a,o),[`${p}__${m}`,U(l(a,{namespace:p,name:m}),o)]))).flat()),n=F(e);return l({...n,tables:{...n.tables,...u},codegen:l(n.codegen,i(e.codegen)),deploy:f(e.deploy),systems:c(e.systems??d.systems),excludeSystems:I(e,"excludeSystems"),modules:e.modules},d)}function Z(e){return _(e),A(e)}export{_ as a,A as b,Z as c};
|
|
2
|
+
//# sourceMappingURL=chunk-APK5Q6HQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../ts/config/v2/world.ts","../ts/config/v2/defaults.ts","../ts/config/v2/systems.ts","../ts/config/v2/codegen.ts","../ts/config/v2/deploy.ts"],"sourcesContent":["import { conform, evaluate, narrow } from \"@arktype/util\";\nimport {\n UserTypes,\n extendedScope,\n get,\n resolveTable,\n validateTable,\n mergeIfUndefined,\n validateTables,\n resolveStore,\n Store,\n hasOwnKey,\n validateStore,\n isObject,\n} from \"@latticexyz/store/config/v2\";\nimport { SystemsInput, WorldInput } from \"./input\";\nimport { CONFIG_DEFAULTS } from \"./defaults\";\nimport { Tables } from \"@latticexyz/store\";\nimport { resolveSystems } from \"./systems\";\nimport { resolveNamespacedTables, validateNamespaces } from \"./namespaces\";\nimport { resolveCodegen } from \"./codegen\";\nimport { resolveDeploy } from \"./deploy\";\n\nexport type validateWorld<world> = {\n readonly [key in keyof world]: key extends \"tables\"\n ? validateTables<world[key], extendedScope<world>>\n : key extends \"userTypes\"\n ? UserTypes\n : key extends \"enums\"\n ? narrow<world[key]>\n : key extends \"namespaces\"\n ? validateNamespaces<world[key], extendedScope<world>>\n : key extends keyof WorldInput\n ? conform<world[key], WorldInput[key]>\n : world[key];\n};\n\nexport function validateWorld(world: unknown): asserts world is WorldInput {\n const scope = extendedScope(world);\n validateStore(world);\n\n if (hasOwnKey(world, \"namespaces\")) {\n if (!isObject(world.namespaces)) {\n throw new Error(`Expected namespaces, received ${JSON.stringify(world.namespaces)}`);\n }\n for (const namespace of Object.values(world.namespaces)) {\n if (hasOwnKey(namespace, \"tables\")) {\n validateTables(namespace.tables, scope);\n }\n }\n }\n}\n\nexport type resolveWorld<world> = evaluate<\n resolveStore<world> &\n mergeIfUndefined<\n { tables: resolveNamespacedTables<world> } & Omit<\n {\n [key in keyof world]: key extends \"systems\"\n ? resolveSystems<world[key] & SystemsInput>\n : key extends \"deploy\"\n ? resolveDeploy<world[key]>\n : key extends \"codegen\"\n ? resolveCodegen<world[key]>\n : world[key];\n },\n \"namespaces\" | keyof Store\n >,\n typeof CONFIG_DEFAULTS\n >\n>;\n\nexport function resolveWorld<const world extends WorldInput>(world: world): resolveWorld<world> {\n const scope = extendedScope(world);\n const namespaces = world.namespaces ?? {};\n\n const resolvedNamespacedTables = Object.fromEntries(\n Object.entries(namespaces)\n .map(([namespaceKey, namespace]) =>\n Object.entries(namespace.tables ?? {}).map(([tableKey, table]) => {\n validateTable(table, scope);\n return [\n `${namespaceKey}__${tableKey}`,\n resolveTable(mergeIfUndefined(table, { namespace: namespaceKey, name: tableKey }), scope),\n ];\n }),\n )\n .flat(),\n ) as Tables;\n\n const resolvedStore = resolveStore(world);\n\n return mergeIfUndefined(\n {\n ...resolvedStore,\n tables: { ...resolvedStore.tables, ...resolvedNamespacedTables },\n codegen: mergeIfUndefined(resolvedStore.codegen, resolveCodegen(world.codegen)),\n deploy: resolveDeploy(world.deploy),\n systems: resolveSystems(world.systems ?? CONFIG_DEFAULTS.systems),\n excludeSystems: get(world, \"excludeSystems\"),\n modules: world.modules,\n },\n CONFIG_DEFAULTS,\n ) as unknown as resolveWorld<world>;\n}\n\nexport function defineWorld<const world>(world: validateWorld<world>): resolveWorld<world> {\n validateWorld(world);\n return resolveWorld(world) as unknown as resolveWorld<world>;\n}\n","export const SYSTEM_DEFAULTS = {\n registerFunctionSelectors: true,\n openAccess: true,\n accessList: [] as string[],\n} as const;\n\nexport const CODEGEN_DEFAULTS = {\n worldInterfaceName: \"IWorld\",\n worldgenDirectory: \"world\",\n worldImportPath: \"@latticexyz/world/src/\",\n} as const;\n\nexport const DEPLOY_DEFAULTS = {\n customWorldContract: undefined,\n postDeployScript: \"PostDeploy\",\n deploysDirectory: \"./deploys\",\n worldsFile: \"./worlds.json\",\n} as const;\n\nexport const CONFIG_DEFAULTS = {\n systems: {},\n tables: {},\n excludeSystems: [] as string[],\n modules: [],\n codegen: CODEGEN_DEFAULTS,\n deploy: DEPLOY_DEFAULTS,\n} as const;\n","import { mapObject } from \"@latticexyz/common/utils\";\nimport { SYSTEM_DEFAULTS } from \"../defaults\";\nimport { SystemsInput } from \"./input\";\nimport { mergeIfUndefined } from \"@latticexyz/store/config/v2\";\n\nexport type resolveSystems<systems extends SystemsInput> = {\n [system in keyof systems]: mergeIfUndefined<systems[system], typeof SYSTEM_DEFAULTS>;\n};\n\nexport function resolveSystems<systems extends SystemsInput>(systems: systems): resolveSystems<systems> {\n return mapObject(systems, (system) => mergeIfUndefined(system, SYSTEM_DEFAULTS));\n}\n","import { isObject, mergeIfUndefined } from \"@latticexyz/store/config/v2\";\nimport { CODEGEN_DEFAULTS } from \"./defaults\";\n\nexport type resolveCodegen<codegen> = codegen extends {}\n ? mergeIfUndefined<codegen, typeof CODEGEN_DEFAULTS>\n : typeof CODEGEN_DEFAULTS;\n\nexport function resolveCodegen<codegen>(codegen: codegen): resolveCodegen<codegen> {\n return (\n isObject(codegen) ? mergeIfUndefined(codegen, CODEGEN_DEFAULTS) : CODEGEN_DEFAULTS\n ) as resolveCodegen<codegen>;\n}\n","import { mergeIfUndefined, isObject } from \"@latticexyz/store/config/v2\";\nimport { DEPLOY_DEFAULTS } from \"./defaults\";\n\nexport type resolveDeploy<deploy> = deploy extends {}\n ? mergeIfUndefined<deploy, typeof DEPLOY_DEFAULTS>\n : typeof DEPLOY_DEFAULTS;\n\nexport function resolveDeploy<deploy>(deploy: deploy): resolveDeploy<deploy> {\n return (isObject(deploy) ? mergeIfUndefined(deploy, DEPLOY_DEFAULTS) : DEPLOY_DEFAULTS) as resolveDeploy<deploy>;\n}\n"],"mappings":"wCACA,OAEE,iBAAAA,EACA,OAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,oBAAAC,EACA,kBAAAC,EACA,gBAAAC,EAEA,aAAAC,EACA,iBAAAC,EACA,YAAAC,MACK,8BCRA,IAAMC,EAAmB,CAC9B,mBAAoB,SACpB,kBAAmB,QACnB,gBAAiB,wBACnB,EAEaC,EAAkB,CAC7B,oBAAqB,OACrB,iBAAkB,aAClB,iBAAkB,YAClB,WAAY,eACd,EAEaC,EAAkB,CAC7B,QAAS,CAAC,EACV,OAAQ,CAAC,EACT,eAAgB,CAAC,EACjB,QAAS,CAAC,EACV,QAASF,EACT,OAAQC,CACV,EC1BA,OAAS,aAAAE,MAAiB,2BAG1B,OAAS,oBAAAC,MAAwB,8BAM1B,SAASC,EAA6CC,EAA2C,CACtG,OAAOC,EAAUD,EAAUE,GAAWJ,EAAiBI,EAAQC,CAAe,CAAC,CACjF,CCXA,OAAS,YAAAC,EAAU,oBAAAC,MAAwB,8BAOpC,SAASC,EAAwBC,EAA2C,CACjF,OACEC,EAASD,CAAO,EAAIE,EAAiBF,EAASG,CAAgB,EAAIA,CAEtE,CCXA,OAAS,oBAAAC,EAAkB,YAAAC,MAAgB,8BAOpC,SAASC,EAAsBC,EAAuC,CAC3E,OAAQC,EAASD,CAAM,EAAIE,EAAiBF,EAAQG,CAAe,EAAIA,CACzE,CJ4BO,SAASC,EAAcC,EAA6C,CACzE,IAAMC,EAAQC,EAAcF,CAAK,EAGjC,GAFAG,EAAcH,CAAK,EAEfI,EAAUJ,EAAO,YAAY,EAAG,CAClC,GAAI,CAACK,EAASL,EAAM,UAAU,EAC5B,MAAM,IAAI,MAAM,iCAAiC,KAAK,UAAUA,EAAM,UAAU,GAAG,EAErF,QAAWM,KAAa,OAAO,OAAON,EAAM,UAAU,EAChDI,EAAUE,EAAW,QAAQ,GAC/BC,EAAeD,EAAU,OAAQL,CAAK,EAI9C,CAqBO,SAASO,EAA6CR,EAAmC,CAC9F,IAAMC,EAAQC,EAAcF,CAAK,EAC3BS,EAAaT,EAAM,YAAc,CAAC,EAElCU,EAA2B,OAAO,YACtC,OAAO,QAAQD,CAAU,EACtB,IAAI,CAAC,CAACE,EAAcL,CAAS,IAC5B,OAAO,QAAQA,EAAU,QAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAACM,EAAUC,CAAK,KAC1DC,EAAcD,EAAOZ,CAAK,EACnB,CACL,GAAGU,MAAiBC,IACpBG,EAAaC,EAAiBH,EAAO,CAAE,UAAWF,EAAc,KAAMC,CAAS,CAAC,EAAGX,CAAK,CAC1F,EACD,CACH,EACC,KAAK,CACV,EAEMgB,EAAgBC,EAAalB,CAAK,EAExC,OAAOgB,EACL,CACE,GAAGC,EACH,OAAQ,CAAE,GAAGA,EAAc,OAAQ,GAAGP,CAAyB,EAC/D,QAASM,EAAiBC,EAAc,QAASE,EAAenB,EAAM,OAAO,CAAC,EAC9E,OAAQoB,EAAcpB,EAAM,MAAM,EAClC,QAASqB,EAAerB,EAAM,SAAWsB,EAAgB,OAAO,EAChE,eAAgBC,EAAIvB,EAAO,gBAAgB,EAC3C,QAASA,EAAM,OACjB,EACAsB,CACF,CACF,CAEO,SAASE,EAAyBxB,EAAkD,CACzF,OAAAD,EAAcC,CAAK,EACZQ,EAAaR,CAAK,CAC3B","names":["extendedScope","get","resolveTable","validateTable","mergeIfUndefined","validateTables","resolveStore","hasOwnKey","validateStore","isObject","CODEGEN_DEFAULTS","DEPLOY_DEFAULTS","CONFIG_DEFAULTS","mapObject","mergeIfUndefined","resolveSystems","systems","mapObject","system","SYSTEM_DEFAULTS","isObject","mergeIfUndefined","resolveCodegen","codegen","isObject","mergeIfUndefined","CODEGEN_DEFAULTS","mergeIfUndefined","isObject","resolveDeploy","deploy","isObject","mergeIfUndefined","DEPLOY_DEFAULTS","validateWorld","world","scope","extendedScope","validateStore","hasOwnKey","isObject","namespace","validateTables","resolveWorld","namespaces","resolvedNamespacedTables","namespaceKey","tableKey","table","validateTable","resolveTable","mergeIfUndefined","resolvedStore","resolveStore","resolveCodegen","resolveDeploy","resolveSystems","CONFIG_DEFAULTS","get","defineWorld"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{storeToV1 as s}from"@latticexyz/store/config/v2";function r(e){return e.map(o=>({name:o.name,root:o.root??!1,args:o.args??[]}))}function d(e){let o={systems:e.systems,excludeSystems:e.excludeSystems,modules:r(e.modules),worldContractName:e.deploy.customWorldContract,postDeployScript:e.deploy.postDeployScript,deploysDirectory:e.deploy.deploysDirectory,worldsFile:e.deploy.worldsFile,worldInterfaceName:e.codegen.worldInterfaceName,worldgenDirectory:e.codegen.worldgenDirectory,worldImportPath:e.codegen.worldImportPath};return{...s(e),...o,v2:e}}export{d as a};
|
|
2
|
+
//# sourceMappingURL=chunk-IOPGO3X3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../ts/config/v2/compat.ts"],"sourcesContent":["import { conform, mutable } from \"@arktype/util\";\nimport { Module, World, Systems } from \"./output\";\nimport { storeToV1, Store } from \"@latticexyz/store/config/v2\";\n\ntype modulesToV1<modules extends readonly Module[]> = mutable<{\n [key in keyof modules]: Required<modules[key]>;\n}>;\n\nfunction modulesToV1<modules extends readonly Module[]>(modules: modules): modulesToV1<modules> {\n return modules.map((module) => ({\n name: module.name,\n root: module.root ?? false,\n args: module.args ?? [],\n })) as modulesToV1<modules>;\n}\n\ntype systemsToV1<systems extends Systems> = {\n [key in keyof systems]: {\n name?: systems[key][\"name\"];\n registerFunctionSelectors: systems[key][\"registerFunctionSelectors\"];\n } & ({ openAccess: true } | { openAccess: false; accessList: systems[key][\"accessList\"] });\n};\n\nfunction systemsToV1<systems extends Systems>(systems: systems): systemsToV1<systems> {\n return systems;\n}\n\nexport type worldToV1<world> = world extends World\n ? Omit<storeToV1<world>, \"v2\"> & {\n systems: systemsToV1<world[\"systems\"]>;\n excludeSystems: mutable<world[\"excludeSystems\"]>;\n modules: modulesToV1<world[\"modules\"]>;\n worldContractName: world[\"deploy\"][\"customWorldContract\"];\n postDeployScript: world[\"deploy\"][\"postDeployScript\"];\n deploysDirectory: world[\"deploy\"][\"deploysDirectory\"];\n worldsFile: world[\"deploy\"][\"worldsFile\"];\n worldInterfaceName: world[\"codegen\"][\"worldInterfaceName\"];\n worldgenDirectory: world[\"codegen\"][\"worldgenDirectory\"];\n worldImportPath: world[\"codegen\"][\"worldImportPath\"];\n v2: world;\n }\n : never;\n\nexport function worldToV1<world>(world: conform<world, World>): worldToV1<world> {\n const v1WorldConfig = {\n systems: systemsToV1(world.systems),\n excludeSystems: world.excludeSystems,\n modules: modulesToV1(world.modules),\n worldContractName: world.deploy.customWorldContract,\n postDeployScript: world.deploy.postDeployScript,\n deploysDirectory: world.deploy.deploysDirectory,\n worldsFile: world.deploy.worldsFile,\n worldInterfaceName: world.codegen.worldInterfaceName,\n worldgenDirectory: world.codegen.worldgenDirectory,\n worldImportPath: world.codegen.worldImportPath,\n };\n\n return { ...storeToV1(world as Store), ...v1WorldConfig, v2: world } as worldToV1<world>;\n}\n"],"mappings":"AAEA,OAAS,aAAAA,MAAwB,8BAMjC,SAASC,EAA+CC,EAAwC,CAC9F,OAAOA,EAAQ,IAAKC,IAAY,CAC9B,KAAMA,EAAO,KACb,KAAMA,EAAO,MAAQ,GACrB,KAAMA,EAAO,MAAQ,CAAC,CACxB,EAAE,CACJ,CA6BO,SAASC,EAAiBC,EAAgD,CAC/E,IAAMC,EAAgB,CACpB,QAAqBD,EAAM,QAC3B,eAAgBA,EAAM,eACtB,QAASE,EAAYF,EAAM,OAAO,EAClC,kBAAmBA,EAAM,OAAO,oBAChC,iBAAkBA,EAAM,OAAO,iBAC/B,iBAAkBA,EAAM,OAAO,iBAC/B,WAAYA,EAAM,OAAO,WACzB,mBAAoBA,EAAM,QAAQ,mBAClC,kBAAmBA,EAAM,QAAQ,kBACjC,gBAAiBA,EAAM,QAAQ,eACjC,EAEA,MAAO,CAAE,GAAGG,EAAUH,CAAc,EAAG,GAAGC,EAAe,GAAID,CAAM,CACrE","names":["storeToV1","modulesToV1","modules","module","worldToV1","world","v1WorldConfig","modulesToV1","storeToV1"]}
|
package/dist/mud.config.d.ts
CHANGED
|
@@ -1,117 +1,401 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _latticexyz_store_config_v2 from '@latticexyz/store/config/v2';
|
|
2
2
|
|
|
3
|
-
declare const _default:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
declare const _default: {
|
|
4
|
+
readonly tables: {
|
|
5
|
+
readonly world__NamespaceOwner: {
|
|
6
|
+
readonly tableId: `0x${string}`;
|
|
7
|
+
readonly name: "NamespaceOwner";
|
|
8
|
+
readonly namespace: "world";
|
|
9
|
+
readonly type: "table";
|
|
10
|
+
readonly key: readonly ["namespaceId"];
|
|
11
|
+
readonly schema: {
|
|
12
|
+
readonly namespaceId: {
|
|
13
|
+
readonly type: "bytes32";
|
|
14
|
+
readonly internalType: "ResourceId";
|
|
15
|
+
};
|
|
16
|
+
readonly owner: {
|
|
17
|
+
readonly type: "address";
|
|
18
|
+
readonly internalType: "address";
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
readonly codegen: _latticexyz_store_config_v2.resolveTableCodegen<{
|
|
22
|
+
namespace: "world";
|
|
23
|
+
schema: {
|
|
24
|
+
readonly namespaceId: "ResourceId";
|
|
25
|
+
readonly owner: "address";
|
|
26
|
+
};
|
|
27
|
+
key: ["namespaceId"];
|
|
28
|
+
name: "NamespaceOwner";
|
|
29
|
+
}>;
|
|
30
|
+
readonly deploy: {
|
|
31
|
+
readonly disabled: false;
|
|
32
|
+
};
|
|
12
33
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
34
|
+
readonly world__ResourceAccess: {
|
|
35
|
+
readonly tableId: `0x${string}`;
|
|
36
|
+
readonly name: "ResourceAccess";
|
|
37
|
+
readonly namespace: "world";
|
|
38
|
+
readonly type: "table";
|
|
39
|
+
readonly key: readonly ["resourceId", "caller"];
|
|
40
|
+
readonly schema: {
|
|
41
|
+
readonly resourceId: {
|
|
42
|
+
readonly type: "bytes32";
|
|
43
|
+
readonly internalType: "ResourceId";
|
|
44
|
+
};
|
|
45
|
+
readonly caller: {
|
|
46
|
+
readonly type: "address";
|
|
47
|
+
readonly internalType: "address";
|
|
48
|
+
};
|
|
49
|
+
readonly access: {
|
|
50
|
+
readonly type: "bool";
|
|
51
|
+
readonly internalType: "bool";
|
|
52
|
+
};
|
|
18
53
|
};
|
|
19
|
-
|
|
20
|
-
|
|
54
|
+
readonly codegen: _latticexyz_store_config_v2.resolveTableCodegen<{
|
|
55
|
+
namespace: "world";
|
|
56
|
+
schema: {
|
|
57
|
+
readonly resourceId: "ResourceId";
|
|
58
|
+
readonly caller: "address";
|
|
59
|
+
readonly access: "bool";
|
|
60
|
+
};
|
|
61
|
+
key: ["resourceId", "caller"];
|
|
62
|
+
name: "ResourceAccess";
|
|
63
|
+
}>;
|
|
64
|
+
readonly deploy: {
|
|
65
|
+
readonly disabled: false;
|
|
21
66
|
};
|
|
22
67
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
68
|
+
readonly world__InstalledModules: {
|
|
69
|
+
readonly tableId: `0x${string}`;
|
|
70
|
+
readonly name: "InstalledModules";
|
|
71
|
+
readonly namespace: "world";
|
|
72
|
+
readonly type: "table";
|
|
73
|
+
readonly key: readonly ["moduleAddress", "argumentsHash"];
|
|
74
|
+
readonly schema: {
|
|
75
|
+
readonly moduleAddress: {
|
|
76
|
+
readonly type: "address";
|
|
77
|
+
readonly internalType: "address";
|
|
78
|
+
};
|
|
79
|
+
readonly argumentsHash: {
|
|
80
|
+
readonly type: "bytes32";
|
|
81
|
+
readonly internalType: "bytes32";
|
|
82
|
+
};
|
|
83
|
+
readonly isInstalled: {
|
|
84
|
+
readonly type: "bool";
|
|
85
|
+
readonly internalType: "bool";
|
|
86
|
+
};
|
|
27
87
|
};
|
|
28
|
-
|
|
29
|
-
|
|
88
|
+
readonly codegen: _latticexyz_store_config_v2.resolveTableCodegen<{
|
|
89
|
+
namespace: "world";
|
|
90
|
+
schema: {
|
|
91
|
+
readonly moduleAddress: "address";
|
|
92
|
+
readonly argumentsHash: "bytes32";
|
|
93
|
+
readonly isInstalled: "bool";
|
|
94
|
+
};
|
|
95
|
+
key: ["moduleAddress", "argumentsHash"];
|
|
96
|
+
name: "InstalledModules";
|
|
97
|
+
}>;
|
|
98
|
+
readonly deploy: {
|
|
99
|
+
readonly disabled: false;
|
|
30
100
|
};
|
|
31
101
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
102
|
+
readonly world__UserDelegationControl: {
|
|
103
|
+
readonly tableId: `0x${string}`;
|
|
104
|
+
readonly name: "UserDelegationControl";
|
|
105
|
+
readonly namespace: "world";
|
|
106
|
+
readonly type: "table";
|
|
107
|
+
readonly key: readonly ["delegator", "delegatee"];
|
|
108
|
+
readonly schema: {
|
|
109
|
+
readonly delegator: {
|
|
110
|
+
readonly type: "address";
|
|
111
|
+
readonly internalType: "address";
|
|
112
|
+
};
|
|
113
|
+
readonly delegatee: {
|
|
114
|
+
readonly type: "address";
|
|
115
|
+
readonly internalType: "address";
|
|
116
|
+
};
|
|
117
|
+
readonly delegationControlId: {
|
|
118
|
+
readonly type: "bytes32";
|
|
119
|
+
readonly internalType: "ResourceId";
|
|
120
|
+
};
|
|
36
121
|
};
|
|
37
|
-
|
|
38
|
-
|
|
122
|
+
readonly codegen: _latticexyz_store_config_v2.resolveTableCodegen<{
|
|
123
|
+
namespace: "world";
|
|
124
|
+
schema: {
|
|
125
|
+
readonly delegator: "address";
|
|
126
|
+
readonly delegatee: "address";
|
|
127
|
+
readonly delegationControlId: "ResourceId";
|
|
128
|
+
};
|
|
129
|
+
key: ["delegator", "delegatee"];
|
|
130
|
+
name: "UserDelegationControl";
|
|
131
|
+
}>;
|
|
132
|
+
readonly deploy: {
|
|
133
|
+
readonly disabled: false;
|
|
39
134
|
};
|
|
40
135
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
136
|
+
readonly world__NamespaceDelegationControl: {
|
|
137
|
+
readonly tableId: `0x${string}`;
|
|
138
|
+
readonly name: "NamespaceDelegationControl";
|
|
139
|
+
readonly namespace: "world";
|
|
140
|
+
readonly type: "table";
|
|
141
|
+
readonly key: readonly ["namespaceId"];
|
|
142
|
+
readonly schema: {
|
|
143
|
+
readonly namespaceId: {
|
|
144
|
+
readonly type: "bytes32";
|
|
145
|
+
readonly internalType: "ResourceId";
|
|
146
|
+
};
|
|
147
|
+
readonly delegationControlId: {
|
|
148
|
+
readonly type: "bytes32";
|
|
149
|
+
readonly internalType: "ResourceId";
|
|
150
|
+
};
|
|
45
151
|
};
|
|
46
|
-
|
|
47
|
-
|
|
152
|
+
readonly codegen: _latticexyz_store_config_v2.resolveTableCodegen<{
|
|
153
|
+
namespace: "world";
|
|
154
|
+
schema: {
|
|
155
|
+
readonly namespaceId: "ResourceId";
|
|
156
|
+
readonly delegationControlId: "ResourceId";
|
|
157
|
+
};
|
|
158
|
+
key: ["namespaceId"];
|
|
159
|
+
name: "NamespaceDelegationControl";
|
|
160
|
+
}>;
|
|
161
|
+
readonly deploy: {
|
|
162
|
+
readonly disabled: false;
|
|
48
163
|
};
|
|
49
164
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
165
|
+
readonly world__Balances: {
|
|
166
|
+
readonly tableId: `0x${string}`;
|
|
167
|
+
readonly name: "Balances";
|
|
168
|
+
readonly namespace: "world";
|
|
169
|
+
readonly type: "table";
|
|
170
|
+
readonly key: readonly ["namespaceId"];
|
|
171
|
+
readonly schema: {
|
|
172
|
+
readonly namespaceId: {
|
|
173
|
+
readonly type: "bytes32";
|
|
174
|
+
readonly internalType: "ResourceId";
|
|
175
|
+
};
|
|
176
|
+
readonly balance: {
|
|
177
|
+
readonly type: "uint256";
|
|
178
|
+
readonly internalType: "uint256";
|
|
179
|
+
};
|
|
53
180
|
};
|
|
54
|
-
|
|
55
|
-
|
|
181
|
+
readonly codegen: _latticexyz_store_config_v2.resolveTableCodegen<{
|
|
182
|
+
namespace: "world";
|
|
183
|
+
schema: {
|
|
184
|
+
readonly namespaceId: "ResourceId";
|
|
185
|
+
readonly balance: "uint256";
|
|
186
|
+
};
|
|
187
|
+
key: ["namespaceId"];
|
|
188
|
+
name: "Balances";
|
|
189
|
+
}>;
|
|
190
|
+
readonly deploy: {
|
|
191
|
+
readonly disabled: false;
|
|
56
192
|
};
|
|
57
193
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
194
|
+
readonly world__Systems: {
|
|
195
|
+
readonly tableId: `0x${string}`;
|
|
196
|
+
readonly name: "Systems";
|
|
197
|
+
readonly namespace: "world";
|
|
198
|
+
readonly type: "table";
|
|
199
|
+
readonly key: readonly ["systemId"];
|
|
200
|
+
readonly schema: {
|
|
201
|
+
readonly systemId: {
|
|
202
|
+
readonly type: "bytes32";
|
|
203
|
+
readonly internalType: "ResourceId";
|
|
204
|
+
};
|
|
205
|
+
readonly system: {
|
|
206
|
+
readonly type: "address";
|
|
207
|
+
readonly internalType: "address";
|
|
208
|
+
};
|
|
209
|
+
readonly publicAccess: {
|
|
210
|
+
readonly type: "bool";
|
|
211
|
+
readonly internalType: "bool";
|
|
212
|
+
};
|
|
61
213
|
};
|
|
62
|
-
|
|
63
|
-
|
|
214
|
+
readonly codegen: _latticexyz_store_config_v2.resolveTableCodegen<{
|
|
215
|
+
codegen: {
|
|
216
|
+
readonly dataStruct: false;
|
|
217
|
+
};
|
|
218
|
+
namespace: "world";
|
|
219
|
+
schema: {
|
|
220
|
+
readonly systemId: "ResourceId";
|
|
221
|
+
readonly system: "address";
|
|
222
|
+
readonly publicAccess: "bool";
|
|
223
|
+
};
|
|
224
|
+
key: ["systemId"];
|
|
225
|
+
name: "Systems";
|
|
226
|
+
}>;
|
|
227
|
+
readonly deploy: {
|
|
228
|
+
readonly disabled: false;
|
|
64
229
|
};
|
|
65
230
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
231
|
+
readonly world__SystemRegistry: {
|
|
232
|
+
readonly tableId: `0x${string}`;
|
|
233
|
+
readonly name: "SystemRegistry";
|
|
234
|
+
readonly namespace: "world";
|
|
235
|
+
readonly type: "table";
|
|
236
|
+
readonly key: readonly ["system"];
|
|
237
|
+
readonly schema: {
|
|
238
|
+
readonly system: {
|
|
239
|
+
readonly type: "address";
|
|
240
|
+
readonly internalType: "address";
|
|
241
|
+
};
|
|
242
|
+
readonly systemId: {
|
|
243
|
+
readonly type: "bytes32";
|
|
244
|
+
readonly internalType: "ResourceId";
|
|
245
|
+
};
|
|
69
246
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
247
|
+
readonly codegen: _latticexyz_store_config_v2.resolveTableCodegen<{
|
|
248
|
+
namespace: "world";
|
|
249
|
+
schema: {
|
|
250
|
+
readonly system: "address";
|
|
251
|
+
readonly systemId: "ResourceId";
|
|
252
|
+
};
|
|
253
|
+
key: ["system"];
|
|
254
|
+
name: "SystemRegistry";
|
|
255
|
+
}>;
|
|
256
|
+
readonly deploy: {
|
|
257
|
+
readonly disabled: false;
|
|
73
258
|
};
|
|
74
|
-
dataStruct: false;
|
|
75
259
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
260
|
+
readonly world__SystemHooks: {
|
|
261
|
+
readonly tableId: `0x${string}`;
|
|
262
|
+
readonly name: "SystemHooks";
|
|
263
|
+
readonly namespace: "world";
|
|
264
|
+
readonly type: "table";
|
|
265
|
+
readonly key: readonly ["systemId"];
|
|
266
|
+
readonly schema: {
|
|
267
|
+
readonly systemId: {
|
|
268
|
+
readonly type: "bytes32";
|
|
269
|
+
readonly internalType: "ResourceId";
|
|
270
|
+
};
|
|
271
|
+
readonly value: {
|
|
272
|
+
readonly type: "bytes21[]";
|
|
273
|
+
readonly internalType: "bytes21[]";
|
|
274
|
+
};
|
|
79
275
|
};
|
|
80
|
-
|
|
81
|
-
|
|
276
|
+
readonly codegen: _latticexyz_store_config_v2.resolveTableCodegen<{
|
|
277
|
+
namespace: "world";
|
|
278
|
+
schema: {
|
|
279
|
+
readonly systemId: "ResourceId";
|
|
280
|
+
readonly value: "bytes21[]";
|
|
281
|
+
};
|
|
282
|
+
key: ["systemId"];
|
|
283
|
+
name: "SystemHooks";
|
|
284
|
+
}>;
|
|
285
|
+
readonly deploy: {
|
|
286
|
+
readonly disabled: false;
|
|
82
287
|
};
|
|
83
288
|
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
289
|
+
readonly world__FunctionSelectors: {
|
|
290
|
+
readonly tableId: `0x${string}`;
|
|
291
|
+
readonly name: "FunctionSelectors";
|
|
292
|
+
readonly namespace: "world";
|
|
293
|
+
readonly type: "table";
|
|
294
|
+
readonly key: readonly ["worldFunctionSelector"];
|
|
295
|
+
readonly schema: {
|
|
296
|
+
readonly worldFunctionSelector: {
|
|
297
|
+
readonly type: "bytes4";
|
|
298
|
+
readonly internalType: "bytes4";
|
|
299
|
+
};
|
|
300
|
+
readonly systemId: {
|
|
301
|
+
readonly type: "bytes32";
|
|
302
|
+
readonly internalType: "ResourceId";
|
|
303
|
+
};
|
|
304
|
+
readonly systemFunctionSelector: {
|
|
305
|
+
readonly type: "bytes4";
|
|
306
|
+
readonly internalType: "bytes4";
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
readonly codegen: _latticexyz_store_config_v2.resolveTableCodegen<{
|
|
310
|
+
codegen: {
|
|
311
|
+
readonly dataStruct: false;
|
|
312
|
+
};
|
|
313
|
+
namespace: "world";
|
|
314
|
+
schema: {
|
|
315
|
+
readonly worldFunctionSelector: "bytes4";
|
|
316
|
+
readonly systemId: "ResourceId";
|
|
317
|
+
readonly systemFunctionSelector: "bytes4";
|
|
318
|
+
};
|
|
319
|
+
key: ["worldFunctionSelector"];
|
|
320
|
+
name: "FunctionSelectors";
|
|
321
|
+
}>;
|
|
322
|
+
readonly deploy: {
|
|
323
|
+
readonly disabled: false;
|
|
87
324
|
};
|
|
88
|
-
valueSchema: "bytes21[]";
|
|
89
325
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
326
|
+
readonly world__FunctionSignatures: {
|
|
327
|
+
readonly tableId: `0x${string}`;
|
|
328
|
+
readonly name: "FunctionSignatures";
|
|
329
|
+
readonly namespace: "world";
|
|
330
|
+
readonly type: "offchainTable";
|
|
331
|
+
readonly key: readonly ["functionSelector"];
|
|
332
|
+
readonly schema: {
|
|
333
|
+
readonly functionSelector: {
|
|
334
|
+
readonly type: "bytes4";
|
|
335
|
+
readonly internalType: "bytes4";
|
|
336
|
+
};
|
|
337
|
+
readonly functionSignature: {
|
|
338
|
+
readonly type: "string";
|
|
339
|
+
readonly internalType: "string";
|
|
340
|
+
};
|
|
93
341
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
342
|
+
readonly codegen: _latticexyz_store_config_v2.resolveTableCodegen<{
|
|
343
|
+
namespace: "world";
|
|
344
|
+
schema: {
|
|
345
|
+
readonly functionSelector: "bytes4";
|
|
346
|
+
readonly functionSignature: "string";
|
|
347
|
+
};
|
|
348
|
+
key: ["functionSelector"];
|
|
349
|
+
type: "offchainTable";
|
|
350
|
+
name: "FunctionSignatures";
|
|
351
|
+
}>;
|
|
352
|
+
readonly deploy: {
|
|
353
|
+
readonly disabled: false;
|
|
97
354
|
};
|
|
98
|
-
dataStruct: false;
|
|
99
355
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
356
|
+
readonly world__InitModuleAddress: {
|
|
357
|
+
readonly tableId: `0x${string}`;
|
|
358
|
+
readonly name: "InitModuleAddress";
|
|
359
|
+
readonly namespace: "world";
|
|
360
|
+
readonly type: "table";
|
|
361
|
+
readonly key: readonly [];
|
|
362
|
+
readonly schema: {
|
|
363
|
+
readonly value: {
|
|
364
|
+
readonly type: "address";
|
|
365
|
+
readonly internalType: "address";
|
|
366
|
+
};
|
|
103
367
|
};
|
|
104
|
-
|
|
105
|
-
|
|
368
|
+
readonly codegen: _latticexyz_store_config_v2.resolveTableCodegen<{
|
|
369
|
+
namespace: "world";
|
|
370
|
+
schema: {
|
|
371
|
+
readonly value: "address";
|
|
372
|
+
};
|
|
373
|
+
key: [];
|
|
374
|
+
name: "InitModuleAddress";
|
|
375
|
+
}>;
|
|
376
|
+
readonly deploy: {
|
|
377
|
+
readonly disabled: false;
|
|
106
378
|
};
|
|
107
|
-
offchainOnly: true;
|
|
108
379
|
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
380
|
+
};
|
|
381
|
+
readonly userTypes: {
|
|
382
|
+
readonly ResourceId: {
|
|
383
|
+
readonly filePath: "@latticexyz/store/src/ResourceId.sol";
|
|
384
|
+
readonly type: "bytes32";
|
|
112
385
|
};
|
|
113
386
|
};
|
|
114
|
-
|
|
115
|
-
|
|
387
|
+
readonly enums: {};
|
|
388
|
+
readonly namespace: "world";
|
|
389
|
+
readonly codegen: never;
|
|
390
|
+
readonly systems: {};
|
|
391
|
+
readonly excludeSystems: ["StoreRegistrationSystem"];
|
|
392
|
+
readonly modules: readonly [];
|
|
393
|
+
readonly deploy: {
|
|
394
|
+
readonly customWorldContract: undefined;
|
|
395
|
+
readonly postDeployScript: "PostDeploy";
|
|
396
|
+
readonly deploysDirectory: "./deploys";
|
|
397
|
+
readonly worldsFile: "./worlds.json";
|
|
398
|
+
};
|
|
399
|
+
};
|
|
116
400
|
|
|
117
401
|
export { _default as default };
|
package/dist/mud.config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{c as e}from"./chunk-APK5Q6HQ.js";import"./chunk-RF4HOV37.js";var a=e({codegen:{worldImportPath:"../../",worldgenDirectory:"interfaces",worldInterfaceName:"IBaseWorld"},namespace:"world",userTypes:{ResourceId:{filePath:"@latticexyz/store/src/ResourceId.sol",type:"bytes32"}},tables:{NamespaceOwner:{schema:{namespaceId:"ResourceId",owner:"address"},key:["namespaceId"]},ResourceAccess:{schema:{resourceId:"ResourceId",caller:"address",access:"bool"},key:["resourceId","caller"]},InstalledModules:{schema:{moduleAddress:"address",argumentsHash:"bytes32",isInstalled:"bool"},key:["moduleAddress","argumentsHash"]},UserDelegationControl:{schema:{delegator:"address",delegatee:"address",delegationControlId:"ResourceId"},key:["delegator","delegatee"]},NamespaceDelegationControl:{schema:{namespaceId:"ResourceId",delegationControlId:"ResourceId"},key:["namespaceId"]},Balances:{schema:{namespaceId:"ResourceId",balance:"uint256"},key:["namespaceId"]},Systems:{schema:{systemId:"ResourceId",system:"address",publicAccess:"bool"},key:["systemId"],codegen:{dataStruct:!1}},SystemRegistry:{schema:{system:"address",systemId:"ResourceId"},key:["system"]},SystemHooks:{schema:{systemId:"ResourceId",value:"bytes21[]"},key:["systemId"]},FunctionSelectors:{schema:{worldFunctionSelector:"bytes4",systemId:"ResourceId",systemFunctionSelector:"bytes4"},key:["worldFunctionSelector"],codegen:{dataStruct:!1}},FunctionSignatures:{type:"offchainTable",schema:{functionSelector:"bytes4",functionSignature:"string"},key:["functionSelector"]},InitModuleAddress:{schema:{value:"address"},key:[]}},excludeSystems:["StoreRegistrationSystem"]});export{a as default};
|
|
2
2
|
//# sourceMappingURL=mud.config.js.map
|
package/dist/mud.config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../mud.config.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../mud.config.ts"],"sourcesContent":["import { defineWorld } from \"./ts/config/v2/world\";\n\nexport default defineWorld({\n codegen: {\n worldImportPath: \"../../\",\n worldgenDirectory: \"interfaces\",\n worldInterfaceName: \"IBaseWorld\",\n },\n namespace: \"world\" as const, // NOTE: this namespace is only used for tables, the core system is deployed in the root namespace.\n userTypes: {\n ResourceId: { filePath: \"@latticexyz/store/src/ResourceId.sol\", type: \"bytes32\" },\n },\n tables: {\n NamespaceOwner: {\n schema: {\n namespaceId: \"ResourceId\",\n owner: \"address\",\n },\n key: [\"namespaceId\"],\n },\n ResourceAccess: {\n schema: {\n resourceId: \"ResourceId\",\n caller: \"address\",\n access: \"bool\",\n },\n key: [\"resourceId\", \"caller\"],\n },\n InstalledModules: {\n schema: {\n moduleAddress: \"address\",\n argumentsHash: \"bytes32\", // Hash of the params passed to the `install` function\n isInstalled: \"bool\",\n },\n key: [\"moduleAddress\", \"argumentsHash\"],\n },\n UserDelegationControl: {\n schema: {\n delegator: \"address\",\n delegatee: \"address\",\n delegationControlId: \"ResourceId\",\n },\n key: [\"delegator\", \"delegatee\"],\n },\n NamespaceDelegationControl: {\n schema: {\n namespaceId: \"ResourceId\",\n delegationControlId: \"ResourceId\",\n },\n key: [\"namespaceId\"],\n },\n Balances: {\n schema: {\n namespaceId: \"ResourceId\",\n balance: \"uint256\",\n },\n key: [\"namespaceId\"],\n },\n Systems: {\n schema: {\n systemId: \"ResourceId\",\n system: \"address\",\n publicAccess: \"bool\",\n },\n key: [\"systemId\"],\n codegen: {\n dataStruct: false,\n },\n },\n SystemRegistry: {\n schema: {\n system: \"address\",\n systemId: \"ResourceId\",\n },\n key: [\"system\"],\n },\n SystemHooks: {\n schema: {\n systemId: \"ResourceId\",\n value: \"bytes21[]\",\n },\n key: [\"systemId\"],\n },\n FunctionSelectors: {\n schema: {\n worldFunctionSelector: \"bytes4\",\n systemId: \"ResourceId\",\n systemFunctionSelector: \"bytes4\",\n },\n key: [\"worldFunctionSelector\"],\n codegen: { dataStruct: false },\n },\n FunctionSignatures: {\n type: \"offchainTable\",\n schema: {\n functionSelector: \"bytes4\",\n functionSignature: \"string\",\n },\n key: [\"functionSelector\"],\n },\n InitModuleAddress: {\n schema: {\n value: \"address\",\n },\n key: [],\n },\n },\n excludeSystems: [\n // Worldgen currently does not support systems inheriting logic\n // from other contracts, so all parts of RegistrationSystem are named\n // System too to be included in the IBaseWorld interface.\n // However, IStoreRegistrationSystem overlaps with IStore if\n // included in IBaseWorld, so it needs to be excluded from worldgen.\n // TODO: add support for inheritance to worldgen\n // (see: https://github.com/latticexyz/mud/issues/631)\n \"StoreRegistrationSystem\",\n ],\n});\n"],"mappings":"oEAEA,IAAOA,EAAQC,EAAY,CACzB,QAAS,CACP,gBAAiB,SACjB,kBAAmB,aACnB,mBAAoB,YACtB,EACA,UAAW,QACX,UAAW,CACT,WAAY,CAAE,SAAU,uCAAwC,KAAM,SAAU,CAClF,EACA,OAAQ,CACN,eAAgB,CACd,OAAQ,CACN,YAAa,aACb,MAAO,SACT,EACA,IAAK,CAAC,aAAa,CACrB,EACA,eAAgB,CACd,OAAQ,CACN,WAAY,aACZ,OAAQ,UACR,OAAQ,MACV,EACA,IAAK,CAAC,aAAc,QAAQ,CAC9B,EACA,iBAAkB,CAChB,OAAQ,CACN,cAAe,UACf,cAAe,UACf,YAAa,MACf,EACA,IAAK,CAAC,gBAAiB,eAAe,CACxC,EACA,sBAAuB,CACrB,OAAQ,CACN,UAAW,UACX,UAAW,UACX,oBAAqB,YACvB,EACA,IAAK,CAAC,YAAa,WAAW,CAChC,EACA,2BAA4B,CAC1B,OAAQ,CACN,YAAa,aACb,oBAAqB,YACvB,EACA,IAAK,CAAC,aAAa,CACrB,EACA,SAAU,CACR,OAAQ,CACN,YAAa,aACb,QAAS,SACX,EACA,IAAK,CAAC,aAAa,CACrB,EACA,QAAS,CACP,OAAQ,CACN,SAAU,aACV,OAAQ,UACR,aAAc,MAChB,EACA,IAAK,CAAC,UAAU,EAChB,QAAS,CACP,WAAY,EACd,CACF,EACA,eAAgB,CACd,OAAQ,CACN,OAAQ,UACR,SAAU,YACZ,EACA,IAAK,CAAC,QAAQ,CAChB,EACA,YAAa,CACX,OAAQ,CACN,SAAU,aACV,MAAO,WACT,EACA,IAAK,CAAC,UAAU,CAClB,EACA,kBAAmB,CACjB,OAAQ,CACN,sBAAuB,SACvB,SAAU,aACV,uBAAwB,QAC1B,EACA,IAAK,CAAC,uBAAuB,EAC7B,QAAS,CAAE,WAAY,EAAM,CAC/B,EACA,mBAAoB,CAClB,KAAM,gBACN,OAAQ,CACN,iBAAkB,SAClB,kBAAmB,QACrB,EACA,IAAK,CAAC,kBAAkB,CAC1B,EACA,kBAAmB,CACjB,OAAQ,CACN,MAAO,SACT,EACA,IAAK,CAAC,CACR,CACF,EACA,eAAgB,CAQd,yBACF,CACF,CAAC","names":["mud_config_default","defineWorld"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Store } from '@latticexyz/store/config/v2';
|
|
2
|
+
|
|
3
|
+
declare enum DynamicResolutionType {
|
|
4
|
+
TABLE_ID = 0,
|
|
5
|
+
SYSTEM_ADDRESS = 1
|
|
6
|
+
}
|
|
7
|
+
type DynamicResolution = {
|
|
8
|
+
type: DynamicResolutionType;
|
|
9
|
+
input: string;
|
|
10
|
+
};
|
|
11
|
+
type ValueWithType = {
|
|
12
|
+
value: string | number | Uint8Array;
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type Module = {
|
|
17
|
+
/** The name of the module */
|
|
18
|
+
readonly name: string;
|
|
19
|
+
/** Should this module be installed as a root module? */
|
|
20
|
+
readonly root?: boolean;
|
|
21
|
+
/** Arguments to be passed to the module's install method */
|
|
22
|
+
readonly args?: (ValueWithType | DynamicResolution)[];
|
|
23
|
+
};
|
|
24
|
+
type System = {
|
|
25
|
+
/** The name of the system contract. Becomes part of the `systemId`. */
|
|
26
|
+
readonly name: string;
|
|
27
|
+
/**
|
|
28
|
+
* Register function selectors for the system in the World.
|
|
29
|
+
* Defaults to true.
|
|
30
|
+
* Note:
|
|
31
|
+
* - For root systems all World function selectors will correspond to the system's function selectors.
|
|
32
|
+
* - For non-root systems, the World function selectors will be <namespace>__<function>.
|
|
33
|
+
*/
|
|
34
|
+
readonly registerFunctionSelectors: boolean;
|
|
35
|
+
/** If openAccess is true, any address can call the system */
|
|
36
|
+
readonly openAccess: boolean;
|
|
37
|
+
/** An array of addresses or system names that can access the system */
|
|
38
|
+
readonly accessList: string[];
|
|
39
|
+
};
|
|
40
|
+
type Systems = {
|
|
41
|
+
readonly [key: string]: System;
|
|
42
|
+
};
|
|
43
|
+
type Deploy = {
|
|
44
|
+
/** The name of a custom World contract to deploy. If no name is provided, a default MUD World is deployed */
|
|
45
|
+
readonly customWorldContract: string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Script to execute after the deployment is complete (Default "PostDeploy").
|
|
48
|
+
* Script must be placed in the forge scripts directory (see foundry.toml) and have a ".s.sol" extension.
|
|
49
|
+
*/
|
|
50
|
+
readonly postDeployScript: string;
|
|
51
|
+
/** Directory to write the deployment info to (Default "./deploys") */
|
|
52
|
+
readonly deploysDirectory: string;
|
|
53
|
+
/** JSON file to write to with chain -> latest world deploy address (Default "./worlds.json") */
|
|
54
|
+
readonly worldsFile: string;
|
|
55
|
+
};
|
|
56
|
+
type Codegen = {
|
|
57
|
+
/** The name of the World interface to generate. (Default `IWorld`) */
|
|
58
|
+
readonly worldInterfaceName: string;
|
|
59
|
+
/** Directory to output system and world interfaces of `worldgen` (Default "world") */
|
|
60
|
+
readonly worldgenDirectory: string;
|
|
61
|
+
/** Path for world package imports. Default is "@latticexyz/world/src/" */
|
|
62
|
+
readonly worldImportPath: string;
|
|
63
|
+
};
|
|
64
|
+
type World = Store & {
|
|
65
|
+
readonly systems: Systems;
|
|
66
|
+
/** Systems to exclude from automatic deployment */
|
|
67
|
+
readonly excludeSystems: readonly string[];
|
|
68
|
+
/** Modules to in the World */
|
|
69
|
+
readonly modules: readonly Module[];
|
|
70
|
+
/** Deploy config */
|
|
71
|
+
readonly deploy: Deploy;
|
|
72
|
+
/** Codegen config */
|
|
73
|
+
readonly codegen: Codegen;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export { Codegen as C, Deploy as D, Module as M, Systems as S, World as W, System as a };
|