Skip to content

Commit

Permalink
fix: simplify tobegeneratedTypes a bit and start on documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tefkah committed Dec 8, 2023
1 parent a685ab7 commit 101ab56
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion core
14 changes: 1 addition & 13 deletions docgen/toBeGeneratedTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,11 @@
import type { Prettify } from '@ts-rest/core'
import type { PClient as C } from '../src/lib/client-types.js'

type PP = Prettify<C>

type P0 = {
[K in keyof PP]: Prettify<PP[K]>
}

/**
* @interface
*/
export type Client = {
[K in keyof P0]: P0[K] extends (...args: any[]) => any
? P0[K]
: Prettify<{
[K2 in keyof P0[K]]: P0[K][K2] extends (...args: any[]) => any
? P0[K][K2]
: Prettify<P0[K][K2]>
}>
[K in keyof C]: Prettify<C[K]>
}

export type PubRaw = C['pub']
Expand Down
2 changes: 2 additions & 0 deletions docgen/utils/processFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@ export async function processFile<
const TEMP = new URL('../TEMP.md', import.meta.url).pathname
const postProcessedMarkdown = await postprocessingFix(processed, TEMP)

rmSync(TEMP)

return postProcessedMarkdown as any
}
Empty file added documentation_generation.md
Empty file.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "tsup",
"postbuild": "pnpm attw --pack . && size-limit",
"postbuild": "npm pack && attw . && size-limit",
"lint": "tsc",
"ci": "rm -rf dist && npm run lint && pnpm run test && pnpm run build",
"prepublish": "pnpm run ci",
Expand Down

0 comments on commit 101ab56

Please sign in to comment.