Skip to content

Commit

Permalink
refactor(@remix-run/vercel): use @remix-run/node instead of `@remix…
Browse files Browse the repository at this point in the history
…-run/server-runtime`
  • Loading branch information
pcattori committed Mar 18, 2022
1 parent d55622a commit d61a333
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
8 changes: 5 additions & 3 deletions packages/remix-vercel/__tests__/server-test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import supertest from "supertest";
import { createRequestHandler as createRemixRequestHandler } from "@remix-run/server-runtime";
import { createRequest } from "node-mocks-http";
import { createServerWithHelpers } from "@vercel/node/dist/helpers";
import type { VercelRequest } from "@vercel/node";
import { Response as NodeResponse } from "@remix-run/node";
import {
createRequestHandler as createRemixRequestHandler,
Response as NodeResponse,
} from "@remix-run/node";
import { Readable } from "stream";

import {
Expand All @@ -14,7 +16,7 @@ import {

// We don't want to test that the remix server works here (that's what the
// puppetteer tests do), we just want to test the vercel adapter
jest.mock("@remix-run/server-runtime");
jest.mock("@remix-run/node");
let mockedCreateRequestHandler =
createRemixRequestHandler as jest.MockedFunction<
typeof createRemixRequestHandler
Expand Down
7 changes: 3 additions & 4 deletions packages/remix-vercel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
"url": "https://github.com/remix-run/remix/issues"
},
"dependencies": {
"@remix-run/node": "1.3.1",
"@remix-run/server-runtime": "1.3.1"
"@remix-run/node": "1.3.1"
},
"peerDependencies": {
"@vercel/node": "^1.8.3"
},
"devDependencies": {
"@types/supertest": "^2.0.10",
"@vercel/node": "^1.8.3",
"supertest": "^6.1.5",
"node-mocks-http": "^1.10.1"
"node-mocks-http": "^1.10.1",
"supertest": "^6.1.5"
}
}
4 changes: 1 addition & 3 deletions packages/remix-vercel/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ import type {
AppLoadContext,
ServerBuild,
ServerPlatform,
} from "@remix-run/server-runtime";
import { createRequestHandler as createRemixRequestHandler } from "@remix-run/server-runtime";
import type {
RequestInit as NodeRequestInit,
Response as NodeResponse,
} from "@remix-run/node";
import {
// This has been added as a global in node 15+
AbortController,
createRequestHandler as createRemixRequestHandler,
Headers as NodeHeaders,
Request as NodeRequest,
} from "@remix-run/node";
Expand Down

0 comments on commit d61a333

Please sign in to comment.