@wix/dev-machine-monitor 1.0.2 → 1.0.4

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/build/run.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  "use strict";
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
@@ -6724,6 +6725,14 @@ async function runProxy(proxyFrom, proxyTo, stdio) {
6724
6725
  proxy.web(req, res, { target: proxyTo });
6725
6726
  }
6726
6727
  });
6728
+ httpServer.on(
6729
+ "upgrade",
6730
+ (req, socket, head) => {
6731
+ proxy.ws(req, socket, head, {
6732
+ target: proxyTo
6733
+ });
6734
+ }
6735
+ );
6727
6736
  proxy.on("error", (_err, _req, res) => {
6728
6737
  if ("req" in res) {
6729
6738
  if (!res.headersSent && !res.writableEnded) {
@@ -6829,7 +6838,19 @@ async function runProxy(proxyFrom, proxyTo, stdio) {
6829
6838
  <form action=${RESTART_URL} method="POST">
6830
6839
  <button class="btn primary" id="retryBtn" type="submit">Retry</button>
6831
6840
  </form>
6832
- <a class="btn" href="/" id="homeBtn">Go to homepage</a>
6841
+ <script type="text/javascript">
6842
+ function fixWithAI() {
6843
+ window.parent?.postMessage({
6844
+ type: "clientError",
6845
+ clientErrorData: {
6846
+ errorType: "build",
6847
+ message: 'Development server is not responding',
6848
+ stack: 'No stack trace available',
6849
+ }
6850
+ }, '*');
6851
+ }
6852
+ </script>
6853
+ <a class="btn" id="homeBtn" onClick={fixWithAI}>Fix with AI</a>
6833
6854
  </div>
6834
6855
 
6835
6856
  <div class="details" id="details" hidden>
@@ -6843,7 +6864,6 @@ async function runProxy(proxyFrom, proxyTo, stdio) {
6843
6864
  <div class="suggestion"><span class="dot"></span><div>If the problem persists, open an issue or contact support.</div></div>
6844
6865
  </div>
6845
6866
 
6846
- <pre aria-hidden="false">${stdio()}</footer>
6847
6867
  </section>
6848
6868
  </main>
6849
6869
  </body>
@@ -13702,9 +13722,6 @@ program.requiredOption("-f, --proxy-from <URL>", "Proxy host URL (e.g. http://lo
13702
13722
  let result = null;
13703
13723
  function runCommandWithAutoRestart() {
13704
13724
  result = runCommand(command);
13705
- result.onStdio((chunk) => {
13706
- stdio += chunk;
13707
- });
13708
13725
  result.onError((error) => {
13709
13726
  console.info(source_default.redBright("Error has been detected"), error);
13710
13727
  console.info(source_default.redBright("Killing the process..."));