Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(schema): exclude functions from DeepPartial #6176

Merged
merged 2 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/schema/src/config/_app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
* Properties that will be set directly on `Vue.config` for vue@2.
*
* @see [vue@2 Documentation](https://v2.vuejs.org/v2/api/#Global-Config)
* @type {import('vue/types/vue').VueConfiguration}
* @type {typeof import('vue/types/vue').VueConfiguration}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it makes sense to automatically infer this in untyped?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that we have a two stage build here.

Copy link
Member

@pi0 pi0 Jul 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I mean if untyped can add automatically add typeof prefix to import in @type annotations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(anyway, this fix makes sense. Was thinking of a way to avoid future issues like this)

* @version 2
*/
config: {
Expand All @@ -23,7 +23,7 @@ export default {
/**
* Options for the Vue compiler that will be passed at build time
* @see [documentation](https://vuejs.org/api/application.html#app-config-compileroptions)
* @type {import('@vue/compiler-core').CompilerOptions}
* @type {typeof import('@vue/compiler-core').CompilerOptions}
* @version 3
*/
compilerOptions: {}
Expand Down Expand Up @@ -164,7 +164,7 @@ export default {
* Options to pass directly to `vue-meta`.
*
* @see [documentation](https://vue-meta.nuxtjs.org/api/#plugin-options).
* @type {import('vue-meta').VueMetaOptions}
* @type {typeof import('vue-meta').VueMetaOptions}
* @version 2
*/
vueMeta: null,
Expand All @@ -173,7 +173,7 @@ export default {
* Set default configuration for `<head>` on every page.
*
* @see [documentation](https://vue-meta.nuxtjs.org/api/#metainfo-properties) for specifics.
* @type {import('vue-meta').MetaInfo}
* @type {typeof import('vue-meta').MetaInfo}
* @version 2
*/
head: {
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/src/types/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ConfigSchema } from '../../schema/config'
import type { ResolvedConfig } from 'c12'

type DeepPartial<T> = T extends Record<string, any> ? { [P in keyof T]?: DeepPartial<T[P]> } : T
type DeepPartial<T> = T extends Function ? T : T extends Record<string, any> ? { [P in keyof T]?: DeepPartial<T[P]> } : T

/** User configuration in `nuxt.config` file */
export interface NuxtConfig extends DeepPartial<Omit<ConfigSchema, 'vite'>> {
Expand Down