Hey, I want to publish a JS IR library to a npm re...
# javascript
h
Hey, I want to publish a JS IR library to a npm registry. This works with
npm-publish
from Martynas Petušk! But if I consume the library, Typescript complaints about
kotlin.js not found
.
In IR, the
kotlin
dependency is bundled with the exported
js
file. But it does not expose
kotlin
to the dependency block in `package.json`:
Copy code
"dependencies": {
    "node-fetch": "2.6.0",
    "abort-controller": "3.0.0",
    "ws": "6.2.1",
    "@js-joda/core": "3.2.0"
  },
b
kotlin itself should be bundled in generated js file
Also it's not re-exported (i.e. you cannot use its types)
I recommend adding "skipLibCheck": true, to your tsconfig
🚀 1
h
I will try this :D But how can you use eg
kotlin.js.Promise
, if it is not re-exported?
Okay, the
skipLibCheck
workaround is working! Thanks 🎉
b
kotlin.js.Promise is just a typealias to regular js promise