create-skybridge 0.0.0-dev.9f755c7 → 0.0.0-dev.a019e1d

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-skybridge",
3
- "version": "0.0.0-dev.9f755c7",
3
+ "version": "0.0.0-dev.a019e1d",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Alpic",
@@ -6,8 +6,8 @@
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "dev": "skybridge",
9
- "build": "vite build -c web/vite.config.ts && shx rm -rf dist && tsc -p tsconfig.server.json && mkdir -p dist/assets && shx cp -r web/dist/. dist/assets",
10
- "start": "node dist/index.js",
9
+ "build": "skybridge build",
10
+ "start": "skybridge start",
11
11
  "inspector": "mcp-inspector http://localhost:3000/mcp",
12
12
  "server:build": "tsc -p tsconfig.server.json",
13
13
  "server:start": "node dist/index.js",
@@ -16,6 +16,7 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@modelcontextprotocol/sdk": "^1.25.2",
19
+ "cors": "^2.8.5",
19
20
  "express": "^5.2.1",
20
21
  "react": "^19.2.3",
21
22
  "react-dom": "^19.2.3",
@@ -25,7 +26,8 @@
25
26
  },
26
27
  "devDependencies": {
27
28
  "@modelcontextprotocol/inspector": "^0.18.0",
28
- "@skybridge/devtools": ">=0.17.1 <1.0.0",
29
+ "@skybridge/devtools": ">=0.20.0 <1.0.0",
30
+ "@types/cors": "^2.8.19",
29
31
  "@types/express": "^5.0.6",
30
32
  "@types/react": "^19.2.7",
31
33
  "@types/react-dom": "^19.2.3",
@@ -1,3 +1,6 @@
1
+ import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import cors from "cors";
1
4
  import express, { type Express } from "express";
2
5
  import { widgetsDevServer } from "skybridge/server";
3
6
  import type { ViteDevServer } from "vite";
@@ -18,6 +21,14 @@ if (env !== "production") {
18
21
  app.use(await widgetsDevServer());
19
22
  }
20
23
 
24
+ if (env === "production") {
25
+ const __filename = fileURLToPath(import.meta.url);
26
+ const __dirname = path.dirname(__filename);
27
+
28
+ app.use("/assets", cors());
29
+ app.use("/assets", express.static(path.join(__dirname, "assets")));
30
+ }
31
+
21
32
  app.listen(3000, (error) => {
22
33
  if (error) {
23
34
  console.error("Failed to start server:", error);