[ci] format

This commit is contained in:
natemoo-re 2023-02-16 15:18:31 +00:00 committed by fredkbot
parent ef5cea4dc5
commit 241c178354
5 changed files with 12 additions and 10 deletions

View file

@ -62,12 +62,16 @@ export { _default as default };`;
: ''
}
export const adapter = _adapter
${adapter.name !== '@astrojs/deno' ? `
${
adapter.name !== '@astrojs/deno'
? `
const _start = 'start';
if(_start in _adapter) {
_adapter[_start](_manifest, _args);
}`: ''}`;
}
}`
: ''
}`;
}
return void 0;
},
async generateBundle(_opts, bundle) {

View file

@ -1,2 +1,2 @@
export const DEFAULTIMPORT = `import { Server } from "https://deno.land/std@0.167.0/http/server.ts"; \n import { fetch } from "https://deno.land/x/file_fetch/mod.ts";\nimport { fileExtension } from "https://deno.land/x/file_extension@v2.1.0/mod.ts";`
export const DEFAULTSTART = `const _start = 'start'; \n if(_start in adapter) { \nadapter[_start](_manifest, _args);}`
export const DEFAULTIMPORT = `import { Server } from "https://deno.land/std@0.167.0/http/server.ts"; \n import { fetch } from "https://deno.land/x/file_fetch/mod.ts";\nimport { fileExtension } from "https://deno.land/x/file_extension@v2.1.0/mod.ts";`;
export const DEFAULTSTART = `const _start = 'start'; \n if(_start in adapter) { \nadapter[_start](_manifest, _args);}`;

View file

@ -3,7 +3,7 @@ import esbuild from 'esbuild';
import * as fs from 'fs';
import * as npath from 'path';
import { fileURLToPath } from 'url';
import * as CONSTANT from './code-constant'
import * as CONSTANT from './code-constant';
interface BuildConfig {
server: URL;
@ -71,7 +71,7 @@ export default function createIntegration(args?: Options): AstroIntegration {
'astro:build:done': async () => {
const entryUrl = new URL(_buildConfig.serverEntry, _buildConfig.server);
const pth = fileURLToPath(entryUrl);
const content = await fs.readFileSync(pth, 'utf8')
const content = await fs.readFileSync(pth, 'utf8');
await fs.writeFileSync(pth, `${CONSTANT.DEFAULTIMPORT}${content}${CONSTANT.DEFAULTSTART}`);
await esbuild.build({
target: 'es2020',

View file

@ -2,7 +2,6 @@
import type { SSRManifest } from 'astro';
import { App } from 'astro/app';
interface Options {
port?: number;
hostname?: string;
@ -49,7 +48,7 @@ export function start(manifest: SSRManifest, options: Options) {
}`
: stringLocalPath
);
// If the static file can't be found
if (fileResp.status == 404) {
// Render the astro custom 404 page

View file

@ -152,7 +152,6 @@ Deno.test({
const resp = await fetch(new URL('perendering', baseUrl));
assertEquals(resp.status, 200);
const html = await resp.text();
assert(html);