Skip to content

Commit

Permalink
fix: make remixRoot the second arg
Browse files Browse the repository at this point in the history
Signed-off-by: Logan McAnsh <logan@mcan.sh>
  • Loading branch information
mcansh committed Feb 7, 2023
1 parent d3b87e6 commit c6f8761
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/remix-dev/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ export async function generateEntry(remixRoot: string, entry: string) {
type: "conjunction",
});

export async function generateEntry(entry: string, remixRoot: string) {
let config = await readConfig(remixRoot);
let entriesArray = Array.from(entries);
let list = listFormat.format(entriesArray);

Expand All @@ -274,7 +276,7 @@ export async function generateEntry(remixRoot: string, entry: string) {
return;
}

let pkgJson = await NPMCliPackageJson.load(remixRoot);
let pkgJson = await NPMCliPackageJson.load(config.rootDirectory);
let deps = pkgJson.content.dependencies ?? {};

let runtime = deps["@remix-run/deno"]
Expand Down Expand Up @@ -310,7 +312,7 @@ export async function generateEntry(remixRoot: string, entry: string) {
// otherwise, copy the entry file from the defaults
if (/\.jsx?$/.test(entry)) {
let javascript = convertFileToJS(contents, {
cwd: remixRoot,
cwd: config.rootDirectory,
filename: isServerEntry ? defaultEntryServer : defaultEntryClient,
});
await fse.writeFile(outputFile, javascript, "utf-8");
Expand All @@ -320,7 +322,10 @@ export async function generateEntry(remixRoot: string, entry: string) {

console.log(
colors.blue(
`Entry file ${entry} created at ${path.relative(remixRoot, outputFile)}.`
`Entry file ${entry} created at ${path.relative(
config.rootDirectory,
outputFile
)}.`
)
);
}
Expand Down

0 comments on commit c6f8761

Please sign in to comment.