Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/react-start-rsc-browser-decode-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/react-start-rsc': patch
---

Type the exports of `@tanstack/react-start-rsc/rsbuild/browser-decode` in its published declarations. They were re-exported from `react-server-dom-rspack/client.browser`, which ships no types, so they resolved to `any`.
6 changes: 6 additions & 0 deletions .changeset/router-plugin-virtual-file-routes-dependency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@tanstack/router-plugin': patch
'@tanstack/start-plugin-core': patch
---

List `@tanstack/virtual-file-routes` as a dependency. The published declarations of both packages refer to its types through the router generator's config, and without the dependency those types resolved to nothing, so `virtualRouteConfig` was typed as `any`.
6 changes: 5 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@
"test:build": {
"cache": true,
"dependsOn": ["build"],
"inputs": ["buildProduction", "dependentTaskOutputs"]
"inputs": [
"buildProduction",
"dependentTaskOutputs",
"{workspaceRoot}/scripts/check-published-types.mjs"
]
},
"test:e2e*": {
"parallelism": false
Expand Down
22 changes: 21 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,27 @@
"nx": {
"includedScripts": [
"test:docs"
]
],
"targets": {
"test:unit": {
"command": "node --test scripts/check-published-types.test.mjs",
"dependsOn": [],
"inputs": [
"{workspaceRoot}/scripts/check-published-types.mjs",
"{workspaceRoot}/scripts/check-published-types.test.mjs",
{
"externalDependencies": [
"typescript",
"@types/node"
]
},
{
"runtime": "node --version"
}
],
"outputs": []
}
}
},
"devDependencies": {
"@changesets/changelog-github": "^0.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/arktype-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:types:ts70": "tsc",
"test:unit": "vitest",
"test:unit:dev": "pnpm run test:unit --watch --typecheck",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"test:types:ts70": "tsc",
"test:unit": "vitest",
"test:unit:dev": "pnpm run test:unit --watch --typecheck",
"test:build": "publint --strict && attw --pack .",
"test:build": "publint --strict && attw --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build && tsc --noEmit"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-start/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"test:types:ts70": "tsc",
"test:unit": "vitest",
"test:unit:dev": "pnpm run test:unit --watch --typecheck",
"test:build": "publint --strict && attw --pack .",
"test:build": "publint --strict && attw --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build && tsc --noEmit"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/history/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"test:unit": "vitest",
"test:unit:dev": "pnpm run test:unit --watch",
"build": "vite build"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-ssr-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:types:ts70": "tsc",
"test:unit": "exit 0; vitest",
"test:unit:dev": "pnpm run test:unit --watch",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"test:unit:dev": "pnpm run test:unit --watch --hideSkippedTests",
"test:perf": "vitest bench",
"test:perf:dev": "pnpm run test:perf --watch --hideSkippedTests",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-start-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-start-rsc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
18 changes: 15 additions & 3 deletions packages/react-start-rsc/src/rsbuild/browser-decode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,19 @@
* Flight decode.
*/

export {
createFromReadableStream,
createFromFetch,
import {
createFromFetch as decodeFlightFetch,
createFromReadableStream as decodeFlightStream,
} from 'react-server-dom-rspack/client.browser'

// react-server-dom-rspack ships no declarations. The annotations keep the
// published declaration file free of imports from it.
export const createFromReadableStream: <T = unknown>(
stream: ReadableStream<Uint8Array>,
options?: object,
) => Promise<T> = decodeFlightStream

export const createFromFetch: <T = unknown>(
fetchPromise: Promise<Response>,
options?: object,
) => Promise<T> = decodeFlightFetch
2 changes: 1 addition & 1 deletion packages/react-start-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-start/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"scripts": {
"clean": "rimraf ./dist && rimraf ./coverage",
"test": "pnpm test:build",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build && vite build -c vite.config.server-entry.ts"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/router-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/router-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"test:unit": "vitest",
"test:unit:dev": "pnpm run test:unit --watch",
"build": "vite build"
Expand Down
2 changes: 1 addition & 1 deletion packages/router-devtools-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/router-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/router-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"test:types:ts70": "tsc -p tsconfig.legacy.json",
"test:unit": "vitest --typecheck false && vitest run --typecheck.only",
"test:unit:dev": "pnpm run test:unit --watch --hideSkippedTests",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
3 changes: 2 additions & 1 deletion packages/router-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down Expand Up @@ -123,6 +123,7 @@
"@tanstack/router-core": "workspace:*",
"@tanstack/router-generator": "workspace:*",
"@tanstack/router-utils": "workspace:*",
"@tanstack/virtual-file-routes": "workspace:*",
"chokidar": "catalog:",
"unplugin": "^3.5.0",
"zod": "catalog:"
Expand Down
2 changes: 1 addition & 1 deletion packages/router-ssr-query-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"test:unit:dev": "pnpm run test:unit --watch",
"test:perf": "vitest bench",
"test:perf:dev": "pnpm run test:perf --watch --hideSkippedTests",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/router-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:unit": "vitest",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/router-vite-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-router-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build && tsc -p tsconfig.build.json"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-router-ssr-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:types:ts70": "tsc",
"test:unit": "exit 0; vitest",
"test:unit:dev": "pnpm run test:unit --watch",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"test:unit:dev": "pnpm run test:unit --watch --hideSkippedTests",
"test:perf": "vitest bench",
"test:perf:dev": "pnpm run test:perf --watch --hideSkippedTests",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build && tsc -p tsconfig.build.json"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-start-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-start-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-start/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"clean": "rimraf ./dist && rimraf ./coverage",
"test": "pnpm test:build",
"test:unit": "vitest",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build && vite build -c vite.config.server-entry.ts"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/start-client-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/start-fn-stubs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
3 changes: 2 additions & 1 deletion packages/start-plugin-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"nx": {
Expand Down Expand Up @@ -118,6 +118,7 @@
"@tanstack/router-plugin": "workspace:*",
"@tanstack/router-utils": "workspace:*",
"@tanstack/start-server-core": "workspace:*",
"@tanstack/virtual-file-routes": "workspace:*",
"exsolve": "^1.1.3",
"lightningcss": "^1.33.0",
"pathe": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion packages/start-server-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"nx": {
Expand Down
2 changes: 1 addition & 1 deletion packages/start-static-server-functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/start-storage-context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js",
"test:types:ts60": "tsc6",
"test:types:ts70": "tsc",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/valibot-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:types:ts70": "tsc",
"test:unit": "vitest",
"test:unit:dev": "pnpm run test:unit --watch --typecheck",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/virtual-file-routes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"scripts": {
"clean": "rimraf ./dist && rimraf ./coverage",
"test:eslint": "eslint ./src",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack . && node ../../scripts/check-published-types.mjs",
"build": "vite build"
},
"type": "module",
Expand Down
Loading
Loading