cacjs / cac

Simple yet powerful framework for building command-line apps.
MIT License
2.65k stars 104 forks source link

Issue using typescript with nodenext #143

Closed Mister-Hope closed 2 years ago

Mister-Hope commented 2 years ago

Typescript cannot find cac types after switching modueResolution to NodeNext .

I think a .d.mts file should be added to avoid this error.

Screenshot_2022-08-24-01-24-14-78_40deb401b9ffe8e1df2f1cc5ba480b12.jpg

Mister-Hope commented 2 years ago

Update, adding a types declareation in exports fild can be the easiest way, so I make a pr to solve issue like this when moduleResolution is NodeNext or Node16:

packages/create/src/index.ts(2,21): error TS7016: Could not find a declaration file for module 'cac'. '/home/mister-hope/projects/vuepress-theme-hope/node_modules/.pnpm/cac@6.7.12/node_modules/cac/dist/index.mjs' implicitly has an 'any' type.
  Try `npm i --save-dev @types/cac` if it exists or add a new declaration (.d.ts) file containing `declare module 'cac';`
egoist commented 2 years ago

:tada: This issue has been resolved in version 6.7.14 :tada:

The release is available on:

Your semantic-release bot :package::rocket: