nit: try out removing all our barrels

This commit is contained in:
Princesseuh 2023-10-09 16:26:28 +02:00
parent 33d0be50be
commit 27875ae0e9
No known key found for this signature in database
GPG key ID: 105BBD6D57F2B0C0
63 changed files with 96 additions and 169 deletions

View file

@ -16,9 +16,9 @@ import type * as vite from 'vite';
import type { RemotePattern } from '../assets/utils/remotePattern.js';
import type { SerializedSSRManifest } from '../core/app/types.js';
import type { PageBuildData } from '../core/build/types.js';
import type { AstroConfigType } from '../core/config/index.js';
import type { AstroConfigType } from '../core/config/schema.js';
import type { AstroTimer } from '../core/config/timer.js';
import type { AstroCookies } from '../core/cookies/index.js';
import type { AstroCookies } from '../core/cookies/cookies.js';
import type { ResponseWithEncoding } from '../core/endpoint/index.js';
import type { AstroIntegrationLogger, Logger, LoggerLevel } from '../core/logger/core.js';
import type { AstroComponentFactory, AstroComponentInstance } from '../runtime/server/index.js';
@ -52,7 +52,7 @@ export type {
} from '../assets/types.js';
export type { RemotePattern } from '../assets/utils/remotePattern.js';
export type { SSRManifest } from '../core/app/types.js';
export type { AstroCookies } from '../core/cookies/index.js';
export type { AstroCookies };
export interface AstroBuiltinProps {
'client:load'?: boolean;

View file

@ -1,3 +0,0 @@
export { getConfiguredImageService, getImage } from './internal.js';
export { baseService, isLocalService } from './services/service.js';
export { type LocalImageProps, type RemoteImageProps } from './types.js';

View file

@ -9,14 +9,10 @@ import ora from 'ora';
import preferredPM from 'preferred-pm';
import prompts from 'prompts';
import type yargs from 'yargs-parser';
import {
loadTSConfig,
resolveConfig,
resolveConfigPath,
resolveRoot,
} from '../../core/config/index.js';
import { resolveConfig, resolveConfigPath, resolveRoot } from '../../core/config/config.js';
import {
defaultTSConfig,
loadTSConfig,
presets,
updateTSConfigForFramework,
type frameworkWithTSSettings,

View file

@ -1,6 +1,6 @@
import { cyan } from 'kleur/colors';
import type yargs from 'yargs-parser';
import devServer from '../../core/dev/index.js';
import devServer from '../../core/dev/dev.js';
import { printHelp } from '../../core/messages.js';
import { flagsToAstroInlineConfig } from '../flags.js';

View file

@ -4,7 +4,7 @@ import { execSync } from 'node:child_process';
import { arch, platform } from 'node:os';
import prompts from 'prompts';
import type yargs from 'yargs-parser';
import { resolveConfig } from '../../core/config/index.js';
import { resolveConfig } from '../../core/config/config.js';
import { ASTRO_VERSION } from '../../core/constants.js';
import { flagsToAstroInlineConfig } from '../flags.js';

View file

@ -17,7 +17,8 @@ export function getViteConfig(inlineConfig: UserConfig) {
fs,
{ mergeConfig },
{ nodeLogDestination },
{ resolveConfig, createSettings },
{ resolveConfig },
{ createSettings },
{ createVite },
{ runHookConfigSetup, runHookConfigDone },
{ astroContentListenPlugin },
@ -25,7 +26,8 @@ export function getViteConfig(inlineConfig: UserConfig) {
import('node:fs'),
import('vite'),
import('../core/logger/node.js'),
import('../core/config/index.js'),
import('../core/config/config.js'),
import('../core/config/settings.js'),
import('../core/create-vite.js'),
import('../integrations/index.js'),
import('./vite-plugin-content-listen.js'),

View file

@ -1,8 +0,0 @@
export { CONTENT_FLAG, PROPAGATED_ASSET_FLAG } from './consts.js';
export { errorMap } from './error-map.js';
export { attachContentServerListeners } from './server-listeners.js';
export { createContentTypesGenerator } from './types-generator.js';
export { contentObservable, getContentPaths, getDotAstroTypeReference } from './utils.js';
export { astroContentAssetPropagationPlugin } from './vite-plugin-content-assets.js';
export { astroContentImportPlugin } from './vite-plugin-content-imports.js';
export { astroContentVirtualModPlugin } from './vite-plugin-content-virtual-mod.js';

View file

@ -7,7 +7,7 @@ import type {
SSRManifest,
} from '../../@types/astro.js';
import type { SinglePageBuiltModule } from '../build/types.js';
import { getSetCookiesFromResponse } from '../cookies/index.js';
import { getSetCookiesFromResponse } from '../cookies/response.js';
import { consoleLogDestination } from '../logger/console.js';
import { AstroIntegrationLogger, Logger } from '../logger/core.js';
import {
@ -15,8 +15,9 @@ import {
prependForwardSlash,
removeTrailingForwardSlash,
} from '../path.js';
import { RedirectSinglePageBuiltModule } from '../redirects/index.js';
import { createEnvironment, createRenderContext, type RenderContext } from '../render/index.js';
import { RedirectSinglePageBuiltModule } from '../redirects/component.js';
import { createRenderContext, type RenderContext } from '../render/context.js';
import { createEnvironment } from '../render/environment.js';
import { RouteCache } from '../render/route-cache.js';
import {
createAssetLink,

View file

@ -1,5 +1,5 @@
import { Pipeline } from '../pipeline.js';
import type { Environment } from '../render/index.js';
import type { Environment } from '../render/environment.js';
/**
* Thrown when an endpoint contains a response with the header "X-Astro-Response" === 'Not-Found'

View file

@ -4,7 +4,7 @@ import { BEFORE_HYDRATION_SCRIPT_ID } from '../../vite-plugin-scripts/index.js';
import type { SSRManifest } from '../app/types.js';
import { Logger } from '../logger/core.js';
import { Pipeline } from '../pipeline.js';
import { createEnvironment } from '../render/index.js';
import { createEnvironment } from '../render/environment.js';
import { createAssetLink } from '../render/ssr-element.js';
import type { BuildInternals } from './internal.js';
import { ASTRO_PAGE_RESOLVED_MODULE_ID } from './plugins/plugin-pages.js';

View file

@ -33,8 +33,9 @@ import { runHookBuildGenerated } from '../../integrations/index.js';
import { getOutputDirectory, isServerLikeOutput } from '../../prerender/utils.js';
import { PAGE_SCRIPT_ID } from '../../vite-plugin-scripts/index.js';
import { AstroError, AstroErrorData } from '../errors/index.js';
import { RedirectSinglePageBuiltModule, getRedirectLocationOrThrow } from '../redirects/index.js';
import { createRenderContext } from '../render/index.js';
import { RedirectSinglePageBuiltModule } from '../redirects/component.js';
import { getRedirectLocationOrThrow } from '../redirects/validate.js';
import { createRenderContext } from '../render/context.js';
import { callGetStaticPaths } from '../render/route-cache.js';
import {
createAssetLink,

View file

@ -27,7 +27,7 @@ import { createVite } from '../create-vite.js';
import { Logger, levels, timerMessage } from '../logger/core.js';
import { apply as applyPolyfill } from '../polyfill.js';
import { RouteCache } from '../render/route-cache.js';
import { createRouteManifest } from '../routing/index.js';
import { createRouteManifest } from '../routing/manifest/create.js';
import { collectPagesData } from './page-data.js';
import { staticBuild, viteBuild } from './static-build.js';
import type { StaticBuildOptions } from './types.js';

View file

@ -6,7 +6,7 @@ import { runHookBuildSsr } from '../../../integrations/index.js';
import { BEFORE_HYDRATION_SCRIPT_ID, PAGE_SCRIPT_ID } from '../../../vite-plugin-scripts/index.js';
import type { SerializedRouteInfo, SerializedSSRManifest } from '../../app/types.js';
import { joinPaths, prependForwardSlash } from '../../path.js';
import { serializeRouteData } from '../../routing/index.js';
import { serializeRouteData } from '../../routing/manifest/serialization.js';
import { addRollupInput } from '../add-rollup-input.js';
import { getOutFile, getOutFolder } from '../common.js';
import { cssOrder, mergeInlineCss, type BuildInternals } from '../internal.js';

View file

@ -1,7 +1,7 @@
import { extname } from 'node:path';
import type { Plugin as VitePlugin } from 'vite';
import type { AstroSettings } from '../../../@types/astro.js';
import { routeIsRedirect } from '../../redirects/index.js';
import { routeIsRedirect } from '../../redirects/helpers.js';
import { addRollupInput } from '../add-rollup-input.js';
import { type BuildInternals } from '../internal.js';
import type { AstroBuildPlugin } from '../plugin.js';

View file

@ -4,7 +4,7 @@ import type { Plugin as VitePlugin } from 'vite';
import type { AstroAdapter, AstroConfig } from '../../../@types/astro.js';
import { isFunctionPerRouteEnabled } from '../../../integrations/index.js';
import { isServerLikeOutput } from '../../../prerender/utils.js';
import { routeIsRedirect } from '../../redirects/index.js';
import { routeIsRedirect } from '../../redirects/helpers.js';
import { addRollupInput } from '../add-rollup-input.js';
import type { BuildInternals } from '../internal.js';
import type { AstroBuildPlugin } from '../plugin.js';

View file

@ -19,7 +19,7 @@ import { runHookBuildSetup } from '../../integrations/index.js';
import { getOutputDirectory, isServerLikeOutput } from '../../prerender/utils.js';
import { PAGE_SCRIPT_ID } from '../../vite-plugin-scripts/index.js';
import { AstroError, AstroErrorData } from '../errors/index.js';
import { routeIsRedirect } from '../redirects/index.js';
import { routeIsRedirect } from '../redirects/helpers.js';
import { getOutDirWithinCwd } from './common.js';
import { generatePages } from './generate.js';
import { trackPageData } from './internal.js';

View file

@ -1,2 +0,0 @@
export { buildClientDirectiveEntrypoint } from './build.js';
export { getDefaultClientDirectives } from './default.js';

View file

@ -1,8 +0,0 @@
export {
cachedCompilation,
getCachedCompileResult,
invalidateCompilation,
isCached,
} from './cache.js';
export type { CompileProps, CompileResult } from './compile.js';
export type { TransformStyle } from './types.js';

View file

@ -1,6 +0,0 @@
export { resolveConfig, resolveConfigPath, resolveFlags, resolveRoot } from './config.js';
export { createNodeLogger } from './logging.js';
export { mergeConfig } from './merge.js';
export type { AstroConfigType } from './schema.js';
export { createSettings } from './settings.js';
export { loadTSConfig, updateTSConfigForFramework } from './tsconfig.js';

View file

@ -2,9 +2,9 @@ import yaml from 'js-yaml';
import path from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import type { AstroConfig, AstroSettings } from '../../@types/astro.js';
import { getContentPaths } from '../../content/index.js';
import { getContentPaths } from '../../content/utils.js';
import { markdownContentEntryType } from '../../vite-plugin-markdown/content-entry-type.js';
import { getDefaultClientDirectives } from '../client-directive/index.js';
import { getDefaultClientDirectives } from '../client-directive/default.js';
import { AstroError, AstroErrorData } from '../errors/index.js';
import { formatYAMLException, isYAMLException } from '../errors/utils.js';
import { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../constants.js';

View file

@ -1,6 +0,0 @@
export { AstroCookies } from './cookies.js';
export {
attachCookiesToResponse,
getSetCookiesFromResponse,
responseHasCookies,
} from './response.js';

View file

@ -6,11 +6,9 @@ import { fileURLToPath } from 'node:url';
import * as vite from 'vite';
import { crawlFrameworkPkgs } from 'vitefu';
import astroAssetsPlugin from '../assets/vite-plugin-assets.js';
import {
astroContentAssetPropagationPlugin,
astroContentImportPlugin,
astroContentVirtualModPlugin,
} from '../content/index.js';
import { astroContentAssetPropagationPlugin } from '../content/vite-plugin-content-assets.js';
import { astroContentImportPlugin } from '../content/vite-plugin-content-imports.js';
import { astroContentVirtualModPlugin } from '../content/vite-plugin-content-virtual-mod.js';
import astroTransitions from '../transitions/vite-plugin-transitions.js';
import astroPostprocessVitePlugin from '../vite-plugin-astro-postprocess/index.js';
import { vitePluginAstroServer } from '../vite-plugin-astro-server/index.js';

View file

@ -4,7 +4,7 @@ import type { AddressInfo } from 'node:net';
import { performance } from 'perf_hooks';
import type * as vite from 'vite';
import type { AstroInlineConfig } from '../../@types/astro.js';
import { attachContentServerListeners } from '../../content/index.js';
import { attachContentServerListeners } from '../../content/server-listeners.js';
import { telemetry } from '../../events/index.js';
import * as msg from '../messages.js';
import { startContainer } from './container.js';

View file

@ -1,3 +0,0 @@
export { createContainer, startContainer } from './container.js';
export { default } from './dev.js';
export { createContainerWithAutomaticRestart } from './restart.js';

View file

@ -3,7 +3,9 @@ import { fileURLToPath } from 'node:url';
import * as vite from 'vite';
import type { AstroInlineConfig, AstroSettings } from '../../@types/astro.js';
import { eventCliSession, telemetry } from '../../events/index.js';
import { createNodeLogger, createSettings, resolveConfig } from '../config/index.js';
import { resolveConfig } from '../config/config.js';
import { createNodeLogger } from '../config/logging.js';
import { createSettings } from '../config/settings.js';
import { collectErrorMetadata } from '../errors/dev/utils.js';
import { isAstroConfigZodError } from '../errors/errors.js';
import { createSafeError } from '../errors/index.js';

View file

@ -1,5 +1,6 @@
import type { EndpointHandler } from '../../../@types/astro.js';
import { createRenderContext, type SSROptions } from '../../render/index.js';
import { createRenderContext } from '../../render/context.js';
import type { SSROptions } from '../../render/index.js';
import { callEndpoint } from '../index.js';
export async function call(options: SSROptions) {

View file

@ -1,18 +1,20 @@
import mime from 'mime';
import type {
APIContext,
EndpointHandler,
EndpointOutput,
MiddlewareEndpointHandler,
MiddlewareHandler,
Params,
import {
type APIContext,
type EndpointHandler,
type EndpointOutput,
type MiddlewareEndpointHandler,
type MiddlewareHandler,
type Params,
} from '../../@types/astro.js';
import { renderEndpoint } from '../../runtime/server/index.js';
import { ASTRO_VERSION } from '../constants.js';
import { AstroCookies, attachCookiesToResponse } from '../cookies/index.js';
import { AstroCookies } from '../cookies/cookies.js';
import { attachCookiesToResponse } from '../cookies/response.js';
import { AstroError, AstroErrorData } from '../errors/index.js';
import { callMiddleware } from '../middleware/callMiddleware.js';
import type { Environment, RenderContext } from '../render/index.js';
import type { RenderContext } from '../render/context.js';
import type { Environment } from '../render/environment.js';
const encoder = new TextEncoder();

View file

@ -2,7 +2,7 @@ import * as fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import { getHighlighter } from 'shiki';
import type { ErrorPayload } from 'vite';
import type { ModuleLoader } from '../../module-loader/index.js';
import type { ModuleLoader } from '../../module-loader/loader.js';
import { FailedToLoadModuleSSR, InvalidGlob, MdxIntegrationMissingError } from '../errors-data.js';
import { AstroError, type ErrorWithMetadata } from '../errors.js';
import { createSafeError } from '../utils.js';

View file

@ -4,7 +4,7 @@ import type { AstroInlineConfig } from '../@types/astro.js';
import { default as _build } from './build/index.js';
import { default as _sync } from './sync/index.js';
export { default as dev } from './dev/index.js';
export { default as dev } from './dev/dev.js';
export { default as preview } from './preview/index.js';
/**

View file

@ -5,9 +5,9 @@ import type {
MiddlewareHandler,
MiddlewareNext,
} from '../../@types/astro.js';
import { attachCookiesToResponse, responseHasCookies } from '../cookies/index.js';
import { attachCookiesToResponse, responseHasCookies } from '../cookies/response.js';
import { AstroError, AstroErrorData } from '../errors/index.js';
import type { Environment } from '../render/index.js';
import type { Environment } from '../render/environment.js';
/**
* Utility function that is in charge of calling the middleware.

View file

@ -1,6 +1,6 @@
import type { AstroSettings } from '../../@types/astro.js';
import { MIDDLEWARE_PATH_SEGMENT_NAME } from '../constants.js';
import type { ModuleLoader } from '../module-loader/index.js';
import type { ModuleLoader } from '../module-loader/loader.js';
/**
* It accepts a module loader and the astro settings, and it attempts to load the middlewares defined in the configuration.

View file

@ -1,3 +0,0 @@
export { createLoader } from './loader.js';
export type { LoaderEvents, ModuleInfo, ModuleLoader, ModuleNode } from './loader.js';
export { createViteLoader } from './vite.js';

View file

@ -7,8 +7,9 @@ import type {
} from '../@types/astro.js';
import { callEndpoint, createAPIContext } from './endpoint/index.js';
import { callMiddleware } from './middleware/callMiddleware.js';
import type { RenderContext } from './render/context.js';
import { renderPage } from './render/core.js';
import { type Environment, type RenderContext } from './render/index.js';
import type { Environment } from './render/environment.js';
type EndpointResultHandler = (
originalRequest: Request,

View file

@ -1,3 +0,0 @@
export { RedirectComponentInstance, RedirectSinglePageBuiltModule } from './component.js';
export { redirectRouteGenerate, redirectRouteStatus, routeIsRedirect } from './helpers.js';
export { getRedirectLocationOrThrow } from './validate.js';

View file

@ -6,10 +6,14 @@ import type {
MiddlewareResponseHandler,
} from '../../@types/astro.js';
import { renderPage as runtimeRenderPage } from '../../runtime/server/index.js';
import { attachCookiesToResponse } from '../cookies/index.js';
import { attachCookiesToResponse } from '../cookies/response.js';
import { callEndpoint, createAPIContext } from '../endpoint/index.js';
import { callMiddleware } from '../middleware/callMiddleware.js';
import { redirectRouteGenerate, redirectRouteStatus, routeIsRedirect } from '../redirects/index.js';
import {
redirectRouteGenerate,
redirectRouteStatus,
routeIsRedirect,
} from '../redirects/helpers.js';
import type { RenderContext } from './context.js';
import type { Environment } from './environment.js';
import { createResult } from './result.js';

View file

@ -1,13 +1,5 @@
import type { AstroMiddlewareInstance, ComponentInstance, RouteData } from '../../@types/astro.js';
import type { Environment } from './environment.js';
export { createRenderContext } from './context.js';
export type { RenderContext } from './context.js';
export { tryRenderRoute } from './core.js';
export { createEnvironment } from './environment.js';
export { getParamsAndProps } from './params-and-props.js';
export { loadRenderer } from './renderer.js';
export type { Environment };
export interface SSROptions {
/** The environment instance */

View file

@ -1,7 +1,7 @@
import type { ComponentInstance, Params, Props, RouteData } from '../../@types/astro.js';
import { AstroError, AstroErrorData } from '../errors/index.js';
import type { Logger } from '../logger/core.js';
import { routeIsRedirect } from '../redirects/index.js';
import { routeIsRedirect } from '../redirects/helpers.js';
import { getParams } from '../routing/params.js';
import { RouteCache, callGetStaticPaths, findPathItemByKey } from './route-cache.js';

View file

@ -1,5 +1,5 @@
import type { AstroRenderer, SSRLoadedRenderer } from '../../@types/astro.js';
import type { ModuleLoader } from '../module-loader/index.js';
import type { ModuleLoader } from '../module-loader/loader.js';
export async function loadRenderer(
renderer: AstroRenderer,

View file

@ -9,7 +9,7 @@ import type {
import { renderSlotToString, type ComponentSlots } from '../../runtime/server/index.js';
import { renderJSX } from '../../runtime/server/jsx.js';
import { chunkToString } from '../../runtime/server/render/index.js';
import { AstroCookies } from '../cookies/index.js';
import { AstroCookies } from '../cookies/cookies.js';
import { AstroError, AstroErrorData } from '../errors/index.js';
import type { Logger } from '../logger/core.js';

View file

@ -1,5 +0,0 @@
export { createRouteManifest } from './manifest/create.js';
export { deserializeRouteData, serializeRouteData } from './manifest/serialization.js';
export { matchAllRoutes, matchRoute } from './match.js';
export { getParams } from './params.js';
export { validateDynamicRouteModule, validateGetStaticPathsResult } from './validation.js';

View file

@ -4,7 +4,7 @@ import { performance } from 'node:perf_hooks';
import { fileURLToPath } from 'node:url';
import { createServer, type HMRPayload } from 'vite';
import type { AstroInlineConfig, AstroSettings } from '../../@types/astro.js';
import { createContentTypesGenerator } from '../../content/index.js';
import { createContentTypesGenerator } from '../../content/types-generator.js';
import { globalContentConfigObserver } from '../../content/utils.js';
import { telemetry } from '../../events/index.js';
import { eventCliSession } from '../../events/session.js';

View file

@ -5,7 +5,7 @@ import { normalizePath } from 'vite';
import type { AstroConfig, AstroSettings, RouteType } from '../@types/astro.js';
import { isServerLikeOutput } from '../prerender/utils.js';
import { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './constants.js';
import type { ModuleLoader } from './module-loader/index.js';
import type { ModuleLoader } from './module-loader/loader.js';
import { prependForwardSlash, removeTrailingForwardSlash, slash } from './path.js';
/** Returns true if argument is an object of any prototype/class (but not null). */

View file

@ -2,7 +2,7 @@ import { bold } from 'kleur/colors';
import fs from 'node:fs';
import type { AddressInfo } from 'node:net';
import { fileURLToPath } from 'node:url';
import type { InlineConfig, ViteDevServer } from 'vite';
import { mergeConfig, type InlineConfig, type ViteDevServer } from 'vite';
import type {
AstroAdapter,
AstroConfig,
@ -16,8 +16,7 @@ import type {
} from '../@types/astro.js';
import type { SerializedSSRManifest } from '../core/app/types.js';
import type { PageBuildData } from '../core/build/types.js';
import { buildClientDirectiveEntrypoint } from '../core/client-directive/index.js';
import { mergeConfig } from '../core/config/index.js';
import { buildClientDirectiveEntrypoint } from '../core/client-directive/build.js';
import { AstroIntegrationLogger, type Logger } from '../core/logger/core.js';
import { isServerLikeOutput } from '../prerender/utils.js';
import { validateSupportedFeatures } from './astroFeaturesValidation.js';

View file

@ -1,2 +0,0 @@
export { createAstroJSXComponent } from './component.js';
export { default as renderer } from './renderer.js';

View file

@ -1,4 +1,4 @@
import type { ModuleInfo, ModuleLoader } from '../core/module-loader/index.js';
import type { ModuleInfo, ModuleLoader } from '../core/module-loader/loader.js';
import { viteID } from '../core/util.js';
type GetPrerenderStatusParams = {

View file

@ -1,5 +1,6 @@
import type { AstroSettings, ComponentInstance, RouteData } from '../@types/astro.js';
import { RedirectComponentInstance, routeIsRedirect } from '../core/redirects/index.js';
import { RedirectComponentInstance } from '../core/redirects/component.js';
import { routeIsRedirect } from '../core/redirects/helpers.js';
import type DevPipeline from '../vite-plugin-astro-server/devPipeline.js';
import { preload } from '../vite-plugin-astro-server/index.js';
import { getPrerenderStatus } from './metadata.js';

View file

@ -1,20 +0,0 @@
// NOTE: Although this entrypoint is exported, it is internal API and may change at any time.
export {
Fragment,
addAttribute,
createAstro,
createComponent,
createTransitionScope,
defineScriptVars,
defineStyleVars,
maybeRenderHead,
mergeSlots,
render,
renderComponent,
renderHead,
renderSlot,
renderTransition,
spreadAttributes,
unescapeHTML,
} from '../server/index.js';

View file

@ -1,4 +1,4 @@
import type { LoaderEvents, ModuleLoader } from '../core/module-loader/index.js';
import type { LoaderEvents, ModuleLoader } from '../core/module-loader/loader.js';
import type { ServerState } from './server-state.js';
import {

View file

@ -1,5 +1,5 @@
import type { RuntimeMode } from '../@types/astro.js';
import type { ModuleLoader } from '../core/module-loader/index.js';
import type { ModuleLoader } from '../core/module-loader/loader.js';
import { viteID } from '../core/util.js';
import { isBuildableCSSRequest } from './util.js';
import { crawlGraph } from './vite.js';

View file

@ -6,10 +6,10 @@ import type {
SSRManifest,
} from '../@types/astro.js';
import type { Logger } from '../core/logger/core.js';
import type { ModuleLoader } from '../core/module-loader/index.js';
import type { ModuleLoader } from '../core/module-loader/loader.js';
import { Pipeline } from '../core/pipeline.js';
import type { Environment } from '../core/render/index.js';
import { createEnvironment, loadRenderer } from '../core/render/index.js';
import { createEnvironment, type Environment } from '../core/render/environment.js';
import { loadRenderer } from '../core/render/renderer.js';
import { RouteCache } from '../core/render/route-cache.js';
import { isServerLikeOutput } from '../prerender/utils.js';
import { createResolve } from './resolve.js';

View file

@ -1,5 +1,5 @@
import type { SSRComponentMetadata, SSRResult } from '../@types/astro.js';
import type { ModuleInfo, ModuleLoader } from '../core/module-loader/index.js';
import type { ModuleInfo, ModuleLoader } from '../core/module-loader/loader.js';
import { viteID } from '../core/util.js';
import { getAstroMetadata } from '../vite-plugin-astro/index.js';
import { crawlGraph } from './vite.js';

View file

@ -3,8 +3,8 @@ import type * as vite from 'vite';
import type { AstroSettings, ManifestData, SSRManifest } from '../@types/astro.js';
import { patchOverlay } from '../core/errors/overlay.js';
import type { Logger } from '../core/logger/core.js';
import { createViteLoader } from '../core/module-loader/index.js';
import { createRouteManifest } from '../core/routing/index.js';
import { createViteLoader } from '../core/module-loader/vite.js';
import { createRouteManifest } from '../core/routing/manifest/create.js';
import { baseMiddleware } from './base.js';
import { createController } from './controller.js';
import DevPipeline from './devPipeline.js';

View file

@ -1,4 +1,4 @@
import type { ModuleLoader } from '../core/module-loader/index.js';
import type { ModuleLoader } from '../core/module-loader/loader.js';
import { resolveIdToUrl } from '../core/util.js';
export function createResolve(loader: ModuleLoader, root: URL) {

View file

@ -1,10 +1,10 @@
import type http from 'node:http';
import type { ErrorWithMetadata } from '../core/errors/index.js';
import type { ModuleLoader } from '../core/module-loader/index.js';
import { Readable } from 'stream';
import { getSetCookiesFromResponse } from '../core/cookies/index.js';
import { getSetCookiesFromResponse } from '../core/cookies/response.js';
import { getViteErrorPayload } from '../core/errors/dev/index.js';
import type { ModuleLoader } from '../core/module-loader/loader.js';
import notFoundTemplate from '../template/4xx.js';
export async function handle404Response(

View file

@ -9,9 +9,11 @@ import type {
} from '../@types/astro.js';
import { AstroErrorData, isAstroError } from '../core/errors/index.js';
import { loadMiddleware } from '../core/middleware/loadMiddleware.js';
import { createRenderContext, getParamsAndProps, type SSROptions } from '../core/render/index.js';
import { createRenderContext } from '../core/render/context.js';
import type { SSROptions } from '../core/render/index.js';
import { getParamsAndProps } from '../core/render/params-and-props.js';
import { createRequest } from '../core/request.js';
import { matchAllRoutes } from '../core/routing/index.js';
import { matchAllRoutes } from '../core/routing/match.js';
import { isPage } from '../core/util.js';
import { getSortedPreloadedMatches } from '../prerender/routing.js';
import { isServerLikeOutput } from '../prerender/utils.js';

View file

@ -1,5 +1,5 @@
import type { SSRElement } from '../@types/astro.js';
import type { ModuleInfo, ModuleLoader } from '../core/module-loader/index.js';
import type { ModuleInfo, ModuleLoader } from '../core/module-loader/loader.js';
import { createModuleScriptElementWithSrc } from '../core/render/ssr-element.js';
import { rootRelativePath, viteID } from '../core/util.js';
import type { PluginMetadata as AstroPluginMetadata } from '../vite-plugin-astro/types.js';

View file

@ -1,6 +1,6 @@
import npath from 'node:path';
import { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from '../core/constants.js';
import type { ModuleLoader, ModuleNode } from '../core/module-loader/index.js';
import type { ModuleLoader, ModuleNode } from '../core/module-loader/loader.js';
import { unwrapId } from '../core/util.js';
import { isCSSRequest } from './util.js';

View file

@ -1,6 +1,7 @@
import { transformWithEsbuild, type ESBuildTransformResult } from 'vite';
import type { AstroConfig } from '../@types/astro.js';
import { cachedCompilation, type CompileProps, type CompileResult } from '../core/compile/index.js';
import { cachedCompilation } from '../core/compile/cache.js';
import type { CompileProps, CompileResult } from '../core/compile/compile.js';
import type { Logger } from '../core/logger/core.js';
import { getFileInfo } from '../vite-plugin-utils/index.js';

View file

@ -1,12 +1,8 @@
import { fileURLToPath } from 'node:url';
import type { HmrContext, ModuleNode } from 'vite';
import type { AstroConfig } from '../@types/astro.js';
import {
cachedCompilation,
invalidateCompilation,
isCached,
type CompileResult,
} from '../core/compile/index.js';
import { cachedCompilation, invalidateCompilation, isCached } from '../core/compile/cache.js';
import type { CompileResult } from '../core/compile/compile.js';
import type { Logger } from '../core/logger/core.js';
import * as msg from '../core/messages.js';
import { isAstroScript } from './query.js';

View file

@ -5,11 +5,8 @@ import type { Logger } from '../core/logger/core.js';
import type { PluginMetadata as AstroPluginMetadata } from './types.js';
import { normalizePath } from 'vite';
import {
cachedCompilation,
getCachedCompileResult,
type CompileProps,
} from '../core/compile/index.js';
import { cachedCompilation, getCachedCompileResult } from '../core/compile/cache.js';
import type { CompileProps } from '../core/compile/compile.js';
import { isRelativePath } from '../core/path.js';
import { normalizeFilename } from '../vite-plugin-utils/index.js';
import { cachedFullCompilation } from './compile.js';

View file

@ -1,4 +1,4 @@
import type { ModuleInfo } from '../core/module-loader/index.js';
import type { ModuleInfo } from '../core/module-loader/loader.js';
import type { PluginMetadata } from './types.js';
export function getAstroMetadata(modInfo: ModuleInfo): PluginMetadata['astro'] | undefined {

View file

@ -4,7 +4,7 @@ import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { normalizePath, type Plugin } from 'vite';
import type { AstroSettings } from '../@types/astro.js';
import { getContentPaths, getDotAstroTypeReference } from '../content/index.js';
import { getContentPaths, getDotAstroTypeReference } from '../content/utils.js';
import { type Logger } from '../core/logger/core.js';
export function getEnvTsPath({ srcDir }: { srcDir: URL }) {

View file

@ -5,7 +5,7 @@ import type { Logger } from '../core/logger/core.js';
import type { PluginMetadata } from '../vite-plugin-astro/types.js';
import babel from '@babel/core';
import { CONTENT_FLAG, PROPAGATED_ASSET_FLAG } from '../content/index.js';
import { CONTENT_FLAG, PROPAGATED_ASSET_FLAG } from '../content/consts.js';
import { astroEntryPrefix } from '../core/build/plugins/plugin-component-entry.js';
import { removeQueryString } from '../core/path.js';
import tagExportsPlugin from './tag.js';