Skip to content

Commit

Permalink
chore(nuxt): move to nuxt 4 directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Teages committed Sep 15, 2024
1 parent f8e6302 commit 401c4f2
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions docs/ecosystem/nuxt/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ export interface UseGQFnSchema<
export interface UseGQFnSchemaWithWarning {
endpoint?: string
/**
* @deprecated It's not really deprecated. This deprecated is just a warning to let you know that the schema is not typed.
* @deprecated It's not really deprecated. The schema is not typed, maybe you input a wrong endpoint or forget to add it to nuxt config.
*/
gqfn: LoadGQFn<string>
/**
* @deprecated It's not really deprecated. This deprecated is just a warning to let you know that the schema is not typed.
* @deprecated It's not really deprecated. The schema is not typed, maybe you input a wrong endpoint or forget to add it to nuxt config.
*/
gqp: LoadGQP<string>
$enum: typeof $enum
Expand Down
5 changes: 3 additions & 2 deletions packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ export default defineNuxtModule<ModuleOptions>({
const resolver = createResolver(import.meta.url)
const logger = useLogger('@gqfn/nuxt', { level: options.silent ? 999 : undefined })

addImportsDir(resolver.resolve('./runtime/composables'))
// addImportsDir(resolver.resolve('./runtime/utils'))
addImportsDir(resolver.resolve('./runtime/app/composables'))
// addImportsDir(resolver.resolve('./runtime/app/utils'))

addServerImportsDir(resolver.resolve('./runtime/server/utils'))

const vfs = useTypeVfs('types/gqfn-schema')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useSchema } from '@gqfn/core'
import type { DollarEnum, Endpoints, ExactEndpoints, LoadGQFn, LoadGQP } from '../internal/utils/schema'
import type { UseGQFnSchema, UseGQFnSchemaWithWarning } from '../internal/types/composables/schema'
import type { DollarEnum, Endpoints, ExactEndpoints, LoadGQFn, LoadGQP } from '../../utils/schema'
import type { UseGQFnSchema, UseGQFnSchemaWithWarning } from '../../types/composables/schema'

export function useGQFnSchema(): UseGQFnSchema<string>
export function useGQFnSchema<T extends ExactEndpoints>(endpoint: T): UseGQFnSchema<T>
/**
* @deprecated It's not really deprecated. This deprecated is just a warning to let you know that the schema is not typed.
* @deprecated It's not really deprecated. The schema is not typed, maybe you input a wrong endpoint or forget to add it to nuxt config.
*/
export function useGQFnSchema(endpoint: string): UseGQFnSchemaWithWarning
export function useGQFnSchema<T extends Endpoints>(endpoint?: T): UseGQFnSchema<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import type { ResultOf, VariablesOf } from '@gqfn/core'
import { hash } from 'ohash'
import { type DocumentNode, Kind } from 'graphql'
import type { ComputedRef } from 'vue'
import type { Endpoints } from '../internal/utils/schema'
import { type HandlerOptions, type SSEOptions, type WSOptions, createHandler, createSubscriptionHandler } from '../internal/utils/client'
import type { UseGQFnSchema } from '../internal/types/composables/schema'
import type { DefineAsyncQuery, DefineOperation, DefineSubscription, WithGQFnClient, WithGQFnClientOptions } from '../internal/types/composables/with-client'
import type { Endpoints } from '../../utils/schema'
import { type HandlerOptions, type SSEOptions, type WSOptions, createHandler, createSubscriptionHandler } from '../../utils/client'
import type { UseGQFnSchema } from '../../types/composables/schema'
import type { DefineAsyncQuery, DefineOperation, DefineSubscription, WithGQFnClient, WithGQFnClientOptions } from '../../types/composables/with-client'
import { useAsyncData } from '#app/composables/asyncData'
import { useState } from '#app'
import { type MaybeRefOrGetter, readonly, toValue, watch } from '#imports'
Expand Down
8 changes: 4 additions & 4 deletions packages/nuxt/src/runtime/server/utils/schema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { $enum } from '@gqfn/core'
import { useSchema } from '@gqfn/core'
import type { DollarEnum, Endpoints, ExactEndpoints, LoadGQFn, LoadGQP } from '../../internal/utils/schema'
import type { DollarEnum, Endpoints, ExactEndpoints, LoadGQFn, LoadGQP } from '../../utils/schema'

export interface ServerUseSchema<
TEndpoint extends Endpoints,
Expand All @@ -14,11 +14,11 @@ export interface ServerUseSchema<
export interface ServerUseSchemaWithWarning {
endpoint?: string
/**
* @deprecated It's not really deprecated. This deprecated is just a warning to let you know that the schema is not typed.
* @deprecated It's not really deprecated. The schema is not typed, maybe you input a wrong endpoint or forget to add it to nuxt config.
*/
gqfn: LoadGQFn<string>
/**
* @deprecated It's not really deprecated. This deprecated is just a warning to let you know that the schema is not typed.
* @deprecated It's not really deprecated. The schema is not typed, maybe you input a wrong endpoint or forget to add it to nuxt config.
*/
gqp: LoadGQP<string>
$enum: typeof $enum
Expand All @@ -27,7 +27,7 @@ export interface ServerUseSchemaWithWarning {
export function useGQFnSchema(): ServerUseSchema<string>
export function useGQFnSchema<T extends ExactEndpoints>(endpoint: T): ServerUseSchema<T>
/**
* @deprecated It's not really deprecated. This deprecated is just a warning to let you know that the schema is not typed.
* @deprecated It's not really deprecated. The schema is not typed, maybe you input a wrong endpoint or forget to add it to nuxt config.
*/
export function useGQFnSchema(endpoint: string): ServerUseSchemaWithWarning
export function useGQFnSchema<T extends Endpoints>(endpoint?: T): ServerUseSchema<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export interface UseGQFnSchema<
export interface UseGQFnSchemaWithWarning {
endpoint?: string
/**
* @deprecated It's not really deprecated. This deprecated is just a warning to let you know that the schema is not typed.
* @deprecated It's not really deprecated. The schema is not typed, maybe you input a wrong endpoint or forget to add it to nuxt config.
*/
gqfn: LoadGQFn<string>
/**
* @deprecated It's not really deprecated. This deprecated is just a warning to let you know that the schema is not typed.
* @deprecated It's not really deprecated. The schema is not typed, maybe you input a wrong endpoint or forget to add it to nuxt config.
*/
gqp: LoadGQP<string>
$enum: typeof $enum
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 401c4f2

Please sign in to comment.