@latticexyz/cli 1.31.2 → 1.32.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.
@@ -30702,16 +30702,15 @@ var require_browser = __commonJS({
30702
30702
  }
30703
30703
  });
30704
30704
 
30705
- // ../../node_modules/supports-color/node_modules/has-flag/index.js
30705
+ // ../../node_modules/has-flag/index.js
30706
30706
  var require_has_flag = __commonJS({
30707
- "../../node_modules/supports-color/node_modules/has-flag/index.js"(exports, module2) {
30707
+ "../../node_modules/has-flag/index.js"(exports, module2) {
30708
30708
  "use strict";
30709
- module2.exports = (flag, argv) => {
30710
- argv = argv || process.argv;
30709
+ module2.exports = (flag, argv = process.argv) => {
30711
30710
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
30712
- const pos = argv.indexOf(prefix + flag);
30713
- const terminatorPos = argv.indexOf("--");
30714
- return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
30711
+ const position = argv.indexOf(prefix + flag);
30712
+ const terminatorPosition = argv.indexOf("--");
30713
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
30715
30714
  };
30716
30715
  }
30717
30716
  });
@@ -30721,16 +30720,23 @@ var require_supports_color = __commonJS({
30721
30720
  "../../node_modules/supports-color/index.js"(exports, module2) {
30722
30721
  "use strict";
30723
30722
  var os = require("os");
30723
+ var tty = require("tty");
30724
30724
  var hasFlag = require_has_flag();
30725
- var env = process.env;
30725
+ var { env } = process;
30726
30726
  var forceColor;
30727
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
30728
- forceColor = false;
30727
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
30728
+ forceColor = 0;
30729
30729
  } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
30730
- forceColor = true;
30730
+ forceColor = 1;
30731
30731
  }
30732
30732
  if ("FORCE_COLOR" in env) {
30733
- forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
30733
+ if (env.FORCE_COLOR === "true") {
30734
+ forceColor = 1;
30735
+ } else if (env.FORCE_COLOR === "false") {
30736
+ forceColor = 0;
30737
+ } else {
30738
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
30739
+ }
30734
30740
  }
30735
30741
  function translateLevel(level) {
30736
30742
  if (level === 0) {
@@ -30743,8 +30749,8 @@ var require_supports_color = __commonJS({
30743
30749
  has16m: level >= 3
30744
30750
  };
30745
30751
  }
30746
- function supportsColor(stream) {
30747
- if (forceColor === false) {
30752
+ function supportsColor(haveStream, streamIsTTY) {
30753
+ if (forceColor === 0) {
30748
30754
  return 0;
30749
30755
  }
30750
30756
  if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
@@ -30753,19 +30759,22 @@ var require_supports_color = __commonJS({
30753
30759
  if (hasFlag("color=256")) {
30754
30760
  return 2;
30755
30761
  }
30756
- if (stream && !stream.isTTY && forceColor !== true) {
30762
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
30757
30763
  return 0;
30758
30764
  }
30759
- const min = forceColor ? 1 : 0;
30765
+ const min = forceColor || 0;
30766
+ if (env.TERM === "dumb") {
30767
+ return min;
30768
+ }
30760
30769
  if (process.platform === "win32") {
30761
30770
  const osRelease = os.release().split(".");
30762
- if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
30771
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
30763
30772
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
30764
30773
  }
30765
30774
  return 1;
30766
30775
  }
30767
30776
  if ("CI" in env) {
30768
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
30777
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
30769
30778
  return 1;
30770
30779
  }
30771
30780
  return min;
@@ -30794,19 +30803,16 @@ var require_supports_color = __commonJS({
30794
30803
  if ("COLORTERM" in env) {
30795
30804
  return 1;
30796
30805
  }
30797
- if (env.TERM === "dumb") {
30798
- return min;
30799
- }
30800
30806
  return min;
30801
30807
  }
30802
30808
  function getSupportLevel(stream) {
30803
- const level = supportsColor(stream);
30809
+ const level = supportsColor(stream, stream && stream.isTTY);
30804
30810
  return translateLevel(level);
30805
30811
  }
30806
30812
  module2.exports = {
30807
30813
  supportsColor: getSupportLevel,
30808
- stdout: getSupportLevel(process.stdout),
30809
- stderr: getSupportLevel(process.stderr)
30814
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
30815
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
30810
30816
  };
30811
30817
  }
30812
30818
  });
@@ -204027,7 +204033,7 @@ var import_promises = require("fs/promises");
204027
204033
  var import_ejs = __toESM(require_ejs());
204028
204034
  var import_path = __toESM(require("path"));
204029
204035
  var contractsDir = import_path.default.join(__dirname, "../../src/contracts");
204030
- var stubLibDeploy = (0, import_promises.readFile)(import_path.default.join(contractsDir, "LibDeploy.sol"));
204036
+ var stubLibDeploy = (0, import_promises.readFile)(import_path.default.join(contractsDir, "LibDeployStub.sol"));
204031
204037
 
204032
204038
  // src/utils/types.ts
204033
204039
  var import_typechain = __toESM(require_dist());
@@ -7448,16 +7448,15 @@ var require_browser = __commonJS({
7448
7448
  }
7449
7449
  });
7450
7450
 
7451
- // ../../node_modules/supports-color/node_modules/has-flag/index.js
7451
+ // ../../node_modules/has-flag/index.js
7452
7452
  var require_has_flag = __commonJS({
7453
- "../../node_modules/supports-color/node_modules/has-flag/index.js"(exports, module2) {
7453
+ "../../node_modules/has-flag/index.js"(exports, module2) {
7454
7454
  "use strict";
7455
- module2.exports = (flag, argv) => {
7456
- argv = argv || process.argv;
7455
+ module2.exports = (flag, argv = process.argv) => {
7457
7456
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
7458
- const pos = argv.indexOf(prefix + flag);
7459
- const terminatorPos = argv.indexOf("--");
7460
- return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
7457
+ const position = argv.indexOf(prefix + flag);
7458
+ const terminatorPosition = argv.indexOf("--");
7459
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
7461
7460
  };
7462
7461
  }
7463
7462
  });
@@ -7467,16 +7466,23 @@ var require_supports_color = __commonJS({
7467
7466
  "../../node_modules/supports-color/index.js"(exports, module2) {
7468
7467
  "use strict";
7469
7468
  var os = require("os");
7469
+ var tty = require("tty");
7470
7470
  var hasFlag = require_has_flag();
7471
- var env = process.env;
7471
+ var { env } = process;
7472
7472
  var forceColor;
7473
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
7474
- forceColor = false;
7473
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
7474
+ forceColor = 0;
7475
7475
  } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
7476
- forceColor = true;
7476
+ forceColor = 1;
7477
7477
  }
7478
7478
  if ("FORCE_COLOR" in env) {
7479
- forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
7479
+ if (env.FORCE_COLOR === "true") {
7480
+ forceColor = 1;
7481
+ } else if (env.FORCE_COLOR === "false") {
7482
+ forceColor = 0;
7483
+ } else {
7484
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
7485
+ }
7480
7486
  }
7481
7487
  function translateLevel(level) {
7482
7488
  if (level === 0) {
@@ -7489,8 +7495,8 @@ var require_supports_color = __commonJS({
7489
7495
  has16m: level >= 3
7490
7496
  };
7491
7497
  }
7492
- function supportsColor(stream) {
7493
- if (forceColor === false) {
7498
+ function supportsColor(haveStream, streamIsTTY) {
7499
+ if (forceColor === 0) {
7494
7500
  return 0;
7495
7501
  }
7496
7502
  if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
@@ -7499,19 +7505,22 @@ var require_supports_color = __commonJS({
7499
7505
  if (hasFlag("color=256")) {
7500
7506
  return 2;
7501
7507
  }
7502
- if (stream && !stream.isTTY && forceColor !== true) {
7508
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
7503
7509
  return 0;
7504
7510
  }
7505
- const min = forceColor ? 1 : 0;
7511
+ const min = forceColor || 0;
7512
+ if (env.TERM === "dumb") {
7513
+ return min;
7514
+ }
7506
7515
  if (process.platform === "win32") {
7507
7516
  const osRelease = os.release().split(".");
7508
- if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
7517
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
7509
7518
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
7510
7519
  }
7511
7520
  return 1;
7512
7521
  }
7513
7522
  if ("CI" in env) {
7514
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
7523
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
7515
7524
  return 1;
7516
7525
  }
7517
7526
  return min;
@@ -7540,19 +7549,16 @@ var require_supports_color = __commonJS({
7540
7549
  if ("COLORTERM" in env) {
7541
7550
  return 1;
7542
7551
  }
7543
- if (env.TERM === "dumb") {
7544
- return min;
7545
- }
7546
7552
  return min;
7547
7553
  }
7548
7554
  function getSupportLevel(stream) {
7549
- const level = supportsColor(stream);
7555
+ const level = supportsColor(stream, stream && stream.isTTY);
7550
7556
  return translateLevel(level);
7551
7557
  }
7552
7558
  module2.exports = {
7553
7559
  supportsColor: getSupportLevel,
7554
- stdout: getSupportLevel(process.stdout),
7555
- stderr: getSupportLevel(process.stderr)
7560
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
7561
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
7556
7562
  };
7557
7563
  }
7558
7564
  });
@@ -180793,7 +180799,7 @@ var import_promises = require("fs/promises");
180793
180799
  var import_ejs = __toESM(require_ejs());
180794
180800
  var import_path = __toESM(require("path"));
180795
180801
  var contractsDir = import_path.default.join(__dirname, "../../src/contracts");
180796
- var stubLibDeploy = (0, import_promises.readFile)(import_path.default.join(contractsDir, "LibDeploy.sol"));
180802
+ var stubLibDeploy = (0, import_promises.readFile)(import_path.default.join(contractsDir, "LibDeployStub.sol"));
180797
180803
  function generateLibDeploy(configPath, out, systems) {
180798
180804
  return __async(this, null, function* () {
180799
180805
  const config = JSON.parse(yield (0, import_promises.readFile)(configPath, { encoding: "utf8" }));
@@ -7448,16 +7448,15 @@ var require_browser = __commonJS({
7448
7448
  }
7449
7449
  });
7450
7450
 
7451
- // ../../node_modules/supports-color/node_modules/has-flag/index.js
7451
+ // ../../node_modules/has-flag/index.js
7452
7452
  var require_has_flag = __commonJS({
7453
- "../../node_modules/supports-color/node_modules/has-flag/index.js"(exports, module2) {
7453
+ "../../node_modules/has-flag/index.js"(exports, module2) {
7454
7454
  "use strict";
7455
- module2.exports = (flag, argv) => {
7456
- argv = argv || process.argv;
7455
+ module2.exports = (flag, argv = process.argv) => {
7457
7456
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
7458
- const pos = argv.indexOf(prefix + flag);
7459
- const terminatorPos = argv.indexOf("--");
7460
- return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
7457
+ const position = argv.indexOf(prefix + flag);
7458
+ const terminatorPosition = argv.indexOf("--");
7459
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
7461
7460
  };
7462
7461
  }
7463
7462
  });
@@ -7467,16 +7466,23 @@ var require_supports_color = __commonJS({
7467
7466
  "../../node_modules/supports-color/index.js"(exports, module2) {
7468
7467
  "use strict";
7469
7468
  var os2 = require("os");
7469
+ var tty2 = require("tty");
7470
7470
  var hasFlag2 = require_has_flag();
7471
- var env2 = process.env;
7471
+ var { env: env2 } = process;
7472
7472
  var forceColor;
7473
- if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false")) {
7474
- forceColor = false;
7473
+ if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
7474
+ forceColor = 0;
7475
7475
  } else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
7476
- forceColor = true;
7476
+ forceColor = 1;
7477
7477
  }
7478
7478
  if ("FORCE_COLOR" in env2) {
7479
- forceColor = env2.FORCE_COLOR.length === 0 || parseInt(env2.FORCE_COLOR, 10) !== 0;
7479
+ if (env2.FORCE_COLOR === "true") {
7480
+ forceColor = 1;
7481
+ } else if (env2.FORCE_COLOR === "false") {
7482
+ forceColor = 0;
7483
+ } else {
7484
+ forceColor = env2.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env2.FORCE_COLOR, 10), 3);
7485
+ }
7480
7486
  }
7481
7487
  function translateLevel2(level) {
7482
7488
  if (level === 0) {
@@ -7489,8 +7495,8 @@ var require_supports_color = __commonJS({
7489
7495
  has16m: level >= 3
7490
7496
  };
7491
7497
  }
7492
- function supportsColor2(stream) {
7493
- if (forceColor === false) {
7498
+ function supportsColor2(haveStream, streamIsTTY) {
7499
+ if (forceColor === 0) {
7494
7500
  return 0;
7495
7501
  }
7496
7502
  if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
@@ -7499,19 +7505,22 @@ var require_supports_color = __commonJS({
7499
7505
  if (hasFlag2("color=256")) {
7500
7506
  return 2;
7501
7507
  }
7502
- if (stream && !stream.isTTY && forceColor !== true) {
7508
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
7503
7509
  return 0;
7504
7510
  }
7505
- const min = forceColor ? 1 : 0;
7511
+ const min = forceColor || 0;
7512
+ if (env2.TERM === "dumb") {
7513
+ return min;
7514
+ }
7506
7515
  if (process.platform === "win32") {
7507
7516
  const osRelease = os2.release().split(".");
7508
- if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
7517
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
7509
7518
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
7510
7519
  }
7511
7520
  return 1;
7512
7521
  }
7513
7522
  if ("CI" in env2) {
7514
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
7523
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
7515
7524
  return 1;
7516
7525
  }
7517
7526
  return min;
@@ -7540,19 +7549,16 @@ var require_supports_color = __commonJS({
7540
7549
  if ("COLORTERM" in env2) {
7541
7550
  return 1;
7542
7551
  }
7543
- if (env2.TERM === "dumb") {
7544
- return min;
7545
- }
7546
7552
  return min;
7547
7553
  }
7548
7554
  function getSupportLevel(stream) {
7549
- const level = supportsColor2(stream);
7555
+ const level = supportsColor2(stream, stream && stream.isTTY);
7550
7556
  return translateLevel2(level);
7551
7557
  }
7552
7558
  module2.exports = {
7553
7559
  supportsColor: getSupportLevel,
7554
- stdout: getSupportLevel(process.stdout),
7555
- stderr: getSupportLevel(process.stderr)
7560
+ stdout: translateLevel2(supportsColor2(true, tty2.isatty(1))),
7561
+ stderr: translateLevel2(supportsColor2(true, tty2.isatty(2)))
7556
7562
  };
7557
7563
  }
7558
7564
  });
@@ -180819,7 +180825,7 @@ var import_promises = require("fs/promises");
180819
180825
  var import_ejs = __toESM(require_ejs());
180820
180826
  var import_path = __toESM(require("path"));
180821
180827
  var contractsDir = import_path.default.join(__dirname, "../../src/contracts");
180822
- var stubLibDeploy = (0, import_promises.readFile)(import_path.default.join(contractsDir, "LibDeploy.sol"));
180828
+ var stubLibDeploy = (0, import_promises.readFile)(import_path.default.join(contractsDir, "LibDeployStub.sol"));
180823
180829
 
180824
180830
  // src/utils/types.ts
180825
180831
  var import_typechain = __toESM(require_dist());
@@ -33968,12 +33968,12 @@ var require_url_json_rpc_provider = __commonJS({
33968
33968
  var _version_1 = require_version25();
33969
33969
  var logger = new logger_1.Logger(_version_1.version);
33970
33970
  var json_rpc_provider_1 = require_json_rpc_provider();
33971
- var StaticJsonRpcProvider = function(_super) {
33972
- __extends(StaticJsonRpcProvider2, _super);
33973
- function StaticJsonRpcProvider2() {
33971
+ var StaticJsonRpcProvider2 = function(_super) {
33972
+ __extends(StaticJsonRpcProvider3, _super);
33973
+ function StaticJsonRpcProvider3() {
33974
33974
  return _super !== null && _super.apply(this, arguments) || this;
33975
33975
  }
33976
- StaticJsonRpcProvider2.prototype.detectNetwork = function() {
33976
+ StaticJsonRpcProvider3.prototype.detectNetwork = function() {
33977
33977
  return __awaiter(this, void 0, void 0, function() {
33978
33978
  var network;
33979
33979
  return __generator(this, function(_a) {
@@ -33999,9 +33999,9 @@ var require_url_json_rpc_provider = __commonJS({
33999
33999
  });
34000
34000
  });
34001
34001
  };
34002
- return StaticJsonRpcProvider2;
34002
+ return StaticJsonRpcProvider3;
34003
34003
  }(json_rpc_provider_1.JsonRpcProvider);
34004
- exports.StaticJsonRpcProvider = StaticJsonRpcProvider;
34004
+ exports.StaticJsonRpcProvider = StaticJsonRpcProvider2;
34005
34005
  var UrlJsonRpcProvider = function(_super) {
34006
34006
  __extends(UrlJsonRpcProvider2, _super);
34007
34007
  function UrlJsonRpcProvider2(network, apiKey) {
@@ -34042,7 +34042,7 @@ var require_url_json_rpc_provider = __commonJS({
34042
34042
  });
34043
34043
  };
34044
34044
  return UrlJsonRpcProvider2;
34045
- }(StaticJsonRpcProvider);
34045
+ }(StaticJsonRpcProvider2);
34046
34046
  exports.UrlJsonRpcProvider = UrlJsonRpcProvider;
34047
34047
  }
34048
34048
  });
@@ -42893,16 +42893,15 @@ var require_browser = __commonJS({
42893
42893
  }
42894
42894
  });
42895
42895
 
42896
- // ../../node_modules/supports-color/node_modules/has-flag/index.js
42896
+ // ../../node_modules/has-flag/index.js
42897
42897
  var require_has_flag = __commonJS({
42898
- "../../node_modules/supports-color/node_modules/has-flag/index.js"(exports, module2) {
42898
+ "../../node_modules/has-flag/index.js"(exports, module2) {
42899
42899
  "use strict";
42900
- module2.exports = (flag, argv) => {
42901
- argv = argv || process.argv;
42900
+ module2.exports = (flag, argv = process.argv) => {
42902
42901
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
42903
- const pos = argv.indexOf(prefix + flag);
42904
- const terminatorPos = argv.indexOf("--");
42905
- return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
42902
+ const position = argv.indexOf(prefix + flag);
42903
+ const terminatorPosition = argv.indexOf("--");
42904
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
42906
42905
  };
42907
42906
  }
42908
42907
  });
@@ -42912,16 +42911,23 @@ var require_supports_color = __commonJS({
42912
42911
  "../../node_modules/supports-color/index.js"(exports, module2) {
42913
42912
  "use strict";
42914
42913
  var os2 = require("os");
42914
+ var tty = require("tty");
42915
42915
  var hasFlag = require_has_flag();
42916
- var env = process.env;
42916
+ var { env } = process;
42917
42917
  var forceColor;
42918
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
42919
- forceColor = false;
42918
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
42919
+ forceColor = 0;
42920
42920
  } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
42921
- forceColor = true;
42921
+ forceColor = 1;
42922
42922
  }
42923
42923
  if ("FORCE_COLOR" in env) {
42924
- forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
42924
+ if (env.FORCE_COLOR === "true") {
42925
+ forceColor = 1;
42926
+ } else if (env.FORCE_COLOR === "false") {
42927
+ forceColor = 0;
42928
+ } else {
42929
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
42930
+ }
42925
42931
  }
42926
42932
  function translateLevel(level) {
42927
42933
  if (level === 0) {
@@ -42934,8 +42940,8 @@ var require_supports_color = __commonJS({
42934
42940
  has16m: level >= 3
42935
42941
  };
42936
42942
  }
42937
- function supportsColor(stream) {
42938
- if (forceColor === false) {
42943
+ function supportsColor(haveStream, streamIsTTY) {
42944
+ if (forceColor === 0) {
42939
42945
  return 0;
42940
42946
  }
42941
42947
  if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
@@ -42944,19 +42950,22 @@ var require_supports_color = __commonJS({
42944
42950
  if (hasFlag("color=256")) {
42945
42951
  return 2;
42946
42952
  }
42947
- if (stream && !stream.isTTY && forceColor !== true) {
42953
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
42948
42954
  return 0;
42949
42955
  }
42950
- const min = forceColor ? 1 : 0;
42956
+ const min = forceColor || 0;
42957
+ if (env.TERM === "dumb") {
42958
+ return min;
42959
+ }
42951
42960
  if (process.platform === "win32") {
42952
42961
  const osRelease = os2.release().split(".");
42953
- if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
42962
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
42954
42963
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
42955
42964
  }
42956
42965
  return 1;
42957
42966
  }
42958
42967
  if ("CI" in env) {
42959
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
42968
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
42960
42969
  return 1;
42961
42970
  }
42962
42971
  return min;
@@ -42985,19 +42994,16 @@ var require_supports_color = __commonJS({
42985
42994
  if ("COLORTERM" in env) {
42986
42995
  return 1;
42987
42996
  }
42988
- if (env.TERM === "dumb") {
42989
- return min;
42990
- }
42991
42997
  return min;
42992
42998
  }
42993
42999
  function getSupportLevel(stream) {
42994
- const level = supportsColor(stream);
43000
+ const level = supportsColor(stream, stream && stream.isTTY);
42995
43001
  return translateLevel(level);
42996
43002
  }
42997
43003
  module2.exports = {
42998
43004
  supportsColor: getSupportLevel,
42999
- stdout: getSupportLevel(process.stdout),
43000
- stderr: getSupportLevel(process.stderr)
43005
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
43006
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
43001
43007
  };
43002
43008
  }
43003
43009
  });
@@ -216279,7 +216285,7 @@ var import_promises = require("fs/promises");
216279
216285
  var import_ejs = __toESM(require_ejs());
216280
216286
  var import_path = __toESM(require("path"));
216281
216287
  var contractsDir = import_path.default.join(__dirname, "../../src/contracts");
216282
- var stubLibDeploy = (0, import_promises.readFile)(import_path.default.join(contractsDir, "LibDeploy.sol"));
216288
+ var stubLibDeploy = (0, import_promises.readFile)(import_path.default.join(contractsDir, "LibDeployStub.sol"));
216283
216289
  function generateLibDeploy(configPath, out, systems) {
216284
216290
  return __async(this, null, function* () {
216285
216291
  const config = JSON.parse(yield (0, import_promises.readFile)(configPath, { encoding: "utf8" }));
@@ -216338,7 +216344,7 @@ function copyAbi(inDir, outDir, contract) {
216338
216344
  try {
216339
216345
  return (0, import_fs2.copyFileSync)(import_path2.default.join(inDir, contract + ".sol", contract + ".json"), import_path2.default.join(outDir, contract + ".json"));
216340
216346
  } catch (e) {
216341
- console.warn(e);
216347
+ console.log("Skipping", contract);
216342
216348
  }
216343
216349
  }
216344
216350
  function filterAbi(abiIn = "./out", abiOut = "./abi", exclude = ["Component", "IComponent"]) {
@@ -217364,11 +217370,22 @@ function execa(file, args, options) {
217364
217370
  }
217365
217371
 
217366
217372
  // src/utils/deploy.ts
217373
+ var import_providers = __toESM(require_lib32());
217367
217374
  var contractsDir2 = __dirname + "/../../src/contracts";
217368
- function deploy(deployerPrivateKey, rpc = "http://localhost:8545", worldAddress, reuseComponents) {
217375
+ function deploy(deployerPrivateKey, rpc = "http://localhost:8545", worldAddress, reuseComponents, gasPrice) {
217369
217376
  return __async(this, null, function* () {
217370
- var _a, _b;
217377
+ var _a, _b, _c;
217371
217378
  const address = deployerPrivateKey ? new import_ethers.Wallet(deployerPrivateKey).address : import_ethers.constants.AddressZero;
217379
+ if (gasPrice == null) {
217380
+ try {
217381
+ console.log("Fetching gas price...");
217382
+ const provider = new import_providers.StaticJsonRpcProvider(rpc, { name: "AnyNetwork", chainId: 1234 });
217383
+ gasPrice = (yield provider.getGasPrice()).toNumber() * 1.3;
217384
+ console.log("Gas price:", gasPrice);
217385
+ } catch (e) {
217386
+ console.log("Could not fetch gas price");
217387
+ }
217388
+ }
217372
217389
  const child = execa(
217373
217390
  "forge",
217374
217391
  [
@@ -217384,12 +217401,14 @@ function deploy(deployerPrivateKey, rpc = "http://localhost:8545", worldAddress,
217384
217401
  worldAddress || import_ethers.constants.AddressZero,
217385
217402
  reuseComponents ? "true" : "false",
217386
217403
  "--fork-url",
217387
- rpc
217404
+ rpc,
217405
+ ...gasPrice != null ? ["--with-gas-price", String(gasPrice)] : []
217388
217406
  ],
217389
- { stdio: ["inherit", "pipe", "inherit"] }
217407
+ { stdio: ["inherit", "pipe", "pipe"] }
217390
217408
  );
217391
- (_a = child.stdout) == null ? void 0 : _a.on("data", (data) => console.log(data.toString()));
217392
- const lines = (_b = (yield child).stdout) == null ? void 0 : _b.split("\n");
217409
+ (_a = child.stderr) == null ? void 0 : _a.on("data", (data) => console.log("stderr:", data.toString()));
217410
+ (_b = child.stdout) == null ? void 0 : _b.on("data", (data) => console.log(data.toString()));
217411
+ const lines = (_c = (yield child).stdout) == null ? void 0 : _c.split("\n");
217393
217412
  const deployedWorldAddress = findLog(lines, "world: address");
217394
217413
  const initialBlockNumber = findLog(lines, "initialBlockNumber: uint256");
217395
217414
  return { child: yield child, deployedWorldAddress, initialBlockNumber };
@@ -217403,7 +217422,13 @@ function generateAndDeploy(args) {
217403
217422
  try {
217404
217423
  libDeployPath = yield generateLibDeploy(args.config, contractsDir2, args.systems);
217405
217424
  yield generateTypes(void 0, "./types", { clear: args.clear });
217406
- const result = yield deploy(args.deployerPrivateKey, args.rpc, args.worldAddress, Boolean(args.systems));
217425
+ const result = yield deploy(
217426
+ args.deployerPrivateKey,
217427
+ args.rpc,
217428
+ args.worldAddress,
217429
+ Boolean(args.systems),
217430
+ args.gasPrice
217431
+ );
217407
217432
  deployedWorldAddress = result.deployedWorldAddress;
217408
217433
  initialBlockNumber = result.initialBlockNumber;
217409
217434
  } catch (e) {
@@ -217411,7 +217436,7 @@ function generateAndDeploy(args) {
217411
217436
  } finally {
217412
217437
  console.log("Cleaning up deployment script");
217413
217438
  if (libDeployPath)
217414
- resetLibDeploy(contractsDir2);
217439
+ yield resetLibDeploy(contractsDir2);
217415
217440
  }
217416
217441
  return { deployedWorldAddress, initialBlockNumber };
217417
217442
  });
@@ -217480,7 +217505,8 @@ var builder = (yargs) => yargs.options({
217480
217505
  systems: { type: "string", desc: "Only upgrade the given systems. Requires World address." },
217481
217506
  watch: { type: "boolean", desc: "Automatically redeploy changed systems" },
217482
217507
  dev: { type: "boolean", desc: "Automatically use funded dev private key for local development" },
217483
- openUrl: { type: "string", desc: "Opens a browser at the provided url with the worldAddress url param prefilled" }
217508
+ openUrl: { type: "string", desc: "Opens a browser at the provided url with the worldAddress url param prefilled" },
217509
+ gasPrice: { type: "number", desc: "Gas price to set for deploy transactions" }
217484
217510
  });
217485
217511
  var handler = (args) => __async(void 0, null, function* () {
217486
217512
  var _a;
@@ -217488,7 +217514,7 @@ var handler = (args) => __async(void 0, null, function* () {
217488
217514
  console.error("Error: Upgrading systems requires a World address.");
217489
217515
  process.exit(1);
217490
217516
  }
217491
- const deployerPrivateKey = ((_a = args.deployerPrivateKey) != null ? _a : args.dev) ? "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" : void 0;
217517
+ const deployerPrivateKey = (_a = args.deployerPrivateKey) != null ? _a : args.dev ? "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" : void 0;
217492
217518
  const { deployedWorldAddress: worldAddress, initialBlockNumber } = yield generateAndDeploy(__spreadProps(__spreadValues({}, args), {
217493
217519
  deployerPrivateKey,
217494
217520
  clear: true
@@ -217500,14 +217526,15 @@ var handler = (args) => __async(void 0, null, function* () {
217500
217526
  import_openurl.default.open(url2.toString());
217501
217527
  }
217502
217528
  if (args.watch) {
217503
- const { config, rpc } = args;
217529
+ const { config, rpc, gasPrice } = args;
217504
217530
  hsr("./src", (systems) => {
217505
217531
  return generateAndDeploy({
217506
217532
  config,
217507
217533
  deployerPrivateKey,
217508
217534
  worldAddress,
217509
217535
  rpc,
217510
- systems
217536
+ systems,
217537
+ gasPrice
217511
217538
  });
217512
217539
  });
217513
217540
  } else {