Skip to content

Commit

Permalink
chore(exports): Separate export for ServerAuthProvider (#10711)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored May 31, 2024
1 parent 8d51107 commit 009dd04
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 15 deletions.
23 changes: 20 additions & 3 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,26 @@
"license": "MIT",
"type": "module",
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/cjs/index.js"
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/cjs/index.js"
},
"./ServerAuthProvider": {
"types": "./dist/AuthProvider/ServerAuthProvider.d.ts",
"import": "./dist/AuthProvider/ServerAuthProvider.js",
"default": "./dist/cjs/AuthProvider/ServerAuthProvider.js"
},
"./dist/AuthProvider/ServerAuthProvider": {
"types": "./dist/AuthProvider/ServerAuthProvider.d.ts",
"import": "./dist/AuthProvider/ServerAuthProvider.js",
"default": "./dist/cjs/AuthProvider/ServerAuthProvider.js"
},
"./dist/AuthProvider/ServerAuthProvider.js": {
"types": "./dist/AuthProvider/ServerAuthProvider.d.ts",
"import": "./dist/AuthProvider/ServerAuthProvider.js",
"default": "./dist/cjs/AuthProvider/ServerAuthProvider.js"
}
},
"types": "./dist/index.d.ts",
"files": [
Expand Down
1 change: 0 additions & 1 deletion packages/auth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export type { CustomProviderHooks } from './authFactory.js'
export type { AuthImplementation } from './AuthImplementation.js'

export * from './AuthProvider/AuthProviderState.js'
export * from './AuthProvider/ServerAuthProvider.js'

export * from './getCurrentUserFromMiddleware.js'
6 changes: 2 additions & 4 deletions packages/vite/src/middleware/MiddlewareRequest.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Request as WhatWgRequest } from '@whatwg-node/fetch'

import {
middlewareDefaultAuthProviderState,
type ServerAuthState,
} from '@redwoodjs/auth'
import { middlewareDefaultAuthProviderState } from '@redwoodjs/auth'
import type { ServerAuthState } from '@redwoodjs/auth/dist/AuthProvider/ServerAuthProvider.js'

import { CookieJar } from './CookieJar.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/middleware/invokeMiddleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ServerAuthState } from '@redwoodjs/auth'
import type { ServerAuthState } from '@redwoodjs/auth/dist/AuthProvider/ServerAuthProvider.js'

import { setServerAuthState } from '../serverStore.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/rsc/rscWorkerCommunication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Readable } from 'node:stream'
import { PassThrough } from 'node:stream'
import { Worker } from 'node:worker_threads'

import type { ServerAuthState } from '@redwoodjs/auth'
import type { ServerAuthState } from '@redwoodjs/auth/dist/AuthProvider/ServerAuthProvider.js'

import type { RscFetchProps } from './rscFetchForClientRouter'

Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/serverStore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AsyncLocalStorage } from 'async_hooks'

import type { ServerAuthState } from '@redwoodjs/auth'
import type { ServerAuthState } from '@redwoodjs/auth/dist/AuthProvider/ServerAuthProvider.js'

import { CookieJar } from './middleware/CookieJar.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/streaming/createReactStreamingHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type { HTTPMethod } from 'find-my-way'
import { createIsbotFromList, list as isbotList } from 'isbot'
import type { ViteDevServer } from 'vite'

import type { ServerAuthState } from '@redwoodjs/auth'
import { middlewareDefaultAuthProviderState } from '@redwoodjs/auth'
import type { ServerAuthState } from '@redwoodjs/auth/dist/AuthProvider/ServerAuthProvider.js'
import type { RouteSpec, RWRouteManifestItem } from '@redwoodjs/internal'
import { getAppRouteHook, getConfig, getPaths } from '@redwoodjs/project-config'
import { matchPath } from '@redwoodjs/router'
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/streaming/streamHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import type {
} from 'react-dom/server'
import type { default as RDServerModule } from 'react-dom/server.edge'

import type { ServerAuthState } from '@redwoodjs/auth'
import { ServerAuthProvider } from '@redwoodjs/auth'
import type { ServerAuthState } from '@redwoodjs/auth/dist/AuthProvider/ServerAuthProvider.js'
import { ServerAuthProvider } from '@redwoodjs/auth/dist/AuthProvider/ServerAuthProvider.js'
import { getConfig, getPaths } from '@redwoodjs/project-config'
import { LocationProvider } from '@redwoodjs/router'
import type { TagDescriptor } from '@redwoodjs/web'
Expand Down
3 changes: 2 additions & 1 deletion packages/web/src/apollo/suspense.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ import {
import { buildManualDataTransport } from '@apollo/client-react-streaming/manual-transport'

import type { UseAuth } from '@redwoodjs/auth'
import { ServerAuthContext, useNoAuth } from '@redwoodjs/auth'
import { useNoAuth } from '@redwoodjs/auth'
import { ServerAuthContext } from '@redwoodjs/auth/dist/AuthProvider/ServerAuthProvider.js'
import './typeOverride'

import {
Expand Down

0 comments on commit 009dd04

Please sign in to comment.