verdaccio / monorepo

🏰 Core dependencies and plugins for verdaccio 5.x branch ⚠️ DEPRECATED
https://verdaccio.org
MIT License
81 stars 62 forks source link

`@verdaccio/local-storage` TypeScript types are gone from NPM #659

Closed Leksat closed 1 year ago

Leksat commented 1 year ago

Describe the bug

After upgrading @verdaccio/local-storage from 10.3.1 to 10.3.2 I started to get TS errors like this one

error TS7016: Could not find a declaration file for module '@verdaccio/local-storage'

My code

import LocalDataBase from '@verdaccio/local-storage';

I have found that the removal of types happened here: https://github.com/verdaccio/monorepo/pull/653/files#diff-8ee64c91b245a2d7b3704bc22a5df031b567732609ac23b0de7ea3a8661bdc03L57-R56 But I don't get why.

package.json still states that types are included, yet they are gone.

(I tried to add to the project @verdaccio/types and @verdaccio/legacy-types mentioned in the PR, but they don't have a declaration for LocalDataBase)

Leksat commented 1 year ago

@juanpicado maybe you can help here?

juanpicado commented 1 year ago

yes sorry, I what's the usage are you giving to the module?

Leksat commented 1 year ago

We use it to release packages to Git repositories: https://github.com/AmazeeLabs/silverback-mono/tree/development/packages/npm/verdaccio-git

juanpicado commented 1 year ago

I see, ok,

What happened is I'm trying to reduce the multiple modules to maintain (migration from v5->v6-alpha, and merged this old types @verdaccio/types package with the new one @verdaccio/types in v6,

The legacy @verdaccio/legacy-types is just if someone need it, but I can improve that to keep supporting old types but with a different module. I'll try to restore all packages using @verdaccio/legacy-types instead,

But I'd need to check your project and see, because I just noticed you are using

    "@verdaccio/types": "10.8.0",     <<----
    "verdaccio": "5.23.1"  <<----

These two versions won't work anymore, v5 uses now https://github.com/verdaccio/verdaccio/blob/5.x/package.json#L103

I the meantime you can use declare module "@verdaccio/local-storage" to avoid TS ask for the modules.

Leksat commented 1 year ago

But I'd need to check your project and see, because I just noticed you are using

"@verdaccio/types": "10.8.0",     <<----
"verdaccio": "5.23.1"  <<----

These two versions won't work anymore, v5 uses now https://github.com/verdaccio/verdaccio/blob/5.x/package.json#L103

Thanks! I will check this.

you can use declare module "@verdaccio/local-storage" to avoid TS ask for the modules

Yeah, but it would be nice to still have TS checks :)

juanpicado commented 1 year ago

Ok, now has types back, try again let me know if that helps