@latticexyz/world 2.0.0-main-07e12ea2 → 2.0.0-main-cc4f4246
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.
|
@@ -1,2 +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 N}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,deployment:r};import{mapObject as E}from"@latticexyz/common/utils";import{mergeIfUndefined as T}from"@latticexyz/store/config/v2";function c(e){return E(e,o=>T(o,y))}import{isObject as D,mergeIfUndefined as g}from"@latticexyz/store/config/v2";function i(e){return D(e)?g(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 W(e){let o=v(e);if(L(e),S(e,"namespaces")){if(!N(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 _(e){let o=v(e),s=e.namespaces??{},u=Object.fromEntries(Object.entries(s).map(([m,x])=>Object.entries(x.tables).map(([p,a])=>(b(a,o),[`${m}__${p}`,U(l(a,{namespace:m,name:p}),o)]))).flat()),n=F(e);return l({...n,tables:{...n.tables,...u},codegen:l(n.codegen,i(e.codegen)),deployment:f(e.deployment),systems:c(e.systems??d.systems),excludeSystems:I(e,"excludeSystems"),modules:e.modules},d)}function Z(e){return W(e),_(e)}export{Z as defineWorld,_ as resolveWorld,W as validateWorld};
|
|
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 N}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,deployment:r};import{mapObject as E}from"@latticexyz/common/utils";import{mergeIfUndefined as T}from"@latticexyz/store/config/v2";function c(e){return E(e,o=>T(o,y))}import{isObject as D,mergeIfUndefined as g}from"@latticexyz/store/config/v2";function i(e){return D(e)?g(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 W(e){let o=v(e);if(L(e),S(e,"namespaces")){if(!N(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 _(e){let o=v(e),s=e.namespaces??{},u=Object.fromEntries(Object.entries(s).map(([m,x])=>Object.entries(x.tables??{}).map(([p,a])=>(b(a,o),[`${m}__${p}`,U(l(a,{namespace:m,name:p}),o)]))).flat()),n=F(e);return l({...n,tables:{...n.tables,...u},codegen:l(n.codegen,i(e.codegen)),deployment:f(e.deployment),systems:c(e.systems??d.systems),excludeSystems:I(e,"excludeSystems"),modules:e.modules},d)}function Z(e){return W(e),_(e)}export{Z as defineWorld,_ as resolveWorld,W as validateWorld};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +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/deployment.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 { resolveDeployment } from \"./deployment\";\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 \"deployment\"\n ? resolveDeployment<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 deployment: resolveDeployment(world.deployment),\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 DEPLOYMENT_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 deployment: DEPLOYMENT_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 { DEPLOYMENT_DEFAULTS } from \"./defaults\";\n\nexport type resolveDeployment<deployment> = deployment extends {}\n ? mergeIfUndefined<deployment, typeof DEPLOYMENT_DEFAULTS>\n : typeof DEPLOYMENT_DEFAULTS;\n\nexport function resolveDeployment<deployment>(deployment: deployment): resolveDeployment<deployment> {\n return (\n isObject(deployment) ? mergeIfUndefined(deployment, DEPLOYMENT_DEFAULTS) : DEPLOYMENT_DEFAULTS\n ) as resolveDeployment<deployment>;\n}\n"],"mappings":"+CACA,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,EAAsB,CACjC,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,WAAYC,CACd,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,EAA8BC,EAAuD,CACnG,OACEC,EAASD,CAAU,EAAIE,EAAiBF,EAAYG,CAAmB,EAAIA,CAE/E,CJ0BO,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,
|
|
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/deployment.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 { resolveDeployment } from \"./deployment\";\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 \"deployment\"\n ? resolveDeployment<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 deployment: resolveDeployment(world.deployment),\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 DEPLOYMENT_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 deployment: DEPLOYMENT_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 { DEPLOYMENT_DEFAULTS } from \"./defaults\";\n\nexport type resolveDeployment<deployment> = deployment extends {}\n ? mergeIfUndefined<deployment, typeof DEPLOYMENT_DEFAULTS>\n : typeof DEPLOYMENT_DEFAULTS;\n\nexport function resolveDeployment<deployment>(deployment: deployment): resolveDeployment<deployment> {\n return (\n isObject(deployment) ? mergeIfUndefined(deployment, DEPLOYMENT_DEFAULTS) : DEPLOYMENT_DEFAULTS\n ) as resolveDeployment<deployment>;\n}\n"],"mappings":"+CACA,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,EAAsB,CACjC,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,WAAYC,CACd,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,EAA8BC,EAAuD,CACnG,OACEC,EAASD,CAAU,EAAIE,EAAiBF,EAAYG,CAAmB,EAAIA,CAE/E,CJ0BO,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,WAAYoB,EAAkBpB,EAAM,UAAU,EAC9C,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","DEPLOYMENT_DEFAULTS","CONFIG_DEFAULTS","mapObject","mergeIfUndefined","resolveSystems","systems","mapObject","system","SYSTEM_DEFAULTS","isObject","mergeIfUndefined","resolveCodegen","codegen","isObject","mergeIfUndefined","CODEGEN_DEFAULTS","mergeIfUndefined","isObject","resolveDeployment","deployment","isObject","mergeIfUndefined","DEPLOYMENT_DEFAULTS","validateWorld","world","scope","extendedScope","validateStore","hasOwnKey","isObject","namespace","validateTables","resolveWorld","namespaces","resolvedNamespacedTables","namespaceKey","tableKey","table","validateTable","resolveTable","mergeIfUndefined","resolvedStore","resolveStore","resolveCodegen","resolveDeployment","resolveSystems","CONFIG_DEFAULTS","get","defineWorld"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@latticexyz/world",
|
|
3
|
-
"version": "2.0.0-main-
|
|
3
|
+
"version": "2.0.0-main-cc4f4246",
|
|
4
4
|
"description": "World framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"arktype": "1.0.29-alpha",
|
|
40
40
|
"viem": "2.7.12",
|
|
41
41
|
"zod": "^3.21.4",
|
|
42
|
-
"@latticexyz/common": "2.0.0-main-
|
|
43
|
-
"@latticexyz/
|
|
44
|
-
"@latticexyz/
|
|
45
|
-
"@latticexyz/store": "2.0.0-main-
|
|
42
|
+
"@latticexyz/common": "2.0.0-main-cc4f4246",
|
|
43
|
+
"@latticexyz/config": "2.0.0-main-cc4f4246",
|
|
44
|
+
"@latticexyz/schema-type": "2.0.0-main-cc4f4246",
|
|
45
|
+
"@latticexyz/store": "2.0.0-main-cc4f4246"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/ejs": "^3.1.1",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"tsup": "^6.7.0",
|
|
58
58
|
"tsx": "^3.12.6",
|
|
59
59
|
"vitest": "0.34.6",
|
|
60
|
-
"@latticexyz/abi-ts": "2.0.0-main-
|
|
61
|
-
"@latticexyz/gas-report": "2.0.0-main-
|
|
60
|
+
"@latticexyz/abi-ts": "2.0.0-main-cc4f4246",
|
|
61
|
+
"@latticexyz/gas-report": "2.0.0-main-cc4f4246"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "pnpm run build:mud && pnpm run build:abi && pnpm run build:abi-ts && pnpm run build:js",
|
package/ts/config/v2/world.ts
CHANGED
|
@@ -77,7 +77,7 @@ export function resolveWorld<const world extends WorldInput>(world: world): reso
|
|
|
77
77
|
const resolvedNamespacedTables = Object.fromEntries(
|
|
78
78
|
Object.entries(namespaces)
|
|
79
79
|
.map(([namespaceKey, namespace]) =>
|
|
80
|
-
Object.entries(namespace.tables).map(([tableKey, table]) => {
|
|
80
|
+
Object.entries(namespace.tables ?? {}).map(([tableKey, table]) => {
|
|
81
81
|
validateTable(table, scope);
|
|
82
82
|
return [
|
|
83
83
|
`${namespaceKey}__${tableKey}`,
|