Skip to content

Commit eee9240

Browse files
authored
chore: update dependencies for Deno 1.7.0 (#59)
1 parent 00bda54 commit eee9240

File tree

12 files changed

+64
-1073
lines changed

12 files changed

+64
-1073
lines changed

README.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,40 @@ The Preact Framework for Deno. Dext.ts is heavily inspired by Next.js.
1515

1616
## Installing
1717

18-
To install, run the following command. This will make the `dext` CLI available in your path.
18+
To install, run the following command. This will make the `dext` CLI available
19+
in your path.
1920

2021
```
2122
deno install --allow-read --allow-write --allow-env --allow-net --allow-run --unstable -f -n dext https://deno.land/x/dext@0.10.1/cli.ts
2223
```
2324

2425
## Getting started
2526

26-
To create a new project run `dext create myproject`. This will scaffold a new dext project in the
27-
`myproject` folder. This folder contains a few files:
27+
To create a new project run `dext create myproject`. This will scaffold a new
28+
dext project in the `myproject` folder. This folder contains a few files:
2829

2930
- `deps.ts` contains all of your projects dependencies.
3031
- `pages/index.tsx` is the source for the `/` of your project.
31-
- `pages/user/[name].tsx` is the source for all routes at `/user/[name]` (e.g. `/user/luca` and `/user/bartek`).
32+
- `pages/user/[name].tsx` is the source for all routes at `/user/[name]` (e.g.
33+
`/user/luca` and `/user/bartek`).
3234
- `tsconfig.json` is the TypeScript configuration that the project uses.
33-
- `.gitignore` tells `git` to ignore the `.dext` folder that is created by `dext dev` and `dext build`.
35+
- `.gitignore` tells `git` to ignore the `.dext` folder that is created by
36+
`dext dev` and `dext build`.
3437

35-
Now that you have a project set up, you can start the development server using `dext dev`.
36-
After a few seconds you can view your built page at http://127.0.0.1:3000. When you change
37-
any of the files in the `pages` directory, your project will be rebuilt automatically, and
38-
the page will be automatically reloaded in the browser.
38+
Now that you have a project set up, you can start the development server using
39+
`dext dev`. After a few seconds you can view your built page at
40+
http://127.0.0.1:3000. When you change any of the files in the `pages`
41+
directory, your project will be rebuilt automatically, and the page will be
42+
automatically reloaded in the browser.
3943

40-
When you are ready to deploy to production, run `dext build`. This will generate a production
41-
optimized build. You can start a production webserver to serve this build with `dext start`.
44+
When you are ready to deploy to production, run `dext build`. This will generate
45+
a production optimized build. You can start a production webserver to serve this
46+
build with `dext start`.
4247

4348
## Example
4449

45-
For an example, see the `/example` folder. You can create a production build it by running
46-
`dext build`, and then serve it by running `dext start`. You can also run `dext dev` to
47-
start watching, building, and serving.
50+
For an example, see the `/example` folder. You can create a production build it
51+
by running `dext build`, and then serve it by running `dext start`. You can also
52+
run `dext dev` to start watching, building, and serving.
4853

4954
You can also see a deployed version of this example on at https://dext.fly.dev.

deps/mod.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export { rollup } from "https://raw.githubusercontent.com/denofn/denopack/77aa4af97421999a14a80c3497ab5dcd64bac3f0/deps.ts";
1+
export { rollup } from "https://raw.githubusercontent.com/denofn/denopack/8bae39bef47e532a1e8d0f6700b72a2192f7bca4/deps.ts";
22
export type {
33
ModuleFormat,
44
OutputAsset,
@@ -11,39 +11,39 @@ export type {
1111
RollupCache,
1212
RollupOptions,
1313
RollupOutput,
14-
} from "https://raw.githubusercontent.com/denofn/denopack/77aa4af97421999a14a80c3497ab5dcd64bac3f0/deps.ts";
14+
} from "https://raw.githubusercontent.com/denofn/denopack/8bae39bef47e532a1e8d0f6700b72a2192f7bca4/deps.ts";
1515

16-
export { useCache } from "https://raw.githubusercontent.com/denofn/denopack/77aa4af97421999a14a80c3497ab5dcd64bac3f0/plugin/mod.ts";
17-
export { pluginTerserTransform } from "https://raw.githubusercontent.com/denofn/denopack/77aa4af97421999a14a80c3497ab5dcd64bac3f0/plugin/terserTransform/mod.ts";
16+
export { useCache } from "https://raw.githubusercontent.com/denofn/denopack/8bae39bef47e532a1e8d0f6700b72a2192f7bca4/plugin/mod.ts";
17+
export { pluginTerserTransform } from "https://raw.githubusercontent.com/denofn/denopack/8bae39bef47e532a1e8d0f6700b72a2192f7bca4/plugin/terserTransform/mod.ts";
1818

19-
export { persistSourceMaps } from "https://raw.githubusercontent.com/denofn/denopack/77aa4af97421999a14a80c3497ab5dcd64bac3f0/cli/persistSourceMaps.ts";
20-
export { emitFiles } from "https://raw.githubusercontent.com/denofn/denopack/77aa4af97421999a14a80c3497ab5dcd64bac3f0/cli/emitFiles.ts";
19+
export { persistSourceMaps } from "https://raw.githubusercontent.com/denofn/denopack/8bae39bef47e532a1e8d0f6700b72a2192f7bca4/cli/persistSourceMaps.ts";
20+
export { emitFiles } from "https://raw.githubusercontent.com/denofn/denopack/8bae39bef47e532a1e8d0f6700b72a2192f7bca4/cli/emitFiles.ts";
2121

2222
// std
23-
export * as colors from "https://deno.land/std@0.77.0/fmt/colors.ts";
24-
export * as path from "https://deno.land/std@0.77.0/path/mod.ts";
25-
export * as fs from "https://deno.land/std@0.77.0/fs/mod.ts";
26-
export { deferred, pooledMap } from "https://deno.land/std@0.77.0/async/mod.ts";
27-
export { format as dateFormat } from "https://deno.land/std@0.77.0/datetime/mod.ts";
23+
export * as colors from "https://deno.land/std@0.84.0/fmt/colors.ts";
24+
export * as path from "https://deno.land/std@0.84.0/path/mod.ts";
25+
export * as fs from "https://deno.land/std@0.84.0/fs/mod.ts";
26+
export { deferred, pooledMap } from "https://deno.land/std@0.84.0/async/mod.ts";
27+
export { format as dateFormat } from "https://deno.land/std@0.84.0/datetime/mod.ts";
2828

2929
export {
3030
Command,
3131
CompletionsCommand,
3232
HelpCommand,
33-
} from "https://deno.land/x/cliffy@v0.15.0/command/mod.ts";
34-
export { Table } from "https://deno.land/x/cliffy@v0.15.0/table/mod.ts";
33+
} from "https://deno.land/x/cliffy@v0.17.0/command/mod.ts";
34+
export { Table } from "https://deno.land/x/cliffy@v0.17.0/table/mod.ts";
3535

36-
export * as oak from "https://deno.land/x/oak@v6.3.2/mod.ts";
36+
export * as oak from "https://deno.land/x/oak@v6.4.2/mod.ts";
3737
// path_to_regexp
38-
export { compile } from "https://deno.land/x/oak@v6.3.2/deps.ts";
38+
export { compile } from "https://deno.land/x/oak@v6.4.2/deps.ts";
3939
// WebSocket
40-
export { isWebSocketCloseEvent } from "https://deno.land/std@0.77.0/ws/mod.ts";
41-
export type { WebSocket } from "https://deno.land/std@0.77.0/ws/mod.ts";
40+
export { isWebSocketCloseEvent } from "https://deno.land/std@0.84.0/ws/mod.ts";
41+
export type { WebSocket } from "https://deno.land/std@0.84.0/ws/mod.ts";
4242

4343
export { gzipEncode } from "https://deno.land/x/wasm_gzip@v1.0.0/mod.ts";
4444
export { compress as brotliEncode } from "https://deno.land/x/brotli@v0.1.4/mod.ts";
4545

46-
import { default as _debounce } from "https://unpkg.com/lodash-es@4.17.15/debounce.js";
46+
import { default as _debounce } from "https://unpkg.com/lodash-es@4.17.20/debounce.js";
4747
export const debounce = _debounce as <
4848
T extends (...args: unknown[]) => unknown,
4949
>(

deps/preact/debug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "https://x.lcas.dev/preact@10.5.7/debug.js";
1+
export * from "https://x.lcas.dev/preact@10.5.11/debug.js";

deps/preact/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "https://x.lcas.dev/preact@10.5.7/hooks.js";
1+
export * from "https://x.lcas.dev/preact@10.5.11/hooks.js";

deps/preact/mod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "https://x.lcas.dev/preact@10.5.7/mod.js";
1+
export * from "https://x.lcas.dev/preact@10.5.11/mod.js";

deps/preact/ssr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from "https://x.lcas.dev/preact@10.5.7/ssr.js";
1+
export * from "https://x.lcas.dev/preact@10.5.11/ssr.js";

deps/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ export {
22
assert,
33
assertEquals,
44
assertStringIncludes,
5-
} from "https://deno.land/std@0.77.0/testing/asserts.ts";
5+
} from "https://deno.land/std@0.84.0/testing/asserts.ts";
66
export {
77
copy,
88
ensureDir,
99
exists,
10-
} from "https://deno.land/std@0.77.0/fs/mod.ts";
10+
} from "https://deno.land/std@0.84.0/fs/mod.ts";
1111
import { path } from "./mod.ts";
1212
export const join = path.join;

src/bundle.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,12 @@ export async function bundle(
150150

151151
for (const out of chunks) {
152152
const filename = `/${out.fileName}`;
153-
if (out.facadeModuleId && out.facadeModuleId.startsWith("dext-page://")) {
153+
if (
154+
out.facadeModuleId && out.facadeModuleId.startsWith("dext-page:///")
155+
) {
154156
const page = pages.pages.find(
155157
(p) =>
156-
p.path === out.facadeModuleId!.substring("dext-page://".length),
158+
p.path === out.facadeModuleId!.substring("dext-page:///".length),
157159
)!;
158160
const imports = [
159161
...flattenImports(chunks, out.fileName),

src/plugins/dext.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function dextPlugin(
4343
implicitlyLoadedAfterOneOf.push(component);
4444
this.emitFile({
4545
name: pageMap[component].name.replace("/", "-"),
46-
id: "dext-page://" + component,
46+
id: "dext-page:///" + component,
4747
type: "chunk",
4848
});
4949
}
@@ -55,23 +55,23 @@ export function dextPlugin(
5555
},
5656
resolveId(source, referrer) {
5757
if (referrer === "dext:///main.js") return source;
58-
if (referrer?.startsWith("dext-page://")) {
59-
return this.resolve(source, referrer.substring("dext-page://".length));
58+
if (referrer?.startsWith("dext-page:///")) {
59+
return this.resolve(source, referrer.substring("dext-page:///".length));
6060
}
6161
return null;
6262
},
6363
load(id) {
64-
if (id.startsWith("dext-page://")) {
64+
if (id.startsWith("dext-page:///")) {
6565
return `export { default } from "${
6666
id.substring(
67-
"dext-page://".length,
67+
"dext-page:///".length,
6868
)
6969
}";`;
7070
}
7171
if (id == "dext:///main.js") {
7272
const routes = Object.entries(pageMap)
7373
.map(([id, page]) => {
74-
return `["${page.route}", [() => import("dext-page://${id}"), ${
74+
return `["${page.route}", [() => import("dext-page:///${id}"), ${
7575
page.hasGetStaticData ? "true" : "false"
7676
}]]`;
7777
})
@@ -100,7 +100,7 @@ start([${routes}], App);`;
100100
const file = bundle[name];
101101
if (file.type === "chunk" && file.isEntry) {
102102
const component = file.facadeModuleId!.substring(
103-
"dext-page://".length,
103+
"dext-page:///".length,
104104
);
105105
const page = pageMap[component];
106106

@@ -138,8 +138,12 @@ start([${routes}], App);`;
138138
const body = options.prerender
139139
? await prerenderPage(
140140
component,
141-
{ data, route: page_.route, path: `/${path}` },
142-
{ ...options, appURL },
141+
{ data, route: page_.route },
142+
{
143+
...options,
144+
appURL,
145+
location: `https://dext-prerender.local/${path}`,
146+
},
143147
)
144148
: "";
145149

@@ -289,11 +293,11 @@ async function prerenderDocument(
289293
async function prerenderPage(
290294
component: string,
291295
context: {
292-
path: string;
293296
data: unknown;
294297
route?: Record<string, string | string[]>;
295298
},
296299
options: {
300+
location: string;
297301
tsconfigPath: string;
298302
appURL: string;
299303
typecheck: boolean;
@@ -312,6 +316,8 @@ async function prerenderPage(
312316
"-q",
313317
"-c",
314318
options.tsconfigPath,
319+
"--location",
320+
options.location,
315321
...(options.typecheck ? [] : ["--no-check"]),
316322
prerenderHostURL.toString(),
317323
new URL(`file:///${resolvedComponent}`).toString(),

src/runtime/hot_refresh.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
// deno-lint-ignore no-undef
21
export default function hotRefresh(host = location.host) {
32
const hr = new WebSocket(`ws://${host}/_dext/hr`);
43
hr.addEventListener("message", (e) => {
54
if (e.data === "reload") {
6-
// deno-lint-ignore no-undef
75
location.reload();
86
}
97
});

0 commit comments

Comments
 (0)