rwsdk 0.1.0-alpha.5 → 0.1.0-alpha.6

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.
@@ -31,6 +31,7 @@ export async function getSrcPaths(rootDir = process.cwd()) {
31
31
  const files = await glob(globPattern, {
32
32
  ignore: ["**/node_modules/**", "**/dist/**", "**/*.d.ts"],
33
33
  absolute: true,
34
+ nodir: true,
34
35
  });
35
36
  return files;
36
37
  }
@@ -6,6 +6,7 @@ import debug from "debug";
6
6
  import { normalizeModulePath } from "./normalizeModulePath.mjs";
7
7
  import { ensureAliasArray } from "./ensureAliasArray.mjs";
8
8
  import { pathExists } from "fs-extra";
9
+ import { stat } from "fs/promises";
9
10
  import { getSrcPaths } from "../lib/getSrcPaths.js";
10
11
  export const findFilesContainingDirective = async ({ projectRootDir, files, directive, debugNamespace, }) => {
11
12
  const log = debug(debugNamespace);
@@ -15,11 +16,17 @@ export const findFilesContainingDirective = async ({ projectRootDir, files, dire
15
16
  const filesInsideNodeModules = await glob("**/node_modules/**/*.{js,mjs,cjs}", {
16
17
  cwd: projectRootDir,
17
18
  absolute: true,
19
+ nodir: true,
18
20
  });
19
21
  const allFiles = [...filesOutsideNodeModules, ...filesInsideNodeModules];
20
22
  log("Found %d files to scan for '%s' directive", allFiles.length, directive);
21
23
  for (const file of allFiles) {
22
24
  try {
25
+ const stats = await stat(file);
26
+ if (!stats.isFile()) {
27
+ verboseLog("Skipping %s (not a file)", file);
28
+ continue;
29
+ }
23
30
  verboseLog("Scanning file: %s", file);
24
31
  const content = await readFile(file, "utf-8");
25
32
  const lines = content.split("\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rwsdk",
3
- "version": "0.1.0-alpha.5",
3
+ "version": "0.1.0-alpha.6",
4
4
  "description": "Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime",
5
5
  "type": "module",
6
6
  "bin": {