haxiomic / dts2hx

Converts TypeScript definition files (d.ts) to haxe externs (.hx) via the TypeScript compiler API
MIT License
134 stars 9 forks source link

NodeJS type errors when converting module 'cacheable-lookup' #63

Open haxiomic opened 3 years ago

haxiomic commented 3 years ago

Breakout issue from https://github.com/haxiomic/dts2hx/issues/61#issuecomment-713973285

@rb1147x:

> Converting module cacheable-lookup
> Error: [TypeScript 3.7] Cannot find module 'dns'. (C:/test/node_modules/cacheable-lookup/index.d.ts:1:57)
> Error: [TypeScript 3.7] Cannot find module 'http'. (C:/test/node_modules/cacheable-lookup/index.d.ts:2:21)
> Error: [TypeScript 3.7] Cannot find namespace 'NodeJS'. (C:/test/node_modules/cacheable-lookup/index.d.ts:102:63)
> Error: [TypeScript 3.7] Cannot find namespace 'NodeJS'. (C:/test/node_modules/cacheable-lookup/index.d.ts:103:45)
> Error: [TypeScript 3.7] Cannot find namespace 'NodeJS'. (C:/test/node_modules/cacheable-lookup/index.d.ts:104:83)
> Error: [TypeScript 3.7] Cannot find namespace 'NodeJS'. (C:/test/node_modules/cacheable-lookup/index.d.ts:105:69)
> Saved externs for cacheable-lookup into .haxelib/cacheable-lookup/5,0,3/ 

cacheable-lookup doesn't explicitly depend on nodejs, so these definitions aren't made available, is it the

  "engines": {
    "node": ">=10"
  },

In package.json that implies them?