fix(deno): add start to options interface and extract to new file (close #8221) (#8245)

* fix(deno): add start to options and extract to new file

* Reword changeset

---------

Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
This commit is contained in:
Florian Lefebvre 2023-08-27 23:21:28 +02:00 committed by GitHub
parent cc740fb103
commit ed39fbf168
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 17 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/deno': patch
---
TypeScript users now get better suggestions when configuring the Deno adapter.

View file

@ -3,17 +3,7 @@ import esbuild from 'esbuild';
import * as fs from 'node:fs';
import * as npath from 'node:path';
import { fileURLToPath } from 'node:url';
interface BuildConfig {
server: URL;
serverEntry: string;
assets: string;
}
interface Options {
port?: number;
hostname?: string;
}
import type { BuildConfig, Options } from './types';
const SHIM = `globalThis.process = {
argv: [],

View file

@ -1,16 +1,11 @@
// Normal Imports
import type { SSRManifest } from 'astro';
import { App } from 'astro/app';
import type { Options } from './types';
// @ts-expect-error
import { fromFileUrl, serveFile, Server } from '@astrojs/deno/__deno_imports.js';
interface Options {
port?: number;
hostname?: string;
start?: boolean;
}
let _server: Server | undefined = undefined;
let _startPromise: Promise<void> | undefined = undefined;

View file

@ -0,0 +1,11 @@
export interface Options {
port?: number;
hostname?: string;
start?: boolean;
}
export interface BuildConfig {
server: URL;
serverEntry: string;
assets: string;
}