fix: tsconfig conflict issue that occurs with ts-proto-descriptors #312
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When importing
ts-proto-descriptors
into a typescript project, it will try to import the typescript source code, and not the generated javascript. This is an issue when the dependent project'stsconfig
file does not agree with thetsconfig
forts-proto
.For example, my project depends on
ts-proto-descriptors
has atsconfig
that has enabledesModuleInterop
. But thets-proto
tsconfig
does not have this option set, meaning thets-proto-descriptors
source is not compatible with my project and throws the following typescript errors:This PR addresses the underlying issue by exporting only the generated javascript from
ts-proto-descriptors
(along with ts definition files for type safety). This means that it cannot be broken by the outer project'sts-config
because it is already compiled.From a developer perspective, there will be no change as the definition files will maintain type-safety, as if you were working with typescript directly. However if you really wanted to import the TS source, then you could also do that by just specifying the path explicitly (eg.
import { FileDescriptorProto } from "ts-proto-descriptors/index"
).NOTE: This change will require a release to NPM for https://www.npmjs.com/package/ts-proto-descriptors