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 Jul 18, 2024
1 parent fe3afeb commit a637169
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 19 deletions.
10 changes: 6 additions & 4 deletions packages/astro/src/core/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 1 addition & 4 deletions packages/astro/src/core/routing/manifest/pattern.ts
Original file line number Diff line number Diff line change
@@ -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[][],
Expand Down
2 changes: 0 additions & 2 deletions packages/astro/src/core/server-islands/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion packages/astro/src/vite-plugin-astro-server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
14 changes: 6 additions & 8 deletions packages/integrations/vercel/test/server-islands.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Expand Down

0 comments on commit a637169

Please sign in to comment.