diff --git a/packages/astro/src/content/index.ts b/packages/astro/src/content/index.ts index 36f810de6f..30936fb626 100644 --- a/packages/astro/src/content/index.ts +++ b/packages/astro/src/content/index.ts @@ -1,3 +1,4 @@ +export { attachContentServerListeners } from './server-listeners.js'; export { createContentTypesGenerator } from './types-generator.js'; export { contentObservable, getContentPaths, getDotAstroTypeReference } from './utils.js'; export { @@ -5,5 +6,4 @@ export { astroContentProdBundlePlugin, } from './vite-plugin-content-assets.js'; export { astroContentImportPlugin } from './vite-plugin-content-imports.js'; -export { attachContentServerListeners } from './server-listeners.js'; export { astroContentVirtualModPlugin } from './vite-plugin-content-virtual-mod.js'; diff --git a/packages/astro/src/content/server-listeners.ts b/packages/astro/src/content/server-listeners.ts index a6417b7f43..f0513d07fa 100644 --- a/packages/astro/src/content/server-listeners.ts +++ b/packages/astro/src/content/server-listeners.ts @@ -1,12 +1,12 @@ import { cyan } from 'kleur/colors'; -import { pathToFileURL } from 'node:url'; import type fsMod from 'node:fs'; +import { pathToFileURL } from 'node:url'; import type { ViteDevServer } from 'vite'; import type { AstroSettings } from '../@types/astro.js'; import { info, LogOptions } from '../core/logger/core.js'; import { appendForwardSlash } from '../core/path.js'; import { createContentTypesGenerator } from './types-generator.js'; -import { globalContentConfigObserver, getContentPaths } from './utils.js'; +import { getContentPaths, globalContentConfigObserver } from './utils.js'; interface ContentServerListenerParams { fs: typeof fsMod; diff --git a/packages/astro/src/content/utils.ts b/packages/astro/src/content/utils.ts index ff6930723e..a2c4631896 100644 --- a/packages/astro/src/content/utils.ts +++ b/packages/astro/src/content/utils.ts @@ -3,12 +3,11 @@ import matter from 'gray-matter'; import type fsMod from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import { createServer, ErrorPayload as ViteErrorPayload, normalizePath, ViteDevServer } from 'vite'; +import { ErrorPayload as ViteErrorPayload, normalizePath, ViteDevServer } from 'vite'; import { z } from 'zod'; import { AstroConfig, AstroSettings } from '../@types/astro.js'; import { AstroError, AstroErrorData } from '../core/errors/index.js'; import { CONTENT_TYPES_FILE } from './consts.js'; -import { astroContentVirtualModPlugin } from './vite-plugin-content-virtual-mod.js'; export const collectionConfigParser = z.object({ schema: z.any().optional(), diff --git a/packages/astro/src/content/vite-plugin-content-imports.ts b/packages/astro/src/content/vite-plugin-content-imports.ts index 5ba8c9b1ca..66d20d7031 100644 --- a/packages/astro/src/content/vite-plugin-content-imports.ts +++ b/packages/astro/src/content/vite-plugin-content-imports.ts @@ -1,22 +1,22 @@ import * as devalue from 'devalue'; +import type fsMod from 'node:fs'; import { pathToFileURL } from 'url'; import type { Plugin } from 'vite'; -import type fsMod from 'node:fs'; import { AstroSettings } from '../@types/astro.js'; +import { AstroErrorData } from '../core/errors/errors-data.js'; +import { AstroError } from '../core/errors/errors.js'; +import { escapeViteEnvReferences, getFileInfo } from '../vite-plugin-utils/index.js'; import { contentFileExts, CONTENT_FLAG } from './consts.js'; +import { getEntryType } from './types-generator.js'; import { ContentConfig, - globalContentConfigObserver, getContentPaths, getEntryData, getEntryInfo, getEntrySlug, + globalContentConfigObserver, parseFrontmatter, } from './utils.js'; -import { escapeViteEnvReferences, getFileInfo } from '../vite-plugin-utils/index.js'; -import { getEntryType } from './types-generator.js'; -import { AstroError } from '../core/errors/errors.js'; -import { AstroErrorData } from '../core/errors/errors-data.js'; function isContentFlagImport(viteId: string) { const { pathname, searchParams } = new URL(viteId, 'file://');