fix: types in fresh-init --twind's main.ts (#269)

This commit is contained in:
Luca Casonato
2022-06-22 12:48:27 +02:00
committed by GitHub
parent b1d4eb3da0
commit 1339a315e6
2 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -239,7 +239,9 @@ let MAIN_TS = `/// <reference no-default-lib="true" />
/// <reference lib="deno.ns" />
/// <reference lib="deno.unstable" />
import { start } from "$fresh/server.ts";
import { ${
useTwind ? "InnerRenderFunction, RenderContext, " : ""
}start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";
`;
@@ -252,7 +254,7 @@ const sheet = virtualSheet();
sheet.reset();
setup({ ...config, sheet });
function render(ctx, render) {
function render(ctx: RenderContext, render: InnerRenderFunction) {
const snapshot = ctx.state.get("twind") as unknown[] | null;
sheet.reset(snapshot || undefined);
render();
+2 -2
View File
@@ -104,7 +104,7 @@ Deno.test({
await t.step("start up the server and access the root page", async () => {
const serverProcess = Deno.run({
cmd: ["deno", "run", "-A", "main.ts"],
cmd: ["deno", "run", "-A", "--check", "main.ts"],
stdout: "piped",
stderr: "inherit",
cwd: tmpDirName,
@@ -231,7 +231,7 @@ Deno.test({
await t.step("start up the server and access the root page", async () => {
const serverProcess = Deno.run({
cmd: ["deno", "run", "-A", "main.ts"],
cmd: ["deno", "run", "-A", "--check", "main.ts"],
stdout: "piped",
stderr: "inherit",
cwd: tmpDirName,