raktajs 0.1.1 → 0.1.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.
package/dist/index.js CHANGED
@@ -1832,7 +1832,7 @@ async function buildProject(options) {
1832
1832
  };
1833
1833
  }
1834
1834
  // src/forge/devServer.ts
1835
- import { existsSync as existsSync5, readFileSync as readFileSync2 } from "fs";
1835
+ import { existsSync as existsSync5, readFileSync as readFileSync2, statSync as statSync2 } from "fs";
1836
1836
  import { join as join6 } from "path";
1837
1837
 
1838
1838
  // src/render/modes.ts
@@ -2090,6 +2090,9 @@ function resolveMime(filePath) {
2090
2090
  function resolveDevPort(port) {
2091
2091
  return port > 0 ? port : DEFAULT_DEV_PORT;
2092
2092
  }
2093
+ function isReadableFile(filePath) {
2094
+ return existsSync5(filePath) && statSync2(filePath).isFile();
2095
+ }
2093
2096
  function startDevServer(options) {
2094
2097
  const manifest = generateManifest(options.appDir);
2095
2098
  const resolvedPort = resolveDevPort(options.port);
@@ -2100,7 +2103,7 @@ function startDevServer(options) {
2100
2103
  const url = new URL(request.url);
2101
2104
  const { pathname } = url;
2102
2105
  const publicPath = join6(options.publicDir, pathname);
2103
- if (existsSync5(publicPath) && !publicPath.endsWith("/")) {
2106
+ if (isReadableFile(publicPath)) {
2104
2107
  return new Response(readFileSync2(publicPath), {
2105
2108
  headers: { "Content-Type": resolveMime(pathname) }
2106
2109
  });
@@ -2156,7 +2159,7 @@ function startDevServer(options) {
2156
2159
  };
2157
2160
  }
2158
2161
  // src/forge/inspect.ts
2159
- import { existsSync as existsSync6, readdirSync as readdirSync3, statSync as statSync2 } from "fs";
2162
+ import { existsSync as existsSync6, readdirSync as readdirSync3, statSync as statSync3 } from "fs";
2160
2163
  import { join as join7 } from "path";
2161
2164
  function detectArtifactKind(filename) {
2162
2165
  if (filename === "route-manifest.json")
@@ -2187,7 +2190,7 @@ function scanDirectory2(dirPath) {
2187
2190
  } else if (entry.isFile()) {
2188
2191
  collected.push({
2189
2192
  outputPath: full,
2190
- sizeBytes: statSync2(full).size,
2193
+ sizeBytes: statSync3(full).size,
2191
2194
  kind: detectArtifactKind(entry.name)
2192
2195
  });
2193
2196
  }
@@ -3602,7 +3605,7 @@ function createRaktaStore(creator) {
3602
3605
  return Object.assign(useStore, storeApi);
3603
3606
  }
3604
3607
  // src/tide/adapter.ts
3605
- import { existsSync as existsSync7, readFileSync as readFileSync3 } from "fs";
3608
+ import { existsSync as existsSync7, readFileSync as readFileSync3, statSync as statSync4 } from "fs";
3606
3609
  import { join as join8 } from "path";
3607
3610
 
3608
3611
  // src/tide/runtime.ts
@@ -3674,6 +3677,9 @@ function normalizeStaticPath(pathname) {
3674
3677
  }
3675
3678
  return "index.html";
3676
3679
  }
3680
+ function isReadableFile2(filePath) {
3681
+ return existsSync7(filePath) && statSync4(filePath).isFile();
3682
+ }
3677
3683
  function isApiRouteExports(value) {
3678
3684
  if (typeof value !== "object" || value === null) {
3679
3685
  return false;
@@ -3714,7 +3720,7 @@ function createBunAdapter(adapterConfig, renderConfig) {
3714
3720
  const staticPathname = normalizeStaticPath(pathname);
3715
3721
  for (const searchDirectory of searchDirectories) {
3716
3722
  const filePath = join8(searchDirectory, staticPathname);
3717
- if (existsSync7(filePath) && !filePath.endsWith("/")) {
3723
+ if (isReadableFile2(filePath)) {
3718
3724
  return new Response(readFileSync3(filePath), {
3719
3725
  headers: {
3720
3726
  "Content-Type": mimeForPath(filePath),
@@ -3869,4 +3875,4 @@ export {
3869
3875
  ArrayType
3870
3876
  };
3871
3877
 
3872
- //# debugId=3BC1F83A70EC3DAC64756E2164756E21
3878
+ //# debugId=64277F0C4350509364756E2164756E21