@latticexyz/cli 2.0.0-alpha.68 → 2.0.0-alpha.7
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-TPZUS44H.js → chunk-6V563IAZ.js} +5 -5
- package/dist/{chunk-B6YHE4SO.js → chunk-KJTPZOUH.js} +364 -231
- package/dist/{chunk-O6HOO6WA.js → chunk-L4YLJHLJ.js} +1 -9
- package/dist/{chunk-KPBNUPK6.js → chunk-SKNB74MT.js} +155 -159
- package/dist/chunk-VQTZJIFF.js +353 -0
- package/dist/{chunk-MIGVHECZ.js → chunk-WZFXLDPK.js} +38 -15
- package/dist/{chunk-3FH42MS5.js → chunk-YL4GJLLL.js} +6982 -6230
- package/dist/index.d.ts +2 -4
- package/dist/index.js +0 -22
- package/dist/mud.js +311 -318
- package/dist/mud2.js +7 -9
- package/dist/render-solidity/index.d.ts +2 -3
- package/dist/render-solidity/index.js +3 -4
- package/dist/render-ts/index.d.ts +2 -3
- package/dist/render-ts/index.js +3 -4
- package/dist/utils/deprecated/index.js +2 -2
- package/dist/utils/index.d.ts +3 -15
- package/dist/utils/index.js +4 -15
- package/package.json +17 -20
- package/src/commands/deploy-v2.ts +8 -4
- package/src/commands/deprecated/test.ts +1 -1
- package/src/commands/gas-report.ts +54 -55
- package/src/commands/set-version.ts +39 -10
- package/src/commands/tablegen.ts +5 -5
- package/src/commands/tsgen.ts +1 -1
- package/src/commands/worldgen.ts +5 -4
- package/src/contracts/BulkUpload.sol +13 -20
- package/src/contracts/Deploy.sol +3 -3
- package/src/contracts/LibDeploy.sol +1 -1
- package/src/contracts/LibDeployStub.sol +1 -1
- package/src/index.ts +1 -15
- package/src/render-solidity/common.ts +4 -4
- package/src/render-solidity/renderTableIndex.ts +15 -0
- package/src/render-solidity/renderTypesFromConfig.ts +1 -1
- package/src/render-solidity/tableOptions.ts +2 -2
- package/src/render-solidity/tablegen.ts +13 -1
- package/src/render-solidity/types.ts +1 -1
- package/src/render-solidity/userType.ts +1 -2
- package/src/render-solidity/worldgen.ts +3 -3
- package/src/render-ts/recsV1TableOptions.ts +2 -2
- package/src/render-ts/renderRecsV1Tables.ts +2 -2
- package/src/render-ts/tsgen.ts +1 -1
- package/src/render-ts/types.ts +1 -1
- package/src/utils/contractToInterface.ts +1 -1
- package/src/utils/deploy-v2.ts +85 -78
- package/src/utils/errors.ts +3 -23
- package/dist/chunk-5NC2OON2.js +0 -164
- package/dist/chunk-FFY7VTYB.js +0 -14358
- package/dist/chunk-S7JI7355.js +0 -441
- package/dist/config/index.d.ts +0 -408
- package/dist/config/index.js +0 -85
- package/dist/parseStoreConfig-05533795.d.ts +0 -369
- package/src/config/commonSchemas.ts +0 -34
- package/src/config/dynamicResolution.ts +0 -49
- package/src/config/index.ts +0 -24
- package/src/config/loadConfig.ts +0 -40
- package/src/config/loadStoreConfig.ts +0 -18
- package/src/config/parseStoreConfig.test-d.ts +0 -40
- package/src/config/parseStoreConfig.ts +0 -314
- package/src/config/validation.ts +0 -163
- package/src/config/world/index.ts +0 -4
- package/src/config/world/loadWorldConfig.test-d.ts +0 -11
- package/src/config/world/loadWorldConfig.ts +0 -26
- package/src/config/world/parseWorldConfig.ts +0 -56
- package/src/config/world/resolveWorldConfig.ts +0 -80
- package/src/config/world/userTypes.ts +0 -74
- package/src/utils/typeUtils.ts +0 -17
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
deploy
|
|
3
|
-
} from "./chunk-3FH42MS5.js";
|
|
4
|
-
import {
|
|
5
|
-
MUDError,
|
|
6
|
-
loadStoreConfig,
|
|
7
|
-
loadWorldConfig,
|
|
2
|
+
deploy,
|
|
8
3
|
logError
|
|
9
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YL4GJLLL.js";
|
|
10
5
|
import {
|
|
11
6
|
execLog
|
|
12
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VQTZJIFF.js";
|
|
13
8
|
import {
|
|
14
9
|
anvil,
|
|
15
10
|
forge,
|
|
@@ -22,21 +17,21 @@ import {
|
|
|
22
17
|
renderList,
|
|
23
18
|
renderedSolidityHeader,
|
|
24
19
|
tablegen
|
|
25
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-WZFXLDPK.js";
|
|
26
21
|
import {
|
|
27
22
|
tsgen
|
|
28
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-6V563IAZ.js";
|
|
29
24
|
import {
|
|
30
25
|
formatAndWriteSolidity
|
|
31
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-SKNB74MT.js";
|
|
32
27
|
import {
|
|
33
28
|
__commonJS,
|
|
34
29
|
__toESM
|
|
35
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-L4YLJHLJ.js";
|
|
36
31
|
|
|
37
|
-
// ../../node_modules/@protobufjs/aspromise/index.js
|
|
32
|
+
// ../../node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js
|
|
38
33
|
var require_aspromise = __commonJS({
|
|
39
|
-
"../../node_modules/@protobufjs/aspromise/index.js"(exports2, module2) {
|
|
34
|
+
"../../node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js"(exports2, module2) {
|
|
40
35
|
"use strict";
|
|
41
36
|
module2.exports = asPromise;
|
|
42
37
|
function asPromise(fn, ctx) {
|
|
@@ -70,9 +65,9 @@ var require_aspromise = __commonJS({
|
|
|
70
65
|
}
|
|
71
66
|
});
|
|
72
67
|
|
|
73
|
-
// ../../node_modules/@protobufjs/base64/index.js
|
|
68
|
+
// ../../node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.js
|
|
74
69
|
var require_base64 = __commonJS({
|
|
75
|
-
"../../node_modules/@protobufjs/base64/index.js"(exports2) {
|
|
70
|
+
"../../node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.js"(exports2) {
|
|
76
71
|
"use strict";
|
|
77
72
|
var base64 = exports2;
|
|
78
73
|
base64.length = function length(string) {
|
|
@@ -170,9 +165,9 @@ var require_base64 = __commonJS({
|
|
|
170
165
|
}
|
|
171
166
|
});
|
|
172
167
|
|
|
173
|
-
// ../../node_modules/@protobufjs/eventemitter/index.js
|
|
168
|
+
// ../../node_modules/.pnpm/@protobufjs+eventemitter@1.1.0/node_modules/@protobufjs/eventemitter/index.js
|
|
174
169
|
var require_eventemitter = __commonJS({
|
|
175
|
-
"../../node_modules/@protobufjs/eventemitter/index.js"(exports2, module2) {
|
|
170
|
+
"../../node_modules/.pnpm/@protobufjs+eventemitter@1.1.0/node_modules/@protobufjs/eventemitter/index.js"(exports2, module2) {
|
|
176
171
|
"use strict";
|
|
177
172
|
module2.exports = EventEmitter;
|
|
178
173
|
function EventEmitter() {
|
|
@@ -216,9 +211,9 @@ var require_eventemitter = __commonJS({
|
|
|
216
211
|
}
|
|
217
212
|
});
|
|
218
213
|
|
|
219
|
-
// ../../node_modules/@protobufjs/float/index.js
|
|
214
|
+
// ../../node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js
|
|
220
215
|
var require_float = __commonJS({
|
|
221
|
-
"../../node_modules/@protobufjs/float/index.js"(exports2, module2) {
|
|
216
|
+
"../../node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js"(exports2, module2) {
|
|
222
217
|
"use strict";
|
|
223
218
|
module2.exports = factory(factory);
|
|
224
219
|
function factory(exports3) {
|
|
@@ -414,9 +409,9 @@ var require_float = __commonJS({
|
|
|
414
409
|
}
|
|
415
410
|
});
|
|
416
411
|
|
|
417
|
-
// ../../node_modules/@protobufjs/inquire/index.js
|
|
412
|
+
// ../../node_modules/.pnpm/@protobufjs+inquire@1.1.0/node_modules/@protobufjs/inquire/index.js
|
|
418
413
|
var require_inquire = __commonJS({
|
|
419
|
-
"../../node_modules/@protobufjs/inquire/index.js"(exports, module) {
|
|
414
|
+
"../../node_modules/.pnpm/@protobufjs+inquire@1.1.0/node_modules/@protobufjs/inquire/index.js"(exports, module) {
|
|
420
415
|
"use strict";
|
|
421
416
|
module.exports = inquire;
|
|
422
417
|
function inquire(moduleName) {
|
|
@@ -431,9 +426,9 @@ var require_inquire = __commonJS({
|
|
|
431
426
|
}
|
|
432
427
|
});
|
|
433
428
|
|
|
434
|
-
// ../../node_modules/@protobufjs/utf8/index.js
|
|
429
|
+
// ../../node_modules/.pnpm/@protobufjs+utf8@1.1.0/node_modules/@protobufjs/utf8/index.js
|
|
435
430
|
var require_utf8 = __commonJS({
|
|
436
|
-
"../../node_modules/@protobufjs/utf8/index.js"(exports2) {
|
|
431
|
+
"../../node_modules/.pnpm/@protobufjs+utf8@1.1.0/node_modules/@protobufjs/utf8/index.js"(exports2) {
|
|
437
432
|
"use strict";
|
|
438
433
|
var utf8 = exports2;
|
|
439
434
|
utf8.length = function utf8_length(string) {
|
|
@@ -508,9 +503,9 @@ var require_utf8 = __commonJS({
|
|
|
508
503
|
}
|
|
509
504
|
});
|
|
510
505
|
|
|
511
|
-
// ../../node_modules/@protobufjs/pool/index.js
|
|
506
|
+
// ../../node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js
|
|
512
507
|
var require_pool = __commonJS({
|
|
513
|
-
"../../node_modules/@protobufjs/pool/index.js"(exports2, module2) {
|
|
508
|
+
"../../node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js"(exports2, module2) {
|
|
514
509
|
"use strict";
|
|
515
510
|
module2.exports = pool;
|
|
516
511
|
function pool(alloc, slice, size) {
|
|
@@ -534,9 +529,9 @@ var require_pool = __commonJS({
|
|
|
534
529
|
}
|
|
535
530
|
});
|
|
536
531
|
|
|
537
|
-
//
|
|
532
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/util/longbits.js
|
|
538
533
|
var require_longbits = __commonJS({
|
|
539
|
-
"
|
|
534
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/util/longbits.js"(exports2, module2) {
|
|
540
535
|
"use strict";
|
|
541
536
|
module2.exports = LongBits;
|
|
542
537
|
var util = require_minimal();
|
|
@@ -636,9 +631,9 @@ var require_longbits = __commonJS({
|
|
|
636
631
|
}
|
|
637
632
|
});
|
|
638
633
|
|
|
639
|
-
//
|
|
634
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/util/minimal.js
|
|
640
635
|
var require_minimal = __commonJS({
|
|
641
|
-
"
|
|
636
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/util/minimal.js"(exports2) {
|
|
642
637
|
"use strict";
|
|
643
638
|
var util = exports2;
|
|
644
639
|
util.asPromise = require_aspromise();
|
|
@@ -746,7 +741,7 @@ var require_minimal = __commonJS({
|
|
|
746
741
|
configurable: true
|
|
747
742
|
},
|
|
748
743
|
name: {
|
|
749
|
-
get() {
|
|
744
|
+
get: function get() {
|
|
750
745
|
return name;
|
|
751
746
|
},
|
|
752
747
|
set: void 0,
|
|
@@ -758,7 +753,7 @@ var require_minimal = __commonJS({
|
|
|
758
753
|
configurable: true
|
|
759
754
|
},
|
|
760
755
|
toString: {
|
|
761
|
-
value() {
|
|
756
|
+
value: function value() {
|
|
762
757
|
return this.name + ": " + this.message;
|
|
763
758
|
},
|
|
764
759
|
writable: true,
|
|
@@ -811,9 +806,9 @@ var require_minimal = __commonJS({
|
|
|
811
806
|
}
|
|
812
807
|
});
|
|
813
808
|
|
|
814
|
-
//
|
|
809
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/writer.js
|
|
815
810
|
var require_writer = __commonJS({
|
|
816
|
-
"
|
|
811
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/writer.js"(exports2, module2) {
|
|
817
812
|
"use strict";
|
|
818
813
|
module2.exports = Writer;
|
|
819
814
|
var util = require_minimal();
|
|
@@ -1002,9 +997,9 @@ var require_writer = __commonJS({
|
|
|
1002
997
|
}
|
|
1003
998
|
});
|
|
1004
999
|
|
|
1005
|
-
//
|
|
1000
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/writer_buffer.js
|
|
1006
1001
|
var require_writer_buffer = __commonJS({
|
|
1007
|
-
"
|
|
1002
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/writer_buffer.js"(exports2, module2) {
|
|
1008
1003
|
"use strict";
|
|
1009
1004
|
module2.exports = BufferWriter;
|
|
1010
1005
|
var Writer = require_writer();
|
|
@@ -1053,9 +1048,9 @@ var require_writer_buffer = __commonJS({
|
|
|
1053
1048
|
}
|
|
1054
1049
|
});
|
|
1055
1050
|
|
|
1056
|
-
//
|
|
1051
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/reader.js
|
|
1057
1052
|
var require_reader = __commonJS({
|
|
1058
|
-
"
|
|
1053
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/reader.js"(exports2, module2) {
|
|
1059
1054
|
"use strict";
|
|
1060
1055
|
module2.exports = Reader;
|
|
1061
1056
|
var util = require_minimal();
|
|
@@ -1277,9 +1272,9 @@ var require_reader = __commonJS({
|
|
|
1277
1272
|
}
|
|
1278
1273
|
});
|
|
1279
1274
|
|
|
1280
|
-
//
|
|
1275
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/reader_buffer.js
|
|
1281
1276
|
var require_reader_buffer = __commonJS({
|
|
1282
|
-
"
|
|
1277
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/reader_buffer.js"(exports2, module2) {
|
|
1283
1278
|
"use strict";
|
|
1284
1279
|
module2.exports = BufferReader;
|
|
1285
1280
|
var Reader = require_reader();
|
|
@@ -1300,9 +1295,9 @@ var require_reader_buffer = __commonJS({
|
|
|
1300
1295
|
}
|
|
1301
1296
|
});
|
|
1302
1297
|
|
|
1303
|
-
//
|
|
1298
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/rpc/service.js
|
|
1304
1299
|
var require_service = __commonJS({
|
|
1305
|
-
"
|
|
1300
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/rpc/service.js"(exports2, module2) {
|
|
1306
1301
|
"use strict";
|
|
1307
1302
|
module2.exports = Service;
|
|
1308
1303
|
var util = require_minimal();
|
|
@@ -1375,26 +1370,26 @@ var require_service = __commonJS({
|
|
|
1375
1370
|
}
|
|
1376
1371
|
});
|
|
1377
1372
|
|
|
1378
|
-
//
|
|
1373
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/rpc.js
|
|
1379
1374
|
var require_rpc = __commonJS({
|
|
1380
|
-
"
|
|
1375
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/rpc.js"(exports2) {
|
|
1381
1376
|
"use strict";
|
|
1382
1377
|
var rpc = exports2;
|
|
1383
1378
|
rpc.Service = require_service();
|
|
1384
1379
|
}
|
|
1385
1380
|
});
|
|
1386
1381
|
|
|
1387
|
-
//
|
|
1382
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/roots.js
|
|
1388
1383
|
var require_roots = __commonJS({
|
|
1389
|
-
"
|
|
1384
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/roots.js"(exports2, module2) {
|
|
1390
1385
|
"use strict";
|
|
1391
1386
|
module2.exports = {};
|
|
1392
1387
|
}
|
|
1393
1388
|
});
|
|
1394
1389
|
|
|
1395
|
-
//
|
|
1390
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/index-minimal.js
|
|
1396
1391
|
var require_index_minimal = __commonJS({
|
|
1397
|
-
"
|
|
1392
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/src/index-minimal.js"(exports2) {
|
|
1398
1393
|
"use strict";
|
|
1399
1394
|
var protobuf = exports2;
|
|
1400
1395
|
protobuf.build = "minimal";
|
|
@@ -1415,9 +1410,9 @@ var require_index_minimal = __commonJS({
|
|
|
1415
1410
|
}
|
|
1416
1411
|
});
|
|
1417
1412
|
|
|
1418
|
-
//
|
|
1413
|
+
// ../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/minimal.js
|
|
1419
1414
|
var require_minimal2 = __commonJS({
|
|
1420
|
-
"
|
|
1415
|
+
"../../node_modules/.pnpm/protobufjs@7.2.3/node_modules/protobufjs/minimal.js"(exports2, module2) {
|
|
1421
1416
|
"use strict";
|
|
1422
1417
|
module2.exports = require_index_minimal();
|
|
1423
1418
|
}
|
|
@@ -1450,7 +1445,7 @@ var commandModule = {
|
|
|
1450
1445
|
};
|
|
1451
1446
|
var devnode_default = commandModule;
|
|
1452
1447
|
|
|
1453
|
-
//
|
|
1448
|
+
// ../../node_modules/.pnpm/long@5.2.1/node_modules/long/index.js
|
|
1454
1449
|
var wasm = null;
|
|
1455
1450
|
try {
|
|
1456
1451
|
wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([
|
|
@@ -2366,25 +2361,35 @@ var LinkedTwitterPair = {
|
|
|
2366
2361
|
return writer;
|
|
2367
2362
|
},
|
|
2368
2363
|
decode(input, length) {
|
|
2369
|
-
const reader = input instanceof import_minimal.default.Reader ? input :
|
|
2364
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2370
2365
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2371
2366
|
const message = createBaseLinkedTwitterPair();
|
|
2372
2367
|
while (reader.pos < end) {
|
|
2373
2368
|
const tag = reader.uint32();
|
|
2374
2369
|
switch (tag >>> 3) {
|
|
2375
2370
|
case 1:
|
|
2371
|
+
if (tag != 10) {
|
|
2372
|
+
break;
|
|
2373
|
+
}
|
|
2376
2374
|
message.username = reader.string();
|
|
2377
|
-
|
|
2375
|
+
continue;
|
|
2378
2376
|
case 2:
|
|
2377
|
+
if (tag != 18) {
|
|
2378
|
+
break;
|
|
2379
|
+
}
|
|
2379
2380
|
message.address = reader.string();
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2381
|
+
continue;
|
|
2382
|
+
}
|
|
2383
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2384
|
+
break;
|
|
2384
2385
|
}
|
|
2386
|
+
reader.skipType(tag & 7);
|
|
2385
2387
|
}
|
|
2386
2388
|
return message;
|
|
2387
2389
|
},
|
|
2390
|
+
create(base) {
|
|
2391
|
+
return LinkedTwitterPair.fromPartial(base ?? {});
|
|
2392
|
+
},
|
|
2388
2393
|
fromPartial(object) {
|
|
2389
2394
|
const message = createBaseLinkedTwitterPair();
|
|
2390
2395
|
message.username = object.username ?? "";
|
|
@@ -2406,25 +2411,35 @@ var DripRequest = {
|
|
|
2406
2411
|
return writer;
|
|
2407
2412
|
},
|
|
2408
2413
|
decode(input, length) {
|
|
2409
|
-
const reader = input instanceof import_minimal.default.Reader ? input :
|
|
2414
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2410
2415
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2411
2416
|
const message = createBaseDripRequest();
|
|
2412
2417
|
while (reader.pos < end) {
|
|
2413
2418
|
const tag = reader.uint32();
|
|
2414
2419
|
switch (tag >>> 3) {
|
|
2415
2420
|
case 1:
|
|
2421
|
+
if (tag != 10) {
|
|
2422
|
+
break;
|
|
2423
|
+
}
|
|
2416
2424
|
message.username = reader.string();
|
|
2417
|
-
|
|
2425
|
+
continue;
|
|
2418
2426
|
case 2:
|
|
2427
|
+
if (tag != 18) {
|
|
2428
|
+
break;
|
|
2429
|
+
}
|
|
2419
2430
|
message.address = reader.string();
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2431
|
+
continue;
|
|
2432
|
+
}
|
|
2433
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2434
|
+
break;
|
|
2424
2435
|
}
|
|
2436
|
+
reader.skipType(tag & 7);
|
|
2425
2437
|
}
|
|
2426
2438
|
return message;
|
|
2427
2439
|
},
|
|
2440
|
+
create(base) {
|
|
2441
|
+
return DripRequest.fromPartial(base ?? {});
|
|
2442
|
+
},
|
|
2428
2443
|
fromPartial(object) {
|
|
2429
2444
|
const message = createBaseDripRequest();
|
|
2430
2445
|
message.username = object.username ?? "";
|
|
@@ -2443,22 +2458,29 @@ var DripDevRequest = {
|
|
|
2443
2458
|
return writer;
|
|
2444
2459
|
},
|
|
2445
2460
|
decode(input, length) {
|
|
2446
|
-
const reader = input instanceof import_minimal.default.Reader ? input :
|
|
2461
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2447
2462
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2448
2463
|
const message = createBaseDripDevRequest();
|
|
2449
2464
|
while (reader.pos < end) {
|
|
2450
2465
|
const tag = reader.uint32();
|
|
2451
2466
|
switch (tag >>> 3) {
|
|
2452
2467
|
case 1:
|
|
2468
|
+
if (tag != 10) {
|
|
2469
|
+
break;
|
|
2470
|
+
}
|
|
2453
2471
|
message.address = reader.string();
|
|
2454
|
-
|
|
2455
|
-
default:
|
|
2456
|
-
reader.skipType(tag & 7);
|
|
2457
|
-
break;
|
|
2472
|
+
continue;
|
|
2458
2473
|
}
|
|
2474
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2475
|
+
break;
|
|
2476
|
+
}
|
|
2477
|
+
reader.skipType(tag & 7);
|
|
2459
2478
|
}
|
|
2460
2479
|
return message;
|
|
2461
2480
|
},
|
|
2481
|
+
create(base) {
|
|
2482
|
+
return DripDevRequest.fromPartial(base ?? {});
|
|
2483
|
+
},
|
|
2462
2484
|
fromPartial(object) {
|
|
2463
2485
|
const message = createBaseDripDevRequest();
|
|
2464
2486
|
message.address = object.address ?? "";
|
|
@@ -2479,25 +2501,35 @@ var DripResponse = {
|
|
|
2479
2501
|
return writer;
|
|
2480
2502
|
},
|
|
2481
2503
|
decode(input, length) {
|
|
2482
|
-
const reader = input instanceof import_minimal.default.Reader ? input :
|
|
2504
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2483
2505
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2484
2506
|
const message = createBaseDripResponse();
|
|
2485
2507
|
while (reader.pos < end) {
|
|
2486
2508
|
const tag = reader.uint32();
|
|
2487
2509
|
switch (tag >>> 3) {
|
|
2488
2510
|
case 1:
|
|
2511
|
+
if (tag != 10) {
|
|
2512
|
+
break;
|
|
2513
|
+
}
|
|
2489
2514
|
message.dripTxHash = reader.string();
|
|
2490
|
-
|
|
2515
|
+
continue;
|
|
2491
2516
|
case 2:
|
|
2517
|
+
if (tag != 18) {
|
|
2518
|
+
break;
|
|
2519
|
+
}
|
|
2492
2520
|
message.ecsTxHash = reader.string();
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2521
|
+
continue;
|
|
2522
|
+
}
|
|
2523
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2524
|
+
break;
|
|
2497
2525
|
}
|
|
2526
|
+
reader.skipType(tag & 7);
|
|
2498
2527
|
}
|
|
2499
2528
|
return message;
|
|
2500
2529
|
},
|
|
2530
|
+
create(base) {
|
|
2531
|
+
return DripResponse.fromPartial(base ?? {});
|
|
2532
|
+
},
|
|
2501
2533
|
fromPartial(object) {
|
|
2502
2534
|
const message = createBaseDripResponse();
|
|
2503
2535
|
message.dripTxHash = object.dripTxHash ?? "";
|
|
@@ -2519,25 +2551,35 @@ var TimeUntilDripResponse = {
|
|
|
2519
2551
|
return writer;
|
|
2520
2552
|
},
|
|
2521
2553
|
decode(input, length) {
|
|
2522
|
-
const reader = input instanceof import_minimal.default.Reader ? input :
|
|
2554
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2523
2555
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2524
2556
|
const message = createBaseTimeUntilDripResponse();
|
|
2525
2557
|
while (reader.pos < end) {
|
|
2526
2558
|
const tag = reader.uint32();
|
|
2527
2559
|
switch (tag >>> 3) {
|
|
2528
2560
|
case 1:
|
|
2561
|
+
if (tag != 9) {
|
|
2562
|
+
break;
|
|
2563
|
+
}
|
|
2529
2564
|
message.timeUntilDripMinutes = reader.double();
|
|
2530
|
-
|
|
2565
|
+
continue;
|
|
2531
2566
|
case 2:
|
|
2567
|
+
if (tag != 17) {
|
|
2568
|
+
break;
|
|
2569
|
+
}
|
|
2532
2570
|
message.timeUntilDripSeconds = reader.double();
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2571
|
+
continue;
|
|
2572
|
+
}
|
|
2573
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2574
|
+
break;
|
|
2537
2575
|
}
|
|
2576
|
+
reader.skipType(tag & 7);
|
|
2538
2577
|
}
|
|
2539
2578
|
return message;
|
|
2540
2579
|
},
|
|
2580
|
+
create(base) {
|
|
2581
|
+
return TimeUntilDripResponse.fromPartial(base ?? {});
|
|
2582
|
+
},
|
|
2541
2583
|
fromPartial(object) {
|
|
2542
2584
|
const message = createBaseTimeUntilDripResponse();
|
|
2543
2585
|
message.timeUntilDripMinutes = object.timeUntilDripMinutes ?? 0;
|
|
@@ -2553,19 +2595,23 @@ var GetLinkedTwittersRequest = {
|
|
|
2553
2595
|
return writer;
|
|
2554
2596
|
},
|
|
2555
2597
|
decode(input, length) {
|
|
2556
|
-
const reader = input instanceof import_minimal.default.Reader ? input :
|
|
2598
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2557
2599
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2558
2600
|
const message = createBaseGetLinkedTwittersRequest();
|
|
2559
2601
|
while (reader.pos < end) {
|
|
2560
2602
|
const tag = reader.uint32();
|
|
2561
2603
|
switch (tag >>> 3) {
|
|
2562
|
-
default:
|
|
2563
|
-
reader.skipType(tag & 7);
|
|
2564
|
-
break;
|
|
2565
2604
|
}
|
|
2605
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2606
|
+
break;
|
|
2607
|
+
}
|
|
2608
|
+
reader.skipType(tag & 7);
|
|
2566
2609
|
}
|
|
2567
2610
|
return message;
|
|
2568
2611
|
},
|
|
2612
|
+
create(base) {
|
|
2613
|
+
return GetLinkedTwittersRequest.fromPartial(base ?? {});
|
|
2614
|
+
},
|
|
2569
2615
|
fromPartial(_) {
|
|
2570
2616
|
const message = createBaseGetLinkedTwittersRequest();
|
|
2571
2617
|
return message;
|
|
@@ -2582,22 +2628,29 @@ var GetLinkedTwittersResponse = {
|
|
|
2582
2628
|
return writer;
|
|
2583
2629
|
},
|
|
2584
2630
|
decode(input, length) {
|
|
2585
|
-
const reader = input instanceof import_minimal.default.Reader ? input :
|
|
2631
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2586
2632
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2587
2633
|
const message = createBaseGetLinkedTwittersResponse();
|
|
2588
2634
|
while (reader.pos < end) {
|
|
2589
2635
|
const tag = reader.uint32();
|
|
2590
2636
|
switch (tag >>> 3) {
|
|
2591
2637
|
case 1:
|
|
2638
|
+
if (tag != 10) {
|
|
2639
|
+
break;
|
|
2640
|
+
}
|
|
2592
2641
|
message.linkedTwitters.push(LinkedTwitterPair.decode(reader, reader.uint32()));
|
|
2593
|
-
|
|
2594
|
-
default:
|
|
2595
|
-
reader.skipType(tag & 7);
|
|
2596
|
-
break;
|
|
2642
|
+
continue;
|
|
2597
2643
|
}
|
|
2644
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2645
|
+
break;
|
|
2646
|
+
}
|
|
2647
|
+
reader.skipType(tag & 7);
|
|
2598
2648
|
}
|
|
2599
2649
|
return message;
|
|
2600
2650
|
},
|
|
2651
|
+
create(base) {
|
|
2652
|
+
return GetLinkedTwittersResponse.fromPartial(base ?? {});
|
|
2653
|
+
},
|
|
2601
2654
|
fromPartial(object) {
|
|
2602
2655
|
const message = createBaseGetLinkedTwittersResponse();
|
|
2603
2656
|
message.linkedTwitters = object.linkedTwitters?.map((e) => LinkedTwitterPair.fromPartial(e)) || [];
|
|
@@ -2615,22 +2668,29 @@ var LinkedTwitterForAddressRequest = {
|
|
|
2615
2668
|
return writer;
|
|
2616
2669
|
},
|
|
2617
2670
|
decode(input, length) {
|
|
2618
|
-
const reader = input instanceof import_minimal.default.Reader ? input :
|
|
2671
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2619
2672
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2620
2673
|
const message = createBaseLinkedTwitterForAddressRequest();
|
|
2621
2674
|
while (reader.pos < end) {
|
|
2622
2675
|
const tag = reader.uint32();
|
|
2623
2676
|
switch (tag >>> 3) {
|
|
2624
2677
|
case 1:
|
|
2678
|
+
if (tag != 10) {
|
|
2679
|
+
break;
|
|
2680
|
+
}
|
|
2625
2681
|
message.address = reader.string();
|
|
2626
|
-
|
|
2627
|
-
default:
|
|
2628
|
-
reader.skipType(tag & 7);
|
|
2629
|
-
break;
|
|
2682
|
+
continue;
|
|
2630
2683
|
}
|
|
2684
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2685
|
+
break;
|
|
2686
|
+
}
|
|
2687
|
+
reader.skipType(tag & 7);
|
|
2631
2688
|
}
|
|
2632
2689
|
return message;
|
|
2633
2690
|
},
|
|
2691
|
+
create(base) {
|
|
2692
|
+
return LinkedTwitterForAddressRequest.fromPartial(base ?? {});
|
|
2693
|
+
},
|
|
2634
2694
|
fromPartial(object) {
|
|
2635
2695
|
const message = createBaseLinkedTwitterForAddressRequest();
|
|
2636
2696
|
message.address = object.address ?? "";
|
|
@@ -2648,22 +2708,29 @@ var LinkedTwitterForAddressResponse = {
|
|
|
2648
2708
|
return writer;
|
|
2649
2709
|
},
|
|
2650
2710
|
decode(input, length) {
|
|
2651
|
-
const reader = input instanceof import_minimal.default.Reader ? input :
|
|
2711
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2652
2712
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2653
2713
|
const message = createBaseLinkedTwitterForAddressResponse();
|
|
2654
2714
|
while (reader.pos < end) {
|
|
2655
2715
|
const tag = reader.uint32();
|
|
2656
2716
|
switch (tag >>> 3) {
|
|
2657
2717
|
case 1:
|
|
2718
|
+
if (tag != 10) {
|
|
2719
|
+
break;
|
|
2720
|
+
}
|
|
2658
2721
|
message.username = reader.string();
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2722
|
+
continue;
|
|
2723
|
+
}
|
|
2724
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2725
|
+
break;
|
|
2663
2726
|
}
|
|
2727
|
+
reader.skipType(tag & 7);
|
|
2664
2728
|
}
|
|
2665
2729
|
return message;
|
|
2666
2730
|
},
|
|
2731
|
+
create(base) {
|
|
2732
|
+
return LinkedTwitterForAddressResponse.fromPartial(base ?? {});
|
|
2733
|
+
},
|
|
2667
2734
|
fromPartial(object) {
|
|
2668
2735
|
const message = createBaseLinkedTwitterForAddressResponse();
|
|
2669
2736
|
message.username = object.username ?? "";
|
|
@@ -2681,22 +2748,29 @@ var LinkedAddressForTwitterRequest = {
|
|
|
2681
2748
|
return writer;
|
|
2682
2749
|
},
|
|
2683
2750
|
decode(input, length) {
|
|
2684
|
-
const reader = input instanceof import_minimal.default.Reader ? input :
|
|
2751
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2685
2752
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2686
2753
|
const message = createBaseLinkedAddressForTwitterRequest();
|
|
2687
2754
|
while (reader.pos < end) {
|
|
2688
2755
|
const tag = reader.uint32();
|
|
2689
2756
|
switch (tag >>> 3) {
|
|
2690
2757
|
case 1:
|
|
2758
|
+
if (tag != 10) {
|
|
2759
|
+
break;
|
|
2760
|
+
}
|
|
2691
2761
|
message.username = reader.string();
|
|
2692
|
-
|
|
2693
|
-
default:
|
|
2694
|
-
reader.skipType(tag & 7);
|
|
2695
|
-
break;
|
|
2762
|
+
continue;
|
|
2696
2763
|
}
|
|
2764
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2765
|
+
break;
|
|
2766
|
+
}
|
|
2767
|
+
reader.skipType(tag & 7);
|
|
2697
2768
|
}
|
|
2698
2769
|
return message;
|
|
2699
2770
|
},
|
|
2771
|
+
create(base) {
|
|
2772
|
+
return LinkedAddressForTwitterRequest.fromPartial(base ?? {});
|
|
2773
|
+
},
|
|
2700
2774
|
fromPartial(object) {
|
|
2701
2775
|
const message = createBaseLinkedAddressForTwitterRequest();
|
|
2702
2776
|
message.username = object.username ?? "";
|
|
@@ -2714,22 +2788,29 @@ var LinkedAddressForTwitterResponse = {
|
|
|
2714
2788
|
return writer;
|
|
2715
2789
|
},
|
|
2716
2790
|
decode(input, length) {
|
|
2717
|
-
const reader = input instanceof import_minimal.default.Reader ? input :
|
|
2791
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2718
2792
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2719
2793
|
const message = createBaseLinkedAddressForTwitterResponse();
|
|
2720
2794
|
while (reader.pos < end) {
|
|
2721
2795
|
const tag = reader.uint32();
|
|
2722
2796
|
switch (tag >>> 3) {
|
|
2723
2797
|
case 1:
|
|
2798
|
+
if (tag != 10) {
|
|
2799
|
+
break;
|
|
2800
|
+
}
|
|
2724
2801
|
message.address = reader.string();
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2802
|
+
continue;
|
|
2803
|
+
}
|
|
2804
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2805
|
+
break;
|
|
2729
2806
|
}
|
|
2807
|
+
reader.skipType(tag & 7);
|
|
2730
2808
|
}
|
|
2731
2809
|
return message;
|
|
2732
2810
|
},
|
|
2811
|
+
create(base) {
|
|
2812
|
+
return LinkedAddressForTwitterResponse.fromPartial(base ?? {});
|
|
2813
|
+
},
|
|
2733
2814
|
fromPartial(object) {
|
|
2734
2815
|
const message = createBaseLinkedAddressForTwitterResponse();
|
|
2735
2816
|
message.address = object.address ?? "";
|
|
@@ -2753,28 +2834,41 @@ var SetLinkedTwitterRequest = {
|
|
|
2753
2834
|
return writer;
|
|
2754
2835
|
},
|
|
2755
2836
|
decode(input, length) {
|
|
2756
|
-
const reader = input instanceof import_minimal.default.Reader ? input :
|
|
2837
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2757
2838
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2758
2839
|
const message = createBaseSetLinkedTwitterRequest();
|
|
2759
2840
|
while (reader.pos < end) {
|
|
2760
2841
|
const tag = reader.uint32();
|
|
2761
2842
|
switch (tag >>> 3) {
|
|
2762
2843
|
case 1:
|
|
2844
|
+
if (tag != 10) {
|
|
2845
|
+
break;
|
|
2846
|
+
}
|
|
2763
2847
|
message.address = reader.string();
|
|
2764
|
-
|
|
2848
|
+
continue;
|
|
2765
2849
|
case 2:
|
|
2850
|
+
if (tag != 18) {
|
|
2851
|
+
break;
|
|
2852
|
+
}
|
|
2766
2853
|
message.username = reader.string();
|
|
2767
|
-
|
|
2854
|
+
continue;
|
|
2768
2855
|
case 3:
|
|
2856
|
+
if (tag != 26) {
|
|
2857
|
+
break;
|
|
2858
|
+
}
|
|
2769
2859
|
message.signature = reader.string();
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2860
|
+
continue;
|
|
2861
|
+
}
|
|
2862
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2863
|
+
break;
|
|
2774
2864
|
}
|
|
2865
|
+
reader.skipType(tag & 7);
|
|
2775
2866
|
}
|
|
2776
2867
|
return message;
|
|
2777
2868
|
},
|
|
2869
|
+
create(base) {
|
|
2870
|
+
return SetLinkedTwitterRequest.fromPartial(base ?? {});
|
|
2871
|
+
},
|
|
2778
2872
|
fromPartial(object) {
|
|
2779
2873
|
const message = createBaseSetLinkedTwitterRequest();
|
|
2780
2874
|
message.address = object.address ?? "";
|
|
@@ -2791,19 +2885,23 @@ var SetLinkedTwitterResponse = {
|
|
|
2791
2885
|
return writer;
|
|
2792
2886
|
},
|
|
2793
2887
|
decode(input, length) {
|
|
2794
|
-
const reader = input instanceof import_minimal.default.Reader ? input :
|
|
2888
|
+
const reader = input instanceof import_minimal.default.Reader ? input : import_minimal.default.Reader.create(input);
|
|
2795
2889
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2796
2890
|
const message = createBaseSetLinkedTwitterResponse();
|
|
2797
2891
|
while (reader.pos < end) {
|
|
2798
2892
|
const tag = reader.uint32();
|
|
2799
2893
|
switch (tag >>> 3) {
|
|
2800
|
-
default:
|
|
2801
|
-
reader.skipType(tag & 7);
|
|
2802
|
-
break;
|
|
2803
2894
|
}
|
|
2895
|
+
if ((tag & 7) == 4 || tag == 0) {
|
|
2896
|
+
break;
|
|
2897
|
+
}
|
|
2898
|
+
reader.skipType(tag & 7);
|
|
2804
2899
|
}
|
|
2805
2900
|
return message;
|
|
2806
2901
|
},
|
|
2902
|
+
create(base) {
|
|
2903
|
+
return SetLinkedTwitterResponse.fromPartial(base ?? {});
|
|
2904
|
+
},
|
|
2807
2905
|
fromPartial(_) {
|
|
2808
2906
|
const message = createBaseSetLinkedTwitterResponse();
|
|
2809
2907
|
return message;
|
|
@@ -2880,7 +2978,7 @@ var FaucetServiceDefinition = {
|
|
|
2880
2978
|
}
|
|
2881
2979
|
}
|
|
2882
2980
|
};
|
|
2883
|
-
var
|
|
2981
|
+
var tsProtoGlobalThis = (() => {
|
|
2884
2982
|
if (typeof globalThis !== "undefined") {
|
|
2885
2983
|
return globalThis;
|
|
2886
2984
|
}
|
|
@@ -2946,6 +3044,7 @@ import { readFileSync, writeFileSync, rmSync as rmSync2 } from "fs";
|
|
|
2946
3044
|
import { execa } from "execa";
|
|
2947
3045
|
import chalk2 from "chalk";
|
|
2948
3046
|
import { table, getBorderCharacters } from "table";
|
|
3047
|
+
var tempFileSuffix = "MudGasReport";
|
|
2949
3048
|
var commandModule3 = {
|
|
2950
3049
|
command: "gas-report",
|
|
2951
3050
|
describe: "Create a gas report",
|
|
@@ -2956,33 +3055,36 @@ var commandModule3 = {
|
|
|
2956
3055
|
compare: { type: "string", desc: "Compare to an existing gas report" }
|
|
2957
3056
|
});
|
|
2958
3057
|
},
|
|
2959
|
-
async handler({ path:
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
3058
|
+
async handler({ path: files, save, compare: compare2 }) {
|
|
3059
|
+
const validFiles = files.filter((file) => file.endsWith(".t.sol"));
|
|
3060
|
+
const tempFiles = await Promise.all(validFiles.map((file) => createGasReport(file)));
|
|
3061
|
+
process.once("SIGINT", () => {
|
|
3062
|
+
console.log("caught sigint, deleting temp files");
|
|
3063
|
+
tempFiles.forEach((file) => rmSync2(file));
|
|
3064
|
+
});
|
|
3065
|
+
let gasReport;
|
|
3066
|
+
try {
|
|
3067
|
+
gasReport = await runGasReport();
|
|
3068
|
+
} catch {
|
|
3069
|
+
setTimeout(() => process.exit());
|
|
3070
|
+
return;
|
|
3071
|
+
} finally {
|
|
3072
|
+
tempFiles.forEach((file) => rmSync2(file));
|
|
2963
3073
|
}
|
|
2964
|
-
const compareGasReport = [];
|
|
2965
3074
|
if (compare2) {
|
|
2966
3075
|
try {
|
|
2967
|
-
const
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
const gasUsed = compareGasReportMatch[4];
|
|
2975
|
-
compareGasReport.push({ source, name, functionCall, gasUsed: parseInt(gasUsed) });
|
|
2976
|
-
}
|
|
3076
|
+
const compareGasReport = JSON.parse(readFileSync(compare2, "utf8"));
|
|
3077
|
+
gasReport = gasReport.map((entry) => {
|
|
3078
|
+
const prevEntry = compareGasReport.find(
|
|
3079
|
+
(e) => e.name === entry.name && e.functionCall === entry.functionCall
|
|
3080
|
+
);
|
|
3081
|
+
return { ...entry, prevGasUsed: prevEntry?.gasUsed };
|
|
3082
|
+
});
|
|
2977
3083
|
} catch {
|
|
2978
3084
|
console.log(chalk2.red(`Gas report to compare not found: ${compare2}`));
|
|
2979
3085
|
compare2 = void 0;
|
|
2980
3086
|
}
|
|
2981
3087
|
}
|
|
2982
|
-
gasReport = gasReport.map((entry) => {
|
|
2983
|
-
const prevEntry = compareGasReport.find((e) => e.name === entry.name && e.functionCall === entry.functionCall);
|
|
2984
|
-
return { ...entry, prevGasUsed: prevEntry?.gasUsed };
|
|
2985
|
-
});
|
|
2986
3088
|
printGasReport(gasReport, compare2);
|
|
2987
3089
|
if (save)
|
|
2988
3090
|
saveGasReport(gasReport, save);
|
|
@@ -2990,14 +3092,9 @@ var commandModule3 = {
|
|
|
2990
3092
|
}
|
|
2991
3093
|
};
|
|
2992
3094
|
var gas_report_default = commandModule3;
|
|
2993
|
-
async function
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
return [];
|
|
2997
|
-
}
|
|
2998
|
-
console.log("Running gas report for", chalk2.bold(path6));
|
|
2999
|
-
const gasReport = [];
|
|
3000
|
-
const fileContents = readFileSync(path6, "utf8");
|
|
3095
|
+
async function createGasReport(filename) {
|
|
3096
|
+
console.log("Creating gas report for", chalk2.bold(filename));
|
|
3097
|
+
const fileContents = readFileSync(filename, "utf8");
|
|
3001
3098
|
let newFile = fileContents;
|
|
3002
3099
|
const functionRegex = new RegExp(/function (.*){/g);
|
|
3003
3100
|
let functionMatch;
|
|
@@ -3017,33 +3114,38 @@ uint256 _gasreport;`);
|
|
|
3017
3114
|
_gasreport = gasleft();
|
|
3018
3115
|
${functionCall}
|
|
3019
3116
|
_gasreport = _gasreport - gasleft();
|
|
3020
|
-
console.log("GAS REPORT: ${name} [${functionCall.replaceAll('"', '\\"')}]:", _gasreport);`
|
|
3117
|
+
console.log("GAS REPORT(${filename}): ${name} [${functionCall.replaceAll('"', '\\"')}]:", _gasreport);`
|
|
3021
3118
|
);
|
|
3022
3119
|
}
|
|
3023
3120
|
newFile = newFile.replace(/pure/g, "view");
|
|
3024
|
-
const tempFileName =
|
|
3121
|
+
const tempFileName = filename.replace(/\.t\.sol$/, `${tempFileSuffix}.t.sol`);
|
|
3025
3122
|
writeFileSync(tempFileName, newFile);
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3123
|
+
return tempFileName;
|
|
3124
|
+
}
|
|
3125
|
+
async function runGasReport() {
|
|
3126
|
+
console.log("Running gas report");
|
|
3127
|
+
const gasReport = [];
|
|
3029
3128
|
let logs = "";
|
|
3030
3129
|
try {
|
|
3130
|
+
const child = execa("forge", ["test", "--match-path", `*${tempFileSuffix}*`, "-vvv"], {
|
|
3131
|
+
stdio: ["inherit", "pipe", "inherit"]
|
|
3132
|
+
});
|
|
3031
3133
|
logs = (await child).stdout;
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
console.log(e.stdout ?? e);
|
|
3134
|
+
} catch (error) {
|
|
3135
|
+
console.log(error.stdout ?? error);
|
|
3035
3136
|
console.log(chalk2.red("\n-----------\nError while running the gas report (see above)"));
|
|
3036
|
-
|
|
3037
|
-
process.exit();
|
|
3137
|
+
throw error;
|
|
3038
3138
|
}
|
|
3039
|
-
const gasReportRegex = new RegExp(/GAS REPORT: (.*) \[(.*)\]: (.*)/g);
|
|
3139
|
+
const gasReportRegex = new RegExp(/GAS REPORT\((.*)\): (.*) \[(.*)\]: (.*)/g);
|
|
3040
3140
|
let gasReportMatch;
|
|
3041
3141
|
while ((gasReportMatch = gasReportRegex.exec(logs)) !== null) {
|
|
3042
|
-
const
|
|
3043
|
-
const
|
|
3044
|
-
const
|
|
3045
|
-
|
|
3142
|
+
const source = gasReportMatch[1];
|
|
3143
|
+
const name = gasReportMatch[2];
|
|
3144
|
+
const functionCall = gasReportMatch[3].replace(";", "");
|
|
3145
|
+
const gasUsed = parseInt(gasReportMatch[4]);
|
|
3146
|
+
gasReport.push({ source, name, functionCall, gasUsed });
|
|
3046
3147
|
}
|
|
3148
|
+
gasReport.sort((a, b) => a.source.localeCompare(b.source));
|
|
3047
3149
|
return gasReport;
|
|
3048
3150
|
}
|
|
3049
3151
|
function printGasReport(gasReport, compare2) {
|
|
@@ -3066,10 +3168,10 @@ function printGasReport(gasReport, compare2) {
|
|
|
3066
3168
|
const rows = [headers, ...values];
|
|
3067
3169
|
console.log(table(rows, { border: getBorderCharacters("norc") }));
|
|
3068
3170
|
}
|
|
3069
|
-
function saveGasReport(gasReport,
|
|
3070
|
-
console.log(chalk2.bold(`Saving gas report to ${
|
|
3071
|
-
|
|
3072
|
-
|
|
3171
|
+
function saveGasReport(gasReport, path7) {
|
|
3172
|
+
console.log(chalk2.bold(`Saving gas report to ${path7}`));
|
|
3173
|
+
writeFileSync(path7, `${JSON.stringify(gasReport, null, 2)}
|
|
3174
|
+
`);
|
|
3073
3175
|
}
|
|
3074
3176
|
|
|
3075
3177
|
// src/commands/hello.ts
|
|
@@ -3090,6 +3192,8 @@ var commandModule4 = {
|
|
|
3090
3192
|
var hello_default = commandModule4;
|
|
3091
3193
|
|
|
3092
3194
|
// src/commands/tablegen.ts
|
|
3195
|
+
import path2 from "path";
|
|
3196
|
+
import { loadStoreConfig } from "@latticexyz/config";
|
|
3093
3197
|
var commandModule5 = {
|
|
3094
3198
|
command: "tablegen",
|
|
3095
3199
|
describe: "Autogenerate MUD Store table libraries based on the config file",
|
|
@@ -3099,15 +3203,16 @@ var commandModule5 = {
|
|
|
3099
3203
|
});
|
|
3100
3204
|
},
|
|
3101
3205
|
async handler({ configPath }) {
|
|
3102
|
-
const srcDirectory = await getSrcDirectory();
|
|
3103
3206
|
const config = await loadStoreConfig(configPath);
|
|
3104
|
-
await
|
|
3207
|
+
const srcDir = await getSrcDirectory();
|
|
3208
|
+
await tablegen(config, path2.join(srcDir, config.codegenDirectory));
|
|
3105
3209
|
process.exit(0);
|
|
3106
3210
|
}
|
|
3107
3211
|
};
|
|
3108
3212
|
var tablegen_default = commandModule5;
|
|
3109
3213
|
|
|
3110
3214
|
// src/commands/tsgen.ts
|
|
3215
|
+
import { loadStoreConfig as loadStoreConfig2 } from "@latticexyz/config";
|
|
3111
3216
|
var commandModule6 = {
|
|
3112
3217
|
command: "tsgen",
|
|
3113
3218
|
describe: "Autogenerate MUD typescript definitions based on the config file",
|
|
@@ -3119,7 +3224,7 @@ var commandModule6 = {
|
|
|
3119
3224
|
},
|
|
3120
3225
|
async handler(args) {
|
|
3121
3226
|
const { configPath, out } = args;
|
|
3122
|
-
const config = await
|
|
3227
|
+
const config = await loadStoreConfig2(configPath);
|
|
3123
3228
|
await tsgen(config, out);
|
|
3124
3229
|
process.exit(0);
|
|
3125
3230
|
}
|
|
@@ -3129,7 +3234,9 @@ var tsgen_default = commandModule6;
|
|
|
3129
3234
|
// src/commands/deploy-v2.ts
|
|
3130
3235
|
import chalk3 from "chalk";
|
|
3131
3236
|
import glob from "glob";
|
|
3132
|
-
import
|
|
3237
|
+
import path3, { basename } from "path";
|
|
3238
|
+
import { loadStoreConfig as loadStoreConfig3, loadWorldConfig } from "@latticexyz/config";
|
|
3239
|
+
import { MUDError } from "@latticexyz/config";
|
|
3133
3240
|
import { mkdirSync, writeFileSync as writeFileSync2 } from "fs";
|
|
3134
3241
|
|
|
3135
3242
|
// src/utils/getChainId.ts
|
|
@@ -3155,7 +3262,9 @@ var yDeployOptions = {
|
|
|
3155
3262
|
default: 1
|
|
3156
3263
|
},
|
|
3157
3264
|
saveDeployment: { type: "boolean", desc: "Save the deployment info to a file", default: true },
|
|
3158
|
-
rpc: { type: "string", desc: "The RPC URL to use. Defaults to the RPC url from the local foundry.toml" }
|
|
3265
|
+
rpc: { type: "string", desc: "The RPC URL to use. Defaults to the RPC url from the local foundry.toml" },
|
|
3266
|
+
worldAddress: { type: "string", desc: "Deploy to an existing World at the given address" },
|
|
3267
|
+
srcDir: { type: "string", desc: "Source directory. Defaults to foundry src directory." }
|
|
3159
3268
|
};
|
|
3160
3269
|
async function deployHandler(args) {
|
|
3161
3270
|
args.profile = args.profile ?? process.env.FOUNDRY_PROFILE;
|
|
@@ -3171,10 +3280,10 @@ async function deployHandler(args) {
|
|
|
3171
3280
|
if (clean)
|
|
3172
3281
|
await forge(["clean"], { profile });
|
|
3173
3282
|
await forge(["build"], { profile });
|
|
3174
|
-
const srcDir = await getSrcDirectory();
|
|
3175
|
-
const existingContracts = glob.sync(`${srcDir}/**/*.sol`).map((
|
|
3283
|
+
const srcDir = args?.srcDir ?? await getSrcDirectory();
|
|
3284
|
+
const existingContracts = glob.sync(`${srcDir}/**/*.sol`).map((path7) => basename(path7, ".sol"));
|
|
3176
3285
|
const worldConfig = await loadWorldConfig(configPath, existingContracts);
|
|
3177
|
-
const storeConfig = await
|
|
3286
|
+
const storeConfig = await loadStoreConfig3(configPath);
|
|
3178
3287
|
const mudConfig = { ...worldConfig, ...storeConfig };
|
|
3179
3288
|
if (printConfig)
|
|
3180
3289
|
console.log(chalk3.green("\nResolved config:\n"), JSON.stringify(mudConfig, null, 2));
|
|
@@ -3185,10 +3294,10 @@ async function deployHandler(args) {
|
|
|
3185
3294
|
const deploymentInfo = await deploy(mudConfig, { ...args, rpc, privateKey });
|
|
3186
3295
|
if (args.saveDeployment) {
|
|
3187
3296
|
const chainId = await getChainId(rpc);
|
|
3188
|
-
const outputDir =
|
|
3297
|
+
const outputDir = path3.join(mudConfig.deploysDirectory, chainId.toString());
|
|
3189
3298
|
mkdirSync(outputDir, { recursive: true });
|
|
3190
|
-
writeFileSync2(
|
|
3191
|
-
writeFileSync2(
|
|
3299
|
+
writeFileSync2(path3.join(outputDir, "latest.json"), JSON.stringify(deploymentInfo, null, 2));
|
|
3300
|
+
writeFileSync2(path3.join(outputDir, Date.now() + ".json"), JSON.stringify(deploymentInfo, null, 2));
|
|
3192
3301
|
console.log(chalk3.bgGreen(chalk3.whiteBright(`
|
|
3193
3302
|
Deployment result (written to ${outputDir}):
|
|
3194
3303
|
`)));
|
|
@@ -3214,15 +3323,17 @@ var commandModule7 = {
|
|
|
3214
3323
|
var deploy_v2_default = commandModule7;
|
|
3215
3324
|
|
|
3216
3325
|
// src/commands/worldgen.ts
|
|
3326
|
+
import { loadStoreConfig as loadStoreConfig4, loadWorldConfig as loadWorldConfig2 } from "@latticexyz/config";
|
|
3217
3327
|
import glob2 from "glob";
|
|
3218
|
-
import
|
|
3328
|
+
import path5, { basename as basename2 } from "path";
|
|
3219
3329
|
|
|
3220
3330
|
// src/render-solidity/worldgen.ts
|
|
3221
3331
|
import { readFileSync as readFileSync2 } from "fs";
|
|
3222
|
-
import
|
|
3332
|
+
import path4 from "path";
|
|
3223
3333
|
|
|
3224
3334
|
// src/utils/contractToInterface.ts
|
|
3225
3335
|
import { parse, visit } from "@solidity-parser/parser";
|
|
3336
|
+
import { MUDError as MUDError2 } from "@latticexyz/config";
|
|
3226
3337
|
function contractToInterface(data, contractName) {
|
|
3227
3338
|
const ast = parse(data);
|
|
3228
3339
|
let withContract = false;
|
|
@@ -3240,7 +3351,7 @@ function contractToInterface(data, contractName) {
|
|
|
3240
3351
|
if (isConstructor || isFallback || isReceiveEther)
|
|
3241
3352
|
return;
|
|
3242
3353
|
if (visibility === "default")
|
|
3243
|
-
throw new
|
|
3354
|
+
throw new MUDError2(`Visibility is not specified`);
|
|
3244
3355
|
if (visibility === "external" || visibility === "public") {
|
|
3245
3356
|
functions.push({
|
|
3246
3357
|
name: name === null ? "" : name,
|
|
@@ -3253,7 +3364,7 @@ function contractToInterface(data, contractName) {
|
|
|
3253
3364
|
}
|
|
3254
3365
|
}
|
|
3255
3366
|
} catch (error) {
|
|
3256
|
-
if (error instanceof
|
|
3367
|
+
if (error instanceof MUDError2) {
|
|
3257
3368
|
error.message = `Function "${name}" in contract "${contractName}": ${error.message}`;
|
|
3258
3369
|
}
|
|
3259
3370
|
throw error;
|
|
@@ -3262,7 +3373,7 @@ function contractToInterface(data, contractName) {
|
|
|
3262
3373
|
}
|
|
3263
3374
|
});
|
|
3264
3375
|
if (!withContract) {
|
|
3265
|
-
throw new
|
|
3376
|
+
throw new MUDError2(`Contract not found: ${contractName}`);
|
|
3266
3377
|
}
|
|
3267
3378
|
return {
|
|
3268
3379
|
functions,
|
|
@@ -3309,7 +3420,7 @@ function flattenTypeName(typeName) {
|
|
|
3309
3420
|
stateMutability
|
|
3310
3421
|
};
|
|
3311
3422
|
} else {
|
|
3312
|
-
throw new
|
|
3423
|
+
throw new MUDError2(`Invalid typeName.type ${typeName.type}`);
|
|
3313
3424
|
}
|
|
3314
3425
|
}
|
|
3315
3426
|
function typeNameToExternalSymbols(typeName) {
|
|
@@ -3375,7 +3486,7 @@ interface ${interfaceName} is ${renderArguments(["IStore", "IWorldCore", ...impo
|
|
|
3375
3486
|
|
|
3376
3487
|
// src/render-solidity/worldgen.ts
|
|
3377
3488
|
async function worldgen(config, existingContracts, outputBaseDirectory) {
|
|
3378
|
-
const worldgenBaseDirectory =
|
|
3489
|
+
const worldgenBaseDirectory = path4.join(outputBaseDirectory, config.worldgenDirectory);
|
|
3379
3490
|
const systems = existingContracts.filter(({ basename: basename3 }) => Object.keys(config.systems).includes(basename3));
|
|
3380
3491
|
const systemInterfaceImports = [];
|
|
3381
3492
|
for (const system of systems) {
|
|
@@ -3387,14 +3498,14 @@ async function worldgen(config, existingContracts, outputBaseDirectory) {
|
|
|
3387
3498
|
usedInPath: worldgenBaseDirectory
|
|
3388
3499
|
}));
|
|
3389
3500
|
const systemInterfaceName = `I${system.basename}`;
|
|
3390
|
-
const {
|
|
3501
|
+
const { name } = config.systems[system.basename];
|
|
3391
3502
|
const output2 = renderSystemInterface({
|
|
3392
3503
|
name: systemInterfaceName,
|
|
3393
|
-
functionPrefix: config.namespace === "" ? "" : `${config.namespace}_${
|
|
3504
|
+
functionPrefix: config.namespace === "" ? "" : `${config.namespace}_${name}_`,
|
|
3394
3505
|
functions,
|
|
3395
3506
|
imports
|
|
3396
3507
|
});
|
|
3397
|
-
const fullOutputPath2 =
|
|
3508
|
+
const fullOutputPath2 = path4.join(worldgenBaseDirectory, systemInterfaceName + ".sol");
|
|
3398
3509
|
await formatAndWriteSolidity(output2, fullOutputPath2, "Generated system interface");
|
|
3399
3510
|
systemInterfaceImports.push({
|
|
3400
3511
|
symbol: systemInterfaceName,
|
|
@@ -3408,7 +3519,7 @@ async function worldgen(config, existingContracts, outputBaseDirectory) {
|
|
|
3408
3519
|
storeImportPath: config.storeImportPath,
|
|
3409
3520
|
worldImportPath: config.worldImportPath
|
|
3410
3521
|
});
|
|
3411
|
-
const fullOutputPath =
|
|
3522
|
+
const fullOutputPath = path4.join(worldgenBaseDirectory, config.worldInterfaceName + ".sol");
|
|
3412
3523
|
await formatAndWriteSolidity(output, fullOutputPath, "Generated system interface");
|
|
3413
3524
|
}
|
|
3414
3525
|
|
|
@@ -3426,19 +3537,20 @@ var commandModule8 = {
|
|
|
3426
3537
|
async handler(args) {
|
|
3427
3538
|
const { configPath, clean } = args;
|
|
3428
3539
|
const srcDir = await getSrcDirectory();
|
|
3429
|
-
const existingContracts = glob2.sync(`${srcDir}/**/*.sol`).map((
|
|
3430
|
-
path:
|
|
3431
|
-
basename: basename2(
|
|
3540
|
+
const existingContracts = glob2.sync(`${srcDir}/**/*.sol`).map((path7) => ({
|
|
3541
|
+
path: path7,
|
|
3542
|
+
basename: basename2(path7, ".sol")
|
|
3432
3543
|
}));
|
|
3433
|
-
const worldConfig = await
|
|
3544
|
+
const worldConfig = await loadWorldConfig2(
|
|
3434
3545
|
configPath,
|
|
3435
3546
|
existingContracts.map(({ basename: basename3 }) => basename3)
|
|
3436
3547
|
);
|
|
3437
|
-
const storeConfig = await
|
|
3548
|
+
const storeConfig = await loadStoreConfig4(configPath);
|
|
3438
3549
|
const mudConfig = { ...worldConfig, ...storeConfig };
|
|
3550
|
+
const outputBaseDirectory = path5.join(srcDir, mudConfig.codegenDirectory);
|
|
3439
3551
|
if (clean)
|
|
3440
|
-
rmSync3(
|
|
3441
|
-
await worldgen(mudConfig, existingContracts,
|
|
3552
|
+
rmSync3(path5.join(outputBaseDirectory, mudConfig.worldgenDirectory), { recursive: true, force: true });
|
|
3553
|
+
await worldgen(mudConfig, existingContracts, outputBaseDirectory);
|
|
3442
3554
|
process.exit(0);
|
|
3443
3555
|
}
|
|
3444
3556
|
};
|
|
@@ -3447,12 +3559,13 @@ var worldgen_default = commandModule8;
|
|
|
3447
3559
|
// src/commands/set-version.ts
|
|
3448
3560
|
import chalk4 from "chalk";
|
|
3449
3561
|
import { existsSync, readFileSync as readFileSync3, rmSync as rmSync4, writeFileSync as writeFileSync3 } from "fs";
|
|
3450
|
-
import
|
|
3562
|
+
import path6 from "path";
|
|
3563
|
+
import { MUDError as MUDError3 } from "@latticexyz/config";
|
|
3451
3564
|
|
|
3452
3565
|
// package.json
|
|
3453
3566
|
var package_default = {
|
|
3454
3567
|
name: "@latticexyz/cli",
|
|
3455
|
-
version: "
|
|
3568
|
+
version: "1.42.0",
|
|
3456
3569
|
description: "Command line interface for mud",
|
|
3457
3570
|
main: "dist/index.js",
|
|
3458
3571
|
types: "dist/index.d.ts",
|
|
@@ -3468,46 +3581,45 @@ var package_default = {
|
|
|
3468
3581
|
directory: "packages/cli"
|
|
3469
3582
|
},
|
|
3470
3583
|
scripts: {
|
|
3471
|
-
|
|
3472
|
-
codegen: "ts-node --esm --files ./scripts/codegen.ts",
|
|
3584
|
+
codegen: "tsx ./scripts/codegen.ts",
|
|
3473
3585
|
lint: "eslint . --ext .ts",
|
|
3474
3586
|
dev: "tsup --watch",
|
|
3475
3587
|
build: "tsup",
|
|
3476
|
-
|
|
3477
|
-
test: "
|
|
3478
|
-
"test:contracts": "yarn codegen && forge test",
|
|
3479
|
-
"git:install": "bash git-install.sh",
|
|
3588
|
+
test: "tsc --noEmit && pnpm test:contracts",
|
|
3589
|
+
"test:contracts": "pnpm codegen && forge test",
|
|
3480
3590
|
release: "npm publish --access=public"
|
|
3481
3591
|
},
|
|
3482
3592
|
devDependencies: {
|
|
3483
|
-
"@latticexyz/store": "^2.0.0-alpha.68+0ac76fd5",
|
|
3484
3593
|
"@types/ejs": "^3.1.1",
|
|
3485
3594
|
"@types/glob": "^7.2.0",
|
|
3486
3595
|
"@types/node": "^17.0.34",
|
|
3487
3596
|
"@types/openurl": "^1.0.0",
|
|
3488
3597
|
"@types/yargs": "^17.0.10",
|
|
3489
|
-
esbuild: "^0.15.16",
|
|
3490
3598
|
tsup: "^6.6.3",
|
|
3599
|
+
tsx: "^3.12.6",
|
|
3491
3600
|
vitest: "^0.29.8"
|
|
3492
3601
|
},
|
|
3493
3602
|
dependencies: {
|
|
3603
|
+
"@ethersproject/abi": "^5.7.0",
|
|
3604
|
+
"@ethersproject/providers": "^5.7.2",
|
|
3494
3605
|
"@improbable-eng/grpc-web": "^0.15.0",
|
|
3495
3606
|
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
|
3496
|
-
"@latticexyz/
|
|
3497
|
-
"@latticexyz/
|
|
3498
|
-
"@latticexyz/
|
|
3499
|
-
"@latticexyz/
|
|
3607
|
+
"@latticexyz/config": "workspace:*",
|
|
3608
|
+
"@latticexyz/schema-type": "workspace:*",
|
|
3609
|
+
"@latticexyz/services": "workspace:*",
|
|
3610
|
+
"@latticexyz/solecs": "workspace:*",
|
|
3611
|
+
"@latticexyz/std-contracts": "workspace:*",
|
|
3612
|
+
"@latticexyz/store": "workspace:*",
|
|
3613
|
+
"@latticexyz/world": "workspace:*",
|
|
3500
3614
|
"@solidity-parser/parser": "^0.16.0",
|
|
3501
|
-
"@typechain/ethers-v5": "^10.
|
|
3615
|
+
"@typechain/ethers-v5": "^10.2.0",
|
|
3502
3616
|
chalk: "^5.0.1",
|
|
3503
3617
|
chokidar: "^3.5.3",
|
|
3504
3618
|
dotenv: "^16.0.3",
|
|
3505
3619
|
"ds-test": "https://github.com/dapphub/ds-test.git#c9ce3f25bde29fc5eb9901842bf02850dfd2d084",
|
|
3506
3620
|
ejs: "^3.1.8",
|
|
3507
|
-
esbuild: "^0.17.14",
|
|
3508
3621
|
ethers: "^5.7.2",
|
|
3509
3622
|
execa: "^7.0.0",
|
|
3510
|
-
"find-up": "^6.3.0",
|
|
3511
3623
|
"forge-std": "https://github.com/foundry-rs/forge-std.git#b4f121555729b3afb3c5ffccb62ff4b6e2818fd3",
|
|
3512
3624
|
glob: "^8.0.3",
|
|
3513
3625
|
"nice-grpc-web": "^2.0.1",
|
|
@@ -3515,16 +3627,14 @@ var package_default = {
|
|
|
3515
3627
|
path: "^0.12.7",
|
|
3516
3628
|
prettier: "^2.8.4",
|
|
3517
3629
|
"prettier-plugin-solidity": "^1.1.2",
|
|
3518
|
-
solmate: "https://github.com/Rari-Capital/solmate.git#9cf1428245074e39090dceacb0c28b1f684f584c",
|
|
3519
3630
|
table: "^6.8.1",
|
|
3520
|
-
"ts-node": "^10.9.1",
|
|
3521
3631
|
typechain: "^8.1.1",
|
|
3522
3632
|
typescript: "^4.9.5",
|
|
3523
3633
|
yargs: "^17.7.1",
|
|
3524
3634
|
zod: "^3.21.4",
|
|
3525
|
-
"zod-validation-error": "^1.0
|
|
3635
|
+
"zod-validation-error": "^1.3.0"
|
|
3526
3636
|
},
|
|
3527
|
-
gitHead: "
|
|
3637
|
+
gitHead: "914a1e0ae4a573d685841ca2ea921435057deb8f"
|
|
3528
3638
|
};
|
|
3529
3639
|
|
|
3530
3640
|
// src/commands/set-version.ts
|
|
@@ -3541,20 +3651,24 @@ var commandModule9 = {
|
|
|
3541
3651
|
description: `Backup fails if a "${BACKUP_FILE}" file is found, unless --force is provided`
|
|
3542
3652
|
},
|
|
3543
3653
|
restore: { type: "boolean", description: `Restore the previous MUD versions from "${BACKUP_FILE}"` },
|
|
3544
|
-
mudVersion: { alias: "v", type: "string", description: "The MUD version to install" }
|
|
3654
|
+
mudVersion: { alias: "v", type: "string", description: "The MUD version to install" },
|
|
3655
|
+
link: { alias: "l", type: "string", description: "Relative path to the local MUD root directory to link" }
|
|
3545
3656
|
});
|
|
3546
3657
|
},
|
|
3547
3658
|
async handler(options) {
|
|
3548
3659
|
try {
|
|
3549
|
-
if (!options.mudVersion && !options.restore) {
|
|
3550
|
-
throw new
|
|
3660
|
+
if (!options.mudVersion && !options.link && !options.restore) {
|
|
3661
|
+
throw new MUDError3("`--mudVersion` or `--link` is required unless --restore is provided.");
|
|
3662
|
+
}
|
|
3663
|
+
if (options.link && options.mudVersion) {
|
|
3664
|
+
throw new MUDError3("Options `--link` and `--mudVersion` are mutually exclusive");
|
|
3551
3665
|
}
|
|
3552
3666
|
options.mudVersion = options.mudVersion === "canary" ? await getCanaryVersion(package_default.name) : options.mudVersion;
|
|
3553
3667
|
const rootPath = "./package.json";
|
|
3554
3668
|
const { workspaces } = updatePackageJson(rootPath, options);
|
|
3555
3669
|
if (workspaces) {
|
|
3556
3670
|
for (const workspace of workspaces) {
|
|
3557
|
-
const filePath =
|
|
3671
|
+
const filePath = path6.join(workspace, "/package.json");
|
|
3558
3672
|
updatePackageJson(filePath, options);
|
|
3559
3673
|
}
|
|
3560
3674
|
}
|
|
@@ -3566,10 +3680,14 @@ var commandModule9 = {
|
|
|
3566
3680
|
}
|
|
3567
3681
|
};
|
|
3568
3682
|
function updatePackageJson(filePath, options) {
|
|
3569
|
-
const {
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3683
|
+
const { restore, force, link } = options;
|
|
3684
|
+
let { backup, mudVersion } = options;
|
|
3685
|
+
const backupFilePath = path6.join(path6.dirname(filePath), BACKUP_FILE);
|
|
3686
|
+
const backupFileExists = existsSync(backupFilePath);
|
|
3687
|
+
if (link && !backupFileExists)
|
|
3688
|
+
backup = true;
|
|
3689
|
+
if (backup && !force && backupFileExists) {
|
|
3690
|
+
throw new MUDError3(
|
|
3573
3691
|
`A backup file already exists at ${backupFilePath}.
|
|
3574
3692
|
Use --force to overwrite it or --restore to restore it.`
|
|
3575
3693
|
);
|
|
@@ -3597,12 +3715,12 @@ Use --force to overwrite it or --restore to restore it.`
|
|
|
3597
3715
|
}
|
|
3598
3716
|
for (const key in packageJson.dependencies) {
|
|
3599
3717
|
if (key.startsWith(MUD_PREFIX)) {
|
|
3600
|
-
packageJson.dependencies[key] =
|
|
3718
|
+
packageJson.dependencies[key] = resolveMudVersion(key, "dependencies");
|
|
3601
3719
|
}
|
|
3602
3720
|
}
|
|
3603
3721
|
for (const key in packageJson.devDependencies) {
|
|
3604
3722
|
if (key.startsWith(MUD_PREFIX)) {
|
|
3605
|
-
packageJson.devDependencies[key] =
|
|
3723
|
+
packageJson.devDependencies[key] = resolveMudVersion(key, "devDependencies");
|
|
3606
3724
|
}
|
|
3607
3725
|
}
|
|
3608
3726
|
writeFileSync3(filePath, JSON.stringify(packageJson, null, 2) + "\n");
|
|
@@ -3614,13 +3732,22 @@ Use --force to overwrite it or --restore to restore it.`
|
|
|
3614
3732
|
console.log(chalk4.green(`Cleaned up ${backupFilePath}`));
|
|
3615
3733
|
}
|
|
3616
3734
|
return packageJson;
|
|
3735
|
+
function resolveMudVersion(key, type) {
|
|
3736
|
+
if (restore && backupJson)
|
|
3737
|
+
return backupJson[type][key];
|
|
3738
|
+
if (link)
|
|
3739
|
+
mudVersion = resolveLinkPath(filePath, link, key);
|
|
3740
|
+
if (!mudVersion)
|
|
3741
|
+
return packageJson[type][key];
|
|
3742
|
+
return mudVersion;
|
|
3743
|
+
}
|
|
3617
3744
|
}
|
|
3618
|
-
function readPackageJson(
|
|
3745
|
+
function readPackageJson(path7) {
|
|
3619
3746
|
try {
|
|
3620
|
-
const jsonString = readFileSync3(
|
|
3747
|
+
const jsonString = readFileSync3(path7, "utf8");
|
|
3621
3748
|
return JSON.parse(jsonString);
|
|
3622
3749
|
} catch {
|
|
3623
|
-
throw new
|
|
3750
|
+
throw new MUDError3("Could not read JSON at " + path7);
|
|
3624
3751
|
}
|
|
3625
3752
|
}
|
|
3626
3753
|
async function getCanaryVersion(pkg) {
|
|
@@ -3631,7 +3758,7 @@ async function getCanaryVersion(pkg) {
|
|
|
3631
3758
|
console.log(chalk4.green("MUD canary version:", canary));
|
|
3632
3759
|
return canary;
|
|
3633
3760
|
} catch (e) {
|
|
3634
|
-
throw new
|
|
3761
|
+
throw new MUDError3(`Could not fetch canary version of ${pkg}`);
|
|
3635
3762
|
}
|
|
3636
3763
|
}
|
|
3637
3764
|
function logComparison(prev, curr) {
|
|
@@ -3641,6 +3768,12 @@ function logComparison(prev, curr) {
|
|
|
3641
3768
|
}
|
|
3642
3769
|
}
|
|
3643
3770
|
}
|
|
3771
|
+
function resolveLinkPath(packageJsonPath, mudLinkPath, pkg) {
|
|
3772
|
+
const pkgName = pkg.replace(MUD_PREFIX, "");
|
|
3773
|
+
const packageJsonToRootPath = path6.relative(path6.dirname(packageJsonPath), process.cwd());
|
|
3774
|
+
const linkPath = path6.join(packageJsonToRootPath, mudLinkPath, "packages", pkgName);
|
|
3775
|
+
return "link:" + linkPath;
|
|
3776
|
+
}
|
|
3644
3777
|
var set_version_default = commandModule9;
|
|
3645
3778
|
|
|
3646
3779
|
// src/commands/test-v2.ts
|