Skip to content

Commit

Permalink
fix(start): correctly generate .d.ts files (#2225)
Browse files Browse the repository at this point in the history
* chore: upgrade to latest config version to generate correct .d.ts files

see #2223

* chore: added arethetypeswrong (attw)

since attw will report a node10 related issue we want to ignore (see https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/NoResolution.md#true-positive-node-10-doesnt-support-packagejson-exports) and cannot (yet) be configured to skip node10 (see arethetypeswrong/arethetypeswrong.github.io#112), the `no-resolution` rule is skipped

* fix(start): correctly reference client

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
schiller-manuel and autofix-ci[bot] authored Aug 29, 2024
1 parent 0948389 commit 3fb7226
Show file tree
Hide file tree
Showing 22 changed files with 256 additions and 63 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
"gpt-generate": "node gpt/generate.js"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.15.4",
"@eslint-react/eslint-plugin": "^1.12.3",
"@playwright/test": "^1.46.1",
"@tanstack/config": "^0.12.0",
"@tanstack/config": "^0.12.1",
"@types/node": "^20.14.7",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
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:ts53": "node ../../node_modules/typescript53/lib/tsc.js",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
"test:types:ts55": "tsc",
"test:build": "publint --strict",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"test:unit": "vitest",
"test:unit:dev": "pnpm run test:unit --watch",
"build": "vite build"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-cross-context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
"test:types:ts55": "tsc",
"test:build": "publint --strict",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-with-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:types:ts55": "tsc",
"test:unit": "vitest",
"test:unit:dev": "pnpm run test:unit --watch",
"test:build": "publint --strict",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"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 @@ -35,7 +35,7 @@
"test:types:ts55": "tsc",
"test:unit": "vitest",
"test:unit:dev": "pnpm run test:unit --watch --hideSkippedTests",
"test:build": "publint --strict",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/router-arktype-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:types:ts55": "tsc",
"test:unit": "vitest",
"test:unit:dev": "pnpm run test:unit --watch --typecheck",
"test:build": "publint --strict",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"build": "vite build"
},
"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:ts53": "node ../../node_modules/typescript53/lib/tsc.js",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
"test:types:ts55": "tsc",
"test:build": "publint --strict",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"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:ts53": "node ../../node_modules/typescript53/lib/tsc.js",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
"test:types:ts55": "tsc",
"test:build": "publint --strict",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"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 @@ -34,7 +34,7 @@
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
"test:types:ts55": "tsc",
"test:unit": "vitest",
"test:build": "publint --strict",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/router-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
"test:types:ts55": "tsc",
"test:build": "publint --strict",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/router-valibot-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:types:ts55": "tsc",
"test:unit": "vitest",
"test:unit:dev": "pnpm run test:unit --watch --typecheck",
"test:build": "publint --strict",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"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:ts53": "node ../../node_modules/typescript53/lib/tsc.js",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
"test:types:ts55": "tsc",
"test:build": "publint --strict",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/router-zod-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:types:ts55": "tsc",
"test:unit": "vitest",
"test:unit:dev": "pnpm run test:unit --watch --typecheck",
"test:build": "publint --strict",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"build": "vite build"
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/start-vite-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
"test:types:ts55": "tsc",
"test:build": "publint --strict",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"build": "vite build"
},
"type": "module",
Expand Down
17 changes: 7 additions & 10 deletions packages/start/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@
"test:types:ts53": "node ../../node_modules/typescript53/lib/tsc.js",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
"test:types:ts55": "tsc",
"test:build": "publint --strict",
"build": "vite build && pnpm build:config && pnpm build:router-manifest && pnpm build:server-handler && pnpm build:server-runtime && pnpm build:react-server-runtime",
"test:build": "publint --strict && attw --ignore-rules no-resolution --pack .",
"build": "vite build && pnpm build:config && pnpm build:router-manifest",
"build:config": "tsc --project tsconfigs/config.tsconfig.json",
"build:router-manifest": "tsc --project tsconfigs/router-manifest.tsconfig.json",
"build:server-handler": "tsc --project tsconfigs/server-handler.tsconfig.json",
"build:server-runtime": "tsc --project tsconfigs/server-runtime.tsconfig.json",
"build:react-server-runtime": "tsc --project tsconfigs/react-server-runtime.tsconfig.json"
"build:router-manifest": "tsc --project tsconfigs/router-manifest.tsconfig.json"
},
"type": "module",
"exports": {
Expand Down Expand Up @@ -107,8 +104,8 @@
},
"./server-runtime": {
"import": {
"types": "./dist/esm/server-runtime/server-runtime/index.d.ts",
"default": "./dist/esm/server-runtime/server-runtime/index.js"
"types": "./dist/esm/server-runtime/index.d.ts",
"default": "./dist/esm/server-runtime/index.js"
}
},
"./react-server-runtime": {
Expand All @@ -119,8 +116,8 @@
},
"./server-handler": {
"import": {
"types": "./dist/esm/server-handler/server-handler/index.d.ts",
"default": "./dist/esm/server-handler/server-handler/index.js"
"types": "./dist/esm/server-handler/index.d.ts",
"default": "./dist/esm/server-handler/index.js"
}
},
"./package.json": "./package.json"
Expand Down
2 changes: 1 addition & 1 deletion packages/start/src/client-runtime/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { fetcher } from './fetcher'
import { getBaseUrl } from './getBaseUrl'
import type { FetchFn } from '../client'
import type { FetchFn } from '../client/createServerFn'

export function createServerReference<TPayload, TResponse>(
_fn: FetchFn<TPayload, TResponse>,
Expand Down
6 changes: 3 additions & 3 deletions packages/start/src/server-runtime/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Readable, Writable } from 'node:stream'
import { getEvent, getRequestHeaders } from 'vinxi/http'
import { fetcher } from '../client-runtime'
import { fetcher } from '../client-runtime/fetcher'
import { getBaseUrl } from '../client-runtime/getBaseUrl'
import { handleServerRequest } from '../server-handler'
import { handleServerRequest } from '../server-handler/index'
import type { WritableOptions } from 'node:stream'
import type { FetchFn } from '../client'
import type { FetchFn } from '../client/createServerFn'
/**
*
* @returns {import('node:http').IncomingMessage}
Expand Down
10 changes: 0 additions & 10 deletions packages/start/tsconfigs/react-server-runtime.tsconfig.json

This file was deleted.

10 changes: 0 additions & 10 deletions packages/start/tsconfigs/server-handler.tsconfig.json

This file was deleted.

10 changes: 0 additions & 10 deletions packages/start/tsconfigs/server-runtime.tsconfig.json

This file was deleted.

3 changes: 3 additions & 0 deletions packages/start/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export default mergeConfig(
'./src/server/index.tsx',
'./src/client-runtime/index.tsx',
'./src/api/index.ts',
'./src/server-runtime/index.tsx',
'./src/react-server-runtime/index.tsx',
'./src/server-handler/index.tsx',
],
srcDir: './src',
exclude: ['./src/config'],
Expand Down
Loading

0 comments on commit 3fb7226

Please sign in to comment.