@zuplo/cli 1.81.0 → 1.82.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.
@@ -1,18 +1,22 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <link rel="icon" href="/favicon.ico" />
6
6
  <style>
7
- @import url('https://fonts.googleapis.com/css2?family=Exo:wght@500&display=swap');
7
+ @import url("https://fonts.googleapis.com/css2?family=Exo:wght@500&display=swap");
8
8
  </style>
9
9
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
10
10
  <title>Zuplo Local Designer</title>
11
11
  <script type="module" crossorigin src="/assets/index-03352ce7.js"></script>
12
- <link rel="stylesheet" href="/assets/index-416489b7.css">
12
+ <link rel="stylesheet" href="/assets/index-416489b7.css" />
13
13
  </head>
14
14
  <body>
15
15
  <div id="root"></div>
16
-
16
+
17
+ <script>
18
+ // Set the global window variable
19
+ window.SERVER_DATA = __SERVER_DATA__;
20
+ </script>
17
21
  </body>
18
22
  </html>
@@ -1,10 +1,10 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="70ff8667-6414-5c3f-83ad-33606a7805f6")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="466535e1-0ea2-5336-8c14-853d1f02f9b3")}catch(e){}}();
3
3
  import fastifyStatic from "@fastify/static";
4
4
  import chokidar from "chokidar";
5
5
  import Fastify from "fastify";
6
6
  import { FastifySSEPlugin } from "fastify-sse-v2";
7
- import fs, { readdir } from "node:fs/promises";
7
+ import fs, { readFile, readdir } from "node:fs/promises";
8
8
  import path from "node:path";
9
9
  import { fileURLToPath } from "node:url";
10
10
  import { logger } from "../../common/logger.js";
@@ -40,8 +40,13 @@ export class ApiServer {
40
40
  });
41
41
  this.fastify.register((instance, _options, done) => {
42
42
  instance.get("/", {
43
- handler: (_request, reply) => {
44
- reply.sendFile("index.html");
43
+ handler: async (_request, reply) => {
44
+ let html = await readFile(path.join(editorRootPath, "index.html"), "utf-8");
45
+ html = html.replace("__SERVER_DATA__", JSON.stringify({
46
+ server_address: this.listenerHost,
47
+ server_port: this.listenerPort,
48
+ }));
49
+ reply.type("text/html").send(html);
45
50
  },
46
51
  });
47
52
  instance.get("/open-api-content", {
@@ -211,4 +216,4 @@ export class ApiServer {
211
216
  };
212
217
  }
213
218
  //# sourceMappingURL=server.js.map
214
- //# debugId=70ff8667-6414-5c3f-83ad-33606a7805f6
219
+ //# debugId=466535e1-0ea2-5336-8c14-853d1f02f9b3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "1.81.0",
3
+ "version": "1.82.0",
4
4
  "type": "module",
5
5
  "repository": "https://github.com/zuplo/cli",
6
6
  "description": "The command-line interface for Zuplo",