bun-dev-server 0.9.6 → 0.9.8

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.
Files changed (2) hide show
  1. package/dist/index.js +8 -3
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1008,6 +1008,7 @@ function hotReload() {
1008
1008
  }
1009
1009
  if (parsed?.type === "tscerror") {
1010
1010
  console.error(parsed.message);
1011
+ return;
1011
1012
  }
1012
1013
  if (parsed?.type === "error") {
1013
1014
  console.error(parsed.message);
@@ -1178,7 +1179,11 @@ async function startBunDevServer(serverConfig, importMeta) {
1178
1179
  } catch (e) {
1179
1180
  if (e.code === "ENOENT") {
1180
1181
  console.log("Directory not found, creating it...");
1181
- await $2`mkdir ${destinationPath}`;
1182
+ try {
1183
+ await $2`mkdir ${destinationPath}`;
1184
+ } catch (e2) {
1185
+ console.error("Unable to create directory", e2);
1186
+ }
1182
1187
  } else {
1183
1188
  throw e;
1184
1189
  }
@@ -1220,7 +1225,7 @@ async function startBunDevServer(serverConfig, importMeta) {
1220
1225
  if (req.url.toLowerCase().endsWith(finalConfig.websocketPath)) {
1221
1226
  finalConfig.logRequests && console.log(`${req.url} Socket Upgrade`);
1222
1227
  if (server.upgrade(req)) {
1223
- return;
1228
+ return withCORSHeaders(new Response("", { status: 200 }), req);
1224
1229
  }
1225
1230
  }
1226
1231
  const url = new URL(req.url);
@@ -1327,7 +1332,7 @@ async function cleanDirectory(dst) {
1327
1332
  if (stderr.indexOf("no matches found") > -1) {
1328
1333
  console.log("Directory is empty");
1329
1334
  } else {
1330
- throw stderr;
1335
+ console.warn("Unable to clean directory", stderr.toString("utf8"));
1331
1336
  }
1332
1337
  }
1333
1338
  }
package/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "exports": {
25
25
  ".": "./dist/index.js"
26
26
  },
27
- "version": "0.9.6",
27
+ "version": "0.9.8",
28
28
  "module": "index.ts",
29
29
  "type": "module",
30
30
  "license": "MIT",
@@ -32,10 +32,10 @@
32
32
  "build": "bun run ./build.ts"
33
33
  },
34
34
  "devDependencies": {
35
- "@types/bun": "^1.2.4"
35
+ "@types/bun": "^1.2.7"
36
36
  },
37
37
  "peerDependencies": {
38
- "typescript": "^5.7.3"
38
+ "typescript": "^5.8.2"
39
39
  },
40
40
  "dependencies": {
41
41
  "@types/ejs": "^3.1.5",