Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Michaël De Boey <info@michaeldeboey.be>

Signed-off-by: Logan McAnsh <logan@mcan.sh>
  • Loading branch information
mcansh committed Mar 7, 2023
1 parent 126ece6 commit 9125fb7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions packages/remix-dev/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,9 @@ export async function generateEntry(
return;
}

let clientRuntime = deps["@remix-run/react"] ? "react" : undefined;
let clientRenderer = deps["@remix-run/react"] ? "react" : undefined;

if (!clientRuntime) {
if (!clientRenderer) {
console.error(
colors.error(
`Could not determine runtime. Please install the following: @remix-run/react`
Expand All @@ -348,12 +348,12 @@ export async function generateEntry(
let defaultsDirectory = path.resolve(__dirname, "..", "config", "defaults");
let defaultEntryClient = path.resolve(
defaultsDirectory,
`entry.client.${clientRuntime}-${type}.tsx`
`entry.client.${clientRenderer}-${type}.tsx`
);
let defaultEntryServer = path.resolve(
defaultsDirectory,
serverRuntime,
`entry.server.${clientRuntime}-${type}.tsx`
`entry.server.${clientRenderer}-${type}.tsx`
);

let isServerEntry = entry === "entry.server";
Expand Down
14 changes: 7 additions & 7 deletions packages/remix-dev/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,11 @@ export async function readConfig(
);
}

let clientRuntime = deps["@remix-run/react"] ? "react" : undefined;
let clientRenderer = deps["@remix-run/react"] ? "react" : undefined;

if (!clientRuntime) {
if (!clientRenderer) {
throw new Error(
`Could not determine runtime. Please install the following: @remix-run/react`
`Could not determine renderer. Please install the following: @remix-run/react`
);
}

Expand Down Expand Up @@ -528,15 +528,15 @@ export async function readConfig(
});
}

entryServerFile = `${serverRuntime}/entry.server.${clientRuntime}-${type}.tsx`;
entryServerFile = `${serverRuntime}/entry.server.${clientRenderer}-${type}.tsx`;
}

if (userEntryClientFile) {
entryClientFile = userEntryClientFile;
} else {
let clientRuntime = deps["@remix-run/react"] ? "react" : undefined;
let clientRenderer = deps["@remix-run/react"] ? "react" : undefined;

if (!clientRuntime) {
if (!clientRenderer) {
throw new Error(
`Could not determine runtime. Please install the following: @remix-run/react`
);
Expand All @@ -556,7 +556,7 @@ export async function readConfig(
? "stream"
: "string";

entryClientFile = `entry.client.${clientRuntime}-${type}.tsx`;
entryClientFile = `entry.client.${clientRenderer}-${type}.tsx`;
}

let entryClientFilePath = userEntryClientFile
Expand Down

0 comments on commit 9125fb7

Please sign in to comment.