Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing declarations in upgrade from v3 to v5 #33

Closed
gnarea opened this issue Dec 13, 2021 · 7 comments · Fixed by #34
Closed

Missing declarations in upgrade from v3 to v5 #33

gnarea opened this issue Dec 13, 2021 · 7 comments · Fixed by #34

Comments

@gnarea
Copy link
Contributor

gnarea commented Dec 13, 2021

Dependabot created a PR to upgrade from v3 to v5.0.1, but the tests are breaking due to some missing types:

node_modules/dohdec/types/dnsUtils.d.ts:193:25 - error TS7016: Could not find a declaration file for module 'dns-packet'. '/home/runner/work/relaynet-core-js/relaynet-core-js/node_modules/dns-packet/index.js' implicitly has an 'any' type.
  Try `npm install @types/dns-packet` if it exists or add a new declaration (.d.ts) file containing `declare module 'dns-packet';`

193 import * as packet from "dns-packet";
                            ~~~~~~~~~~~~

node_modules/dohdec/types/doh.d.ts:146:25 - error TS7016: Could not find a declaration file for module 'dns-packet'. '/home/runner/work/relaynet-core-js/relaynet-core-js/node_modules/dns-packet/index.js' implicitly has an 'any' type.
  Try `npm install @types/dns-packet` if it exists or add a new declaration (.d.ts) file containing `declare module 'dns-packet';`

146 import * as packet from "dns-packet";
                            ~~~~~~~~~~~~

node_modules/dohdec/types/dot.d.ts:48:43 - error TS2694: Namespace '"crypto"' has no exported member 'X509Certificate'.

48     static hashCert(cert: Buffer | crypto.X509Certificate, hashAlg?: string): string;
                                             ~~~~~~~~~~~~~~~

node_modules/dohdec/types/dot.d.ts:188:25 - error TS7016: Could not find a declaration file for module 'dns-packet'. '/home/runner/work/relaynet-core-js/relaynet-core-js/node_modules/dns-packet/index.js' implicitly has an 'any' type.
  Try `npm install @types/dns-packet` if it exists or add a new declaration (.d.ts) file containing `declare module 'dns-packet';`

188 import * as packet from "dns-packet";
                            ~~~~~~~~~~~~


Found 4 errors.
@hildjj
Copy link
Owner

hildjj commented Dec 13, 2021

Do you think I should take a runtime dependency on @types/dns-packet instead of asking Typescript users to do so? I agree that at the very least, I need to update the docs.

@hildjj
Copy link
Owner

hildjj commented Dec 13, 2021

The worst part is that @types/dns-packet is pretty out of date. Maybe I should just use dns-packet without type info.

@gnarea
Copy link
Contributor Author

gnarea commented Dec 13, 2021 via email

@hildjj
Copy link
Owner

hildjj commented Dec 13, 2021

I'll see if I can work around needing it at all. But in a typescript project, I would be surprised if you didn't have any other @types/ dev-dependencies.

@gnarea
Copy link
Contributor Author

gnarea commented Dec 13, 2021 via email

@hildjj
Copy link
Owner

hildjj commented Dec 13, 2021

Fixed in v5.0.3 which I just published.

@gnarea
Copy link
Contributor Author

gnarea commented Dec 13, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants