@latticexyz/cli 2.2.22-26d2e3acd8fc0a0852f530e8e1574a68d2baa3d2 → 2.2.22-2fe59091a36e3ace2e5ec143138e801fadcdc707
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.
| @@ -23,7 +23,8 @@ function printCommand(proc) { | |
| 23 23 |  | 
| 24 24 | 
             
            // src/build.ts
         | 
| 25 25 | 
             
            async function build({ rootDir, config, foundryProfile }) {
         | 
| 26 | 
            -
              await  | 
| 26 | 
            +
              await tablegen({ rootDir, config });
         | 
| 27 | 
            +
              await worldgen({ rootDir, config });
         | 
| 27 28 | 
             
              await printCommand(
         | 
| 28 29 | 
             
                execa("forge", ["build"], {
         | 
| 29 30 | 
             
                  stdio: "inherit",
         | 
| @@ -201,7 +202,7 @@ var package_default = { | |
| 201 202 | 
             
                rxjs: "7.5.5",
         | 
| 202 203 | 
             
                "throttle-debounce": "^5.0.0",
         | 
| 203 204 | 
             
                toposort: "^2.0.2",
         | 
| 204 | 
            -
                viem: "2. | 
| 205 | 
            +
                viem: "2.30.6",
         | 
| 205 206 | 
             
                yargs: "^17.7.1",
         | 
| 206 207 | 
             
                zod: "3.23.8",
         | 
| 207 208 | 
             
                "zod-validation-error": "^1.3.0"
         | 
| @@ -225,17 +226,17 @@ import { stringToHex as stringToHex2 } from "viem"; | |
| 225 226 | 
             
            import { waitForTransactionReceipt } from "viem/actions";
         | 
| 226 227 |  | 
| 227 228 | 
             
            // src/deploy/getWorldFactoryContracts.ts
         | 
| 228 | 
            -
            import worldFactoryBuild from "@latticexyz/world/out/WorldFactory.sol/WorldFactory.json"  | 
| 229 | 
            -
            import worldFactoryAbi from "@latticexyz/world/out/WorldFactory.sol/WorldFactory.abi.json"  | 
| 229 | 
            +
            import worldFactoryBuild from "@latticexyz/world/out/WorldFactory.sol/WorldFactory.json" with { type: "json" };
         | 
| 230 | 
            +
            import worldFactoryAbi from "@latticexyz/world/out/WorldFactory.sol/WorldFactory.abi.json" with { type: "json" };
         | 
| 230 231 | 
             
            import { encodeDeployData as encodeDeployData2, size as size2 } from "viem";
         | 
| 231 232 |  | 
| 232 233 | 
             
            // src/deploy/getWorldContracts.ts
         | 
| 233 | 
            -
            import accessManagementSystemBuild from "@latticexyz/world/out/AccessManagementSystem.sol/AccessManagementSystem.json"  | 
| 234 | 
            -
            import balanceTransferSystemBuild from "@latticexyz/world/out/BalanceTransferSystem.sol/BalanceTransferSystem.json"  | 
| 235 | 
            -
            import batchCallSystemBuild from "@latticexyz/world/out/BatchCallSystem.sol/BatchCallSystem.json"  | 
| 236 | 
            -
            import registrationSystemBuild from "@latticexyz/world/out/RegistrationSystem.sol/RegistrationSystem.json"  | 
| 237 | 
            -
            import initModuleBuild from "@latticexyz/world/out/InitModule.sol/InitModule.json"  | 
| 238 | 
            -
            import initModuleAbi from "@latticexyz/world/out/InitModule.sol/InitModule.abi.json"  | 
| 234 | 
            +
            import accessManagementSystemBuild from "@latticexyz/world/out/AccessManagementSystem.sol/AccessManagementSystem.json" with { type: "json" };
         | 
| 235 | 
            +
            import balanceTransferSystemBuild from "@latticexyz/world/out/BalanceTransferSystem.sol/BalanceTransferSystem.json" with { type: "json" };
         | 
| 236 | 
            +
            import batchCallSystemBuild from "@latticexyz/world/out/BatchCallSystem.sol/BatchCallSystem.json" with { type: "json" };
         | 
| 237 | 
            +
            import registrationSystemBuild from "@latticexyz/world/out/RegistrationSystem.sol/RegistrationSystem.json" with { type: "json" };
         | 
| 238 | 
            +
            import initModuleBuild from "@latticexyz/world/out/InitModule.sol/InitModule.json" with { type: "json" };
         | 
| 239 | 
            +
            import initModuleAbi from "@latticexyz/world/out/InitModule.sol/InitModule.abi.json" with { type: "json" };
         | 
| 239 240 | 
             
            import { encodeDeployData, size } from "viem";
         | 
| 240 241 | 
             
            import { getContractAddress } from "@latticexyz/common/internal";
         | 
| 241 242 | 
             
            function getWorldContracts(deployerAddress) {
         | 
| @@ -324,8 +325,8 @@ function getWorldFactoryContracts(deployerAddress) { | |
| 324 325 | 
             
            }
         | 
| 325 326 |  | 
| 326 327 | 
             
            // src/deploy/getWorldProxyFactoryContracts.ts
         | 
| 327 | 
            -
            import worldProxyFactoryBuild from "@latticexyz/world/out/WorldProxyFactory.sol/WorldProxyFactory.json"  | 
| 328 | 
            -
            import worldProxyFactoryAbi from "@latticexyz/world/out/WorldProxyFactory.sol/WorldProxyFactory.abi.json"  | 
| 328 | 
            +
            import worldProxyFactoryBuild from "@latticexyz/world/out/WorldProxyFactory.sol/WorldProxyFactory.json" with { type: "json" };
         | 
| 329 | 
            +
            import worldProxyFactoryAbi from "@latticexyz/world/out/WorldProxyFactory.sol/WorldProxyFactory.abi.json" with { type: "json" };
         | 
| 329 330 | 
             
            import { encodeDeployData as encodeDeployData3, size as size3 } from "viem";
         | 
| 330 331 | 
             
            import { getContractAddress as getContractAddress3 } from "@latticexyz/common/internal";
         | 
| 331 332 | 
             
            function getWorldProxyFactoryContracts(deployerAddress) {
         | 
| @@ -370,7 +371,7 @@ async function ensureWorldFactory(client, deployerAddress, withWorldProxy) { | |
| 370 371 | 
             
            }
         | 
| 371 372 |  | 
| 372 373 | 
             
            // src/deploy/deployWorld.ts
         | 
| 373 | 
            -
            import WorldFactoryAbi from "@latticexyz/world/out/WorldFactory.sol/WorldFactory.abi.json"  | 
| 374 | 
            +
            import WorldFactoryAbi from "@latticexyz/world/out/WorldFactory.sol/WorldFactory.abi.json" with { type: "json" };
         | 
| 374 375 | 
             
            import { writeContract } from "@latticexyz/common";
         | 
| 375 376 |  | 
| 376 377 | 
             
            // src/debug.ts
         | 
| @@ -390,7 +391,7 @@ error2.log = console.error.bind(console); | |
| 390 391 | 
             
            import { AbiEventSignatureNotFoundError, decodeEventLog, hexToString, parseAbi, getAddress } from "viem";
         | 
| 391 392 |  | 
| 392 393 | 
             
            // src/deploy/common.ts
         | 
| 393 | 
            -
            import IBaseWorldAbi from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.abi.json"  | 
| 394 | 
            +
            import IBaseWorldAbi from "@latticexyz/world/out/IBaseWorld.sol/IBaseWorld.abi.json" with { type: "json" };
         | 
| 394 395 | 
             
            import { helloStoreEvent } from "@latticexyz/store";
         | 
| 395 396 | 
             
            import { helloWorldEvent } from "@latticexyz/world";
         | 
| 396 397 | 
             
            var worldDeployEvents = [helloStoreEvent, helloWorldEvent];
         | 
| @@ -1202,8 +1203,8 @@ import { stringToHex, BaseError as BaseError2, concatHex } from "viem"; | |
| 1202 1203 | 
             
            import { hexToResource as hexToResource5, writeContract as writeContract7 } from "@latticexyz/common";
         | 
| 1203 1204 | 
             
            import { identity, isDefined as isDefined4 } from "@latticexyz/common/utils";
         | 
| 1204 1205 | 
             
            import metadataConfig from "@latticexyz/world-module-metadata/mud.config";
         | 
| 1205 | 
            -
            import metadataAbi from "@latticexyz/world-module-metadata/out/IMetadataSystem.sol/IMetadataSystem.abi.json"  | 
| 1206 | 
            -
            import metadataModule from "@latticexyz/world-module-metadata/out/MetadataModule.sol/MetadataModule.json"  | 
| 1206 | 
            +
            import metadataAbi from "@latticexyz/world-module-metadata/out/IMetadataSystem.sol/IMetadataSystem.abi.json" with { type: "json" };
         | 
| 1207 | 
            +
            import metadataModule from "@latticexyz/world-module-metadata/out/MetadataModule.sol/MetadataModule.json" with { type: "json" };
         | 
| 1207 1208 |  | 
| 1208 1209 | 
             
            // src/utils/getContractArtifact.ts
         | 
| 1209 1210 | 
             
            import { isHex, size as size4 } from "viem";
         | 
| @@ -1647,7 +1648,7 @@ function getContractData(filename, contractName, forgeOutDirectory) { | |
| 1647 1648 | 
             
            }
         | 
| 1648 1649 |  | 
| 1649 1650 | 
             
            // src/deploy/resolveConfig.ts
         | 
| 1650 | 
            -
            import { groupBy } from "@latticexyz/common/utils";
         | 
| 1651 | 
            +
            import { groupBy, isDefined as isDefined5 } from "@latticexyz/common/utils";
         | 
| 1651 1652 |  | 
| 1652 1653 | 
             
            // src/deploy/findLibraries.ts
         | 
| 1653 1654 | 
             
            import { readFileSync as readFileSync2 } from "fs";
         | 
| @@ -1745,6 +1746,10 @@ async function resolveConfig({ | |
| 1745 1746 | 
             
                  );
         | 
| 1746 1747 | 
             
                }
         | 
| 1747 1748 | 
             
                const contractData = getContractData(`${system.label}.sol`, system.label, forgeOutDir);
         | 
| 1749 | 
            +
                if (!contractData.deployedBytecodeSize) {
         | 
| 1750 | 
            +
                  debug2(`skipping ${system.label} system with no bytecode`);
         | 
| 1751 | 
            +
                  return;
         | 
| 1752 | 
            +
                }
         | 
| 1748 1753 | 
             
                const worldFunctions = system.deploy.registerWorldFunctions ? contractData.abi.filter((item) => item.type === "function").map(toFunctionSignature).filter((sig) => !baseSystemFunctions.includes(sig)).map((sig) => {
         | 
| 1749 1754 | 
             
                  const worldSignature = system.namespace === "" ? sig : `${system.namespace}__${sig}`;
         | 
| 1750 1755 | 
             
                  return {
         | 
| @@ -1774,7 +1779,7 @@ async function resolveConfig({ | |
| 1774 1779 | 
             
                    worldAbi: manifest.worldAbi
         | 
| 1775 1780 | 
             
                  }
         | 
| 1776 1781 | 
             
                };
         | 
| 1777 | 
            -
              });
         | 
| 1782 | 
            +
              }).filter(isDefined5);
         | 
| 1778 1783 | 
             
              const systemsById = groupBy(systems, (system) => system.systemId);
         | 
| 1779 1784 | 
             
              const overlappingSystems = Array.from(systemsById.values()).filter((matches) => matches.length > 1).flat();
         | 
| 1780 1785 | 
             
              if (overlappingSystems.length) {
         | 
| @@ -1863,7 +1868,7 @@ async function importContractArtifact({ | |
| 1863 1868 |  | 
| 1864 1869 | 
             
            // src/deploy/configToModules.ts
         | 
| 1865 1870 | 
             
            import { resolveWithContext } from "@latticexyz/world/internal";
         | 
| 1866 | 
            -
            import callWithSignatureModule from "@latticexyz/world-module-callwithsignature/out/CallWithSignatureModule.sol/CallWithSignatureModule.json"  | 
| 1871 | 
            +
            import callWithSignatureModule from "@latticexyz/world-module-callwithsignature/out/CallWithSignatureModule.sol/CallWithSignatureModule.json" with { type: "json" };
         | 
| 1867 1872 |  | 
| 1868 1873 | 
             
            // src/deploy/compat/moduleArtifactPathFromName.ts
         | 
| 1869 1874 | 
             
            import path7 from "node:path";
         | 
| @@ -2211,6 +2216,98 @@ import chalk3 from "chalk"; | |
| 2211 2216 | 
             
            import { readFileSync as readFileSync4, writeFileSync as writeFileSync2 } from "fs";
         | 
| 2212 2217 | 
             
            import path11 from "path";
         | 
| 2213 2218 | 
             
            import { MUDError as MUDError3 } from "@latticexyz/common/errors";
         | 
| 2219 | 
            +
             | 
| 2220 | 
            +
            // package.json with { type: 'json' }
         | 
| 2221 | 
            +
            var package_default2 = {
         | 
| 2222 | 
            +
              name: "@latticexyz/cli",
         | 
| 2223 | 
            +
              version: "2.2.21",
         | 
| 2224 | 
            +
              description: "Command line interface for mud",
         | 
| 2225 | 
            +
              repository: {
         | 
| 2226 | 
            +
                type: "git",
         | 
| 2227 | 
            +
                url: "https://github.com/latticexyz/mud.git",
         | 
| 2228 | 
            +
                directory: "packages/cli"
         | 
| 2229 | 
            +
              },
         | 
| 2230 | 
            +
              license: "MIT",
         | 
| 2231 | 
            +
              type: "module",
         | 
| 2232 | 
            +
              exports: {
         | 
| 2233 | 
            +
                ".": "./dist/index.js"
         | 
| 2234 | 
            +
              },
         | 
| 2235 | 
            +
              typesVersions: {
         | 
| 2236 | 
            +
                "*": {
         | 
| 2237 | 
            +
                  index: [
         | 
| 2238 | 
            +
                    "./dist/index.d.ts"
         | 
| 2239 | 
            +
                  ]
         | 
| 2240 | 
            +
                }
         | 
| 2241 | 
            +
              },
         | 
| 2242 | 
            +
              bin: {
         | 
| 2243 | 
            +
                mud: "./bin/mud.js"
         | 
| 2244 | 
            +
              },
         | 
| 2245 | 
            +
              files: [
         | 
| 2246 | 
            +
                "bin",
         | 
| 2247 | 
            +
                "dist"
         | 
| 2248 | 
            +
              ],
         | 
| 2249 | 
            +
              scripts: {
         | 
| 2250 | 
            +
                build: "pnpm run build:js && pnpm run build:test-tables",
         | 
| 2251 | 
            +
                "build:js": "tsup && chmod +x ./dist/mud.js",
         | 
| 2252 | 
            +
                "build:test-tables": "tsx ./scripts/generate-test-tables.ts",
         | 
| 2253 | 
            +
                clean: "pnpm run clean:js && pnpm run clean:test-tables",
         | 
| 2254 | 
            +
                "clean:js": "shx rm -rf dist",
         | 
| 2255 | 
            +
                "clean:test-tables": "shx rm -rf src/**/codegen",
         | 
| 2256 | 
            +
                dev: "tsup --watch",
         | 
| 2257 | 
            +
                lint: "eslint . --ext .ts",
         | 
| 2258 | 
            +
                test: "tsc --noEmit && forge test",
         | 
| 2259 | 
            +
                "test:ci": "pnpm run test"
         | 
| 2260 | 
            +
              },
         | 
| 2261 | 
            +
              dependencies: {
         | 
| 2262 | 
            +
                "@ark/util": "0.2.2",
         | 
| 2263 | 
            +
                "@aws-sdk/client-kms": "^3.556.0",
         | 
| 2264 | 
            +
                "@latticexyz/abi-ts": "workspace:*",
         | 
| 2265 | 
            +
                "@latticexyz/block-logs-stream": "workspace:*",
         | 
| 2266 | 
            +
                "@latticexyz/common": "workspace:*",
         | 
| 2267 | 
            +
                "@latticexyz/config": "workspace:*",
         | 
| 2268 | 
            +
                "@latticexyz/gas-report": "workspace:*",
         | 
| 2269 | 
            +
                "@latticexyz/protocol-parser": "workspace:*",
         | 
| 2270 | 
            +
                "@latticexyz/schema-type": "workspace:*",
         | 
| 2271 | 
            +
                "@latticexyz/store": "workspace:*",
         | 
| 2272 | 
            +
                "@latticexyz/store-sync": "workspace:*",
         | 
| 2273 | 
            +
                "@latticexyz/utils": "workspace:*",
         | 
| 2274 | 
            +
                "@latticexyz/world": "workspace:*",
         | 
| 2275 | 
            +
                "@latticexyz/world-module-callwithsignature": "workspace:*",
         | 
| 2276 | 
            +
                "@latticexyz/world-module-metadata": "workspace:*",
         | 
| 2277 | 
            +
                abitype: "1.0.6",
         | 
| 2278 | 
            +
                "asn1.js": "^5.4.1",
         | 
| 2279 | 
            +
                chalk: "^5.0.1",
         | 
| 2280 | 
            +
                chokidar: "^3.5.3",
         | 
| 2281 | 
            +
                debug: "^4.3.4",
         | 
| 2282 | 
            +
                dotenv: "^16.0.3",
         | 
| 2283 | 
            +
                execa: "^9.5.2",
         | 
| 2284 | 
            +
                "find-up": "^6.3.0",
         | 
| 2285 | 
            +
                glob: "^10.4.2",
         | 
| 2286 | 
            +
                openurl: "^1.1.1",
         | 
| 2287 | 
            +
                "p-queue": "^7.4.1",
         | 
| 2288 | 
            +
                "p-retry": "^5.1.2",
         | 
| 2289 | 
            +
                path: "^0.12.7",
         | 
| 2290 | 
            +
                rxjs: "7.5.5",
         | 
| 2291 | 
            +
                "throttle-debounce": "^5.0.0",
         | 
| 2292 | 
            +
                toposort: "^2.0.2",
         | 
| 2293 | 
            +
                viem: "2.30.6",
         | 
| 2294 | 
            +
                yargs: "^17.7.1",
         | 
| 2295 | 
            +
                zod: "3.23.8",
         | 
| 2296 | 
            +
                "zod-validation-error": "^1.3.0"
         | 
| 2297 | 
            +
              },
         | 
| 2298 | 
            +
              devDependencies: {
         | 
| 2299 | 
            +
                "@types/debug": "^4.1.7",
         | 
| 2300 | 
            +
                "@types/ejs": "^3.1.1",
         | 
| 2301 | 
            +
                "@types/openurl": "^1.0.0",
         | 
| 2302 | 
            +
                "@types/throttle-debounce": "^5.0.0",
         | 
| 2303 | 
            +
                "@types/toposort": "^2.0.6",
         | 
| 2304 | 
            +
                "@types/yargs": "^17.0.10",
         | 
| 2305 | 
            +
                "ds-test": "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0",
         | 
| 2306 | 
            +
                "forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1"
         | 
| 2307 | 
            +
              }
         | 
| 2308 | 
            +
            };
         | 
| 2309 | 
            +
             | 
| 2310 | 
            +
            // src/commands/set-version.ts
         | 
| 2214 2311 | 
             
            import { globSync as globSync2 } from "glob";
         | 
| 2215 2312 |  | 
| 2216 2313 | 
             
            // src/mudPackages.ts
         | 
| @@ -2291,7 +2388,7 @@ async function resolveVersion(options2) { | |
| 2291 2388 | 
             
              let npmResult;
         | 
| 2292 2389 | 
             
              try {
         | 
| 2293 2390 | 
             
                console.log(chalk3.blue(`Fetching available versions`));
         | 
| 2294 | 
            -
                npmResult = await (await fetch(`https://registry.npmjs.org/${ | 
| 2391 | 
            +
                npmResult = await (await fetch(`https://registry.npmjs.org/${package_default2.name}`)).json();
         | 
| 2295 2392 | 
             
              } catch (e) {
         | 
| 2296 2393 | 
             
                throw new MUDError3(`Could not fetch available MUD versions`);
         | 
| 2297 2394 | 
             
              }
         | 
| @@ -2515,7 +2612,7 @@ import path13 from "path"; | |
| 2515 2612 | 
             
            import { homedir as homedir2 } from "os";
         | 
| 2516 2613 | 
             
            import { rmSync as rmSync2 } from "fs";
         | 
| 2517 2614 | 
             
            import { BehaviorSubject, debounceTime, exhaustMap, filter } from "rxjs";
         | 
| 2518 | 
            -
            import { isDefined as  | 
| 2615 | 
            +
            import { isDefined as isDefined6 } from "@latticexyz/common/utils";
         | 
| 2519 2616 | 
             
            import { execa as execa6 } from "execa";
         | 
| 2520 2617 | 
             
            var devOptions = {
         | 
| 2521 2618 | 
             
              rpc: deployOptions.rpc,
         | 
| @@ -2597,7 +2694,7 @@ var commandModule10 = { | |
| 2597 2694 | 
             
                      console.log(chalk5.gray("\nWaiting for file changes\u2026\n"));
         | 
| 2598 2695 | 
             
                    }
         | 
| 2599 2696 | 
             
                  }),
         | 
| 2600 | 
            -
                  filter( | 
| 2697 | 
            +
                  filter(isDefined6)
         | 
| 2601 2698 | 
             
                );
         | 
| 2602 2699 | 
             
                deploys$.subscribe();
         | 
| 2603 2700 | 
             
              }
         | 
| @@ -2901,7 +2998,7 @@ error3.log = console.error.bind(console); | |
| 2901 2998 | 
             
            // src/pull/pull.ts
         | 
| 2902 2999 | 
             
            import { defineWorld } from "@latticexyz/world";
         | 
| 2903 3000 | 
             
            import { findUp as findUp3 } from "find-up";
         | 
| 2904 | 
            -
            import { isDefined as  | 
| 3001 | 
            +
            import { isDefined as isDefined7 } from "@latticexyz/common/utils";
         | 
| 2905 3002 | 
             
            var ignoredNamespaces = /* @__PURE__ */ new Set(["store", "world", "metadata"]);
         | 
| 2906 3003 | 
             
            function namespaceToHex(namespace) {
         | 
| 2907 3004 | 
             
              return resourceToHex5({ type: "namespace", namespace, name: "" });
         | 
| @@ -2968,14 +3065,14 @@ async function pull({ rootDir, client, worldAddress, replace, indexerUrl, chainI | |
| 2968 3065 | 
             
                    } catch {
         | 
| 2969 3066 | 
             
                      debug3(`Skipping invalid system signature: ${sig}`);
         | 
| 2970 3067 | 
             
                    }
         | 
| 2971 | 
            -
                  }).filter( | 
| 3068 | 
            +
                  }).filter(isDefined7);
         | 
| 2972 3069 | 
             
                  const worldAbi3 = (metadataWorldAbi.length ? metadataWorldAbi : functions.map((func) => `function ${func.signature}`)).map((sig) => {
         | 
| 2973 3070 | 
             
                    try {
         | 
| 2974 3071 | 
             
                      return parseAbiItem(sig);
         | 
| 2975 3072 | 
             
                    } catch {
         | 
| 2976 3073 | 
             
                      debug3(`Skipping invalid world signature: ${sig}`);
         | 
| 2977 3074 | 
             
                    }
         | 
| 2978 | 
            -
                  }).filter( | 
| 3075 | 
            +
                  }).filter(isDefined7);
         | 
| 2979 3076 | 
             
                  return {
         | 
| 2980 3077 | 
             
                    namespaceId,
         | 
| 2981 3078 | 
             
                    namespaceLabel: labels[namespaceId] ?? namespace,
         | 
| @@ -3154,4 +3251,4 @@ var commands = [ | |
| 3154 3251 | 
             
            export {
         | 
| 3155 3252 | 
             
              commands
         | 
| 3156 3253 | 
             
            };
         | 
| 3157 | 
            -
            //# sourceMappingURL=commands- | 
| 3254 | 
            +
            //# sourceMappingURL=commands-PGHNOEML.js.map
         |