iway1 / trpc-panel

MIT License
663 stars 50 forks source link

Module Resolution for nodenext #50

Closed dca123 closed 1 year ago

dca123 commented 1 year ago

Currently the package.json doesn't export the types property and thus if you tsconfig has

{
  moduleResolution: 'nodenext'
}

it throws an error

 error TS7016: Could not find a declaration file for module 'trpc-panel'. '/home/devinda/Projects/.../node_modules/.pnpm/trpc-panel@1.2.8_ty3fefsii75ejeai2aadxz5swe/node_modules/trpc-panel/lib/index.js' implicitly has an 'any' type.

Try `npm i --save-dev @types/trpc-panel` if it exists or add a new declaration (.d.ts) file containing `declare module 'trpc-panel';`

ELIFECYCLE  Command failed with exit code 1.

Here is a demo of the problem - https://stackblitz.com/edit/typescript-uso3mx?file=index.ts

Attached a simple PR #51 that should fix this.

Great project ! Super simple, but super awesome in a team environment !

iway1 commented 1 year ago

this has been released, ty :)