Emit type declarations#30
Conversation
|
Tested with my fork that the published npm package includes type declarations: https://www.npmjs.com/package/@omkar.xyz/ro-crate |
|
@omkar-ethz Sorry I just noticed your PR today. Thank you for your contribution. I am still a little bit unsure that the javascript code must be compiled using tsc, but there may not be another way. I will discuss this first with my team and do more tests. |
alvinsw
left a comment
There was a problem hiding this comment.
I will merge this first and then try it, then publish it as a new version separately.
|
Thanks @alvinsw ! let me know in case of any issues |
|
@omkar-ethz I have published v3.7.1 but I have to pin typedoc to version 0.28.13 which still uses typescript 5. If I upgrade typedoc to current version (with typescript 6), |
|
@alvinsw it seems that typescript 6 made 'strict: true' as default, setting it explicitly to false in tsconfig.json got rid of most errors. I will create a PR with updated typedoc and ts versions |
We enabled type declarations upstream in the `ro-crate` library ([PR](Language-Research-Technology/ro-crate-js#30)). Upgrading to v3.7.1 of the lib which includes them. Moreover rocrate.metadata was a type error (but somehow still working), replaced it with [descriptor](https://language-research-technology.github.io/ro-crate-js/v3.7/classes/ROCrate.html#descriptor) instead.
Motivation
Currently, the ro-crate package as published on npm does not include type declarations. This means ts projects cannot benefit from typings for ROCrate, Entity, etc.
This PR attempts to fix project configuration to export type declarations in the npm package.
Changes