Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored and astrobot-houston committed Jun 19, 2024
1 parent ea987d7 commit c44f7f4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/astro/src/container/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
10 changes: 5 additions & 5 deletions packages/astro/src/core/build/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand All @@ -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.
Expand Down Expand Up @@ -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)!;
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/routing/rewrite.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
8 changes: 4 additions & 4 deletions packages/astro/src/vite-plugin-astro-server/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions packages/astro/test/rewrite.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
});
Expand Down

0 comments on commit c44f7f4

Please sign in to comment.