Skip to content

Commit

Permalink
fix: typescript will now properly typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-alford committed Sep 17, 2024
1 parent fd53164 commit 6190bd7
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 57 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"prettier-plugin-jsdoc": "^1.1.1",
"tsc-files": "^1.1.4",
"tsup": "^8.0.0",
"typescript": "^5.5.4"
"typescript": "^5.6.0"
},
"peerDependencies": {
"tsup": "^8.0.0"
Expand Down
108 changes: 54 additions & 54 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions src/TypesService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ function sharedConfig(
module: ts.ModuleKind.Node16,
target: ts.ScriptTarget.ESNext,
stripInternal: true,
noEmitOnError: true,
...config.dtsCompilerOverrides,
},
fileSystem: host,
Expand Down Expand Up @@ -457,20 +458,34 @@ function emitDtsCommon(
err => new TypeEmissionError(LoggingService, err, 'Emitting types'),
),
),
// TE.tapIO(
// ({ result, sourceFiles }) =>
// () =>
// console.log(JSON.stringify(result, null, 2), sourceFiles),
// ),
TE.flatMap(({ result, diagnosticHost, sourceFiles }) =>
pipe(
TE.Do,
TE.apS(
'diagnostics',
TE.tryCatch(
async () => result.getDiagnostics(),
async () => {
const diagnostics = result.getDiagnostics()
console.log({ diagnostics })
return diagnostics
},
err => new TypeEmissionError(LoggingService, err, 'Getting diagnostics'),
),
),
TE.apS(
'emitSkipped',
TE.tryCatch(
async () => result.getEmitSkipped(),
async () => {
const emitSkipped = result.getEmitSkipped()

console.log({ emitSkipped })
return emitSkipped
},
err => new TypeEmissionError(LoggingService, err, 'Getting emit skipped'),
),
),
Expand Down

0 comments on commit 6190bd7

Please sign in to comment.