* 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:
parent
cc740fb103
commit
ed39fbf168
4 changed files with 18 additions and 17 deletions
5
.changeset/olive-moles-tan.md
Normal file
5
.changeset/olive-moles-tan.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@astrojs/deno': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
TypeScript users now get better suggestions when configuring the Deno adapter.
|
|
@ -3,17 +3,7 @@ import esbuild from 'esbuild';
|
||||||
import * as fs from 'node:fs';
|
import * as fs from 'node:fs';
|
||||||
import * as npath from 'node:path';
|
import * as npath from 'node:path';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
|
import type { BuildConfig, Options } from './types';
|
||||||
interface BuildConfig {
|
|
||||||
server: URL;
|
|
||||||
serverEntry: string;
|
|
||||||
assets: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Options {
|
|
||||||
port?: number;
|
|
||||||
hostname?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const SHIM = `globalThis.process = {
|
const SHIM = `globalThis.process = {
|
||||||
argv: [],
|
argv: [],
|
||||||
|
|
|
@ -1,16 +1,11 @@
|
||||||
// Normal Imports
|
// Normal Imports
|
||||||
import type { SSRManifest } from 'astro';
|
import type { SSRManifest } from 'astro';
|
||||||
import { App } from 'astro/app';
|
import { App } from 'astro/app';
|
||||||
|
import type { Options } from './types';
|
||||||
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
import { fromFileUrl, serveFile, Server } from '@astrojs/deno/__deno_imports.js';
|
import { fromFileUrl, serveFile, Server } from '@astrojs/deno/__deno_imports.js';
|
||||||
|
|
||||||
interface Options {
|
|
||||||
port?: number;
|
|
||||||
hostname?: string;
|
|
||||||
start?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
let _server: Server | undefined = undefined;
|
let _server: Server | undefined = undefined;
|
||||||
let _startPromise: Promise<void> | undefined = undefined;
|
let _startPromise: Promise<void> | undefined = undefined;
|
||||||
|
|
||||||
|
|
11
packages/integrations/deno/src/types.ts
Normal file
11
packages/integrations/deno/src/types.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
export interface Options {
|
||||||
|
port?: number;
|
||||||
|
hostname?: string;
|
||||||
|
start?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BuildConfig {
|
||||||
|
server: URL;
|
||||||
|
serverEntry: string;
|
||||||
|
assets: string;
|
||||||
|
}
|
Loading…
Reference in a new issue