Skip to content

Commit 22cd401

Browse files
authored
Add typecheck script to packages (#13040)
1 parent 6b677a7 commit 22cd401

File tree

17 files changed

+24
-32
lines changed

17 files changed

+24
-32
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ node_modules/
3030
.eslintcache
3131
.tmp
3232
tsup.config.bundled_*.mjs
33+
build.utils.d.ts
3334
/.env
3435
/NOTES.md
3536

integration/vite-spa-mode-test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ test.describe("SPA Mode", () => {
905905
appFixture.close();
906906
});
907907

908-
test("renders the root HydrateFallback initially with access to the root loader data", async ({}) => {
908+
test("renders the root HydrateFallback initially with access to the root loader data", async () => {
909909
let res = await fixture.requestDocument("/");
910910
let html = await res.text();
911911
expect(html).toMatch('<h1 data-loading="true">Loading SPA...</h1>');

packages/create-react-router/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"./package.json": "./package.json"
2020
},
2121
"scripts": {
22-
"build": "wireit"
22+
"build": "wireit",
23+
"typecheck": "tsc"
2324
},
2425
"wireit": {
2526
"build": {

packages/react-router-architect/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"./package.json": "./package.json"
3333
},
3434
"scripts": {
35-
"build": "wireit"
35+
"build": "wireit",
36+
"typecheck": "tsc"
3637
},
3738
"wireit": {
3839
"build": {

packages/react-router-cloudflare/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"./package.json": "./package.json"
2828
},
2929
"scripts": {
30-
"build": "wireit"
30+
"build": "wireit",
31+
"typecheck": "tsc"
3132
},
3233
"wireit": {
3334
"build": {

packages/react-router-dev/vite/plugin.ts

-14
Original file line numberDiff line numberDiff line change
@@ -2127,20 +2127,6 @@ function uniqueNodes(
21272127
return unique;
21282128
}
21292129

2130-
function findConfig(
2131-
dir: string,
2132-
basename: string,
2133-
extensions: string[]
2134-
): string | undefined {
2135-
for (let ext of extensions) {
2136-
let name = basename + ext;
2137-
let file = path.join(dir, name);
2138-
if (fse.existsSync(file)) return file;
2139-
}
2140-
2141-
return undefined;
2142-
}
2143-
21442130
function addRefreshWrapper(
21452131
reactRouterConfig: ResolvedReactRouterConfig,
21462132
code: string,

packages/react-router-dom/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"./package.json": "./package.json"
4242
},
4343
"scripts": {
44-
"build": "wireit"
44+
"build": "wireit",
45+
"typecheck": "tsc"
4546
},
4647
"wireit": {
4748
"build": {

packages/react-router-express/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"./package.json": "./package.json"
3333
},
3434
"scripts": {
35-
"build": "wireit"
35+
"build": "wireit",
36+
"typecheck": "tsc"
3637
},
3738
"wireit": {
3839
"build": {

packages/react-router-fs-routes/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"./package.json": "./package.json"
2222
},
2323
"scripts": {
24-
"build": "wireit"
24+
"build": "wireit",
25+
"typecheck": "tsc"
2526
},
2627
"wireit": {
2728
"build": {

packages/react-router-node/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
"./dist/install.mjs"
5252
],
5353
"scripts": {
54-
"build": "wireit"
54+
"build": "wireit",
55+
"typecheck": "tsc"
5556
},
5657
"wireit": {
5758
"build": {

packages/react-router-node/tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"strict": true,
1111
"jsx": "react",
1212
"declaration": true,
13-
"emitDeclarationOnly": true,
1413
"rootDir": ".",
1514
"outDir": "./dist",
1615
"noEmit": true,

packages/react-router-serve/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"react-router-serve": "bin.js"
1919
},
2020
"scripts": {
21-
"build": "wireit"
21+
"build": "wireit",
22+
"typecheck": "tsc"
2223
},
2324
"wireit": {
2425
"build": {

packages/react-router/lib/dom/ssr/links.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { Location } from "../../router/history";
2-
import { parsePath } from "../../router/history";
32
import type { AgnosticDataRouteMatch } from "../../router/utils";
43

54
import type { AssetsManifest } from "./entry";
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1+
import type { RouteModules } from "../dom/ssr/routeModules";
12
import type { ServerRouteManifest } from "./routes";
2-
import type { RouteModules, EntryRouteModule } from "./routeModules";
33

44
export function createEntryRouteModules(
55
manifest: ServerRouteManifest
6-
): RouteModules<EntryRouteModule> {
6+
): RouteModules {
77
return Object.keys(manifest).reduce((memo, routeId) => {
88
let route = manifest[routeId];
99
if (route) {
1010
memo[routeId] = route.module;
1111
}
1212
return memo;
13-
}, {} as RouteModules<EntryRouteModule>);
13+
}, {} as RouteModules);
1414
}

packages/react-router/lib/server-runtime/server.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { StaticHandler, StaticHandlerContext } from "../router/router";
1+
import type { StaticHandler } from "../router/router";
22
import type { ErrorResponse } from "../router/utils";
33
import { isRouteErrorResponse, ErrorResponseImpl } from "../router/utils";
44
import {
@@ -29,7 +29,6 @@ import {
2929
SINGLE_FETCH_REDIRECT_STATUS,
3030
} from "./single-fetch";
3131
import { getDocumentHeaders } from "./headers";
32-
import invariant from "./invariant";
3332
import type { EntryRoute } from "../dom/ssr/routes";
3433

3534
export type RequestHandler = (

packages/react-router/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
"./package.json": "./package.json"
6464
},
6565
"scripts": {
66-
"build": "wireit"
66+
"build": "wireit",
67+
"typecheck": "tsc"
6768
},
6869
"wireit": {
6970
"build": {

packages/react-router/tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"jsx": "react",
1212

1313
"declaration": true,
14-
"emitDeclarationOnly": true,
1514

1615
"skipLibCheck": true,
1716

0 commit comments

Comments
 (0)