Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make store a dist import
  • Loading branch information
Josh-Walker-GM committed Nov 13, 2023
commit 95924ac447f944d4c6608cae7e274a2278ce0970
2 changes: 1 addition & 1 deletion packages/api-server/src/fastify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { FastifyInstance, FastifyServerOptions } from 'fastify'
import Fastify from 'fastify'

import type { GlobalContext } from '@redwoodjs/context'
import { getAsyncStoreInstance } from '@redwoodjs/context'
import { getAsyncStoreInstance } from '@redwoodjs/context/dist/store'
import { getPaths, getConfig } from '@redwoodjs/project-config'

import type { FastifySideConfigFn } from './types'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DbAuthHandler, DbAuthHandlerOptions } from '@redwoodjs/auth-dbauth-api'
import { db } from 'src/lib/db'
import { getAsyncStoreInstance as __rw_getAsyncStoreInstance } from '@redwoodjs/context'
import { getAsyncStoreInstance as __rw_getAsyncStoreInstance } from '@redwoodjs/context/dist/store'
const __rw_handler = async (event, context) => {
const forgotPasswordOptions = {
// handler() is invoked after verifying that a user was found with the given
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { logger } from 'src/lib/logger'
* @param { Context } context - contains information about the invocation,
* function, and execution environment.
*/
import { getAsyncStoreInstance as __rw_getAsyncStoreInstance } from '@redwoodjs/context'
import { getAsyncStoreInstance as __rw_getAsyncStoreInstance } from '@redwoodjs/context/dist/store'
const __rw_handler = async (event, _context) => {
logger.info(`${event.httpMethod} ${event.path}: custom function`)
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import services from 'src/services/**/*.{js,ts}'
import { getCurrentUser } from 'src/lib/auth'
import { db } from 'src/lib/db'
import { logger } from 'src/lib/logger'
import { getAsyncStoreInstance as __rw_getAsyncStoreInstance } from '@redwoodjs/context'
import { getAsyncStoreInstance as __rw_getAsyncStoreInstance } from '@redwoodjs/context/dist/store'
const __rw_handler = createGraphQLHandler({
authDecoder,
getCurrentUser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ export default function ({ types: t }: { types: typeof types }): PluginObj {
return
}
path.insertBefore(
// import { getAsyncStoreInstance as __rw_getAsyncStoreInstance } from '@redwoodjs/context'
// import { getAsyncStoreInstance as __rw_getAsyncStoreInstance } from '@redwoodjs/context/dist/store'
t.importDeclaration(
[
t.importSpecifier(
t.identifier('__rw_getAsyncStoreInstance'),
t.identifier('getAsyncStoreInstance')
),
],
t.stringLiteral('@redwoodjs/context')
t.stringLiteral('@redwoodjs/context/dist/store')
)
)

Expand Down
2 changes: 1 addition & 1 deletion packages/context/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './store'
export * from './context'
// Note: store is not exported here to discourage direct usage.

import './global.api-auto-imports'
export * from './global.api-auto-imports'
2 changes: 1 addition & 1 deletion packages/fastify/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { FastifyInstance, HookHandlerDoneFunction } from 'fastify'
import fastifyRawBody from 'fastify-raw-body'

import type { GlobalContext } from '@redwoodjs/context'
import { getAsyncStoreInstance } from '@redwoodjs/context'
import { getAsyncStoreInstance } from '@redwoodjs/context/dist/store'

import { loadFastifyConfig } from './config'
import { lambdaRequestHandler, loadFunctionsFromDist } from './lambda'
Expand Down
2 changes: 1 addition & 1 deletion packages/fastify/src/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import fastifyRawBody from 'fastify-raw-body'
import type { Plugin } from 'graphql-yoga'

import type { GlobalContext } from '@redwoodjs/context'
import { getAsyncStoreInstance } from '@redwoodjs/context'
import { getAsyncStoreInstance } from '@redwoodjs/context/dist/store'
import type { GraphQLYogaOptions } from '@redwoodjs/graphql-server'
import { createGraphQLYoga } from '@redwoodjs/graphql-server'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { context as globalContext, setContext } from '@redwoodjs/context'
import { getAsyncStoreInstance } from '@redwoodjs/context'
import { getAsyncStoreInstance } from '@redwoodjs/context/dist/store'

describe('Global context with context isolation', () => {
it('Should work when assigning directly into context', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-server/src/functions/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
} from 'aws-lambda'

import type { GlobalContext } from '@redwoodjs/context'
import { getAsyncStoreInstance } from '@redwoodjs/context'
import { getAsyncStoreInstance } from '@redwoodjs/context/dist/store'

import { createGraphQLYoga } from '../createGraphQLYoga'
import type { GraphQLHandlerOptions } from '../types'
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-server/src/functions/useRequireAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Decoder } from '@redwoodjs/api'
import { getAuthenticationContext } from '@redwoodjs/api'
import type { GlobalContext } from '@redwoodjs/context'
import { context as globalContext } from '@redwoodjs/context'
import { getAsyncStoreInstance } from '@redwoodjs/context'
import { getAsyncStoreInstance } from '@redwoodjs/context/dist/store'

import type { GetCurrentUser } from '../types'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { createTestkit } from '@envelop/testing'
import * as GraphQLJS from 'graphql'

import type { GlobalContext } from '@redwoodjs/context'
import { context, getAsyncStoreInstance, setContext } from '@redwoodjs/context'
import { context, setContext } from '@redwoodjs/context'
import { getAsyncStoreInstance } from '@redwoodjs/context/dist/store'

import { testSchema, testQuery } from '../__fixtures__/common'
import { useRedwoodGlobalContextSetter } from '../useRedwoodGlobalContextSetter'
Expand Down