Skip to content

Commit

Permalink
refactor: re-use package name
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed May 29, 2024
1 parent 98633e5 commit 991df69
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { camelCase, pascalCase } from 'scule'
import { addImportsSources, addServerHandler, addTemplate, createResolver, defineNuxtModule, tryResolveModule, useLogger } from '@nuxt/kit'
import type { OpenAPI3, OpenAPITSOptions } from 'openapi-typescript'
import type { QueryObject } from 'ufo'
import { name } from '../package.json'
import { generateDeclarationTypes } from './openapi'

export interface ApiEndpoint {
Expand Down Expand Up @@ -88,7 +89,7 @@ declare module '@nuxt/schema' {

export default defineNuxtModule<ModuleOptions>({
meta: {
name: 'nuxt-api-party',
name,
configKey: 'apiParty',
compatibility: {
nuxt: '^3.7',
Expand All @@ -103,7 +104,7 @@ export default defineNuxtModule<ModuleOptions>({
},
},
async setup(options, nuxt) {
const moduleName = 'nuxt-api-party'
const moduleName = name
const logger = useLogger(moduleName)
const getRawComposableName = (endpointId: string) => `$${camelCase(endpointId)}`
const getDataComposableName = (endpointId: string) => `use${pascalCase(endpointId)}Data`
Expand Down

0 comments on commit 991df69

Please sign in to comment.