mirror of
https://github.com/withastro/astro.git
synced 2025-03-31 23:31:30 -05:00
[ci] format
This commit is contained in:
parent
ea987d7da5
commit
c44f7f4bab
5 changed files with 12 additions and 13 deletions
|
@ -14,7 +14,7 @@ import {
|
|||
createStylesheetElementSet,
|
||||
} from '../core/render/ssr-element.js';
|
||||
import { DEFAULT_404_ROUTE } from '../core/routing/astro-designed-error-pages.js';
|
||||
import {findRouteToRewrite} from "../core/routing/rewrite.js";
|
||||
import { findRouteToRewrite } from '../core/routing/rewrite.js';
|
||||
|
||||
export class ContainerPipeline extends Pipeline {
|
||||
/**
|
||||
|
|
|
@ -8,6 +8,7 @@ import type {
|
|||
import { getOutputDirectory } from '../../prerender/utils.js';
|
||||
import { BEFORE_HYDRATION_SCRIPT_ID, PAGE_SCRIPT_ID } from '../../vite-plugin-scripts/index.js';
|
||||
import type { SSRManifest } from '../app/types.js';
|
||||
import { DEFAULT_404_COMPONENT } from '../constants.js';
|
||||
import { routeIsFallback, routeIsRedirect } from '../redirects/helpers.js';
|
||||
import { RedirectSinglePageBuiltModule } from '../redirects/index.js';
|
||||
import { Pipeline } from '../render/index.js';
|
||||
|
@ -16,6 +17,8 @@ import {
|
|||
createModuleScriptsSet,
|
||||
createStylesheetElementSet,
|
||||
} from '../render/ssr-element.js';
|
||||
import { default404Page } from '../routing/astro-designed-error-pages.js';
|
||||
import { findRouteToRewrite } from '../routing/rewrite.js';
|
||||
import { isServerLikeOutput } from '../util.js';
|
||||
import { getOutDirWithinCwd } from './common.js';
|
||||
import { type BuildInternals, cssOrder, getPageData, mergeInlineCss } from './internal.js';
|
||||
|
@ -24,9 +27,6 @@ import { RESOLVED_SPLIT_MODULE_ID } from './plugins/plugin-ssr.js';
|
|||
import { getPagesFromVirtualModulePageName, getVirtualModulePageName } from './plugins/util.js';
|
||||
import type { PageBuildData, SinglePageBuiltModule, StaticBuildOptions } from './types.js';
|
||||
import { i18nHasFallback } from './util.js';
|
||||
import { findRouteToRewrite } from '../routing/rewrite.js';
|
||||
import {DEFAULT_404_COMPONENT} from "../constants.js";
|
||||
import {default404Page} from "../routing/astro-designed-error-pages.js";
|
||||
|
||||
/**
|
||||
* The build pipeline is responsible to gather the files emitted by the SSR build and generate the pages by executing these files.
|
||||
|
@ -270,7 +270,7 @@ export class BuildPipeline extends Pipeline {
|
|||
const entry = this.#componentsInterner.get(routeData)!;
|
||||
return await entry.page();
|
||||
} else if (routeData.component === DEFAULT_404_COMPONENT) {
|
||||
return { default: default404Page }
|
||||
return { default: default404Page };
|
||||
} else {
|
||||
// SAFETY: the pipeline calls `retrieveRoutesToGenerate`, which is in charge to fill the cache.
|
||||
const filePath = this.#routesByFilePath.get(routeData)!;
|
||||
|
@ -290,7 +290,7 @@ export class BuildPipeline extends Pipeline {
|
|||
routes: this.options.manifest.routes,
|
||||
trailingSlash: this.config.trailingSlash,
|
||||
buildFormat: this.config.build.format,
|
||||
base: this.config.base
|
||||
base: this.config.base,
|
||||
});
|
||||
|
||||
const componentInstance = await this.getComponentByRoute(foundRoute);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { AstroConfig, RewritePayload, RouteData } from '../../@types/astro.js';
|
||||
import { shouldAppendForwardSlash } from '../build/util.js';
|
||||
import { DEFAULT_404_ROUTE } from './astro-designed-error-pages.js';
|
||||
import { appendForwardSlash, removeTrailingForwardSlash } from '../path.js';
|
||||
import { DEFAULT_404_ROUTE } from './astro-designed-error-pages.js';
|
||||
|
||||
export type FindRouteToRewrite = {
|
||||
payload: RewritePayload;
|
||||
|
|
|
@ -12,23 +12,23 @@ import type {
|
|||
} from '../@types/astro.js';
|
||||
import { getInfoOutput } from '../cli/info/index.js';
|
||||
import { type HeadElements } from '../core/base-pipeline.js';
|
||||
import { shouldAppendForwardSlash } from '../core/build/util.js';
|
||||
import { ASTRO_VERSION, DEFAULT_404_COMPONENT } from '../core/constants.js';
|
||||
import { enhanceViteSSRError } from '../core/errors/dev/index.js';
|
||||
import { RewriteEncounteredAnError } from '../core/errors/errors-data.js';
|
||||
import { AggregateError, AstroError, CSSError, MarkdownError } from '../core/errors/index.js';
|
||||
import type { Logger } from '../core/logger/core.js';
|
||||
import type { ModuleLoader } from '../core/module-loader/index.js';
|
||||
import { prependForwardSlash, removeTrailingForwardSlash } from '../core/path.js';
|
||||
import { Pipeline, loadRenderer } from '../core/render/index.js';
|
||||
import { DEFAULT_404_ROUTE, default404Page } from '../core/routing/astro-designed-error-pages.js';
|
||||
import { findRouteToRewrite } from '../core/routing/rewrite.js';
|
||||
import { isPage, isServerLikeOutput, resolveIdToUrl, viteID } from '../core/util.js';
|
||||
import { PAGE_SCRIPT_ID } from '../vite-plugin-scripts/index.js';
|
||||
import { getStylesForURL } from './css.js';
|
||||
import { getComponentMetadata } from './metadata.js';
|
||||
import { createResolve } from './resolve.js';
|
||||
import { getScriptsForURL } from './scripts.js';
|
||||
import { shouldAppendForwardSlash } from '../core/build/util.js';
|
||||
import { prependForwardSlash, removeTrailingForwardSlash } from '../core/path.js';
|
||||
import { findRouteToRewrite } from '../core/routing/rewrite.js';
|
||||
|
||||
export class DevPipeline extends Pipeline {
|
||||
// renderers are loaded on every request,
|
||||
|
@ -208,7 +208,7 @@ export class DevPipeline extends Pipeline {
|
|||
routes: this.manifestData?.routes,
|
||||
trailingSlash: this.config.trailingSlash,
|
||||
buildFormat: this.config.build.format,
|
||||
base: this.config.base
|
||||
base: this.config.base,
|
||||
});
|
||||
|
||||
const componentInstance = await this.getComponentByRoute(foundRoute);
|
||||
|
|
|
@ -86,7 +86,6 @@ describe('Dev rewrite, trailing slash -> never', () => {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
describe('Dev rewrite, trailing slash -> never, with base', () => {
|
||||
/** @type {import('./test-utils').Fixture} */
|
||||
let fixture;
|
||||
|
@ -95,7 +94,7 @@ describe('Dev rewrite, trailing slash -> never, with base', () => {
|
|||
before(async () => {
|
||||
fixture = await loadFixture({
|
||||
root: './fixtures/rewrite-trailing-slash-never/',
|
||||
base: "base",
|
||||
base: 'base',
|
||||
});
|
||||
devServer = await fixture.startDevServer();
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue