Skip to content

Commit 1ea01a4

Browse files
authored
chore: run typecheck on whole project + cleanup tests (#3758)
1 parent 121cb7e commit 1ea01a4

117 files changed

Lines changed: 225 additions & 683 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,3 @@ test/fixture/functions
7979
.pnpm-store
8080
.wrangler
8181

82-
# mirror pkg
83-
.mirror
84-
85-
# Generated types
86-
*.d.ts
87-
!lib/**/*.d.ts
88-
!runtime-meta.d.ts
89-
!src/types/**/*.d.ts

automd.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
import type { Config } from "automd";
2+
13
export default {
24
input: ["README.md", "docs/**/*.md"],
35
generators: {
46
compatDate: {
7+
name: "compatDate",
58
async generate(ctx) {
69
const { compatibilityChanges } = await import("./lib/meta.mjs");
710

@@ -20,4 +23,4 @@ export default {
2023
},
2124
},
2225
},
23-
};
26+
} satisfies Config;

examples/auto-imports/server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import { defineHandler } from "nitro/h3";
2+
import { makeGreeting } from "./server/utils/hello.ts";
23

34
export default defineHandler(() => `<h1>${makeGreeting("Nitro")}</h1>`);

examples/nano-jsx/server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineHandler, html } from "h3";
2-
import { h, renderSSR } from "nano-jsx";
2+
import { renderSSR } from "nano-jsx";
33

44
export default defineHandler(() => {
55
return html(renderSSR(() => <h1>Nitro + nano-jsx works!</h1>));
File renamed without changes.

examples/vite-ssr-html/app/entry-server.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { fetch } from "nitro";
22

33
export default {
44
async fetch() {
5-
const quote = await fetch("/quote").then((res) => res.json());
5+
const quote = (await fetch("/quote").then((res) => res.json())) as {
6+
text: string;
7+
};
68
return tokenizedStream(quote.text, 50);
79
},
810
};

examples/vite-ssr-html/routes/quote.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ const QUOTES_URL =
33

44
let _quotes: Promise<unknown> | undefined;
55

6-
function getQuotes(): Promise<{ quoteText: string; quoteAuthor: string }[]> {
7-
return (_quotes ??= fetch(QUOTES_URL).then((res) => res.json()));
6+
function getQuotes() {
7+
return (_quotes ??= fetch(QUOTES_URL).then((res) => res.json())) as Promise<
8+
{ quoteText: string; quoteAuthor: string }[]
9+
>;
810
}
911

1012
export default async function quotesHandler() {

examples/vite-ssr-preact/src/entry-client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { hydrate } from "preact";
2-
import { App } from "./app";
2+
import { App } from "./app.tsx";
33

44
function main() {
55
hydrate(<App />, document.querySelector("#app")!);

examples/vite-ssr-preact/src/entry-server.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import "./styles.css";
22
import { renderToReadableStream } from "preact-render-to-string/stream";
3-
import { App } from "./app";
3+
import { App } from "./app.jsx";
44

55
// @ts-ignore
66
import clientAssets from "./entry-client?assets=client";

0 commit comments

Comments
 (0)