mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 09:25:54 +00:00
fix(nuxt3): export composable types (#2828)
This commit is contained in:
parent
9660cd8212
commit
cd42f62fb9
@ -1,7 +1,7 @@
|
|||||||
export { defineNuxtComponent } from './component'
|
export { defineNuxtComponent } from './component'
|
||||||
export { useAsyncData, useLazyAsyncData } from './asyncData'
|
export { AsyncDataOptions, AsyncData, useAsyncData, useLazyAsyncData } from './asyncData'
|
||||||
export { useHydration } from './hydrate'
|
export { useHydration } from './hydrate'
|
||||||
export { useState } from './state'
|
export { useState } from './state'
|
||||||
export { useFetch, useLazyFetch } from './fetch'
|
export { FetchResult, UseFetchOptions, useFetch, useLazyFetch } from './fetch'
|
||||||
export { useCookie } from './cookie'
|
export { CookieOptions, CookieRef, useCookie } from './cookie'
|
||||||
export { useRequestHeaders } from './ssr'
|
export { useRequestHeaders } from './ssr'
|
||||||
|
@ -53,6 +53,15 @@ describe('auto-imports:transform', () => {
|
|||||||
|
|
||||||
const excludedNuxtHelpers = ['useHydration']
|
const excludedNuxtHelpers = ['useHydration']
|
||||||
|
|
||||||
|
const typeExports = [
|
||||||
|
'AsyncDataOptions',
|
||||||
|
'AsyncData',
|
||||||
|
'FetchResult',
|
||||||
|
'UseFetchOptions',
|
||||||
|
'CookieOptions',
|
||||||
|
'CookieRef'
|
||||||
|
]
|
||||||
|
|
||||||
describe('auto-imports:nuxt3', () => {
|
describe('auto-imports:nuxt3', () => {
|
||||||
try {
|
try {
|
||||||
const { __dirname } = createCommonJS(import.meta.url)
|
const { __dirname } = createCommonJS(import.meta.url)
|
||||||
@ -60,7 +69,7 @@ describe('auto-imports:nuxt3', () => {
|
|||||||
|
|
||||||
const names = findExports(entrypointContents).flatMap(i => i.names || i.name)
|
const names = findExports(entrypointContents).flatMap(i => i.names || i.name)
|
||||||
for (const name of names) {
|
for (const name of names) {
|
||||||
if (excludedNuxtHelpers.includes(name)) {
|
if (excludedNuxtHelpers.includes(name) || typeExports.includes(name)) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
it(`should register ${name} globally`, () => {
|
it(`should register ${name} globally`, () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user