What is the reason d.ts.libs folder (a copy of typ...
# javascript
v
What is the reason d.ts.libs folder (a copy of typescript/lib) is bundled with dukat?
u
In what sense bundled? It's not the part of repository per se. It's downloaded though (via npm) since we need to have standard lib definitions (which are expected by default for many declarations)
v
in a sense that after doing
npm install dukat
, there is a
./node_modules/dukat/d.ts.libs
folder; this folder also is in the published and downloaded
.tgz
bundle
my goal is to understand how dukat currently uses the folder
because I am trying to convert typescript definitions of node and ecmascript to kotlin in order to write and run a well typed kotlin version of https://nodejs.org/en/about/ sample
converting http://npmjs.com/package/@types/node succeeds, but ecmascript is currently failing at
npm i dukat && npx dukat -d kt node_modules/dukat/d.ts.libs/*.d.ts
, which throws
failed to resolve source file lib.es5.d.ts
so in summary: • I want to write a http server using node apis in kotlin running on node: i.e. port the sample in https://nodejs.org/en/about/ from js to kotlin • I am using strictly only
npm
and command line tools (
dukat
and
kotlinc-js
- no Gradle, IDEs, etc.); • for kotlinc-js to compile, I also need to have definitions for node and ecmascript APIs converted from typescript to kotlin • I am failing at a step of converting ecmascript definitions, try this:
npm i dukat && npx dukat -d kt node_modules/dukat/d.ts.libs/*.d.ts
, you will get
failed to resolve source file lib.es5.d.ts
• therefore got curious why the d.ts files are bundled with
dukat
while
dukat
fails to compile them - maybe it can work, but I missed to do something required
u
@Vytautas Jakutis as of now dukat is still under a heavy development and in our internal tests it compiles without problems (that is, the generated code compiles as well) about 25% of all definitions from DefinitelyTyped. As of now dukat helps in smaller cases as well as come up with some initial drafts so that one doesn't need to start from scratch while writing declarations. As of typescript std lib compilation - some improvements will happen pretty soon and I'll keep posted.
v
awesome! would love if the platforms (ecmascript, node and browser) definitions work first, only then libraries
I'll watch the dukat repo and this channel, thank you!
🙏 1