@latticexyz/world 2.2.21-f4db683f90214b03bb8d68635a3825cc9bf58263 → 2.2.22-03af917786370b8251542adb3d53099aa85e754f

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.
Files changed (75) hide show
  1. package/dist/{chunk-6KRKTNJ5.js → chunk-WKPUHKX4.js} +2 -1
  2. package/dist/{chunk-6KRKTNJ5.js.map → chunk-WKPUHKX4.js.map} +1 -1
  3. package/dist/internal.js +1 -1
  4. package/dist/mud.config.js +1 -1
  5. package/dist/node.js +35 -23
  6. package/dist/node.js.map +1 -1
  7. package/out/AccessManagementSystem.sol/AccessManagementSystem.json +1 -1
  8. package/out/AccessManagementSystemLib.sol/AccessManagementSystemLib.json +1 -1
  9. package/out/AccessManagementSystemLib.sol/_grantAccess_ResourceId_address.json +1 -1
  10. package/out/AccessManagementSystemLib.sol/_renounceOwnership_ResourceId.json +1 -1
  11. package/out/AccessManagementSystemLib.sol/_revokeAccess_ResourceId_address.json +1 -1
  12. package/out/AccessManagementSystemLib.sol/_transferOwnership_ResourceId_address.json +1 -1
  13. package/out/BalanceTransferSystem.sol/BalanceTransferSystem.json +1 -1
  14. package/out/BalanceTransferSystemLib.sol/BalanceTransferSystemLib.json +1 -1
  15. package/out/BalanceTransferSystemLib.sol/_transferBalanceToAddress_ResourceId_address_uint256.json +1 -1
  16. package/out/BalanceTransferSystemLib.sol/_transferBalanceToNamespace_ResourceId_ResourceId_uint256.json +1 -1
  17. package/out/BatchCall.t.sol/BatchCallTest.json +1 -1
  18. package/out/BatchCall.t.sol/TestSystem.json +1 -1
  19. package/out/BatchCallSystem.sol/BatchCallSystem.json +1 -1
  20. package/out/BatchCallSystemLib.sol/BatchCallSystemLib.json +1 -1
  21. package/out/BatchCallSystemLib.sol/_batchCallFrom_SystemCallFromDataArray.json +1 -1
  22. package/out/BatchCallSystemLib.sol/_batchCall_SystemCallDataArray.json +1 -1
  23. package/out/DelegationControl.sol/DelegationControl.json +1 -1
  24. package/out/DelegationControlMock.sol/DelegationControlMock.json +1 -1
  25. package/out/Factories.t.sol/FactoriesTest.json +1 -1
  26. package/out/IBaseWorld.sol/IBaseWorld.json +1 -1
  27. package/out/IWorldRegistrationSystem.sol/IWorldRegistrationSystem.json +1 -1
  28. package/out/InitModule.sol/InitModule.json +1 -1
  29. package/out/InitModule.t.sol/InitModuleTest.json +1 -1
  30. package/out/InitModule.t.sol/WorldMock.json +1 -1
  31. package/out/InitSystems.t.sol/LimitedCallContextTest.json +1 -1
  32. package/out/ModuleInstallationSystem.sol/ModuleInstallationSystem.json +1 -1
  33. package/out/ModuleInstallationSystemLib.sol/ModuleInstallationSystemLib.json +1 -1
  34. package/out/ModuleInstallationSystemLib.sol/_installModule_IModule_bytes.json +1 -1
  35. package/out/RegistrationSystem.sol/RegistrationSystem.json +1 -1
  36. package/out/RegistrationSystemLib.sol/RegistrationSystemLib.json +1 -1
  37. package/out/StoreRegistrationSystem.sol/StoreRegistrationSystem.json +1 -1
  38. package/out/StoreRegistrationSystemLib.sol/StoreRegistrationSystemLib.json +1 -1
  39. package/out/StoreRegistrationSystemLib.sol/_registerStoreHook_ResourceId_IStoreHook_uint8.json +1 -1
  40. package/out/StoreRegistrationSystemLib.sol/_registerTable_ResourceId_FieldLayout_Schema_Schema_stringArray_stringArray.json +1 -1
  41. package/out/StoreRegistrationSystemLib.sol/_unregisterStoreHook_ResourceId_IStoreHook.json +1 -1
  42. package/out/System.sol/System.json +1 -1
  43. package/out/System.t.sol/SystemTest.json +1 -1
  44. package/out/System.t.sol/TestSystem.json +1 -1
  45. package/out/Utils.t.sol/UtilsTest.json +1 -1
  46. package/out/Utils.t.sol/UtilsTestSystem.json +1 -1
  47. package/out/World.t.sol/EchoSystemHook.json +1 -1
  48. package/out/World.t.sol/IWorldTestSystem.json +1 -1
  49. package/out/World.t.sol/PayableFallbackSystem.json +1 -1
  50. package/out/World.t.sol/RevertSystemHook.json +1 -1
  51. package/out/World.t.sol/WorldTest.json +1 -1
  52. package/out/World.t.sol/WorldTestSystem.json +1 -1
  53. package/out/WorldBalance.t.sol/WorldBalanceTest.json +1 -1
  54. package/out/WorldBalance.t.sol/WorldBalanceTestSystem.json +1 -1
  55. package/out/WorldDynamicUpdate.t.sol/UpdateInDynamicFieldTest.json +1 -1
  56. package/out/WorldFactory.sol/WorldFactory.json +1 -1
  57. package/out/WorldProxy.sol/WorldProxy.json +1 -1
  58. package/out/WorldProxy.t.sol/WorldProxyTest.json +1 -1
  59. package/out/WorldProxyFactory.sol/WorldProxyFactory.json +1 -1
  60. package/out/WorldProxyFactory.t.sol/WorldProxyFactoryTest.json +1 -1
  61. package/out/WorldRegistrationSystem.sol/WorldRegistrationSystem.json +1 -1
  62. package/out/WorldRegistrationSystemLib.sol/WorldRegistrationSystemLib.json +1 -1
  63. package/out/WorldRegistrationSystemLib.sol/_registerDelegation_address_ResourceId_bytes.json +1 -1
  64. package/out/WorldRegistrationSystemLib.sol/_registerFunctionSelector_ResourceId_string.json +1 -1
  65. package/out/WorldRegistrationSystemLib.sol/_registerNamespaceDelegation_ResourceId_ResourceId_bytes.json +1 -1
  66. package/out/WorldRegistrationSystemLib.sol/_registerNamespace_ResourceId.json +1 -1
  67. package/out/WorldRegistrationSystemLib.sol/_registerRootFunctionSelector_ResourceId_string_string.json +1 -1
  68. package/out/WorldRegistrationSystemLib.sol/_registerSystemHook_ResourceId_ISystemHook_uint8.json +1 -1
  69. package/out/WorldRegistrationSystemLib.sol/_registerSystem_ResourceId_System_bool.json +1 -1
  70. package/out/WorldRegistrationSystemLib.sol/_unregisterDelegation_address.json +1 -1
  71. package/out/WorldRegistrationSystemLib.sol/_unregisterNamespaceDelegation_ResourceId.json +1 -1
  72. package/out/WorldRegistrationSystemLib.sol/_unregisterSystemHook_ResourceId_ISystemHook.json +1 -1
  73. package/out/build-info/{6366a746548e984842b93ef762b76b99.json → bf27acd14b2b959864c0abf4ffaa7965.json} +1 -1
  74. package/package.json +9 -9
  75. package/src/System.sol +1 -1
@@ -114,6 +114,7 @@ var systemsConfig = defineWorld({
114
114
  worldgenDirectory: "interfaces",
115
115
  worldInterfaceName: "IBaseWorld",
116
116
  generateSystemLibraries: true,
117
+ // generate into experimental dir until these are stable/audited
117
118
  systemLibrariesDirectory: "experimental/systems"
118
119
  },
119
120
  // Keep aligned with src/modules/init/constants.sol
@@ -149,4 +150,4 @@ export {
149
150
  systemsConfig,
150
151
  mud_config_default
151
152
  };
152
- //# sourceMappingURL=chunk-6KRKTNJ5.js.map
153
+ //# sourceMappingURL=chunk-WKPUHKX4.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../mud.config.ts"],"sourcesContent":["import { defineWorld } from \"./ts/config/v2/world\";\n\n// Ideally we'd use a single multi-namespace config here, but we don't want\n// to break imports from this package because the source location changed.\n//\n// Once we have more nuanced control over source paths and codegen for each\n// namespace, then we could probably migrate to multi-namespace config.\n//\n// Or some way to deeply merge multiple configs while retaining strong types.\n\n/** @internal */\nexport const tablesConfig = defineWorld({\n namespace: \"world\",\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: {\n dataStruct: false,\n },\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});\n\n/** @internal */\nexport const systemsConfig = defineWorld({\n namespace: \"\",\n codegen: {\n worldImportPath: \"./src\",\n worldgenDirectory: \"interfaces\",\n worldInterfaceName: \"IBaseWorld\",\n generateSystemLibraries: true,\n systemLibrariesDirectory: \"experimental/systems\",\n },\n // Keep aligned with src/modules/init/constants.sol\n systems: {\n AccessManagementSystem: {\n name: \"AccessManagement\",\n },\n BalanceTransferSystem: {\n name: \"BalanceTransfer\",\n },\n BatchCallSystem: {\n name: \"BatchCall\",\n },\n RegistrationSystem: {\n name: \"Registration\",\n },\n // abstract systems that are deployed as part of RegistrationSystem\n ModuleInstallationSystem: {\n name: \"Registration\",\n },\n StoreRegistrationSystem: {\n name: \"Registration\",\n },\n WorldRegistrationSystem: {\n name: \"Registration\",\n },\n },\n});\n\nexport default tablesConfig;\n"],"mappings":";;;;;AAWO,IAAM,eAAe,YAAY;AAAA,EACtC,WAAW;AAAA,EACX,WAAW;AAAA,IACT,YAAY,EAAE,UAAU,wCAAwC,MAAM,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,QACV,OAAO;AAAA,MACT;AAAA,MACA,KAAK,CAAC,UAAU;AAAA,IAClB;AAAA,IACA,mBAAmB;AAAA,MACjB,QAAQ;AAAA,QACN,uBAAuB;AAAA,QACvB,UAAU;AAAA,QACV,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,CAAC,uBAAuB;AAAA,MAC7B,SAAS;AAAA,QACP,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB,MAAM;AAAA,MACN,QAAQ;AAAA,QACN,kBAAkB;AAAA,QAClB,mBAAmB;AAAA,MACrB;AAAA,MACA,KAAK,CAAC,kBAAkB;AAAA,IAC1B;AAAA,IACA,mBAAmB;AAAA,MACjB,QAAQ;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,KAAK,CAAC;AAAA,IACR;AAAA,EACF;AACF,CAAC;AAGM,IAAM,gBAAgB,YAAY;AAAA,EACvC,WAAW;AAAA,EACX,SAAS;AAAA,IACP,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,yBAAyB;AAAA,IACzB,0BAA0B;AAAA,EAC5B;AAAA;AAAA,EAEA,SAAS;AAAA,IACP,wBAAwB;AAAA,MACtB,MAAM;AAAA,IACR;AAAA,IACA,uBAAuB;AAAA,MACrB,MAAM;AAAA,IACR;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,IACR;AAAA,IACA,oBAAoB;AAAA,MAClB,MAAM;AAAA,IACR;AAAA;AAAA,IAEA,0BAA0B;AAAA,MACxB,MAAM;AAAA,IACR;AAAA,IACA,yBAAyB;AAAA,MACvB,MAAM;AAAA,IACR;AAAA,IACA,yBAAyB;AAAA,MACvB,MAAM;AAAA,IACR;AAAA,EACF;AACF,CAAC;AAED,IAAO,qBAAQ;","names":[]}
1
+ {"version":3,"sources":["../mud.config.ts"],"sourcesContent":["import { defineWorld } from \"./ts/config/v2/world\";\n\n// Ideally we'd use a single multi-namespace config here, but we don't want\n// to break imports from this package because the source location changed.\n//\n// Once we have more nuanced control over source paths and codegen for each\n// namespace, then we could probably migrate to multi-namespace config.\n//\n// Or some way to deeply merge multiple configs while retaining strong types.\n\n/** @internal */\nexport const tablesConfig = defineWorld({\n namespace: \"world\",\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: {\n dataStruct: false,\n },\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});\n\n/** @internal */\nexport const systemsConfig = defineWorld({\n namespace: \"\",\n codegen: {\n worldImportPath: \"./src\",\n worldgenDirectory: \"interfaces\",\n worldInterfaceName: \"IBaseWorld\",\n generateSystemLibraries: true,\n // generate into experimental dir until these are stable/audited\n systemLibrariesDirectory: \"experimental/systems\",\n },\n // Keep aligned with src/modules/init/constants.sol\n systems: {\n AccessManagementSystem: {\n name: \"AccessManagement\",\n },\n BalanceTransferSystem: {\n name: \"BalanceTransfer\",\n },\n BatchCallSystem: {\n name: \"BatchCall\",\n },\n RegistrationSystem: {\n name: \"Registration\",\n },\n // abstract systems that are deployed as part of RegistrationSystem\n ModuleInstallationSystem: {\n name: \"Registration\",\n },\n StoreRegistrationSystem: {\n name: \"Registration\",\n },\n WorldRegistrationSystem: {\n name: \"Registration\",\n },\n },\n});\n\nexport default tablesConfig;\n"],"mappings":";;;;;AAWO,IAAM,eAAe,YAAY;AAAA,EACtC,WAAW;AAAA,EACX,WAAW;AAAA,IACT,YAAY,EAAE,UAAU,wCAAwC,MAAM,UAAU;AAAA,EAClF;AAAA,EACA,QAAQ;AAAA,IACN,gBAAgB;AAAA,MACd,QAAQ;AAAA,QACN,aAAa;AAAA,QACb,OAAO;AAAA,MACT;AAAA,MACA,KAAK,CAAC,aAAa;AAAA,IACrB;AAAA,IACA,gBAAgB;AAAA,MACd,QAAQ;AAAA,QACN,YAAY;AAAA,QACZ,QAAQ;AAAA,QACR,QAAQ;AAAA,MACV;AAAA,MACA,KAAK,CAAC,cAAc,QAAQ;AAAA,IAC9B;AAAA,IACA,kBAAkB;AAAA,MAChB,QAAQ;AAAA,QACN,eAAe;AAAA,QACf,eAAe;AAAA;AAAA,QACf,aAAa;AAAA,MACf;AAAA,MACA,KAAK,CAAC,iBAAiB,eAAe;AAA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QACN,OAAO;AAAA,MACT;AAAA,MACA,KAAK,CAAC;AAAA,IACR;AAAA,EACF;AACF,CAAC;AAGM,IAAM,gBAAgB,YAAY;AAAA,EACvC,WAAW;AAAA,EACX,SAAS;AAAA,IACP,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,yBAAyB;AAAA;AAAA,IAEzB,0BAA0B;AAAA,EAC5B;AAAA;AAAA,EAEA,SAAS;AAAA,IACP,wBAAwB;AAAA,MACtB,MAAM;AAAA,IACR;AAAA,IACA,uBAAuB;AAAA,MACrB,MAAM;AAAA,IACR;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,IACR;AAAA,IACA,oBAAoB;AAAA,MAClB,MAAM;AAAA,IACR;AAAA;AAAA,IAEA,0BAA0B;AAAA,MACxB,MAAM;AAAA,IACR;AAAA,IACA,yBAAyB;AAAA,MACvB,MAAM;AAAA,IACR;AAAA,IACA,yBAAyB;AAAA,MACvB,MAAM;AAAA,IACR;AAAA,EACF;AACF,CAAC;AAED,IAAO,qBAAQ;","names":[]}
package/dist/internal.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  mud_config_default
3
- } from "./chunk-6KRKTNJ5.js";
3
+ } from "./chunk-WKPUHKX4.js";
4
4
  import {
5
5
  defineNamespaces,
6
6
  defineWorld,
@@ -2,7 +2,7 @@ import {
2
2
  mud_config_default,
3
3
  systemsConfig,
4
4
  tablesConfig
5
- } from "./chunk-6KRKTNJ5.js";
5
+ } from "./chunk-WKPUHKX4.js";
6
6
  import "./chunk-NVV4GS3R.js";
7
7
  import "./chunk-6E2JY6MZ.js";
8
8
  import "./chunk-5WRI5ZAA.js";
package/dist/node.js CHANGED
@@ -266,11 +266,15 @@ function renderSystemLibrary(options) {
266
266
  systemName,
267
267
  namespace,
268
268
  resourceId,
269
- functions,
269
+ functions: functionsInput,
270
270
  errors: systemErrors,
271
271
  worldImportPath,
272
272
  storeImportPath
273
273
  } = options;
274
+ const functions = functionsInput.map((func) => ({
275
+ ...func,
276
+ stateMutability: func.stateMutability.replace("payable", "")
277
+ }));
274
278
  const imports = [
275
279
  ...systemImports,
276
280
  {
@@ -553,7 +557,7 @@ function renderWorldInterface({
553
557
  }
554
558
 
555
559
  // ts/node/render-solidity/worldgen.ts
556
- import fs from "node:fs/promises";
560
+ import fs2 from "node:fs/promises";
557
561
  import path4 from "node:path";
558
562
  import { formatAndWriteSolidity, contractToInterface } from "@latticexyz/common/codegen";
559
563
 
@@ -562,6 +566,7 @@ import { isHex } from "viem";
562
566
 
563
567
  // ts/node/getSystemContracts.ts
564
568
  import path3 from "node:path";
569
+ import fs from "node:fs/promises";
565
570
 
566
571
  // ts/node/findSolidityFiles.ts
567
572
  import path2 from "node:path";
@@ -5270,8 +5275,8 @@ var PathScurryBase = class {
5270
5275
  *
5271
5276
  * @internal
5272
5277
  */
5273
- constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs3 = defaultFS } = {}) {
5274
- this.#fs = fsFromOption(fs3);
5278
+ constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs4 = defaultFS } = {}) {
5279
+ this.#fs = fsFromOption(fs4);
5275
5280
  if (cwd instanceof URL || cwd.startsWith("file://")) {
5276
5281
  cwd = fileURLToPath(cwd);
5277
5282
  }
@@ -5829,8 +5834,8 @@ var PathScurryWin32 = class extends PathScurryBase {
5829
5834
  /**
5830
5835
  * @internal
5831
5836
  */
5832
- newRoot(fs3) {
5833
- return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs3 });
5837
+ newRoot(fs4) {
5838
+ return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs4 });
5834
5839
  }
5835
5840
  /**
5836
5841
  * Return true if the provided path string is an absolute path
@@ -5858,8 +5863,8 @@ var PathScurryPosix = class extends PathScurryBase {
5858
5863
  /**
5859
5864
  * @internal
5860
5865
  */
5861
- newRoot(fs3) {
5862
- return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs3 });
5866
+ newRoot(fs4) {
5867
+ return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs4 });
5863
5868
  }
5864
5869
  /**
5865
5870
  * Return true if the provided path string is an absolute path
@@ -6947,19 +6952,26 @@ async function findSolidityFiles({ cwd, pattern = "**" }) {
6947
6952
  }
6948
6953
 
6949
6954
  // ts/node/getSystemContracts.ts
6955
+ import { parseSystem } from "@latticexyz/common/codegen";
6956
+ import { isDefined } from "@latticexyz/common/utils";
6950
6957
  async function getSystemContracts({
6951
6958
  rootDir,
6952
6959
  config
6953
6960
  }) {
6954
- const solidityFiles = await findSolidityFiles({
6961
+ const filePaths = await findSolidityFiles({
6955
6962
  cwd: rootDir,
6956
6963
  pattern: path3.join(config.sourceDirectory, "**")
6957
6964
  });
6958
- return solidityFiles.filter(
6959
- (file) => file.basename.endsWith("System") && // exclude the base System contract
6960
- file.basename !== "System" && // exclude interfaces
6961
- !/^I[A-Z]/.test(file.basename)
6962
- ).map((file) => {
6965
+ const files = await Promise.all(
6966
+ filePaths.map(async (file) => {
6967
+ console.log("reading source for", file.filename);
6968
+ const source = await fs.readFile(path3.join(rootDir, file.filename), "utf-8");
6969
+ return { ...file, source };
6970
+ })
6971
+ );
6972
+ return files.map((file) => {
6973
+ const parsedSystem = parseSystem(file.source, file.basename);
6974
+ if (!parsedSystem) return;
6963
6975
  const namespaceLabel = (() => {
6964
6976
  if (!config.multipleNamespaces && config.namespace != null) return config.namespace;
6965
6977
  const relativePath = path3.relative(path3.join(rootDir, config.sourceDirectory), file.filename);
@@ -6976,7 +6988,7 @@ async function getSystemContracts({
6976
6988
  namespaceLabel,
6977
6989
  systemLabel: file.basename
6978
6990
  };
6979
- });
6991
+ }).filter(isDefined);
6980
6992
  }
6981
6993
 
6982
6994
  // ts/node/resolveSystems.ts
@@ -7054,8 +7066,8 @@ async function worldgen({
7054
7066
  if (clean) {
7055
7067
  const libraryDirs = [...new Set(systems.map(({ libraryPath }) => path4.dirname(libraryPath)))];
7056
7068
  await Promise.all([
7057
- fs.rm(worldgenOutDir, { recursive: true, force: true }),
7058
- ...libraryDirs.map((dir) => fs.rm(dir, { recursive: true, force: true }))
7069
+ fs2.rm(worldgenOutDir, { recursive: true, force: true }),
7070
+ ...libraryDirs.map((dir) => fs2.rm(dir, { recursive: true, force: true }))
7059
7071
  ]);
7060
7072
  }
7061
7073
  const outputPath = path4.join(worldgenOutDir, config.codegen.worldInterfaceName + ".sol");
@@ -7069,7 +7081,7 @@ async function worldgen({
7069
7081
  const worldImportPath = config.codegen.worldImportPath.startsWith(".") ? "./" + path4.relative(path4.dirname(outputPath), path4.join(rootDir, config.codegen.worldImportPath)) : config.codegen.worldImportPath;
7070
7082
  await Promise.all(
7071
7083
  systems.map(async (system) => {
7072
- const source = await fs.readFile(path4.join(rootDir, system.sourcePath), "utf8");
7084
+ const source = await fs2.readFile(path4.join(rootDir, system.sourcePath), "utf8");
7073
7085
  const { functions, errors, symbolImports } = contractToInterface(source, system.label);
7074
7086
  const interfaceImports = symbolImports.map(
7075
7087
  ({ symbol, path: importPath }) => ({
@@ -7129,7 +7141,7 @@ async function worldgen({
7129
7141
  import path5 from "node:path";
7130
7142
  import { readFile } from "node:fs/promises";
7131
7143
  import { type as type2 } from "arktype";
7132
- import { indent, isDefined } from "@latticexyz/common/utils";
7144
+ import { indent, isDefined as isDefined2 } from "@latticexyz/common/utils";
7133
7145
  import { size, sliceHex } from "viem";
7134
7146
 
7135
7147
  // ts/node/common.ts
@@ -7207,7 +7219,7 @@ ${indent(artifact.message)}`);
7207
7219
  return;
7208
7220
  }
7209
7221
  return artifact;
7210
- }).filter(isDefined).filter(hasMetadata).map((artifact) => {
7222
+ }).filter(isDefined2).filter(hasMetadata).map((artifact) => {
7211
7223
  artifact;
7212
7224
  const sourcePath = Object.keys(artifact.metadata.settings.compilationTarget)[0];
7213
7225
  const name = artifact.metadata.settings.compilationTarget[sourcePath];
@@ -7316,7 +7328,7 @@ async function buildSystemsManifest(opts) {
7316
7328
  }
7317
7329
 
7318
7330
  // ts/node/loadSystemsManifest.ts
7319
- import fs2 from "node:fs/promises";
7331
+ import fs3 from "node:fs/promises";
7320
7332
  import path7 from "node:path";
7321
7333
  import { type as type4 } from "arktype";
7322
7334
  import { indent as indent2 } from "@latticexyz/common/utils";
@@ -7324,13 +7336,13 @@ var parseManifest = type4("string").pipe.try((s) => JSON.parse(s), SystemsManife
7324
7336
  async function loadSystemsManifest(opts) {
7325
7337
  const outFile = path7.join(opts.rootDir, systemsManifestFilename);
7326
7338
  try {
7327
- await fs2.access(outFile, fs2.constants.F_OK | fs2.constants.R_OK);
7339
+ await fs3.access(outFile, fs3.constants.F_OK | fs3.constants.R_OK);
7328
7340
  } catch (error2) {
7329
7341
  throw new Error(
7330
7342
  `Systems manifest at "${systemsManifestFilename}" not found or not readable. Run \`mud build\` before trying again.`
7331
7343
  );
7332
7344
  }
7333
- const json = await fs2.readFile(outFile, "utf8");
7345
+ const json = await fs3.readFile(outFile, "utf8");
7334
7346
  const manifest = parseManifest(json);
7335
7347
  if (manifest instanceof type4.errors) {
7336
7348
  throw new Error(