Skip to content

Commit

Permalink
fix: fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSnow committed Apr 2, 2024
1 parent 8b1c9a2 commit 31e8586
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion packages/karbon/src/cli/plugins/importer-checker.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import consola from 'consola'
import type { Plugin } from 'vite'

export default function importerChecker() {
export default function importerChecker(): Plugin {
const virtualModuleId = '#imports'
const CHECK_IMPORTER_DIR = ['article-layout', 'editor-blocks']

return {
name: 'importer-checker',
resolveId(id, importer) {
if (!importer) {
return
}

const findImporter = CHECK_IMPORTER_DIR.find((dir) => importer.includes(dir))

if (importer && findImporter) {
Expand Down
4 changes: 2 additions & 2 deletions packages/karbon/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import type { HookResult, NuxtPlugin } from '@nuxt/schema'
import { resolveSEOProviders } from './seo-provider'
import { versionSafe } from './cli/checkFile'
import type {
ArticleMeta,
BaseMeta,
DeskMeta,
ModuleOptions,
ModulePublicRuntimeConfig,
Expand Down Expand Up @@ -81,7 +81,7 @@ const resources: ModuleOptions['resources'] = {
enable: true,
getIdentity: ({ id }) => ({ type: 'article', id }),
isValid: stubTrue,
toURL: ({ id }: ArticleMeta) => `/posts/${id}`,
toURL: ({ id }: BaseMeta) => `/posts/${id}`,
},
desk: {
route: '/desks/:id',
Expand Down
1 change: 1 addition & 0 deletions packages/karbon/src/modules/instantsearch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export default defineNuxtModule({
async setup() {
const widgetSource = await resolvePath('vue-instantsearch/vue3/es/src/widgets')
const promises = []
// @ts-expect-error internal pkg
const widgets = await import('vue-instantsearch/vue3/es/src/widgets.js')
for (const name of Object.keys(widgets)) {
promises.push(
Expand Down
1 change: 1 addition & 0 deletions packages/karbon/src/runtime/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export interface IdComparisonMap {
}

export interface URLGenerators {
// @ts-expect-error no idea only this will have error
article: ResourcePage<ArticleMeta>
desk: ResourcePage<DeskMeta>
author: ResourcePage<AuthorMeta>
Expand Down

0 comments on commit 31e8586

Please sign in to comment.