@skybridge/devtools 0.17.0 → 0.17.2
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,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Router } from "express";
|
|
2
2
|
/**
|
|
3
3
|
* Serve the built devtools React app
|
|
4
4
|
* This router serves static files from the devtools's dist directory.
|
|
@@ -13,4 +13,4 @@ import { type RequestHandler } from "express";
|
|
|
13
13
|
* ^^^^^^^^ Make sure to install the devtoolsStaticServer before the widgetsDevServer
|
|
14
14
|
* }
|
|
15
15
|
*/
|
|
16
|
-
export declare const devtoolsStaticServer: () => Promise<
|
|
16
|
+
export declare const devtoolsStaticServer: () => Promise<Router>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
1
|
import path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
3
|
import cors from "cors";
|
|
4
4
|
import express, {} from "express";
|
|
5
|
-
const require = createRequire(import.meta.url);
|
|
6
5
|
/**
|
|
7
6
|
* Serve the built devtools React app
|
|
8
7
|
* This router serves static files from the devtools's dist directory.
|
|
@@ -19,15 +18,11 @@ const require = createRequire(import.meta.url);
|
|
|
19
18
|
*/
|
|
20
19
|
export const devtoolsStaticServer = async () => {
|
|
21
20
|
const router = express.Router();
|
|
22
|
-
|
|
23
|
-
if (!require.main) {
|
|
24
|
-
throw new Error("require.main is not set");
|
|
25
|
-
}
|
|
26
|
-
devtoolsPath = path.join(path.dirname(require.main.filename), "dist");
|
|
21
|
+
const distDir = path.dirname(fileURLToPath(import.meta.url));
|
|
27
22
|
router.use(cors());
|
|
28
|
-
router.use(express.static(
|
|
23
|
+
router.use(express.static(distDir));
|
|
29
24
|
router.get("/", (_req, res, next) => {
|
|
30
|
-
const indexHtmlPath = path.join(
|
|
25
|
+
const indexHtmlPath = path.join(distDir, "index.html");
|
|
31
26
|
res.sendFile(indexHtmlPath, (error) => {
|
|
32
27
|
if (error) {
|
|
33
28
|
next(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtoolsStaticServer.js","sourceRoot":"","sources":["../src/devtoolsStaticServer.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"devtoolsStaticServer.js","sourceRoot":"","sources":["../src/devtoolsStaticServer.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,EAAE,EAAe,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,IAAqB,EAAE;IAC9D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAE7D,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IACnB,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAClC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACvD,GAAG,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;YACpC,IAAI,KAAK,EAAE,CAAC;gBACV,IAAI,CAAC,KAAK,CAAC,CAAC;YACd,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skybridge/devtools",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"tailwindcss-animate": "^1.0.7",
|
|
46
46
|
"tw-animate-css": "^1.4.0",
|
|
47
47
|
"zustand": "^5.0.9",
|
|
48
|
-
"skybridge": "0.17.
|
|
48
|
+
"skybridge": "0.17.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@eslint/js": "^9.39.2",
|