FoalTS / foal

Full-featured Node.js framework, with no complexity. 🚀 Simple and easy to use, TypeScript-based and well-documented.
https://foalts.org/
MIT License
1.89k stars 139 forks source link

Generating API reference does not work #710

Closed LoicPoullain closed 3 years ago

LoicPoullain commented 4 years ago

Running lerna run docs (or npm run docs in a specific package) fails. Because of that, the API reference has been out-of-date for several minor releases.

Using TypeScript 3.5.3 from /Users/loicpoullain/projects/FoalTS/foal/packages/core/node_modules/typescript/lib
Error: /Users/loicpoullain/projects/FoalTS/foal/packages/core/src/core/http/http-responses.ts(6)
 Could not find a declaration file for module 'mime'. '/Users/loicpoullain/projects/FoalTS/foal/packages/core/node_modules/mime/index.js' implicitly has an 'any' type.
  Try `npm install @types/mime` if it exists or add a new declaration (.d.ts) file containing `declare module 'mime';`
Error: /Users/loicpoullain/projects/FoalTS/foal/packages/core/src/express/create-app.ts(1)
 Could not find a declaration file for module 'cookie-parser'. '/Users/loicpoullain/projects/FoalTS/foal/packages/core/node_modules/cookie-parser/index.js' implicitly has an 'any' type.
  Try `npm install @types/cookie-parser` if it exists or add a new declaration (.d.ts) file containing `declare module 'cookie-parser';`
Error: /Users/loicpoullain/projects/FoalTS/foal/packages/core/src/express/create-app.ts(2)
 Could not find a declaration file for module 'express'. '/Users/loicpoullain/projects/FoalTS/foal/packages/core/node_modules/express/index.js' implicitly has an 'any' type.
  Try `npm install @types/express` if it exists or add a new declaration (.d.ts) file containing `declare module 'express';`
Error: /Users/loicpoullain/projects/FoalTS/foal/packages/core/src/express/create-app.ts(3)
 Could not find a declaration file for module 'morgan'. '/Users/loicpoullain/projects/FoalTS/foal/packages/core/node_modules/morgan/index.js' implicitly has an 'any' type.
  Try `npm install @types/morgan` if it exists or add a new declaration (.d.ts) file containing `declare module 'morgan';`
Error: /Users/loicpoullain/projects/FoalTS/foal/packages/core/src/express/send-response.ts(1)
 Could not find a declaration file for module 'pump'. '/Users/loicpoullain/projects/FoalTS/foal/packages/core/node_modules/pump/index.js' implicitly has an 'any' type.
  Try `npm install @types/pump` if it exists or add a new declaration (.d.ts) file containing `declare module 'pump';`

It looks like the issue is related to the noImplicitAny compiler option in tsconfig.json. When set to false the generation works.

LoicPoullain commented 3 years ago

Resolved in v2