fix: types in fresh-init --twind's main.ts (#269)
This commit is contained in:
@@ -239,7 +239,9 @@ let MAIN_TS = `/// <reference no-default-lib="true" />
|
|||||||
/// <reference lib="deno.ns" />
|
/// <reference lib="deno.ns" />
|
||||||
/// <reference lib="deno.unstable" />
|
/// <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";
|
import manifest from "./fresh.gen.ts";
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -252,7 +254,7 @@ const sheet = virtualSheet();
|
|||||||
sheet.reset();
|
sheet.reset();
|
||||||
setup({ ...config, sheet });
|
setup({ ...config, sheet });
|
||||||
|
|
||||||
function render(ctx, render) {
|
function render(ctx: RenderContext, render: InnerRenderFunction) {
|
||||||
const snapshot = ctx.state.get("twind") as unknown[] | null;
|
const snapshot = ctx.state.get("twind") as unknown[] | null;
|
||||||
sheet.reset(snapshot || undefined);
|
sheet.reset(snapshot || undefined);
|
||||||
render();
|
render();
|
||||||
|
|||||||
+2
-2
@@ -104,7 +104,7 @@ Deno.test({
|
|||||||
|
|
||||||
await t.step("start up the server and access the root page", async () => {
|
await t.step("start up the server and access the root page", async () => {
|
||||||
const serverProcess = Deno.run({
|
const serverProcess = Deno.run({
|
||||||
cmd: ["deno", "run", "-A", "main.ts"],
|
cmd: ["deno", "run", "-A", "--check", "main.ts"],
|
||||||
stdout: "piped",
|
stdout: "piped",
|
||||||
stderr: "inherit",
|
stderr: "inherit",
|
||||||
cwd: tmpDirName,
|
cwd: tmpDirName,
|
||||||
@@ -231,7 +231,7 @@ Deno.test({
|
|||||||
|
|
||||||
await t.step("start up the server and access the root page", async () => {
|
await t.step("start up the server and access the root page", async () => {
|
||||||
const serverProcess = Deno.run({
|
const serverProcess = Deno.run({
|
||||||
cmd: ["deno", "run", "-A", "main.ts"],
|
cmd: ["deno", "run", "-A", "--check", "main.ts"],
|
||||||
stdout: "piped",
|
stdout: "piped",
|
||||||
stderr: "inherit",
|
stderr: "inherit",
|
||||||
cwd: tmpDirName,
|
cwd: tmpDirName,
|
||||||
|
|||||||
Reference in New Issue
Block a user