Skip to content

Commit

Permalink
fix(remix-dev/cli/migrate): fix packageExports map (#3189)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey authored May 14, 2022
1 parent 46717b6 commit a114c40
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 29 deletions.
12 changes: 6 additions & 6 deletions packages/remix-cloudflare/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ export {
isCookie,
isSession,
json,
MaxPartSizeExceededError,
redirect,
unstable_composeUploadHandlers,
unstable_parseMultipartFormData,
unstable_createMemoryUploadHandler,
MaxPartSizeExceededError,
unstable_parseMultipartFormData,
} from "@remix-run/server-runtime";

export type {
ActionFunction,
AppData,
AppLoadContext,
CreateRequestHandlerFunction,
Cookie,
CookieOptions,
CookieParseOptions,
CookieSerializeOptions,
CookieSignatureOptions,
CreateRequestHandlerFunction,
DataFunctionArgs,
EntryContext,
ErrorBoundaryComponent,
Expand All @@ -43,6 +43,8 @@ export type {
LinkDescriptor,
LinksFunction,
LoaderFunction,
MemoryUploadHandlerFilterArgs,
MemoryUploadHandlerOptions,
MetaDescriptor,
MetaFunction,
PageLinkDescriptor,
Expand All @@ -55,8 +57,6 @@ export type {
SessionData,
SessionIdStorageStrategy,
SessionStorage,
UploadHandlerPart,
UploadHandler,
MemoryUploadHandlerOptions,
MemoryUploadHandlerFilterArgs,
UploadHandlerPart,
} from "@remix-run/server-runtime";
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,28 @@ const defaultRuntimeExports: Exports = {
"createCookie",
"createCookieSessionStorage",
"createMemorySessionStorage",
"createSessionStorage",
"createRequestHandler",
"createSession",
"createSessionStorage",
"isCookie",
"isSession",
"json",
"MaxPartSizeExceededError",
"redirect",
"unstable_composeUploadHandlers",
"unstable_createMemoryUploadHandler",
"unstable_parseMultipartFormData",
],
type: [
"ActionFunction",
"AppData",
"AppLoadContext",
"CreateRequestHandlerFunction",
"Cookie",
"CookieOptions",
"CookieParseOptions",
"CookieSerializeOptions",
"CookieSignatureOptions",
"CreateRequestHandlerFunction",
"DataFunctionArgs",
"EntryContext",
"ErrorBoundaryComponent",
Expand All @@ -62,6 +66,8 @@ const defaultRuntimeExports: Exports = {
"LinkDescriptor",
"LinksFunction",
"LoaderFunction",
"MemoryUploadHandlerFilterArgs",
"MemoryUploadHandlerOptions",
"MetaDescriptor",
"MetaFunction",
"PageLinkDescriptor",
Expand All @@ -74,6 +80,8 @@ const defaultRuntimeExports: Exports = {
"SessionData",
"SessionIdStorageStrategy",
"SessionStorage",
"UploadHandler",
"UploadHandlerPart",
],
};

Expand Down Expand Up @@ -111,24 +119,25 @@ export const packageExports: Record<Package, Exports> = {
...defaultRuntimeExports.value,
"AbortController",
"createFileSessionStorage",
"createReadableStreamFromReadable",
"fetch",
"FormData",
"Headers",
"installGlobals",
"NodeOnDiskFile",
"readableStreamToString",
"Request",
"Response",
"unstable_createFileUploadHandler",
"unstable_createMemoryUploadHandler",
"unstable_parseMultipartFormData",
"writeAsyncIterableToWritable",
"writeReadableStreamToWritable",
],
type: [
...defaultRuntimeExports.type,
"HeadersInit",
"RequestInfo",
"RequestInit",
"ResponseInit",
"UploadHandler",
"UploadHandlerArgs",
],
},
react: {
Expand Down
23 changes: 13 additions & 10 deletions packages/remix-eslint-config/rules/packageExports.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ const defaultRuntimeExports = {
"createCookie",
"createCookieSessionStorage",
"createMemorySessionStorage",
"createSessionStorage",
"createRequestHandler",
"createSession",
"createSessionStorage",
"isCookie",
"isSession",
"json",
"MaxPartSizeExceededError",
"redirect",
"unstable_composeUploadHandlers",
"unstable_createMemoryUploadHandler",
Expand All @@ -23,12 +24,12 @@ const defaultRuntimeExports = {
"ActionFunction",
"AppData",
"AppLoadContext",
"CreateRequestHandlerFunction",
"Cookie",
"CookieOptions",
"CookieParseOptions",
"CookieSerializeOptions",
"CookieSignatureOptions",
"CreateRequestHandlerFunction",
"DataFunctionArgs",
"EntryContext",
"ErrorBoundaryComponent",
Expand All @@ -40,6 +41,8 @@ const defaultRuntimeExports = {
"LinkDescriptor",
"LinksFunction",
"LoaderFunction",
"MemoryUploadHandlerFilterArgs",
"MemoryUploadHandlerOptions",
"MetaDescriptor",
"MetaFunction",
"PageLinkDescriptor",
Expand All @@ -52,6 +55,8 @@ const defaultRuntimeExports = {
"SessionData",
"SessionIdStorageStrategy",
"SessionStorage",
"UploadHandler",
"UploadHandlerPart",
],
};

Expand Down Expand Up @@ -79,22 +84,20 @@ const nodeSpecificExports = {
value: [
"AbortController",
"createFileSessionStorage",
"createReadableStreamFromReadable",
"fetch",
"FormData",
"Headers",
"installGlobals",
"NodeOnDiskFile",
"readableStreamToString",
"Request",
"Response",
"unstable_createFileUploadHandler",
"writeAsyncIterableToWritable",
"writeReadableStreamToWritable",
],
type: [
"HeadersInit",
"RequestInfo",
"RequestInit",
"ResponseInit",
"UploadHandler",
"UploadHandlerArgs",
],
type: ["HeadersInit", "RequestInfo", "RequestInit", "ResponseInit"],
};

const reactSpecificExports = {
Expand Down
14 changes: 7 additions & 7 deletions packages/remix-node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type {
RequestInit,
ResponseInit,
} from "./fetch";
export { fetch, Headers, Request, Response, FormData } from "./fetch";
export { fetch, FormData, Headers, Request, Response } from "./fetch";

export { installGlobals } from "./globals";

Expand Down Expand Up @@ -41,23 +41,23 @@ export {
isCookie,
isSession,
json,
MaxPartSizeExceededError,
redirect,
unstable_composeUploadHandlers,
unstable_parseMultipartFormData,
unstable_createMemoryUploadHandler,
MaxPartSizeExceededError,
unstable_parseMultipartFormData,
} from "@remix-run/server-runtime";

export type {
ActionFunction,
AppData,
AppLoadContext,
CreateRequestHandlerFunction,
Cookie,
CookieOptions,
CookieParseOptions,
CookieSerializeOptions,
CookieSignatureOptions,
CreateRequestHandlerFunction,
DataFunctionArgs,
EntryContext,
ErrorBoundaryComponent,
Expand All @@ -69,6 +69,8 @@ export type {
LinkDescriptor,
LinksFunction,
LoaderFunction,
MemoryUploadHandlerFilterArgs,
MemoryUploadHandlerOptions,
MetaDescriptor,
MetaFunction,
PageLinkDescriptor,
Expand All @@ -81,8 +83,6 @@ export type {
SessionData,
SessionIdStorageStrategy,
SessionStorage,
UploadHandlerPart,
UploadHandler,
MemoryUploadHandlerOptions,
MemoryUploadHandlerFilterArgs,
UploadHandlerPart,
} from "@remix-run/server-runtime";

0 comments on commit a114c40

Please sign in to comment.