@latticexyz/cli 1.34.0 → 1.35.0
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/commands/bulkupload.js +4 -24
- package/dist/commands/call-system.js +15 -38
- package/dist/commands/codegen-libdeploy.js +18 -39
- package/dist/commands/create.js +13 -35
- package/dist/commands/deploy-contracts.js +1220 -799
- package/dist/commands/deploy.js +750 -471
- package/dist/commands/devnode.js +12 -34
- package/dist/commands/diamond-abi.js +5 -25
- package/dist/commands/faucet.js +1063 -907
- package/dist/commands/gas-report.js +8065 -0
- package/dist/commands/sync-art.js +22 -44
- package/dist/commands/system-types.js +78 -98
- package/dist/commands/test.js +30 -55
- package/dist/commands/trace.js +20 -42
- package/dist/commands/types.js +2324 -1919
- package/package.json +10 -7
- package/src/commands/deploy-contracts.ts +35 -14
- package/src/commands/deploy.ts +1 -0
- package/src/commands/faucet.ts +2 -1
- package/src/commands/gas-report.ts +219 -0
- package/src/contracts/BulkUpload.sol +7 -9
- package/src/contracts/Deploy.sol +4 -8
- package/src/contracts/LibDeploy.ejs +18 -1
- package/src/utils/build.ts +9 -3
- package/src/utils/codegen.ts +3 -0
- package/src/utils/deploy.ts +2 -5
- package/src/contracts/Cheats.sol +0 -320
package/dist/commands/devnode.js
CHANGED
|
@@ -25,26 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
mod
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var __async = (__this, __arguments, generator) => {
|
|
29
|
-
return new Promise((resolve, reject) => {
|
|
30
|
-
var fulfilled = (value) => {
|
|
31
|
-
try {
|
|
32
|
-
step(generator.next(value));
|
|
33
|
-
} catch (e) {
|
|
34
|
-
reject(e);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var rejected = (value) => {
|
|
38
|
-
try {
|
|
39
|
-
step(generator.throw(value));
|
|
40
|
-
} catch (e) {
|
|
41
|
-
reject(e);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
45
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
28
|
|
|
49
29
|
// ../../node_modules/ejs/lib/utils.js
|
|
50
30
|
var require_utils = __commonJS({
|
|
@@ -180809,19 +180789,17 @@ function deferred() {
|
|
|
180809
180789
|
}
|
|
180810
180790
|
|
|
180811
180791
|
// src/utils/exec.ts
|
|
180812
|
-
function execLog(command2, options) {
|
|
180813
|
-
|
|
180814
|
-
|
|
180815
|
-
|
|
180816
|
-
|
|
180817
|
-
|
|
180818
|
-
|
|
180819
|
-
return promise;
|
|
180820
|
-
});
|
|
180792
|
+
async function execLog(command2, options) {
|
|
180793
|
+
console.log("Cmd:");
|
|
180794
|
+
console.log([command2, ...options].join(" "));
|
|
180795
|
+
const [resolve, , promise] = deferred();
|
|
180796
|
+
const child = (0, import_child_process.spawn)(command2, options, { stdio: [process.stdin, process.stdout, process.stderr] });
|
|
180797
|
+
child.on("exit", (code) => resolve({ exitCode: code ?? 0, child }));
|
|
180798
|
+
return promise;
|
|
180821
180799
|
}
|
|
180822
180800
|
|
|
180823
180801
|
// src/utils/ids.ts
|
|
180824
|
-
var IDregex = new RegExp(
|
|
180802
|
+
var IDregex = new RegExp(/(?<=uint256 constant ID = uint256\(keccak256\(")(.*)(?="\))/);
|
|
180825
180803
|
|
|
180826
180804
|
// src/utils/codegen.ts
|
|
180827
180805
|
var import_promises = require("fs/promises");
|
|
@@ -181299,7 +181277,7 @@ var contractsDir2 = __dirname + "/../../src/contracts";
|
|
|
181299
181277
|
|
|
181300
181278
|
// src/utils/hsr.ts
|
|
181301
181279
|
var import_chokidar = __toESM(require_chokidar());
|
|
181302
|
-
var ImportsRegex = new RegExp(
|
|
181280
|
+
var ImportsRegex = new RegExp(/(?<=import ").*(?=";)|(?<=from ").*(?=";)/g);
|
|
181303
181281
|
|
|
181304
181282
|
// src/commands/devnode.ts
|
|
181305
181283
|
var command = "devnode";
|
|
@@ -181307,18 +181285,18 @@ var desc = "Start a local Ethereum node for development";
|
|
|
181307
181285
|
var builder = (yargs) => yargs.options({
|
|
181308
181286
|
blocktime: { type: "number", default: 1, decs: "Interval in which new blocks are produced" }
|
|
181309
181287
|
});
|
|
181310
|
-
var handler = (argv) =>
|
|
181288
|
+
var handler = async (argv) => {
|
|
181311
181289
|
const { blocktime } = argv;
|
|
181312
181290
|
console.log("Clearing devnode history");
|
|
181313
181291
|
const userHomeDir = (0, import_os3.homedir)();
|
|
181314
181292
|
(0, import_fs.rmSync)(import_path2.default.join(userHomeDir, ".foundry", "anvil", "tmp"), { recursive: true, force: true });
|
|
181315
|
-
const { child } =
|
|
181293
|
+
const { child } = await execLog("anvil", ["-b", String(blocktime), "--block-base-fee-per-gas", "0"]);
|
|
181316
181294
|
process.on("SIGINT", () => {
|
|
181317
181295
|
console.log("\ngracefully shutting down from SIGINT (Crtl-C)");
|
|
181318
181296
|
child.kill();
|
|
181319
181297
|
process.exit();
|
|
181320
181298
|
});
|
|
181321
|
-
}
|
|
181299
|
+
};
|
|
181322
181300
|
// Annotate the CommonJS export names for ESM import in node:
|
|
181323
181301
|
0 && (module.exports = {
|
|
181324
181302
|
builder,
|
|
@@ -25,26 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
mod
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var __async = (__this, __arguments, generator) => {
|
|
29
|
-
return new Promise((resolve, reject) => {
|
|
30
|
-
var fulfilled = (value) => {
|
|
31
|
-
try {
|
|
32
|
-
step(generator.next(value));
|
|
33
|
-
} catch (e) {
|
|
34
|
-
reject(e);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var rejected = (value) => {
|
|
38
|
-
try {
|
|
39
|
-
step(generator.throw(value));
|
|
40
|
-
} catch (e) {
|
|
41
|
-
reject(e);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
45
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
28
|
|
|
49
29
|
// ../../node_modules/fs.realpath/old.js
|
|
50
30
|
var require_old = __commonJS({
|
|
@@ -180805,7 +180785,7 @@ function deferred() {
|
|
|
180805
180785
|
}
|
|
180806
180786
|
|
|
180807
180787
|
// src/utils/ids.ts
|
|
180808
|
-
var IDregex = new RegExp(
|
|
180788
|
+
var IDregex = new RegExp(/(?<=uint256 constant ID = uint256\(keccak256\(")(.*)(?="\))/);
|
|
180809
180789
|
|
|
180810
180790
|
// src/utils/codegen.ts
|
|
180811
180791
|
var import_promises = require("fs/promises");
|
|
@@ -181283,7 +181263,7 @@ var contractsDir2 = __dirname + "/../../src/contracts";
|
|
|
181283
181263
|
|
|
181284
181264
|
// src/utils/hsr.ts
|
|
181285
181265
|
var import_chokidar = __toESM(require_chokidar());
|
|
181286
|
-
var ImportsRegex = new RegExp(
|
|
181266
|
+
var ImportsRegex = new RegExp(/(?<=import ").*(?=";)|(?<=from ").*(?=";)/g);
|
|
181287
181267
|
|
|
181288
181268
|
// src/commands/diamond-abi.ts
|
|
181289
181269
|
var command = "diamond-abi";
|
|
@@ -181293,7 +181273,7 @@ var builder = (yargs) => yargs.options({
|
|
|
181293
181273
|
exclude: { type: "array" },
|
|
181294
181274
|
out: { type: "string" }
|
|
181295
181275
|
});
|
|
181296
|
-
var handler = (argv) =>
|
|
181276
|
+
var handler = async (argv) => {
|
|
181297
181277
|
const { include: _include, exclude: _exclude, out: _out } = argv;
|
|
181298
181278
|
const wd = process.cwd();
|
|
181299
181279
|
console.log("Current working directory:", wd);
|
|
@@ -181308,12 +181288,12 @@ var handler = (argv) => __async(void 0, null, function* () {
|
|
|
181308
181288
|
abi.push(...pathAbi);
|
|
181309
181289
|
resolve();
|
|
181310
181290
|
});
|
|
181311
|
-
|
|
181291
|
+
await promise;
|
|
181312
181292
|
}
|
|
181313
181293
|
import_fs.default.writeFileSync(out, JSON.stringify({ abi }));
|
|
181314
181294
|
console.log(`Created diamond abi at ${out}`);
|
|
181315
181295
|
process.exit(0);
|
|
181316
|
-
}
|
|
181296
|
+
};
|
|
181317
181297
|
// Annotate the CommonJS export names for ESM import in node:
|
|
181318
181298
|
0 && (module.exports = {
|
|
181319
181299
|
builder,
|