mirror of
https://github.com/withastro/astro.git
synced 2025-03-24 23:21:57 -05:00
[ci] format
This commit is contained in:
parent
143bacf396
commit
8a51afdf50
18 changed files with 32 additions and 31 deletions
|
@ -6,10 +6,12 @@ import type {
|
|||
SSRElement,
|
||||
SSRManifest,
|
||||
} from '../../@types/astro.js';
|
||||
import { createI18nMiddleware } from '../../i18n/middleware.js';
|
||||
import type { SinglePageBuiltModule } from '../build/types.js';
|
||||
import { getSetCookiesFromResponse } from '../cookies/index.js';
|
||||
import { consoleLogDestination } from '../logger/console.js';
|
||||
import { AstroIntegrationLogger, Logger } from '../logger/core.js';
|
||||
import { sequence } from '../middleware/index.js';
|
||||
import {
|
||||
collapseDuplicateSlashes,
|
||||
prependForwardSlash,
|
||||
|
@ -26,8 +28,6 @@ import {
|
|||
import { matchRoute } from '../routing/match.js';
|
||||
import { EndpointNotFoundError, SSRRoutePipeline } from './ssrPipeline.js';
|
||||
import type { RouteInfo } from './types.js';
|
||||
import { createI18nMiddleware } from '../../i18n/middleware.js';
|
||||
import { sequence } from '../middleware/index.js';
|
||||
export { deserializeManifest } from './common.js';
|
||||
|
||||
const clientLocalsSymbol = Symbol.for('astro.locals');
|
||||
|
|
|
@ -4,6 +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 { routeIsFallback, routeIsRedirect } from '../redirects/helpers.js';
|
||||
import { createEnvironment } from '../render/index.js';
|
||||
import { createAssetLink } from '../render/ssr-element.js';
|
||||
import type { BuildInternals } from './internal.js';
|
||||
|
@ -11,7 +12,6 @@ import { ASTRO_PAGE_RESOLVED_MODULE_ID } from './plugins/plugin-pages.js';
|
|||
import { RESOLVED_SPLIT_MODULE_ID } from './plugins/plugin-ssr.js';
|
||||
import { ASTRO_PAGE_EXTENSION_POST_PATTERN } from './plugins/util.js';
|
||||
import type { PageBuildData, StaticBuildOptions } from './types.js';
|
||||
import { routeIsFallback, routeIsRedirect } from '../redirects/helpers.js';
|
||||
import { i18nHasFallback } from './util.js';
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,10 +30,14 @@ import {
|
|||
removeLeadingForwardSlash,
|
||||
removeTrailingForwardSlash,
|
||||
} from '../../core/path.js';
|
||||
import { createI18nMiddleware } from '../../i18n/middleware.js';
|
||||
import { runHookBuildGenerated } from '../../integrations/index.js';
|
||||
import { getOutputDirectory, isServerLikeOutput } from '../../prerender/utils.js';
|
||||
import { PAGE_SCRIPT_ID } from '../../vite-plugin-scripts/index.js';
|
||||
import type { SSRManifestI18n } from '../app/types.js';
|
||||
import { AstroError, AstroErrorData } from '../errors/index.js';
|
||||
import { sequence } from '../middleware/index.js';
|
||||
import { routeIsFallback } from '../redirects/helpers.js';
|
||||
import {
|
||||
RedirectSinglePageBuiltModule,
|
||||
getRedirectLocationOrThrow,
|
||||
|
@ -64,10 +68,6 @@ import type {
|
|||
StylesheetAsset,
|
||||
} from './types.js';
|
||||
import { getTimeStat, shouldAppendForwardSlash } from './util.js';
|
||||
import { createI18nMiddleware } from '../../i18n/middleware.js';
|
||||
import { sequence } from '../middleware/index.js';
|
||||
import { routeIsFallback } from '../redirects/helpers.js';
|
||||
import type { SSRManifestI18n } from '../app/types.js';
|
||||
|
||||
function createEntryURL(filePath: string, outFolder: URL) {
|
||||
return new URL('./' + filePath + `?time=${Date.now()}`, outFolder);
|
||||
|
|
|
@ -2,6 +2,7 @@ import type { Rollup } from 'vite';
|
|||
import type { RouteData, SSRResult } from '../../@types/astro.js';
|
||||
import type { PageOptions } from '../../vite-plugin-astro/types.js';
|
||||
import { prependForwardSlash, removeFileExtension } from '../path.js';
|
||||
import { routeIsFallback } from '../redirects/helpers.js';
|
||||
import { viteID } from '../util.js';
|
||||
import {
|
||||
ASTRO_PAGE_RESOLVED_MODULE_ID,
|
||||
|
@ -10,7 +11,6 @@ import {
|
|||
import { RESOLVED_SPLIT_MODULE_ID } from './plugins/plugin-ssr.js';
|
||||
import { ASTRO_PAGE_EXTENSION_POST_PATTERN } from './plugins/util.js';
|
||||
import type { AllPagesData, PageBuildData, StylesheetAsset, ViteID } from './types.js';
|
||||
import { routeIsFallback } from '../redirects/helpers.js';
|
||||
|
||||
export interface BuildInternals {
|
||||
/**
|
||||
|
|
|
@ -4,7 +4,6 @@ import type { AllPagesData } from './types.js';
|
|||
|
||||
import * as colors from 'kleur/colors';
|
||||
import { debug } from '../logger/core.js';
|
||||
import { eachPageFromAllPages } from './internal.js';
|
||||
|
||||
export interface CollectPagesDataOptions {
|
||||
settings: AstroSettings;
|
||||
|
|
|
@ -4,13 +4,16 @@ import type { OutputChunk } from 'rollup';
|
|||
import { type Plugin as VitePlugin } from 'vite';
|
||||
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 type { SSRManifestI18n } from '../../app/types.js';
|
||||
import type {
|
||||
SSRManifestI18n,
|
||||
SerializedRouteInfo,
|
||||
SerializedSSRManifest,
|
||||
} from '../../app/types.js';
|
||||
import { joinPaths, prependForwardSlash } from '../../path.js';
|
||||
import { serializeRouteData } from '../../routing/index.js';
|
||||
import { addRollupInput } from '../add-rollup-input.js';
|
||||
import { getOutFile, getOutFolder } from '../common.js';
|
||||
import { type BuildInternals, cssOrder, mergeInlineCss } from '../internal.js';
|
||||
import { cssOrder, mergeInlineCss, type BuildInternals } from '../internal.js';
|
||||
import type { AstroBuildPlugin } from '../plugin.js';
|
||||
import type { StaticBuildOptions } from '../types.js';
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import type { Plugin as VitePlugin } from 'vite';
|
|||
import type { AstroSettings } from '../../../@types/astro.js';
|
||||
import { routeIsRedirect } from '../../redirects/index.js';
|
||||
import { addRollupInput } from '../add-rollup-input.js';
|
||||
import { type BuildInternals, eachPageFromAllPages } from '../internal.js';
|
||||
import { eachPageFromAllPages, type BuildInternals } from '../internal.js';
|
||||
import type { AstroBuildPlugin } from '../plugin.js';
|
||||
import type { StaticBuildOptions } from '../types.js';
|
||||
import { MIDDLEWARE_MODULE_ID } from './plugin-middleware.js';
|
||||
|
|
|
@ -7,13 +7,13 @@ import { isServerLikeOutput } from '../../../prerender/utils.js';
|
|||
import { routeIsRedirect } from '../../redirects/index.js';
|
||||
import { addRollupInput } from '../add-rollup-input.js';
|
||||
import type { BuildInternals } from '../internal.js';
|
||||
import { eachPageFromAllPages } from '../internal.js';
|
||||
import type { AstroBuildPlugin } from '../plugin.js';
|
||||
import type { StaticBuildOptions } from '../types.js';
|
||||
import { SSR_MANIFEST_VIRTUAL_MODULE_ID } from './plugin-manifest.js';
|
||||
import { ASTRO_PAGE_MODULE_ID } from './plugin-pages.js';
|
||||
import { RENDERERS_MODULE_ID } from './plugin-renderers.js';
|
||||
import { getPathFromVirtualModulePageName, getVirtualModulePageNameFromPath } from './util.js';
|
||||
import { eachPageFromAllPages } from '../internal.js';
|
||||
|
||||
export const SSR_VIRTUAL_MODULE_ID = '@astrojs-ssr-virtual-entry';
|
||||
export const RESOLVED_SSR_VIRTUAL_MODULE_ID = '\0' + SSR_VIRTUAL_MODULE_ID;
|
||||
|
|
|
@ -11,6 +11,7 @@ import {
|
|||
astroContentImportPlugin,
|
||||
astroContentVirtualModPlugin,
|
||||
} from '../content/index.js';
|
||||
import astroInternationalization from '../i18n/vite-plugin-i18n.js';
|
||||
import astroPrefetch from '../prefetch/vite-plugin-prefetch.js';
|
||||
import astroTransitions from '../transitions/vite-plugin-transitions.js';
|
||||
import astroPostprocessVitePlugin from '../vite-plugin-astro-postprocess/index.js';
|
||||
|
@ -31,7 +32,6 @@ import astroScriptsPlugin from '../vite-plugin-scripts/index.js';
|
|||
import astroScriptsPageSSRPlugin from '../vite-plugin-scripts/page-ssr.js';
|
||||
import { vitePluginSSRManifest } from '../vite-plugin-ssr-manifest/index.js';
|
||||
import { joinPaths } from './path.js';
|
||||
import astroInternationalization from '../i18n/vite-plugin-i18n.js';
|
||||
|
||||
interface CreateViteOptions {
|
||||
settings: AstroSettings;
|
||||
|
|
|
@ -12,8 +12,8 @@ import { ASTRO_VERSION } from '../constants.js';
|
|||
import { AstroCookies, attachCookiesToResponse } from '../cookies/index.js';
|
||||
import { AstroError, AstroErrorData } from '../errors/index.js';
|
||||
import { callMiddleware } from '../middleware/callMiddleware.js';
|
||||
import { type Environment, type RenderContext } from '../render/index.js';
|
||||
import { computePreferredLocale, computePreferredLocaleList } from '../render/context.js';
|
||||
import { type Environment, type RenderContext } from '../render/index.js';
|
||||
|
||||
const encoder = new TextEncoder();
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@ import type {
|
|||
SSRElement,
|
||||
SSRResult,
|
||||
} from '../../@types/astro.js';
|
||||
import { normalizeTheLocale } from '../../i18n/index.js';
|
||||
import { AstroError, AstroErrorData } from '../errors/index.js';
|
||||
import type { Environment } from './environment.js';
|
||||
import { getParamsAndProps } from './params-and-props.js';
|
||||
import { normalizeTheLocale } from '../../i18n/index.js';
|
||||
|
||||
const clientLocalsSymbol = Symbol.for('astro.locals');
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import type { AstroCookies, ComponentInstance } from '../../@types/astro.js';
|
||||
import { renderPage as runtimeRenderPage } from '../../runtime/server/index.js';
|
||||
import { attachCookiesToResponse } from '../cookies/index.js';
|
||||
import { CantRenderPage } from '../errors/errors-data.js';
|
||||
import { AstroError } from '../errors/index.js';
|
||||
import { routeIsFallback } from '../redirects/helpers.js';
|
||||
import { redirectRouteGenerate, redirectRouteStatus, routeIsRedirect } from '../redirects/index.js';
|
||||
import type { RenderContext } from './context.js';
|
||||
import type { Environment } from './environment.js';
|
||||
import { createResult } from './result.js';
|
||||
import { AstroError } from '../errors/index.js';
|
||||
import { CantRenderPage } from '../errors/errors-data.js';
|
||||
import { routeIsFallback } from '../redirects/helpers.js';
|
||||
|
||||
export type RenderPage = {
|
||||
mod: ComponentInstance | undefined;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { AstroMiddlewareInstance, ComponentInstance, RouteData } from '../../@types/astro.js';
|
||||
import type { Environment } from './environment.js';
|
||||
export { createRenderContext, computePreferredLocale } from './context.js';
|
||||
export { computePreferredLocale, createRenderContext } from './context.js';
|
||||
export type { RenderContext } from './context.js';
|
||||
export { createEnvironment } from './environment.js';
|
||||
export { getParamsAndProps } from './params-and-props.js';
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
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 { routeIsFallback } from '../redirects/helpers.js';
|
||||
import { routeIsRedirect } from '../redirects/index.js';
|
||||
import { getParams } from '../routing/params.js';
|
||||
import { RouteCache, callGetStaticPaths, findPathItemByKey } from './route-cache.js';
|
||||
import { routeIsFallback } from '../redirects/helpers.js';
|
||||
|
||||
interface GetParamsAndPropsOptions {
|
||||
mod: ComponentInstance | undefined;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { AstroError } from '../core/errors/index.js';
|
||||
import { MissingLocale } from '../core/errors/errors-data.js';
|
||||
import { shouldAppendForwardSlash } from '../core/build/util.js';
|
||||
import type { AstroConfig } from '../@types/astro.js';
|
||||
import { appendForwardSlash, joinPaths } from '@astrojs/internal-helpers/path';
|
||||
import type { AstroConfig } from '../@types/astro.js';
|
||||
import { shouldAppendForwardSlash } from '../core/build/util.js';
|
||||
import { MissingLocale } from '../core/errors/errors-data.js';
|
||||
import { AstroError } from '../core/errors/index.js';
|
||||
|
||||
type GetLocaleRelativeUrl = GetLocaleOptions & {
|
||||
locale: string;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import type { MiddlewareEndpointHandler } from '../@types/astro.js';
|
||||
import type { SSRManifest } from '../@types/astro.js';
|
||||
import { joinPaths } from '@astrojs/internal-helpers/path';
|
||||
import type { MiddlewareEndpointHandler, SSRManifest } from '../@types/astro.js';
|
||||
|
||||
// Checks if the pathname doesn't have any locale, exception for the defaultLocale, which is ignored on purpose
|
||||
function checkIsLocaleFree(pathname: string, locales: string[]): boolean {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import type fs from 'node:fs';
|
||||
import type * as vite from 'vite';
|
||||
import type { AstroSettings, ManifestData, SSRManifest } from '../@types/astro.js';
|
||||
import type { SSRManifestI18n } from '../core/app/types.js';
|
||||
import { patchOverlay } from '../core/errors/overlay.js';
|
||||
import type { Logger } from '../core/logger/core.js';
|
||||
import { createViteLoader } from '../core/module-loader/index.js';
|
||||
|
@ -9,7 +10,6 @@ import { baseMiddleware } from './base.js';
|
|||
import { createController } from './controller.js';
|
||||
import DevPipeline from './devPipeline.js';
|
||||
import { handleRequest } from './request.js';
|
||||
import type { SSRManifestI18n } from '../core/app/types.js';
|
||||
|
||||
export interface AstroPluginOptions {
|
||||
settings: AstroSettings;
|
||||
|
|
|
@ -9,6 +9,7 @@ import type {
|
|||
SSRManifest,
|
||||
} from '../@types/astro.js';
|
||||
import { AstroErrorData, isAstroError } from '../core/errors/index.js';
|
||||
import { sequence } from '../core/middleware/index.js';
|
||||
import { loadMiddleware } from '../core/middleware/loadMiddleware.js';
|
||||
import {
|
||||
createRenderContext,
|
||||
|
@ -19,6 +20,7 @@ import {
|
|||
import { createRequest } from '../core/request.js';
|
||||
import { matchAllRoutes } from '../core/routing/index.js';
|
||||
import { isPage, resolveIdToUrl } from '../core/util.js';
|
||||
import { createI18nMiddleware } from '../i18n/middleware.js';
|
||||
import { getSortedPreloadedMatches } from '../prerender/routing.js';
|
||||
import { isServerLikeOutput } from '../prerender/utils.js';
|
||||
import { PAGE_SCRIPT_ID } from '../vite-plugin-scripts/index.js';
|
||||
|
@ -29,8 +31,6 @@ import { preload } from './index.js';
|
|||
import { getComponentMetadata } from './metadata.js';
|
||||
import { handle404Response, writeSSRResult, writeWebResponse } from './response.js';
|
||||
import { getScriptsForURL } from './scripts.js';
|
||||
import { createI18nMiddleware } from '../i18n/middleware.js';
|
||||
import { sequence } from '../core/middleware/index.js';
|
||||
|
||||
const clientLocalsSymbol = Symbol.for('astro.locals');
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue