@latticexyz/world 2.0.0-alpha.1.87 → 2.0.0-alpha.1.89
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-KXMVYZUU.js → chunk-DTUIRXK6.js} +2 -2
- package/dist/chunk-UWUP7TCT.js +30 -0
- package/dist/chunk-UWUP7TCT.js.map +1 -0
- package/dist/mud.config.js +1 -1
- package/dist/ts/library/index.js +1 -1
- package/dist/ts/register/index.js +1 -1
- package/package.json +6 -6
- package/ts/library/config/resolveWorldConfig.ts +2 -1
- package/dist/chunk-XSZNAEUO.js +0 -30
- package/dist/chunk-XSZNAEUO.js.map +0 -1
- /package/dist/{chunk-KXMVYZUU.js.map → chunk-DTUIRXK6.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{f as o}from"./chunk-UWUP7TCT.js";import"@latticexyz/store/register";import{mudConfig as c,mudCoreConfig as C,resolveTableId as g}from"@latticexyz/store/register";import{extendMUDCoreConfig as t,fromZodErrorCustom as i}from"@latticexyz/config";import{ZodError as n}from"zod";t(r=>{try{return o.parse(r)}catch(e){throw e instanceof n?i(e,"WorldConfig Validation Error"):e}});import"@latticexyz/store/register";export{c as a,C as b,g as c};
|
|
2
|
+
//# sourceMappingURL=chunk-DTUIRXK6.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var S={registerFunctionSelector:!0,openAccess:!0,accessList:[]},l={worldContractName:void 0,worldInterfaceName:"IWorld",overrideSystems:{},excludeSystems:[],postDeployScript:"PostDeploy",deploysDirectory:"./deploys",worldgenDirectory:"world",worldImportPath:"@latticexyz/world/src/",modules:[]};import{getDuplicates as j,STORE_SELECTOR_MAX_LENGTH as T,UnrecognizedSystemErrorFactory as I}from"@latticexyz/config";import{MUDError as z}from"@latticexyz/common/errors";function b(r,o){let c=o?.filter(e=>e.endsWith("System")&&e!=="System"&&!e.match(/^I[A-Z]/))??[],n=Object.keys(r.overrideSystems);if(o){for(let e of n)if(!o.includes(e)||e==="World")throw I(["overrideSystems",e],e)}let m=[...new Set([...c,...n])].filter(e=>!r.excludeSystems.includes(e)).reduce((e,p)=>({...e,[p]:O(p,r.overrideSystems[p],o)}),{}),s=Object.values(r.tables).map(({name:e})=>e),a=Object.values(m).map(({name:e})=>e),d=j([...s,...a]);if(d.length>0)throw new z(`Table and system names must be unique: ${d.join(", ")}`);return{systems:m}}function O(r,o,c){let n=o?.name??r.slice(0,T),i=o?.registerFunctionSelectors??!0,m=o?.openAccess??!0,s=[],a=[],d=o&&!o.openAccess?o.accessList:[];for(let e of d)if(e.startsWith("0x"))s.push(e);else{if(c&&!c.includes(e))throw I(["overrideSystems",r,"accessList"],e);a.push(e)}return{name:n,registerFunctionSelectors:i,openAccess:m,accessListAddresses:s,accessListSystems:a}}import{z as t}from"zod";import{DynamicResolutionType as E,zEthereumAddress as F,zObjectName as w,zSelector as _}from"@latticexyz/config";var g=w,U=w,M=t.array(g.or(F)).default(S.accessList),B=t.intersection(t.object({name:_,registerFunctionSelectors:t.boolean().default(S.registerFunctionSelector)}),t.discriminatedUnion("openAccess",[t.object({openAccess:t.literal(!0).default(S.openAccess)}),t.object({openAccess:t.literal(!1),accessList:M})])),G=t.object({value:t.union([t.string(),t.number(),t.instanceof(Uint8Array)]),type:t.string()}),H=t.object({type:t.nativeEnum(E),input:t.string()}),k=t.object({name:U,root:t.boolean().default(!1),args:t.array(t.union([G,H])).default([])}),K=t.object({worldContractName:t.string().optional(),worldInterfaceName:t.string().default(l.worldInterfaceName),overrideSystems:t.record(g,B).default(l.overrideSystems),excludeSystems:t.array(g).default(l.excludeSystems),postDeployScript:t.string().default(l.postDeployScript),deploysDirectory:t.string().default(l.deploysDirectory),worldgenDirectory:t.string().default(l.worldgenDirectory),worldImportPath:t.string().default(l.worldImportPath),modules:t.array(k).default(l.modules)}),ce=K.catchall(t.any());import{renderArguments as h,renderList as W,renderedSolidityHeader as Y,renderImports as q}from"@latticexyz/common/codegen";function $(r){let{imports:o,name:c,functionPrefix:n,functions:i,errors:m}=r;return`${Y}
|
|
2
|
+
|
|
3
|
+
${q(o)}
|
|
4
|
+
|
|
5
|
+
interface ${c} {
|
|
6
|
+
${W(m,({name:s,parameters:a})=>`error ${s}(${h(a)});`)}
|
|
7
|
+
|
|
8
|
+
${W(i,({name:s,parameters:a,stateMutability:d,returnParameters:e})=>`
|
|
9
|
+
function ${n}${s}(
|
|
10
|
+
${h(a)}
|
|
11
|
+
) external ${d} ${V(e)};
|
|
12
|
+
`)}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
`}function V(r){return r.length>0?`returns (${h(r)})`:""}import{renderArguments as X,renderedSolidityHeader as Z,renderAbsoluteImports as J,renderRelativeImports as Q}from"@latticexyz/common/codegen";function v(r){let{interfaceName:o,storeImportPath:c,worldImportPath:n,imports:i}=r,m=o==="IBaseWorld"?[{symbol:"IStore",path:`${c}IStore.sol`},{symbol:"IWorldKernel",path:`${n}interfaces/IWorldKernel.sol`}]:[{symbol:"IBaseWorld",path:`${n}interfaces/IBaseWorld.sol`}],s=[...m,...i].map(({symbol:a})=>a);return`${Z}
|
|
16
|
+
|
|
17
|
+
${J(m)}
|
|
18
|
+
|
|
19
|
+
${Q(i)}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The ${o} interface includes all systems dynamically added to the World
|
|
23
|
+
* during the deploy process.
|
|
24
|
+
*/
|
|
25
|
+
interface ${o} is ${X(s)} {
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
`}import{readFileSync as ee}from"fs";import u from"path";import{formatAndWriteSolidity as D,contractToInterface as te}from"@latticexyz/common/codegen";async function Ae(r,o,c){let n=b(r,o.map(({basename:e})=>e)),i=u.join(c,r.worldgenDirectory),m=o.filter(({basename:e})=>Object.keys(n.systems).includes(e)),s=[];for(let e of m){let p=ee(e.path,"utf8"),{functions:x,errors:A,symbolImports:C}=te(p,e.basename),R=C.map(f=>f.path[0]==="."?{symbol:f.symbol,fromPath:u.join(u.dirname(e.path),f.path),usedInPath:i}:{symbol:f.symbol,path:f.path}),y=`I${e.basename}`,{name:L}=n.systems[e.basename],N=$({name:y,functionPrefix:r.namespace===""?"":`${r.namespace}_${L}_`,functions:x,errors:A,imports:R}),P=u.join(i,y+".sol");await D(N,P,"Generated system interface"),s.push({symbol:y,fromPath:`${y}.sol`,usedInPath:"./"})}let a=v({interfaceName:r.worldInterfaceName,imports:s,storeImportPath:r.storeImportPath,worldImportPath:r.worldImportPath}),d=u.join(i,r.worldInterfaceName+".sol");await D(a,d,"Generated system interface")}export{S as a,l as b,b as c,O as d,K as e,ce as f,$ as g,v as h,Ae as i};
|
|
30
|
+
//# sourceMappingURL=chunk-UWUP7TCT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../ts/library/config/defaults.ts","../ts/library/config/resolveWorldConfig.ts","../ts/library/config/worldConfig.ts","../ts/library/render-solidity/renderSystemInterface.ts","../ts/library/render-solidity/renderWorld.ts","../ts/library/render-solidity/worldgen.ts"],"sourcesContent":["export const SYSTEM_DEFAULTS = {\n registerFunctionSelector: true,\n openAccess: true,\n accessList: [] as string[],\n} as const;\n\nexport const WORLD_DEFAULTS = {\n worldContractName: undefined,\n worldInterfaceName: \"IWorld\",\n overrideSystems: {} as Record<string, never>,\n excludeSystems: [] as string[],\n postDeployScript: \"PostDeploy\",\n deploysDirectory: \"./deploys\",\n worldgenDirectory: \"world\",\n worldImportPath: \"@latticexyz/world/src/\",\n modules: [] as [],\n} as const;\n","import { getDuplicates, STORE_SELECTOR_MAX_LENGTH, UnrecognizedSystemErrorFactory } from \"@latticexyz/config\";\nimport { MUDError } from \"@latticexyz/common/errors\";\nimport { StoreConfig } from \"@latticexyz/store\";\nimport { SystemConfig, WorldConfig } from \"./types\";\n\nexport type ResolvedSystemConfig = ReturnType<typeof resolveSystemConfig>;\n\nexport type ResolvedWorldConfig = ReturnType<typeof resolveWorldConfig>;\n\n/**\n * Resolves the world config by combining the default and overridden system configs,\n * filtering out excluded systems, validate system names refer to existing contracts, and\n * splitting the access list into addresses and system names.\n */\nexport function resolveWorldConfig(config: StoreConfig & WorldConfig, existingContracts?: string[]) {\n // Include contract names ending in \"System\", but not the base \"System\" contract, and not Interfaces\n const defaultSystemNames =\n existingContracts?.filter((name) => name.endsWith(\"System\") && name !== \"System\" && !name.match(/^I[A-Z]/)) ?? [];\n const overriddenSystemNames = Object.keys(config.overrideSystems);\n\n // Validate every key in overrideSystems refers to an existing system contract (and is not called \"World\")\n if (existingContracts) {\n for (const systemName of overriddenSystemNames) {\n if (!existingContracts.includes(systemName) || systemName === \"World\") {\n throw UnrecognizedSystemErrorFactory([\"overrideSystems\", systemName], systemName);\n }\n }\n }\n\n // Combine the default and overridden system names and filter out excluded systems\n const systemNames = [...new Set([...defaultSystemNames, ...overriddenSystemNames])].filter(\n (name) => !config.excludeSystems.includes(name)\n );\n\n // Resolve the config\n const resolvedSystems: Record<string, ResolvedSystemConfig> = systemNames.reduce((acc, systemName) => {\n return {\n ...acc,\n [systemName]: resolveSystemConfig(systemName, config.overrideSystems[systemName], existingContracts),\n };\n }, {});\n\n // Table and system names must be unique (because they're both used for world selectors)\n const tableNames = Object.values(config.tables).map(({ name }) => name);\n const configuredSystemNames = Object.values(resolvedSystems).map(({ name }) => name);\n const duplicateNames = getDuplicates([...tableNames, ...configuredSystemNames]);\n if (duplicateNames.length > 0) {\n throw new MUDError(`Table and system names must be unique: ${duplicateNames.join(\", \")}`);\n }\n\n return { systems: resolvedSystems };\n}\n\n/**\n * Resolves the system config by combining the default and overridden system configs,\n * @param systemName name of the system\n * @param config optional SystemConfig object, if none is provided the default config is used\n * @param existingContracts optional list of existing contract names, used to validate system names in the access list. If not provided, no validation is performed.\n * @returns ResolvedSystemConfig object\n * Default value for name is `systemName`\n * Default value for registerFunctionSelectors is true\n * Default value for openAccess is true\n * Default value for accessListAddresses is []\n * Default value for accessListSystems is []\n */\nexport function resolveSystemConfig(systemName: string, config?: SystemConfig, existingContracts?: string[]) {\n const name = config?.name ?? systemName.slice(0, STORE_SELECTOR_MAX_LENGTH);\n const registerFunctionSelectors = config?.registerFunctionSelectors ?? true;\n const openAccess = config?.openAccess ?? true;\n const accessListAddresses: string[] = [];\n const accessListSystems: string[] = [];\n const accessList = config && !config.openAccess ? config.accessList : [];\n\n // Split the access list into addresses and system names\n for (const accessListItem of accessList) {\n if (accessListItem.startsWith(\"0x\")) {\n accessListAddresses.push(accessListItem);\n } else {\n // Validate every system refers to an existing system contract\n if (existingContracts && !existingContracts.includes(accessListItem)) {\n throw UnrecognizedSystemErrorFactory([\"overrideSystems\", systemName, \"accessList\"], accessListItem);\n }\n accessListSystems.push(accessListItem);\n }\n }\n\n return { name, registerFunctionSelectors, openAccess, accessListAddresses, accessListSystems };\n}\n","import { z } from \"zod\";\nimport { DynamicResolutionType, zEthereumAddress, zObjectName, zSelector } from \"@latticexyz/config\";\nimport { SYSTEM_DEFAULTS, WORLD_DEFAULTS } from \"./defaults\";\n\nconst zSystemName = zObjectName;\nconst zModuleName = zObjectName;\nconst zSystemAccessList = z.array(zSystemName.or(zEthereumAddress)).default(SYSTEM_DEFAULTS.accessList);\n\n// The system config is a combination of a name config and access config\nconst zSystemConfig = z.intersection(\n z.object({\n name: zSelector,\n registerFunctionSelectors: z.boolean().default(SYSTEM_DEFAULTS.registerFunctionSelector),\n }),\n z.discriminatedUnion(\"openAccess\", [\n z.object({\n openAccess: z.literal(true).default(SYSTEM_DEFAULTS.openAccess),\n }),\n z.object({\n openAccess: z.literal(false),\n accessList: zSystemAccessList,\n }),\n ])\n);\n\nconst zValueWithType = z.object({\n value: z.union([z.string(), z.number(), z.instanceof(Uint8Array)]),\n type: z.string(),\n});\nconst zDynamicResolution = z.object({ type: z.nativeEnum(DynamicResolutionType), input: z.string() });\n\nconst zModuleConfig = z.object({\n name: zModuleName,\n root: z.boolean().default(false),\n args: z.array(z.union([zValueWithType, zDynamicResolution])).default([]),\n});\n\n// The parsed world config is the result of parsing the user config\nexport const zWorldConfig = z.object({\n worldContractName: z.string().optional(),\n worldInterfaceName: z.string().default(WORLD_DEFAULTS.worldInterfaceName),\n overrideSystems: z.record(zSystemName, zSystemConfig).default(WORLD_DEFAULTS.overrideSystems),\n excludeSystems: z.array(zSystemName).default(WORLD_DEFAULTS.excludeSystems),\n postDeployScript: z.string().default(WORLD_DEFAULTS.postDeployScript),\n deploysDirectory: z.string().default(WORLD_DEFAULTS.deploysDirectory),\n worldgenDirectory: z.string().default(WORLD_DEFAULTS.worldgenDirectory),\n worldImportPath: z.string().default(WORLD_DEFAULTS.worldImportPath),\n modules: z.array(zModuleConfig).default(WORLD_DEFAULTS.modules),\n});\n\n// Catchall preserves other plugins' options\nexport const zPluginWorldConfig = zWorldConfig.catchall(z.any());\n","import { renderArguments, renderList, renderedSolidityHeader, renderImports } from \"@latticexyz/common/codegen\";\nimport { RenderSystemInterfaceOptions } from \"./types\";\n\nexport function renderSystemInterface(options: RenderSystemInterfaceOptions) {\n const { imports, name, functionPrefix, functions, errors } = options;\n\n return `${renderedSolidityHeader}\n\n${renderImports(imports)}\n\ninterface ${name} {\n ${renderList(errors, ({ name, parameters }) => `error ${name}(${renderArguments(parameters)});`)}\n\n ${renderList(\n functions,\n ({ name, parameters, stateMutability, returnParameters }) => `\n function ${functionPrefix}${name}(\n ${renderArguments(parameters)}\n ) external ${stateMutability} ${renderReturnParameters(returnParameters)};\n `\n )}\n}\n\n`;\n}\n\nfunction renderReturnParameters(returnParameters: string[]) {\n if (returnParameters.length > 0) {\n return `returns (${renderArguments(returnParameters)})`;\n } else {\n return \"\";\n }\n}\n","import {\n renderArguments,\n renderedSolidityHeader,\n renderAbsoluteImports,\n renderRelativeImports,\n type AbsoluteImportDatum,\n} from \"@latticexyz/common/codegen\";\nimport type { RenderWorldOptions } from \"./types\";\n\nexport function renderWorld(options: RenderWorldOptions) {\n const { interfaceName, storeImportPath, worldImportPath, imports } = options;\n const baseImports: AbsoluteImportDatum[] =\n interfaceName === \"IBaseWorld\"\n ? [\n { symbol: \"IStore\", path: `${storeImportPath}IStore.sol` },\n { symbol: \"IWorldKernel\", path: `${worldImportPath}interfaces/IWorldKernel.sol` },\n ]\n : [\n {\n symbol: \"IBaseWorld\",\n path: `${worldImportPath}interfaces/IBaseWorld.sol`,\n },\n ];\n const importSymbols = [...baseImports, ...imports].map(({ symbol }) => symbol);\n\n return `${renderedSolidityHeader}\n\n${renderAbsoluteImports(baseImports)}\n\n${renderRelativeImports(imports)}\n\n/**\n * The ${interfaceName} interface includes all systems dynamically added to the World\n * during the deploy process.\n */\ninterface ${interfaceName} is ${renderArguments(importSymbols)} {\n\n}\n\n`;\n}\n","import { readFileSync } from \"fs\";\nimport path from \"path\";\nimport { formatAndWriteSolidity, contractToInterface, type RelativeImportDatum } from \"@latticexyz/common/codegen\";\nimport { StoreConfig } from \"@latticexyz/store\";\nimport { renderSystemInterface } from \"./renderSystemInterface\";\nimport { renderWorld } from \"./renderWorld\";\nimport { resolveWorldConfig, WorldConfig } from \"../config\";\n\nexport async function worldgen(\n config: StoreConfig & WorldConfig,\n existingContracts: { path: string; basename: string }[],\n outputBaseDirectory: string\n) {\n const resolvedConfig = resolveWorldConfig(\n config,\n existingContracts.map(({ basename }) => basename)\n );\n\n const worldgenBaseDirectory = path.join(outputBaseDirectory, config.worldgenDirectory);\n const systems = existingContracts.filter(({ basename }) => Object.keys(resolvedConfig.systems).includes(basename));\n\n const systemInterfaceImports: RelativeImportDatum[] = [];\n for (const system of systems) {\n const data = readFileSync(system.path, \"utf8\");\n // get external funcions from a contract\n const { functions, errors, symbolImports } = contractToInterface(data, system.basename);\n const imports = symbolImports.map((symbolImport) => {\n if (symbolImport.path[0] === \".\") {\n // relative import\n return {\n symbol: symbolImport.symbol,\n fromPath: path.join(path.dirname(system.path), symbolImport.path),\n usedInPath: worldgenBaseDirectory,\n };\n } else {\n // absolute import\n return {\n symbol: symbolImport.symbol,\n path: symbolImport.path,\n };\n }\n });\n const systemInterfaceName = `I${system.basename}`;\n // create an interface using the external functions and imports\n const { name } = resolvedConfig.systems[system.basename];\n const output = renderSystemInterface({\n name: systemInterfaceName,\n functionPrefix: config.namespace === \"\" ? \"\" : `${config.namespace}_${name}_`,\n functions,\n errors,\n imports,\n });\n // write to file\n const fullOutputPath = path.join(worldgenBaseDirectory, systemInterfaceName + \".sol\");\n await formatAndWriteSolidity(output, fullOutputPath, \"Generated system interface\");\n\n // prepare imports for IWorld\n systemInterfaceImports.push({\n symbol: systemInterfaceName,\n fromPath: `${systemInterfaceName}.sol`,\n usedInPath: \"./\",\n });\n }\n\n // render IWorld\n const output = renderWorld({\n interfaceName: config.worldInterfaceName,\n imports: systemInterfaceImports,\n storeImportPath: config.storeImportPath,\n worldImportPath: config.worldImportPath,\n });\n // write to file\n const fullOutputPath = path.join(worldgenBaseDirectory, config.worldInterfaceName + \".sol\");\n await formatAndWriteSolidity(output, fullOutputPath, \"Generated system interface\");\n}\n"],"mappings":"AAAO,IAAMA,EAAkB,CAC7B,yBAA0B,GAC1B,WAAY,GACZ,WAAY,CAAC,CACf,EAEaC,EAAiB,CAC5B,kBAAmB,OACnB,mBAAoB,SACpB,gBAAiB,CAAC,EAClB,eAAgB,CAAC,EACjB,iBAAkB,aAClB,iBAAkB,YAClB,kBAAmB,QACnB,gBAAiB,yBACjB,QAAS,CAAC,CACZ,EChBA,OAAS,iBAAAC,EAAe,6BAAAC,EAA2B,kCAAAC,MAAsC,qBACzF,OAAS,YAAAC,MAAgB,4BAalB,SAASC,EAAmBC,EAAmCC,EAA8B,CAElG,IAAMC,EACJD,GAAmB,OAAQE,GAASA,EAAK,SAAS,QAAQ,GAAKA,IAAS,UAAY,CAACA,EAAK,MAAM,SAAS,CAAC,GAAK,CAAC,EAC5GC,EAAwB,OAAO,KAAKJ,EAAO,eAAe,EAGhE,GAAIC,GACF,QAAWI,KAAcD,EACvB,GAAI,CAACH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AAM,IAEpB,CACL,OAAQA,EAAa,OACrB,SAAUX,EAAK,KAAKA,EAAK,QAAQG,EAAO,IAAI,EAAGQ,EAAa,IAAI,EAChE,WAAYZ,CACd,EAGO,CACL,OAAQY,EAAa,OACrB,KAAMA,EAAa,IACrB,CAEH,EACKC,EAAsB,IAAIT,EAAO,WAEjC,CAAE,KAAAU,CAAK,EAAIjB,EAAe,QAAQO,EAAO,QAAQ,EACjDW,EAASC,EAAsB,CACnC,KAAMH,EACN,eAAgBnB,EAAO,YAAc,GAAK,GAAK,GAAGA,EAAO,aAAaoB,KACtE,UAAAP,EACA,OAAAC,EACA,QAAAG,CACF,CAAC,EAEKM,EAAiBhB,EAAK,KAAKD,EAAuBa,EAAsB,MAAM,EACpF,MAAMK,EAAuBH,EAAQE,EAAgB,4BAA4B,EAGjFd,EAAuB,KAAK,CAC1B,OAAQU,EACR,SAAU,GAAGA,QACb,WAAY,IACd,CAAC,EAIH,IAAME,EAASI,EAAY,CACzB,cAAezB,EAAO,mBACtB,QAASS,EACT,gBAAiBT,EAAO,gBACxB,gBAAiBA,EAAO,eAC1B,CAAC,EAEKuB,EAAiBhB,EAAK,KAAKD,EAAuBN,EAAO,mBAAqB,MAAM,EAC1F,MAAMwB,EAAuBH,EAAQE,EAAgB,4BAA4B,CACnF","names":["SYSTEM_DEFAULTS","WORLD_DEFAULTS","getDuplicates","STORE_SELECTOR_MAX_LENGTH","UnrecognizedSystemErrorFactory","MUDError","resolveWorldConfig","config","existingContracts","defaultSystemNames","name","overriddenSystemNames","systemName","resolvedSystems","acc","resolveSystemConfig","tableNames","configuredSystemNames","duplicateNames","registerFunctionSelectors","openAccess","accessListAddresses","accessListSystems","accessList","accessListItem","z","DynamicResolutionType","zEthereumAddress","zObjectName","zSelector","zSystemName","zObjectName","zModuleName","zSystemAccessList","z","zEthereumAddress","SYSTEM_DEFAULTS","zSystemConfig","zSelector","zValueWithType","zDynamicResolution","DynamicResolutionType","zModuleConfig","zWorldConfig","WORLD_DEFAULTS","zPluginWorldConfig","renderArguments","renderList","renderedSolidityHeader","renderImports","renderSystemInterface","options","imports","name","functionPrefix","functions","errors","parameters","stateMutability","returnParameters","renderReturnParameters","renderArguments","renderedSolidityHeader","renderAbsoluteImports","renderRelativeImports","renderWorld","options","interfaceName","storeImportPath","worldImportPath","imports","baseImports","importSymbols","symbol","readFileSync","path","formatAndWriteSolidity","contractToInterface","worldgen","config","existingContracts","outputBaseDirectory","resolvedConfig","resolveWorldConfig","basename","worldgenBaseDirectory","path","systems","systemInterfaceImports","system","data","readFileSync","functions","errors","symbolImports","contractToInterface","imports","symbolImport","systemInterfaceName","name","output","renderSystemInterface","fullOutputPath","formatAndWriteSolidity","renderWorld"]}
|
package/dist/mud.config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-DTUIRXK6.js";import"./chunk-UWUP7TCT.js";var r=e({worldImportPath:"../",worldgenDirectory:"interfaces",worldInterfaceName:"IBaseWorld",codegenDirectory:"",tables:{NamespaceOwner:{primaryKeys:{namespace:"bytes16"},schema:{owner:"address"}},ResourceAccess:{primaryKeys:{resourceSelector:"bytes32",caller:"address"},schema:{access:"bool"}},InstalledModules:{primaryKeys:{moduleName:"bytes16",argumentsHash:"bytes32"},schema:{moduleAddress:"address"},dataStruct:!0},Systems:{directory:"modules/core/tables",primaryKeys:{resourceSelector:"bytes32"},schema:{system:"address",publicAccess:"bool"},dataStruct:!1},SystemRegistry:{directory:"modules/core/tables",primaryKeys:{system:"address"},schema:{resourceSelector:"bytes32"}},ResourceType:{directory:"modules/core/tables",primaryKeys:{resourceSelector:"bytes32"},schema:{resourceType:"Resource"}},FunctionSelectors:{directory:"modules/core/tables",primaryKeys:{functionSelector:"bytes4"},schema:{namespace:"bytes16",name:"bytes16",systemFunctionSelector:"bytes4"},dataStruct:!1},KeysWithValue:{directory:"modules/keyswithvalue/tables",primaryKeys:{valueHash:"bytes32"},schema:{keysWithValue:"bytes32[]"},tableIdArgument:!0},KeysInTable:{directory:"modules/keysintable/tables",primaryKeys:{sourceTable:"bytes32"},schema:{length:"uint32",keys:"bytes32[]"}},UsedKeysIndex:{directory:"modules/keysintable/tables",primaryKeys:{sourceTable:"bytes32",keysHash:"bytes32"},schema:{has:"bool",index:"uint32"},dataStruct:!1},UniqueEntity:{directory:"modules/uniqueentity/tables",primaryKeys:{},schema:"uint256",tableIdArgument:!0,storeArgument:!0},Bool:{directory:"../test/tables",primaryKeys:{},schema:{value:"bool"},tableIdArgument:!0},AddressArray:{directory:"../test/tables",schema:"address[]",tableIdArgument:!0}},enums:{Resource:["NONE","NAMESPACE","TABLE","SYSTEM"]},excludeSystems:["UniqueEntitySystem","StoreRegistrationSystem"]});export{r as default};
|
|
2
2
|
//# sourceMappingURL=mud.config.js.map
|
package/dist/ts/library/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"../../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i}from"../../chunk-UWUP7TCT.js";export{a as SYSTEM_DEFAULTS,b as WORLD_DEFAULTS,g as renderSystemInterface,h as renderWorld,d as resolveSystemConfig,c as resolveWorldConfig,i as worldgen,f as zPluginWorldConfig,e as zWorldConfig};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c}from"../../chunk-
|
|
1
|
+
import{a,b,c}from"../../chunk-DTUIRXK6.js";import"../../chunk-UWUP7TCT.js";export{a as mudConfig,b as mudCoreConfig,c as resolveTableId};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@latticexyz/world",
|
|
3
|
-
"version": "2.0.0-alpha.1.
|
|
3
|
+
"version": "2.0.0-alpha.1.89+2d9bacf4",
|
|
4
4
|
"description": "World framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@ethersproject/abi": "^5.7.0",
|
|
47
47
|
"@ethersproject/providers": "^5.7.2",
|
|
48
|
-
"@latticexyz/common": "2.0.0-alpha.1.
|
|
49
|
-
"@latticexyz/config": "2.0.0-alpha.1.
|
|
50
|
-
"@latticexyz/schema-type": "2.0.0-alpha.1.
|
|
51
|
-
"@latticexyz/store": "2.0.0-alpha.1.
|
|
48
|
+
"@latticexyz/common": "2.0.0-alpha.1.89+2d9bacf4",
|
|
49
|
+
"@latticexyz/config": "2.0.0-alpha.1.89+2d9bacf4",
|
|
50
|
+
"@latticexyz/schema-type": "2.0.0-alpha.1.89+2d9bacf4",
|
|
51
|
+
"@latticexyz/store": "2.0.0-alpha.1.89+2d9bacf4",
|
|
52
52
|
"ethers": "^5.7.2",
|
|
53
53
|
"zod": "^3.21.4"
|
|
54
54
|
},
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"typescript": "^4.9.5",
|
|
74
74
|
"vitest": "0.30.1"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "2d9bacf467d948a8dde5b76fff248af3c711db2b"
|
|
77
77
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { getDuplicates,
|
|
1
|
+
import { getDuplicates, STORE_SELECTOR_MAX_LENGTH, UnrecognizedSystemErrorFactory } from "@latticexyz/config";
|
|
2
|
+
import { MUDError } from "@latticexyz/common/errors";
|
|
2
3
|
import { StoreConfig } from "@latticexyz/store";
|
|
3
4
|
import { SystemConfig, WorldConfig } from "./types";
|
|
4
5
|
|
package/dist/chunk-XSZNAEUO.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
var S={registerFunctionSelector:!0,openAccess:!0,accessList:[]},l={worldContractName:void 0,worldInterfaceName:"IWorld",overrideSystems:{},excludeSystems:[],postDeployScript:"PostDeploy",deploysDirectory:"./deploys",worldgenDirectory:"world",worldImportPath:"@latticexyz/world/src/",modules:[]};import{getDuplicates as j,MUDError as T,STORE_SELECTOR_MAX_LENGTH as z,UnrecognizedSystemErrorFactory as I}from"@latticexyz/config";function b(r,o){let c=o?.filter(e=>e.endsWith("System")&&e!=="System"&&!e.match(/^I[A-Z]/))??[],n=Object.keys(r.overrideSystems);if(o){for(let e of n)if(!o.includes(e)||e==="World")throw I(["overrideSystems",e],e)}let m=[...new Set([...c,...n])].filter(e=>!r.excludeSystems.includes(e)).reduce((e,p)=>({...e,[p]:O(p,r.overrideSystems[p],o)}),{}),s=Object.values(r.tables).map(({name:e})=>e),a=Object.values(m).map(({name:e})=>e),d=j([...s,...a]);if(d.length>0)throw new T(`Table and system names must be unique: ${d.join(", ")}`);return{systems:m}}function O(r,o,c){let n=o?.name??r.slice(0,z),i=o?.registerFunctionSelectors??!0,m=o?.openAccess??!0,s=[],a=[],d=o&&!o.openAccess?o.accessList:[];for(let e of d)if(e.startsWith("0x"))s.push(e);else{if(c&&!c.includes(e))throw I(["overrideSystems",r,"accessList"],e);a.push(e)}return{name:n,registerFunctionSelectors:i,openAccess:m,accessListAddresses:s,accessListSystems:a}}import{z as t}from"zod";import{DynamicResolutionType as E,zEthereumAddress as F,zObjectName as w,zSelector as _}from"@latticexyz/config";var g=w,U=w,M=t.array(g.or(F)).default(S.accessList),B=t.intersection(t.object({name:_,registerFunctionSelectors:t.boolean().default(S.registerFunctionSelector)}),t.discriminatedUnion("openAccess",[t.object({openAccess:t.literal(!0).default(S.openAccess)}),t.object({openAccess:t.literal(!1),accessList:M})])),G=t.object({value:t.union([t.string(),t.number(),t.instanceof(Uint8Array)]),type:t.string()}),H=t.object({type:t.nativeEnum(E),input:t.string()}),k=t.object({name:U,root:t.boolean().default(!1),args:t.array(t.union([G,H])).default([])}),K=t.object({worldContractName:t.string().optional(),worldInterfaceName:t.string().default(l.worldInterfaceName),overrideSystems:t.record(g,B).default(l.overrideSystems),excludeSystems:t.array(g).default(l.excludeSystems),postDeployScript:t.string().default(l.postDeployScript),deploysDirectory:t.string().default(l.deploysDirectory),worldgenDirectory:t.string().default(l.worldgenDirectory),worldImportPath:t.string().default(l.worldImportPath),modules:t.array(k).default(l.modules)}),me=K.catchall(t.any());import{renderArguments as h,renderList as W,renderedSolidityHeader as Y,renderImports as q}from"@latticexyz/common/codegen";function $(r){let{imports:o,name:c,functionPrefix:n,functions:i,errors:m}=r;return`${Y}
|
|
2
|
-
|
|
3
|
-
${q(o)}
|
|
4
|
-
|
|
5
|
-
interface ${c} {
|
|
6
|
-
${W(m,({name:s,parameters:a})=>`error ${s}(${h(a)});`)}
|
|
7
|
-
|
|
8
|
-
${W(i,({name:s,parameters:a,stateMutability:d,returnParameters:e})=>`
|
|
9
|
-
function ${n}${s}(
|
|
10
|
-
${h(a)}
|
|
11
|
-
) external ${d} ${V(e)};
|
|
12
|
-
`)}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
`}function V(r){return r.length>0?`returns (${h(r)})`:""}import{renderArguments as X,renderedSolidityHeader as Z,renderAbsoluteImports as J,renderRelativeImports as Q}from"@latticexyz/common/codegen";function v(r){let{interfaceName:o,storeImportPath:c,worldImportPath:n,imports:i}=r,m=o==="IBaseWorld"?[{symbol:"IStore",path:`${c}IStore.sol`},{symbol:"IWorldKernel",path:`${n}interfaces/IWorldKernel.sol`}]:[{symbol:"IBaseWorld",path:`${n}interfaces/IBaseWorld.sol`}],s=[...m,...i].map(({symbol:a})=>a);return`${Z}
|
|
16
|
-
|
|
17
|
-
${J(m)}
|
|
18
|
-
|
|
19
|
-
${Q(i)}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* The ${o} interface includes all systems dynamically added to the World
|
|
23
|
-
* during the deploy process.
|
|
24
|
-
*/
|
|
25
|
-
interface ${o} is ${X(s)} {
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
`}import{readFileSync as ee}from"fs";import u from"path";import{formatAndWriteSolidity as D,contractToInterface as te}from"@latticexyz/common/codegen";async function xe(r,o,c){let n=b(r,o.map(({basename:e})=>e)),i=u.join(c,r.worldgenDirectory),m=o.filter(({basename:e})=>Object.keys(n.systems).includes(e)),s=[];for(let e of m){let p=ee(e.path,"utf8"),{functions:x,errors:A,symbolImports:C}=te(p,e.basename),R=C.map(f=>f.path[0]==="."?{symbol:f.symbol,fromPath:u.join(u.dirname(e.path),f.path),usedInPath:i}:{symbol:f.symbol,path:f.path}),y=`I${e.basename}`,{name:L}=n.systems[e.basename],N=$({name:y,functionPrefix:r.namespace===""?"":`${r.namespace}_${L}_`,functions:x,errors:A,imports:R}),P=u.join(i,y+".sol");await D(N,P,"Generated system interface"),s.push({symbol:y,fromPath:`${y}.sol`,usedInPath:"./"})}let a=v({interfaceName:r.worldInterfaceName,imports:s,storeImportPath:r.storeImportPath,worldImportPath:r.worldImportPath}),d=u.join(i,r.worldInterfaceName+".sol");await D(a,d,"Generated system interface")}export{S as a,l as b,b as c,O as d,K as e,me as f,$ as g,v as h,xe as i};
|
|
30
|
-
//# sourceMappingURL=chunk-XSZNAEUO.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../ts/library/config/defaults.ts","../ts/library/config/resolveWorldConfig.ts","../ts/library/config/worldConfig.ts","../ts/library/render-solidity/renderSystemInterface.ts","../ts/library/render-solidity/renderWorld.ts","../ts/library/render-solidity/worldgen.ts"],"sourcesContent":["export const SYSTEM_DEFAULTS = {\n registerFunctionSelector: true,\n openAccess: true,\n accessList: [] as string[],\n} as const;\n\nexport const WORLD_DEFAULTS = {\n worldContractName: undefined,\n worldInterfaceName: \"IWorld\",\n overrideSystems: {} as Record<string, never>,\n excludeSystems: [] as string[],\n postDeployScript: \"PostDeploy\",\n deploysDirectory: \"./deploys\",\n worldgenDirectory: \"world\",\n worldImportPath: \"@latticexyz/world/src/\",\n modules: [] as [],\n} as const;\n","import { getDuplicates, MUDError, STORE_SELECTOR_MAX_LENGTH, UnrecognizedSystemErrorFactory } from \"@latticexyz/config\";\nimport { StoreConfig } from \"@latticexyz/store\";\nimport { SystemConfig, WorldConfig } from \"./types\";\n\nexport type ResolvedSystemConfig = ReturnType<typeof resolveSystemConfig>;\n\nexport type ResolvedWorldConfig = ReturnType<typeof resolveWorldConfig>;\n\n/**\n * Resolves the world config by combining the default and overridden system configs,\n * filtering out excluded systems, validate system names refer to existing contracts, and\n * splitting the access list into addresses and system names.\n */\nexport function resolveWorldConfig(config: StoreConfig & WorldConfig, existingContracts?: string[]) {\n // Include contract names ending in \"System\", but not the base \"System\" contract, and not Interfaces\n const defaultSystemNames =\n existingContracts?.filter((name) => name.endsWith(\"System\") && name !== \"System\" && !name.match(/^I[A-Z]/)) ?? [];\n const overriddenSystemNames = Object.keys(config.overrideSystems);\n\n // Validate every key in overrideSystems refers to an existing system contract (and is not called \"World\")\n if (existingContracts) {\n for (const systemName of overriddenSystemNames) {\n if (!existingContracts.includes(systemName) || systemName === \"World\") {\n throw UnrecognizedSystemErrorFactory([\"overrideSystems\", systemName], systemName);\n }\n }\n }\n\n // Combine the default and overridden system names and filter out excluded systems\n const systemNames = [...new Set([...defaultSystemNames, ...overriddenSystemNames])].filter(\n (name) => !config.excludeSystems.includes(name)\n );\n\n // Resolve the config\n const resolvedSystems: Record<string, ResolvedSystemConfig> = systemNames.reduce((acc, systemName) => {\n return {\n ...acc,\n [systemName]: resolveSystemConfig(systemName, config.overrideSystems[systemName], existingContracts),\n };\n }, {});\n\n // Table and system names must be unique (because they're both used for world selectors)\n const tableNames = Object.values(config.tables).map(({ name }) => name);\n const configuredSystemNames = Object.values(resolvedSystems).map(({ name }) => name);\n const duplicateNames = getDuplicates([...tableNames, ...configuredSystemNames]);\n if (duplicateNames.length > 0) {\n throw new MUDError(`Table and system names must be unique: ${duplicateNames.join(\", \")}`);\n }\n\n return { systems: resolvedSystems };\n}\n\n/**\n * Resolves the system config by combining the default and overridden system configs,\n * @param systemName name of the system\n * @param config optional SystemConfig object, if none is provided the default config is used\n * @param existingContracts optional list of existing contract names, used to validate system names in the access list. If not provided, no validation is performed.\n * @returns ResolvedSystemConfig object\n * Default value for name is `systemName`\n * Default value for registerFunctionSelectors is true\n * Default value for openAccess is true\n * Default value for accessListAddresses is []\n * Default value for accessListSystems is []\n */\nexport function resolveSystemConfig(systemName: string, config?: SystemConfig, existingContracts?: string[]) {\n const name = config?.name ?? systemName.slice(0, STORE_SELECTOR_MAX_LENGTH);\n const registerFunctionSelectors = config?.registerFunctionSelectors ?? true;\n const openAccess = config?.openAccess ?? true;\n const accessListAddresses: string[] = [];\n const accessListSystems: string[] = [];\n const accessList = config && !config.openAccess ? config.accessList : [];\n\n // Split the access list into addresses and system names\n for (const accessListItem of accessList) {\n if (accessListItem.startsWith(\"0x\")) {\n accessListAddresses.push(accessListItem);\n } else {\n // Validate every system refers to an existing system contract\n if (existingContracts && !existingContracts.includes(accessListItem)) {\n throw UnrecognizedSystemErrorFactory([\"overrideSystems\", systemName, \"accessList\"], accessListItem);\n }\n accessListSystems.push(accessListItem);\n }\n }\n\n return { name, registerFunctionSelectors, openAccess, accessListAddresses, accessListSystems };\n}\n","import { z } from \"zod\";\nimport { DynamicResolutionType, zEthereumAddress, zObjectName, zSelector } from \"@latticexyz/config\";\nimport { SYSTEM_DEFAULTS, WORLD_DEFAULTS } from \"./defaults\";\n\nconst zSystemName = zObjectName;\nconst zModuleName = zObjectName;\nconst zSystemAccessList = z.array(zSystemName.or(zEthereumAddress)).default(SYSTEM_DEFAULTS.accessList);\n\n// The system config is a combination of a name config and access config\nconst zSystemConfig = z.intersection(\n z.object({\n name: zSelector,\n registerFunctionSelectors: z.boolean().default(SYSTEM_DEFAULTS.registerFunctionSelector),\n }),\n z.discriminatedUnion(\"openAccess\", [\n z.object({\n openAccess: z.literal(true).default(SYSTEM_DEFAULTS.openAccess),\n }),\n z.object({\n openAccess: z.literal(false),\n accessList: zSystemAccessList,\n }),\n ])\n);\n\nconst zValueWithType = z.object({\n value: z.union([z.string(), z.number(), z.instanceof(Uint8Array)]),\n type: z.string(),\n});\nconst zDynamicResolution = z.object({ type: z.nativeEnum(DynamicResolutionType), input: z.string() });\n\nconst zModuleConfig = z.object({\n name: zModuleName,\n root: z.boolean().default(false),\n args: z.array(z.union([zValueWithType, zDynamicResolution])).default([]),\n});\n\n// The parsed world config is the result of parsing the user config\nexport const zWorldConfig = z.object({\n worldContractName: z.string().optional(),\n worldInterfaceName: z.string().default(WORLD_DEFAULTS.worldInterfaceName),\n overrideSystems: z.record(zSystemName, zSystemConfig).default(WORLD_DEFAULTS.overrideSystems),\n excludeSystems: z.array(zSystemName).default(WORLD_DEFAULTS.excludeSystems),\n postDeployScript: z.string().default(WORLD_DEFAULTS.postDeployScript),\n deploysDirectory: z.string().default(WORLD_DEFAULTS.deploysDirectory),\n worldgenDirectory: z.string().default(WORLD_DEFAULTS.worldgenDirectory),\n worldImportPath: z.string().default(WORLD_DEFAULTS.worldImportPath),\n modules: z.array(zModuleConfig).default(WORLD_DEFAULTS.modules),\n});\n\n// Catchall preserves other plugins' options\nexport const zPluginWorldConfig = zWorldConfig.catchall(z.any());\n","import { renderArguments, renderList, renderedSolidityHeader, renderImports } from \"@latticexyz/common/codegen\";\nimport { RenderSystemInterfaceOptions } from \"./types\";\n\nexport function renderSystemInterface(options: RenderSystemInterfaceOptions) {\n const { imports, name, functionPrefix, functions, errors } = options;\n\n return `${renderedSolidityHeader}\n\n${renderImports(imports)}\n\ninterface ${name} {\n ${renderList(errors, ({ name, parameters }) => `error ${name}(${renderArguments(parameters)});`)}\n\n ${renderList(\n functions,\n ({ name, parameters, stateMutability, returnParameters }) => `\n function ${functionPrefix}${name}(\n ${renderArguments(parameters)}\n ) external ${stateMutability} ${renderReturnParameters(returnParameters)};\n `\n )}\n}\n\n`;\n}\n\nfunction renderReturnParameters(returnParameters: string[]) {\n if (returnParameters.length > 0) {\n return `returns (${renderArguments(returnParameters)})`;\n } else {\n return \"\";\n }\n}\n","import {\n renderArguments,\n renderedSolidityHeader,\n renderAbsoluteImports,\n renderRelativeImports,\n type AbsoluteImportDatum,\n} from \"@latticexyz/common/codegen\";\nimport type { RenderWorldOptions } from \"./types\";\n\nexport function renderWorld(options: RenderWorldOptions) {\n const { interfaceName, storeImportPath, worldImportPath, imports } = options;\n const baseImports: AbsoluteImportDatum[] =\n interfaceName === \"IBaseWorld\"\n ? [\n { symbol: \"IStore\", path: `${storeImportPath}IStore.sol` },\n { symbol: \"IWorldKernel\", path: `${worldImportPath}interfaces/IWorldKernel.sol` },\n ]\n : [\n {\n symbol: \"IBaseWorld\",\n path: `${worldImportPath}interfaces/IBaseWorld.sol`,\n },\n ];\n const importSymbols = [...baseImports, ...imports].map(({ symbol }) => symbol);\n\n return `${renderedSolidityHeader}\n\n${renderAbsoluteImports(baseImports)}\n\n${renderRelativeImports(imports)}\n\n/**\n * The ${interfaceName} interface includes all systems dynamically added to the World\n * during the deploy process.\n */\ninterface ${interfaceName} is ${renderArguments(importSymbols)} {\n\n}\n\n`;\n}\n","import { readFileSync } from \"fs\";\nimport path from \"path\";\nimport { formatAndWriteSolidity, contractToInterface, type RelativeImportDatum } from \"@latticexyz/common/codegen\";\nimport { StoreConfig } from \"@latticexyz/store\";\nimport { renderSystemInterface } from \"./renderSystemInterface\";\nimport { renderWorld } from \"./renderWorld\";\nimport { resolveWorldConfig, WorldConfig } from \"../config\";\n\nexport async function worldgen(\n config: StoreConfig & WorldConfig,\n existingContracts: { path: string; basename: string }[],\n outputBaseDirectory: string\n) {\n const resolvedConfig = resolveWorldConfig(\n config,\n existingContracts.map(({ basename }) => basename)\n );\n\n const worldgenBaseDirectory = path.join(outputBaseDirectory, config.worldgenDirectory);\n const systems = existingContracts.filter(({ basename }) => Object.keys(resolvedConfig.systems).includes(basename));\n\n const systemInterfaceImports: RelativeImportDatum[] = [];\n for (const system of systems) {\n const data = readFileSync(system.path, \"utf8\");\n // get external funcions from a contract\n const { functions, errors, symbolImports } = contractToInterface(data, system.basename);\n const imports = symbolImports.map((symbolImport) => {\n if (symbolImport.path[0] === \".\") {\n // relative import\n return {\n symbol: symbolImport.symbol,\n fromPath: path.join(path.dirname(system.path), symbolImport.path),\n usedInPath: worldgenBaseDirectory,\n };\n } else {\n // absolute import\n return {\n symbol: symbolImport.symbol,\n path: symbolImport.path,\n };\n }\n });\n const systemInterfaceName = `I${system.basename}`;\n // create an interface using the external functions and imports\n const { name } = resolvedConfig.systems[system.basename];\n const output = renderSystemInterface({\n name: systemInterfaceName,\n functionPrefix: config.namespace === \"\" ? \"\" : `${config.namespace}_${name}_`,\n functions,\n errors,\n imports,\n });\n // write to file\n const fullOutputPath = path.join(worldgenBaseDirectory, systemInterfaceName + \".sol\");\n await formatAndWriteSolidity(output, fullOutputPath, \"Generated system interface\");\n\n // prepare imports for IWorld\n systemInterfaceImports.push({\n symbol: systemInterfaceName,\n fromPath: `${systemInterfaceName}.sol`,\n usedInPath: \"./\",\n });\n }\n\n // render IWorld\n const output = renderWorld({\n interfaceName: config.worldInterfaceName,\n imports: systemInterfaceImports,\n storeImportPath: config.storeImportPath,\n worldImportPath: config.worldImportPath,\n });\n // write to file\n const fullOutputPath = path.join(worldgenBaseDirectory, config.worldInterfaceName + \".sol\");\n await formatAndWriteSolidity(output, fullOutputPath, \"Generated system interface\");\n}\n"],"mappings":"AAAO,IAAMA,EAAkB,CAC7B,yBAA0B,GAC1B,WAAY,GACZ,WAAY,CAAC,CACf,EAEaC,EAAiB,CAC5B,kBAAmB,OACnB,mBAAoB,SACpB,gBAAiB,CAAC,EAClB,eAAgB,CAAC,EACjB,iBAAkB,aAClB,iBAAkB,YAClB,kBAAmB,QACnB,gBAAiB,yBACjB,QAAS,CAAC,CACZ,EChBA,OAAS,iBAAAC,EAAe,YAAAC,EAAU,6BAAAC,EAA2B,kCAAAC,MAAsC,qBAa5F,SAASC,EAAmBC,EAAmCC,EAA8B,CAElG,IAAMC,EACJD,GAAmB,OAAQE,GAASA,EAAK,SAAS,QAAQ,GAAKA,IAAS,UAAY,CAACA,EAAK,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OAAAC,EAAQ,cAAAC,CAAc,EAAIC,GAAoBL,EAAMD,EAAO,QAAQ,EAChFO,EAAUF,EAAc,IAAKG,GAC7BA,EAAa,KAAK,CAAC,IAAM,IAEpB,CACL,OAAQA,EAAa,OACrB,SAAUX,EAAK,KAAKA,EAAK,QAAQG,EAAO,IAAI,EAAGQ,EAAa,IAAI,EAChE,WAAYZ,CACd,EAGO,CACL,OAAQY,EAAa,OACrB,KAAMA,EAAa,IACrB,CAEH,EACKC,EAAsB,IAAIT,EAAO,WAEjC,CAAE,KAAAU,CAAK,EAAIjB,EAAe,QAAQO,EAAO,QAAQ,EACjDW,EAASC,EAAsB,CACnC,KAAMH,EACN,eAAgBnB,EAAO,YAAc,GAAK,GAAK,GAAGA,EAAO,aAAaoB,KACtE,UAAAP,EACA,OAAAC,EACA,QAAAG,CACF,CAAC,EAEKM,EAAiBhB,EAAK,KAAKD,EAAuBa,EAAsB,MAAM,EACpF,MAAMK,EAAuBH,EAAQE,EAAgB,4BAA4B,EAGjFd,EAAuB,KAAK,CAC1B,OAAQU,EACR,SAAU,GAAGA,QACb,WAAY,IACd,CAAC,EAIH,IAAME,EAASI,EAAY,CACzB,cAAezB,EAAO,mBACtB,QAASS,EACT,gBAAiBT,EAAO,gBACxB,gBAAiBA,EAAO,eAC1B,CAAC,EAEKuB,EAAiBhB,EAAK,KAAKD,EAAuBN,EAAO,mBAAqB,MAAM,EAC1F,MAAMwB,EAAuBH,EAAQE,EAAgB,4BAA4B,CACnF","names":["SYSTEM_DEFAULTS","WORLD_DEFAULTS","getDuplicates","MUDError","STORE_SELECTOR_MAX_LENGTH","UnrecognizedSystemErrorFactory","resolveWorldConfig","config","existingContracts","defaultSystemNames","name","overriddenSystemNames","systemName","resolvedSystems","acc","resolveSystemConfig","tableNames","configuredSystemNames","duplicateNames","registerFunctionSelectors","openAccess","accessListAddresses","accessListSystems","accessList","accessListItem","z","DynamicResolutionType","zEthereumAddress","zObjectName","zSelector","zSystemName","zObjectName","zModuleName","zSystemAccessList","z","zEthereumAddress","SYSTEM_DEFAULTS","zSystemConfig","zSelector","zValueWithType","zDynamicResolution","DynamicResolutionType","zModuleConfig","zWorldConfig","WORLD_DEFAULTS","zPluginWorldConfig","renderArguments","renderList","renderedSolidityHeader","renderImports","renderSystemInterface","options","imports","name","functionPrefix","functions","errors","parameters","stateMutability","returnParameters","renderReturnParameters","renderArguments","renderedSolidityHeader","renderAbsoluteImports","renderRelativeImports","renderWorld","options","interfaceName","storeImportPath","worldImportPath","imports","baseImports","importSymbols","symbol","readFileSync","path","formatAndWriteSolidity","contractToInterface","worldgen","config","existingContracts","outputBaseDirectory","resolvedConfig","resolveWorldConfig","basename","worldgenBaseDirectory","path","systems","systemInterfaceImports","system","data","readFileSync","functions","errors","symbolImports","contractToInterface","imports","symbolImport","systemInterfaceName","name","output","renderSystemInterface","fullOutputPath","formatAndWriteSolidity","renderWorld"]}
|
|
File without changes
|