Skip to content

Commit d0cd496

Browse files
authored
chore: fix watch mode for deno 1.8, release 0.10.5 (#68)
1 parent 22bae6a commit d0cd496

File tree

6 files changed

+22
-15
lines changed

6 files changed

+22
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To install, run the following command. This will make the `dext` CLI available
1919
in your path.
2020

2121
```
22-
deno install --allow-read --allow-write --allow-env --allow-net --allow-run --unstable -f -n dext https://deno.land/x/dext@0.10.4/cli.ts
22+
deno install --allow-read --allow-write --allow-env --allow-net --allow-run --unstable -f -n dext https://deno.land/x/dext@0.10.5/cli.ts
2323
```
2424

2525
## Getting started

cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { exportCommand } from "./src/export.ts";
1616
import { serve } from "./src/serve.ts";
1717
import { findPages, printError } from "./src/util.ts";
1818

19-
const VERSION = "0.10.4";
19+
const VERSION = "0.10.5";
2020

2121
try {
2222
await new Command()

example/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
FROM hayd/alpine-deno:1.7.5 as builder
22
WORKDIR /app
3-
RUN deno cache --unstable https://deno.land/x/dext@0.10.4/cli.ts
3+
RUN deno cache --unstable https://deno.land/x/dext@0.10.5/cli.ts
44
COPY deps.ts deps.ts
55
COPY tsconfig.json tsconfig.json
66
RUN deno cache -c tsconfig.json deps.ts
77
COPY . .
8-
RUN deno run --allow-read --allow-write --allow-env --allow-net --allow-run --unstable https://deno.land/x/dext@0.10.4/cli.ts build
8+
RUN deno run --allow-read --allow-write --allow-env --allow-net --allow-run --unstable https://deno.land/x/dext@0.10.5/cli.ts build
99

1010
FROM hayd/alpine-deno:1.7.5
1111
WORKDIR /app
12-
RUN deno cache --unstable https://deno.land/x/dext@0.10.4/cli.ts
12+
RUN deno cache --unstable https://deno.land/x/dext@0.10.5/cli.ts
1313
COPY --from=builder /app/.dext /app/.dext
14-
CMD [ "deno", "run", "--allow-read", "--allow-net", "--allow-env", "--unstable", "https://deno.land/x/dext@0.10.4/cli.ts", "start" ]
14+
CMD [ "deno", "run", "--allow-read", "--allow-net", "--allow-env", "--unstable", "https://deno.land/x/dext@0.10.5/cli.ts", "start" ]

example/deps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export type {
88
GetStaticDataContext,
99
GetStaticPaths,
1010
PageProps,
11-
} from "https://deno.land/x/dext@0.10.4/mod.ts";
11+
} from "https://deno.land/x/dext@0.10.5/mod.ts";

src/dependency_graph.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
const decoder = new TextDecoder();
22

33
export interface DepGraph {
4-
[file: string]: Dep;
4+
root: string;
5+
modules: Module[];
56
}
67

7-
export interface Dep {
8-
size: number;
9-
deps: string[];
8+
export interface Module {
9+
specifier: string;
10+
dependencies: [];
11+
}
12+
13+
export interface Dependency {
14+
specifier: string;
15+
isDynamic: boolean;
16+
code?: string;
17+
type?: string;
1018
}
1119

1220
async function runDenoInfo(entrypoint: string): Promise<DepGraph> {
@@ -29,8 +37,7 @@ async function runDenoInfo(entrypoint: string): Promise<DepGraph> {
2937
throw new Error(`Failed to run deno info for ${entrypoint}`);
3038
}
3139
const text = decoder.decode(file);
32-
const { files } = JSON.parse(text);
33-
return files;
40+
return JSON.parse(text);
3441
}
3542

3643
export async function dependencyList(entrypoints: string[]): Promise<string[]> {
@@ -39,7 +46,7 @@ export async function dependencyList(entrypoints: string[]): Promise<string[]> {
3946
for (const entrypoint of entrypoints) {
4047
if (dependencies.has(entrypoint)) continue;
4148
const graph = await runDenoInfo(entrypoint);
42-
Object.keys(graph).forEach((dep) => dependencies.add(dep));
49+
graph.modules.forEach((dep) => dependencies.add(dep.specifier));
4350
}
4451

4552
return [...dependencies];

src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export async function checkHasDataHooks(
147147
// deno-lint-ignore no-explicit-any
148148
export function printError(err: any) {
149149
if (err.message != "Failed to prerender page") {
150-
console.log(colors.red(colors.bold("error: ")) + err.message);
150+
console.log(colors.red(colors.bold("error: ")) + err);
151151
if (err.code === "PARSE_ERROR") {
152152
console.log(
153153
`${err.loc.file}:${err.loc.line}:${err.loc.column}\n${err.frame}`,

0 commit comments

Comments
 (0)