mirror of
https://github.com/withastro/astro.git
synced 2025-02-17 22:44:24 -05:00
[ci] format
This commit is contained in:
parent
fe3afebd65
commit
a637169668
5 changed files with 15 additions and 19 deletions
|
@ -27,12 +27,12 @@ import type { Logger } from '../logger/core.js';
|
|||
import { levels, timerMessage } from '../logger/core.js';
|
||||
import { apply as applyPolyfill } from '../polyfill.js';
|
||||
import { createRouteManifest } from '../routing/index.js';
|
||||
import { getServerIslandRouteData } from '../server-islands/endpoint.js';
|
||||
import { ensureProcessNodeEnv, isServerLikeOutput } from '../util.js';
|
||||
import { collectPagesData } from './page-data.js';
|
||||
import { staticBuild, viteBuild } from './static-build.js';
|
||||
import type { StaticBuildOptions } from './types.js';
|
||||
import { getTimeStat } from './util.js';
|
||||
import { getServerIslandRouteData } from '../server-islands/endpoint.js';
|
||||
|
||||
export interface BuildOptions {
|
||||
/**
|
||||
|
@ -217,9 +217,11 @@ class AstroBuilder {
|
|||
pages: pageNames,
|
||||
routes: Object.values(allPages)
|
||||
.flat()
|
||||
.map((pageData) => pageData.route).concat(
|
||||
this.settings.config.experimental.serverIslands ?
|
||||
[ getServerIslandRouteData(this.settings.config) ] : []
|
||||
.map((pageData) => pageData.route)
|
||||
.concat(
|
||||
this.settings.config.experimental.serverIslands
|
||||
? [getServerIslandRouteData(this.settings.config)]
|
||||
: []
|
||||
),
|
||||
logging: this.logger,
|
||||
cacheManifest: internals.cacheManifestUsed,
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
import type {
|
||||
AstroConfig,
|
||||
RoutePart,
|
||||
} from '../../../@types/astro.js';
|
||||
import type { AstroConfig, RoutePart } from '../../../@types/astro.js';
|
||||
|
||||
export function getPattern(
|
||||
segments: RoutePart[][],
|
||||
|
|
|
@ -38,8 +38,6 @@ export function getServerIslandRouteData(config: ConfigFields) {
|
|||
return route;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function ensureServerIslandRoute(config: ConfigFields, routeManifest: ManifestData) {
|
||||
if (routeManifest.routes.some((route) => route.route === '/_server-islands/[name]')) {
|
||||
return;
|
||||
|
|
|
@ -35,7 +35,8 @@ export default function createVitePluginAstroServer({
|
|||
configureServer(viteServer) {
|
||||
const loader = createViteLoader(viteServer);
|
||||
const manifest = createDevelopmentManifest(settings);
|
||||
let manifestData: ManifestData = injectDefaultRoutes(manifest,
|
||||
let manifestData: ManifestData = injectDefaultRoutes(
|
||||
manifest,
|
||||
createRouteManifest({ settings, fsMod }, logger)
|
||||
);
|
||||
const pipeline = DevPipeline.create(manifestData, { loader, logger, manifest, settings });
|
||||
|
|
|
@ -14,15 +14,13 @@ describe('Server Islands', () => {
|
|||
});
|
||||
|
||||
it('server islands route is in the config', async () => {
|
||||
const config = JSON.parse(
|
||||
await fixture.readFile('../.vercel/output/config.json')
|
||||
);
|
||||
const config = JSON.parse(await fixture.readFile('../.vercel/output/config.json'));
|
||||
let found = null;
|
||||
for(let route of config.routes) {
|
||||
if(route.src?.includes('_server-islands')) {
|
||||
found = route;
|
||||
break;
|
||||
}
|
||||
for (let route of config.routes) {
|
||||
if (route.src?.includes('_server-islands')) {
|
||||
found = route;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert.notEqual(found, null, 'Default server islands route included');
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue