Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,31 @@
"release": "pnpm test && release-it"
},
"dependencies": {
"@nuxt/kit": "^4.2.1",
"@nuxt/kit": "^4.2.2",
"citty": "^0.1.6",
"json-schema-to-zod": "^2.7.0",
"mlly": "^1.8.0",
"ohash": "^2.0.11",
"scule": "^1.3.0",
"typescript": "^5.9.3",
"ufo": "^1.6.1",
"vue-component-meta": "^3.1.5"
"ufo": "^1.6.2",
"vue-component-meta": "^3.2.2"
},
"devDependencies": {
"@iconify/vue": "^5.0.0",
"@nuxt/content": "^3.8.2",
"@nuxt/eslint-config": "^1.11.0",
"@nuxt/content": "^3.10.0",
"@nuxt/eslint-config": "^1.12.1",
"@nuxt/module-builder": "^1.0.2",
"@nuxt/test-utils": "^3.20.1",
"@nuxt/test-utils": "^3.23.0",
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"ajv": "^8.17.1",
"changelogen": "^0.6.2",
"eslint": "^9.39.1",
"eslint": "^9.39.2",
"jiti": "^2.6.1",
"nuxt": "^4.2.1",
"release-it": "^19.0.6",
"vitest": "^4.0.14",
"vue": "^3.5.25"
"nuxt": "^4.2.2",
"release-it": "^19.2.3",
"vitest": "^4.0.16",
"vue": "^3.5.26"
},
"build": {
"entries": [
Expand Down Expand Up @@ -115,7 +115,7 @@
"vue-demi"
]
},
"packageManager": "pnpm@10.24.0",
"packageManager": "pnpm@10.27.0",
"release-it": {
"git": {
"commitMessage": "chore(release): release v${version}"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@import 'tailwindcss';
@import '@nuxt/ui-pro';
@import '@nuxt/ui';
76 changes: 76 additions & 0 deletions playground/app/components/Authors.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<script setup lang="ts">
interface Author {
name: string
avatar?: string
role?: 'creator' | 'maintainer' | 'contributor'
bio?: string
}

const props = defineProps<{
authorsOne?: {
name: string
avatar?: string
role?: 'creator' | 'maintainer' | 'contributor'
bio?: string
}[]
authorsTwo?: Author[]
}>()

const selectedGroup = ref<'one' | 'two'>('one')

const displayedAuthors = computed(() => {
return selectedGroup.value === 'one' ? props.authorsOne : props.authorsTwo
})
</script>

<template>
<div class="space-y-6">
<UFieldGroup>
<UButton
:variant="selectedGroup === 'one' ? 'solid' : 'outline'"
color="neutral"
label="Authors One"
@click="selectedGroup = 'one'"
/>
<UButton
:variant="selectedGroup === 'two' ? 'solid' : 'outline'"
color="neutral"
label="Authors Two"
@click="selectedGroup = 'two'"
/>
</UFieldGroup>

<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
<div
v-for="author in displayedAuthors"
:key="author.name"
class="bg-elevated rounded-xl p-6 border border-default hover:border-accented transition-colors duration-200"
>
<div class="flex items-center gap-4">
<UAvatar
:src="author.avatar"
:alt="author.name"
size="xl"
/>
<div class="flex-1 min-w-0">
<h3 class="text-highlighted font-semibold truncate">
{{ author.name }}
</h3>
<p
v-if="author.role"
class="text-muted text-sm"
>
{{ author.role }}
</p>
</div>
</div>
<p
v-if="author.bio"
class="mt-4 text-muted text-sm leading-relaxed"
>
{{ author.bio }}
</p>
</div>
</div>
</div>
</template>
File renamed without changes.
37 changes: 37 additions & 0 deletions playground/app/components/TestInterfaceArray.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script setup lang="ts">
interface Author {
name: string
email: string
role?: 'admin' | 'user' | 'guest'
}

interface Book {
title: string
isbn: string
publishedYear: number
}

defineProps<{
// Test Interface[] syntax
authors?: Author[]
books: Book[]
// Test inline array types
tags?: string[]
ratings?: number[]
}>()
</script>

<template>
<div>
<h2>Authors</h2>
<div v-for="author in authors" :key="author.email">
{{ author.name }} - {{ author.role }}
</div>

<h2>Books</h2>
<div v-for="book in books" :key="book.isbn">
{{ book.title }} ({{ book.publishedYear }})
</div>
</div>
</template>

23 changes: 23 additions & 0 deletions playground/app/components/TestJSComponent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script>
export default {
name: 'TestJSComponent',
props: {
message: {
type: String,
default: 'Hello from JS'
},
count: {
type: Number,
required: true
}
}
}
</script>

<template>
<div>
<p>{{ message }}</p>
<p>Count: {{ count }}</p>
</div>
</template>

14 changes: 14 additions & 0 deletions playground/app/components/global/Button.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<template>
<button :class="`btn-${size} btn-${appearance}`">
<slot />
</button>
</template>

<script lang="ts" setup>
import type { ButtonProps } from '#imports'

const {
size = 'medium',
appearance = 'default',
} = defineProps<ButtonProps>()
</script>
14 changes: 14 additions & 0 deletions playground/app/components/global/ButtonInlineProps.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<template>
<button :class="`btn-${size} btn-${appearance}`">
<slot />
</button>
</template>

<script lang="ts" setup>
import type { ButtonInlineProps } from '../../../shared/types/button-inline-props'

const {
size = 'medium',
appearance = 'default',
} = defineProps<ButtonInlineProps>()
</script>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</template>

<script setup lang="ts">
withDefaults(defineProps<{
interface PropsObject {
hello: string,
booleanProp?: boolean,
numberProp?: number,
Expand All @@ -20,7 +20,9 @@ withDefaults(defineProps<{
* @since v1.0.0
*/
foo?: string[]
}>(), {
partialImage?: string | (Partial<HTMLImageElement> & { [key: string]: any })
}
withDefaults(defineProps<PropsObject>(), {
numberProp: 42,
foo: () => ['bar', 'baz']
})
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default defineNuxtConfig({

modules: [
'@nuxt/content',
'@nuxt/ui-pro',
'@nuxt/ui',
nuxtMetaModule as any
],

Expand Down
9 changes: 5 additions & 4 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
"private": true,
"name": "nuxt-component-meta-playground",
"devDependencies": {
"@nuxt/content": "^3.8.2",
"@nuxt/ui-pro": "^3.3.7",
"nuxt": "^4.2.1",
"@nuxt/content": "^3.10.0",
"nuxt": "^4.2.2",
"nuxt-component-meta": "link:.."
},
"scripts": {
"dev": "nuxi dev",
"build": "nuxi build",
"generate": "nuxi generate"
"generate": "nuxi generate",
"prepare": "nuxi prepare"
},
"dependencies": {
"@amoayun/monaco-editor-vue3": "^1.0.20",
"@nuxt/ui": "^4.3.0",
"monaco-editor": "^0.55.1"
}
}
5 changes: 5 additions & 0 deletions playground/shared/types/button-inline-props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { SharedProps } from '#imports'

export interface ButtonInlineProps extends Pick<SharedProps, 'size'> {
appearance: string
}
5 changes: 5 additions & 0 deletions playground/shared/types/button.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { SharedProps } from '#imports'

export interface ButtonProps extends Pick<SharedProps, 'size'> {
appearance: string
}
3 changes: 3 additions & 0 deletions playground/shared/types/shared-props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface SharedProps {
size: 'small' | 'medium' | 'large'
}
Loading
Loading