Skip to content

Commit

Permalink
fix(deno): add start to options interface and extract to new file (close
Browse files Browse the repository at this point in the history
 #8221) (#8245)

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

* Reword changeset

---------

Co-authored-by: Arsh <[email protected]>
  • Loading branch information
florian-lefebvre and lilnasy committed Aug 27, 2023
1 parent cc740fb commit ed39fbf
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/olive-moles-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/deno': patch
---

TypeScript users now get better suggestions when configuring the Deno adapter.
12 changes: 1 addition & 11 deletions packages/integrations/deno/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down
7 changes: 1 addition & 6 deletions packages/integrations/deno/src/server.ts
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
11 changes: 11 additions & 0 deletions packages/integrations/deno/src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export interface Options {
port?: number;
hostname?: string;
start?: boolean;
}

export interface BuildConfig {
server: URL;
serverEntry: string;
assets: string;
}

0 comments on commit ed39fbf

Please sign in to comment.