-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change!: split entry points into client / node
- Loading branch information
1 parent
5a9bfce
commit d35a75e
Showing
27 changed files
with
193 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
docs/.vitepress/theme/components/theme/ThemeConfigPopover.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import type { Component } from 'vue' | ||
import { watch } from 'vue' | ||
import type { Awaitable } from 'vitepress' | ||
import type { EnhanceAppContext, Theme } from 'vitepress/client' | ||
import * as VueI18n from 'vue-i18n' | ||
import * as components from './components' | ||
import { DEFAULT_OPERATION_SLOTS, useTheme } from './composables/useTheme' | ||
import { useShiki } from './composables/useShiki' | ||
import type { createOpenApiInstance } from './lib/createOpenApiInstance' | ||
|
||
import 'tailwindcss/tailwind.css' | ||
import './style.css' | ||
import './json.css' | ||
|
||
interface OAEnhanceAppContext extends EnhanceAppContext { | ||
openapi: ReturnType<typeof createOpenApiInstance> | ||
} | ||
|
||
interface VPTheme { | ||
Layout: Component | ||
enhanceApp: (ctx: OAEnhanceAppContext) => Awaitable<void> | ||
extends?: Theme | ||
} | ||
|
||
export const theme = { | ||
enhanceApp({ app, openapi = null }) { | ||
if (openapi) { | ||
app.provide('openapi', openapi) | ||
} | ||
|
||
const themeConfig = useTheme() | ||
|
||
const i18n: any = VueI18n.createI18n({ | ||
legacy: false, | ||
locale: themeConfig.getI18nConfig().locale.value, | ||
fallbackLocale: themeConfig.getI18nConfig().fallbackLocale.value, | ||
messages: themeConfig.getI18nConfig().messages, | ||
}) | ||
app.use(i18n) | ||
|
||
watch( | ||
() => themeConfig.getLocale(), | ||
() => { | ||
if (i18n.global.locale.value !== themeConfig.getLocale()) { | ||
i18n.global.locale.value = themeConfig.getLocale() | ||
} | ||
}, | ||
{ | ||
immediate: true, | ||
}, | ||
) | ||
|
||
for (const key in components) { | ||
// @ts-expect-error: no index signature | ||
app.component(key, components[key]) | ||
} | ||
|
||
useShiki().initShiki() | ||
}, | ||
} as VPTheme | ||
|
||
export { useOpenapi } from './composables/useOpenapi' | ||
export { useTheme } from './composables/useTheme' | ||
export { DEFAULT_OPERATION_SLOTS } | ||
export { useShiki } from './composables/useShiki' | ||
export { usePlayground } from './composables/usePlayground' | ||
export { OpenApi } from './lib/OpenApi' | ||
export { getOpenApiInstance } from './lib/getOpenApiInstance' | ||
export { createOpenApiInstance } from './lib/createOpenApiInstance' | ||
export { OARequest } from './lib/codeSamples/request' | ||
export type { IOARequest } from './lib/codeSamples/request' | ||
export { generateCodeSample } from './lib/codeSamples/generateCodeSample' | ||
export { locales } from './locales' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.