If you know how to fix the issue, make a pull request instead.
@types/xxxx package and had problems.Definitions by: in index.d.ts) so they can respond.Imports from joi TS definitions (version 14.3.3) stopped working after I updated the joi package to 'hapi/joi'.
Install @types/hapi__joi.
@sandersn Can we please have all hapi packages deprecated with a notice to use the new ones in the future or something?
We are going to get MANY issues like this.
Thanks for the quick reply. It's working after a couple of tweaks in my case: replaced occurrences of import * as Joi from 'joi'; with import Joi = require('@hapi/joi'); and minDomainAtoms with minDomainSegments in emails validation.
@SimonSchick can you explain more. Did the hapi packages move? Which packages moved to what new names?
The only reference I can find atm is this: https://github.com/hapijs/hapi/issues/3941
But yes, pretty much everything in the hapi org is now released in the hapi namespace.
@hueniverse I couldn't find an official announcement that exactly explains what happens to non-namespaced modules, can you explain it here and/or link us to the corresponding docs?
What does that mean for DT? How do I get a list of the packages that need to be deprecated?
Everything outside the namespace is now deprecated. And I'm starting to move types into the namespaced modules. Still working on support for types testing in lab.
For anyone stumbling on this issue, you can create own typings for new npm @hapi/XXX packages. I have solved my TypeScript compilation issues with these three definitions.
https://gist.github.com/zveljkovic/ffec59003dc76cc54c5c9cf644368f6d hapi__boom.d.ts
https://gist.github.com/zveljkovic/a4153a26c780c0fb37486a62c4aefc4b hapi__hapi.d.ts
https://gist.github.com/zveljkovic/ac17b2280a36b218b3cc4fe072ffa147 hapi__inert.d.ts
Approach was to use existing @types/XXX definitions and to change declare module 'hapi' to declare module '@hapi/hapi' or to wrap the definition inside declare module '@hapi/hapi' if there was nothing to change. Also imports in the definitions should be changed to @hapi/hapi instead of just hapi.
I think similiar will work for joi or other modules.
Be sure to include in .tsconfig, path to directory for your typings folder
{
"compilerOptions": {
...
"typeRoots" : ["./node_modules/@types", "./typings"]
}
}
Most helpful comment
Install @types/hapi__joi.