Skip to content

Commit

Permalink
fix(tests): fix tests ; cannot import utils from server context
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul committed Jun 27, 2022
1 parent 2574ad8 commit d8b9d4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/runtime/server/api/highlight.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { createError, defineLazyEventHandler, useBody } from 'h3'
import { getHighlighter, BUNDLED_LANGUAGES, BUNDLED_THEMES, Lang, Theme } from 'shiki-es'
import { useLogger } from '@nuxt/kit'
import { HighlightParams, HighlightThemedToken } from '../../types'
import mdcTMLanguage from '../../assets/mdc.tmLanguage.json'
import { logger } from '../../../utils'
import { useRuntimeConfig } from '#imports'

// Re-create logger locally as utils cannot be imported from here
export const logger = useLogger('@nuxt/content')

/**
* Resolve Shiki compatible lang from string.
*
Expand Down
1 change: 1 addition & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { ModuleOptions, MountOptions } from './module'
import type { MarkdownPlugin } from './runtime/types'

export const logger = useLogger('@nuxt/content')

/**
* Internal version that represents cache format.
* This is used to invalidate cache when the format changes.
Expand Down

0 comments on commit d8b9d4e

Please sign in to comment.