@latticexyz/cli 2.2.15-entrykit-1694d69f0a35d77c65b0388284ad9c38c32168bd → 2.2.15-entrykit-4c25d1ec5af1bd68a4c1f367c9fe4b6fbea82cb2

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.
@@ -28,7 +28,7 @@ Resolved config:
28
28
  Run 'echo "PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" > .env'
29
29
  in your contracts directory to use the default anvil private key.`);return ss(l)}})();console.log("Deploying from",b.address),M("Deploying from",b.address);let y=await pt({rpcUrl:i,rpcBatch:e.rpcBatch,account:b}),x=await ct(y),A=Date.now(),h=await Go({config:n,deployerAddress:e.deployerAddress,salt:o,worldAddress:e.worldAddress,client:y,tables:g,systems:d,libraries:c,modules:f,artifacts:p});(e.worldAddress==null||e.alwaysRunPostDeploy)&&(y.account.type==="smart"?console.log("Skipping post deploy for smart account (feature coming soon)"):await rt(n.deploy.postDeployScript,h.address,i,t,e.forgeScriptOptions,!!e.kms)),await x?.reset(),console.log(q.green("Deployment completed in",(Date.now()-A)/1e3,"seconds"));let C={worldAddress:h.address,blockNumber:Number(h.deployBlock)};if(e.saveDeployment){let l=y.chain?.id??await us(y,ms,"getChainId")({}),u=ve.join(n.deploy.deploysDirectory,l.toString());rs(u,{recursive:!0}),ze(ve.join(u,"latest.json"),JSON.stringify(C,null,2)),ze(ve.join(u,Date.now()+".json"),JSON.stringify(C,null,2));let v=[1337,31337],w=ts(n.deploy.worldsFile)?JSON.parse(ns(n.deploy.worldsFile,"utf-8")):{};w[l]={address:C.worldAddress,blockNumber:v.includes(l)?void 0:C.blockNumber},ze(n.deploy.worldsFile,JSON.stringify(w,null,2)),console.log(q.bgGreen(q.whiteBright(`
30
30
  Deployment result (written to ${n.deploy.worldsFile} and ${u}):
31
- `)))}return console.log(C),h}var ys={command:"deploy",describe:"Deploy MUD contracts",builder(e){return e.options(R)},async handler(e){try{await G(e)}catch(o){ae(o),process.exit(1)}process.exit(0)}},ft=ys;import gs from"node:path";import{loadConfig as bs,resolveConfigPath as hs}from"@latticexyz/config/node";import{worldgen as ws}from"@latticexyz/world/node";var xs={command:"worldgen",describe:"Autogenerate interfaces for Systems and World based on existing contracts and the config file",builder(e){return e.options({configPath:{type:"string",desc:"Path to the MUD config file"},clean:{type:"boolean",desc:"Clear the worldgen directory before generating new interfaces (defaults to true)",default:!0}})},async handler(e){await Cs(e),process.exit(0)}};async function Cs(e){let o=await hs(e.configPath),t=await bs(o),r=gs.dirname(o);await ws({rootDir:r,config:t,clean:e.clean})}var ut=xs;import re from"chalk";import{readFileSync as ks,writeFileSync as Ds}from"fs";import Ue from"path";import{MUDError as Y}from"@latticexyz/common/errors";var yt={name:"@latticexyz/cli",version:"2.2.14",description:"Command line interface for mud",repository:{type:"git",url:"https://github.com/latticexyz/mud.git",directory:"packages/cli"},license:"MIT",type:"module",exports:{".":"./dist/index.js"},typesVersions:{"*":{index:["./dist/index.d.ts"]}},bin:{mud:"./bin/mud.js"},files:["bin","dist"],scripts:{build:"pnpm run build:js && pnpm run build:test-tables","build:js":"tsup && chmod +x ./dist/mud.js","build:test-tables":"tsx ./scripts/generate-test-tables.ts",clean:"pnpm run clean:js && pnpm run clean:test-tables","clean:js":"shx rm -rf dist","clean:test-tables":"shx rm -rf src/**/codegen",dev:"tsup --watch",lint:"eslint . --ext .ts",test:"tsc --noEmit && forge test","test:ci":"pnpm run test"},dependencies:{"@ark/util":"0.2.2","@aws-sdk/client-kms":"^3.556.0","@latticexyz/abi-ts":"workspace:*","@latticexyz/block-logs-stream":"workspace:*","@latticexyz/common":"workspace:*","@latticexyz/config":"workspace:*","@latticexyz/gas-report":"workspace:*","@latticexyz/paymaster":"workspace:*","@latticexyz/protocol-parser":"workspace:*","@latticexyz/schema-type":"workspace:*","@latticexyz/store":"workspace:*","@latticexyz/utils":"workspace:*","@latticexyz/wiresaw":"workspace:*","@latticexyz/world":"workspace:*","@latticexyz/world-module-metadata":"workspace:*",abitype:"1.0.6","asn1.js":"^5.4.1",chalk:"^5.0.1",chokidar:"^3.5.3",debug:"^4.3.4",dotenv:"^16.0.3",execa:"^7.0.0","find-up":"^6.3.0",glob:"^10.4.2",openurl:"^1.1.1","p-queue":"^7.4.1","p-retry":"^5.1.2",path:"^0.12.7",permissionless:"^0.2.3",rxjs:"7.5.5","throttle-debounce":"^5.0.0",toposort:"^2.0.2",typescript:"5.4.2",viem:"2.21.19",yargs:"^17.7.1",zod:"3.23.8","zod-validation-error":"^1.3.0"},devDependencies:{"@types/debug":"^4.1.7","@types/ejs":"^3.1.1","@types/node":"^18.15.11","@types/openurl":"^1.0.0","@types/throttle-debounce":"^5.0.0","@types/toposort":"^2.0.6","@types/yargs":"^17.0.10","ds-test":"https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0","forge-std":"https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1",tsup:"^6.7.0",vitest:"0.34.6"}};import{globSync as Ps}from"glob";import{ZodError as vs,z as gt}from"zod";var Ss=gt.object({MUD_PACKAGES:gt.string().transform(e=>JSON.parse(e))});function Ts(){try{return Ss.parse({MUD_PACKAGES:'{"@latticexyz/abi-ts":{"localPath":"packages/abi-ts"},"@latticexyz/block-logs-stream":{"localPath":"packages/block-logs-stream"},"@latticexyz/cli":{"localPath":"packages/cli"},"@latticexyz/common":{"localPath":"packages/common"},"@latticexyz/config":{"localPath":"packages/config"},"create-mud":{"localPath":"packages/create-mud"},"@latticexyz/dev-tools":{"localPath":"packages/dev-tools"},"@latticexyz/entrykit":{"localPath":"packages/entrykit"},"@latticexyz/explorer":{"localPath":"packages/explorer"},"@latticexyz/faucet":{"localPath":"packages/faucet"},"@latticexyz/gas-report":{"localPath":"packages/gas-report"},"@latticexyz/paymaster":{"localPath":"packages/paymaster"},"@latticexyz/protocol-parser":{"localPath":"packages/protocol-parser"},"@latticexyz/react":{"localPath":"packages/react"},"@latticexyz/recs":{"localPath":"packages/recs"},"@latticexyz/schema-type":{"localPath":"packages/schema-type"},"solhint-config-mud":{"localPath":"packages/solhint-config-mud"},"solhint-plugin-mud":{"localPath":"packages/solhint-plugin-mud"},"@latticexyz/stash":{"localPath":"packages/stash"},"@latticexyz/store-indexer":{"localPath":"packages/store-indexer"},"@latticexyz/store-sync":{"localPath":"packages/store-sync"},"@latticexyz/store":{"localPath":"packages/store"},"@latticexyz/utils":{"localPath":"packages/utils"},"@latticexyz/wiresaw":{"localPath":"packages/wiresaw"},"@latticexyz/world-module-erc20":{"localPath":"packages/world-module-erc20"},"@latticexyz/world-module-metadata":{"localPath":"packages/world-module-metadata"},"@latticexyz/world-modules":{"localPath":"packages/world-modules"},"@latticexyz/world":{"localPath":"packages/world"}}'})}catch(e){if(e instanceof vs){let{...o}=e.format();console.error(`
31
+ `)))}return console.log(C),h}var ys={command:"deploy",describe:"Deploy MUD contracts",builder(e){return e.options(R)},async handler(e){try{await G(e)}catch(o){ae(o),process.exit(1)}process.exit(0)}},ft=ys;import gs from"node:path";import{loadConfig as bs,resolveConfigPath as hs}from"@latticexyz/config/node";import{worldgen as ws}from"@latticexyz/world/node";var xs={command:"worldgen",describe:"Autogenerate interfaces for Systems and World based on existing contracts and the config file",builder(e){return e.options({configPath:{type:"string",desc:"Path to the MUD config file"},clean:{type:"boolean",desc:"Clear the worldgen directory before generating new interfaces (defaults to true)",default:!0}})},async handler(e){await Cs(e),process.exit(0)}};async function Cs(e){let o=await hs(e.configPath),t=await bs(o),r=gs.dirname(o);await ws({rootDir:r,config:t,clean:e.clean})}var ut=xs;import re from"chalk";import{readFileSync as ks,writeFileSync as Ds}from"fs";import Ue from"path";import{MUDError as Y}from"@latticexyz/common/errors";var yt={name:"@latticexyz/cli",version:"2.2.14",description:"Command line interface for mud",repository:{type:"git",url:"https://github.com/latticexyz/mud.git",directory:"packages/cli"},license:"MIT",type:"module",exports:{".":"./dist/index.js"},typesVersions:{"*":{index:["./dist/index.d.ts"]}},bin:{mud:"./bin/mud.js"},files:["bin","dist"],scripts:{build:"pnpm run build:js && pnpm run build:test-tables","build:js":"tsup && chmod +x ./dist/mud.js","build:test-tables":"tsx ./scripts/generate-test-tables.ts",clean:"pnpm run clean:js && pnpm run clean:test-tables","clean:js":"shx rm -rf dist","clean:test-tables":"shx rm -rf src/**/codegen",dev:"tsup --watch",lint:"eslint . --ext .ts",test:"tsc --noEmit && forge test","test:ci":"pnpm run test"},dependencies:{"@ark/util":"0.2.2","@aws-sdk/client-kms":"^3.556.0","@latticexyz/abi-ts":"workspace:*","@latticexyz/block-logs-stream":"workspace:*","@latticexyz/common":"workspace:*","@latticexyz/config":"workspace:*","@latticexyz/gas-report":"workspace:*","@latticexyz/paymaster":"workspace:*","@latticexyz/protocol-parser":"workspace:*","@latticexyz/schema-type":"workspace:*","@latticexyz/store":"workspace:*","@latticexyz/utils":"workspace:*","@latticexyz/wiresaw":"workspace:*","@latticexyz/world":"workspace:*","@latticexyz/world-module-metadata":"workspace:*",abitype:"1.0.6","asn1.js":"^5.4.1",chalk:"^5.0.1",chokidar:"^3.5.3",debug:"^4.3.4",dotenv:"^16.0.3",execa:"^7.0.0","find-up":"^6.3.0",glob:"^10.4.2",openurl:"^1.1.1","p-queue":"^7.4.1","p-retry":"^5.1.2",path:"^0.12.7",permissionless:"^0.2.3",rxjs:"7.5.5","throttle-debounce":"^5.0.0",toposort:"^2.0.2",typescript:"5.4.2",viem:"2.21.19",yargs:"^17.7.1",zod:"3.23.8","zod-validation-error":"^1.3.0"},devDependencies:{"@types/debug":"^4.1.7","@types/ejs":"^3.1.1","@types/node":"^18.15.11","@types/openurl":"^1.0.0","@types/throttle-debounce":"^5.0.0","@types/toposort":"^2.0.6","@types/yargs":"^17.0.10","ds-test":"https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0","forge-std":"https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1",tsup:"^6.7.0",vitest:"0.34.6"}};import{globSync as Ps}from"glob";import{ZodError as vs,z as gt}from"zod";var Ss=gt.object({MUD_PACKAGES:gt.string().transform(e=>JSON.parse(e))});function Ts(){try{return Ss.parse({MUD_PACKAGES:'{"@latticexyz/abi-ts":{"localPath":"packages/abi-ts"},"@latticexyz/block-logs-stream":{"localPath":"packages/block-logs-stream"},"@latticexyz/cli":{"localPath":"packages/cli"},"@latticexyz/common":{"localPath":"packages/common"},"@latticexyz/config":{"localPath":"packages/config"},"create-mud":{"localPath":"packages/create-mud"},"@latticexyz/dev-tools":{"localPath":"packages/dev-tools"},"@latticexyz/entrykit":{"localPath":"packages/entrykit"},"@latticexyz/explorer":{"localPath":"packages/explorer"},"@latticexyz/faucet":{"localPath":"packages/faucet"},"@latticexyz/gas-report":{"localPath":"packages/gas-report"},"@latticexyz/id":{"localPath":"packages/id"},"@latticexyz/paymaster":{"localPath":"packages/paymaster"},"@latticexyz/protocol-parser":{"localPath":"packages/protocol-parser"},"@latticexyz/react":{"localPath":"packages/react"},"@latticexyz/recs":{"localPath":"packages/recs"},"@latticexyz/schema-type":{"localPath":"packages/schema-type"},"solhint-config-mud":{"localPath":"packages/solhint-config-mud"},"solhint-plugin-mud":{"localPath":"packages/solhint-plugin-mud"},"@latticexyz/stash":{"localPath":"packages/stash"},"@latticexyz/store-indexer":{"localPath":"packages/store-indexer"},"@latticexyz/store-sync":{"localPath":"packages/store-sync"},"@latticexyz/store":{"localPath":"packages/store"},"@latticexyz/utils":{"localPath":"packages/utils"},"@latticexyz/wiresaw":{"localPath":"packages/wiresaw"},"@latticexyz/world-module-erc20":{"localPath":"packages/world-module-erc20"},"@latticexyz/world-module-metadata":{"localPath":"packages/world-module-metadata"},"@latticexyz/world-modules":{"localPath":"packages/world-modules"},"@latticexyz/world":{"localPath":"packages/world"}}'})}catch(e){if(e instanceof vs){let{...o}=e.format();console.error(`
32
32
  Missing or invalid environment variables:
33
33
 
34
34
  ${Object.keys(o).join(`
@@ -51,4 +51,4 @@ Waiting for file changes\u2026
51
51
  `),{overwrite:n});let x=E.join(y.sourceDirectory,"remote");n&&await Te.rm(x,{recursive:!0,force:!0});for(let h of g.filter(C=>C.abi.length)){let C=`I${h.label}`,l=E.join(x,"namespaces",h.namespaceLabel,`${C}.sol`);H("writing system interface",C,"to",l);let u=Bt({name:C,systemId:h.systemId,abi:h.abi});await Ge(E.join(e,l),await Ot(u),{overwrite:n})}let A=g.flatMap(h=>h.worldAbi);if(A.length){let h="IWorldSystems",C=E.join(x,`${h}.sol`);H("writing world systems interface to",C);let l=Bt({name:h,abi:A});await Ge(E.join(e,C),await Ot(l),{overwrite:n})}return{config:y}}async function Yi(e){return Te.access(e).then(()=>!0,()=>!1)}async function Ge(e,o,t={}){if(!t.overwrite&&await Yi(e))throw new ne(e);await Te.mkdir(E.dirname(e),{recursive:!0}),await Te.writeFile(e,o)}import ec from"node:path";var oc={worldAddress:{type:"string",required:!0,desc:"Remote world address"},profile:{type:"string",desc:"The foundry profile to use"},rpc:{type:"string",desc:"The RPC URL to use. Defaults to the RPC url from the local foundry.toml"},rpcBatch:{type:"boolean",desc:"Enable batch processing of RPC requests in viem client (defaults to batch size of 100 and wait of 1s)"},replace:{type:"boolean",desc:"Replace existing files and directories with data from remote world."}},tc={command:"pull",describe:"Pull mud.config.ts and interfaces from an existing world.",builder(e){return e.options(oc)},async handler(e){let o=e.profile??process.env.FOUNDRY_PROFILE,t=e.rpc??await Qi(o),r=Zi({transport:Xi(t,{batch:e.rpcBatch?{batchSize:100,wait:1e3}:void 0})});console.log(ke.bgBlue(ke.whiteBright(`
52
52
  Pulling MUD config from world at ${e.worldAddress}
53
53
  `)));let n=process.cwd();try{let{config:a}=await Ht({rootDir:n,client:r,worldAddress:e.worldAddress,replace:e.replace});await F({rootDir:n,config:a,foundryProfile:o})}catch(a){if(a instanceof ne){console.log(),console.log(ke.bgRed(ke.whiteBright(" Error "))),console.log(` Attempted to write file at "${ec.relative(n,a.filename)}", but it already exists.`),console.log(),console.log(" To overwrite files, use `--replace` when running this command."),console.log();return}throw a}}},Wt=tc;var ph=[Ye,ft,Qe,rc,Ze,Xe,ut,ht,wt,vt,St,nc,Pt,Wt];export{ph as commands};
54
- //# sourceMappingURL=commands-JT3DLH5U.js.map
54
+ //# sourceMappingURL=commands-PP5AD635.js.map