Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/create-react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"gunzip-maybe": "^1.4.2",
"log-update": "^5.0.1",
"proxy-agent": "^6.3.0",
"recursive-readdir": "^2.2.3",
"semver": "^7.3.7",
"sisteransi": "^1.0.5",
"sort-package-json": "^1.55.0",
Expand Down
21 changes: 9 additions & 12 deletions packages/create-react-router/utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import fs from "node:fs";
import { readdir } from "node:fs/promises";
import path from "node:path";
import process from "node:process";
import os from "node:os";
import fs from "node:fs";
import { type Key as ActionKey } from "node:readline";
import { erase, cursor } from "sisteransi";
import chalk from "chalk";
import recursiveReaddir from "recursive-readdir";

// https://no-color.org/
const SUPPORTS_COLOR = chalk.supportsColor && !process.env.NO_COLOR;
Expand Down Expand Up @@ -292,14 +292,11 @@ export function stripDirectoryFromPath(dir: string, filePath: string) {
export const IGNORED_TEMPLATE_DIRECTORIES = [".git", "node_modules"];

export async function getDirectoryFilesRecursive(dir: string) {
let files = await recursiveReaddir(dir, [
(file) => {
let strippedFile = stripDirectoryFromPath(dir, file);
let parts = strippedFile.split(path.sep);
return (
parts.length > 1 && IGNORED_TEMPLATE_DIRECTORIES.includes(parts[0])
);
},
]);
return files.map((f) => stripDirectoryFromPath(dir, f));
return (await readdir(dir, { recursive: true })).filter((file) => {
let parts = file.split(path.sep);

return (
parts.length <= 1 || !IGNORED_TEMPLATE_DIRECTORIES.includes(parts[0])
);
});
}
11 changes: 0 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.