Publish JS artifacts to npm
Publish to npm / GitHub Packages npm registry, possibly using 'npm-pubish' gradle plugin.
Other resources about publication to npm:
- Another less mature gradle plugin: 'kt-npm-publish'
- Gradle deployment script from Kotlinx/coroutines
- Publish your backend API typings as an NPM package
- Kotlin/JS 1.4, how to output a NPM package?
With the new IR backend, it is also possible to generate [TypeScript declaration files](TypeScript declaration files)
Really great to hear! Especially the TypeScript part - cc @pedrouid
I'm not familiar with Kotlin to Typescript to Javascript compilation.
However you can use as reference what we do for WalletConnect packages for compiling from Typescript to Javascript.
Essentially you need to take consideration the command used and the tsconfig file.
Command: tsc -p tsconfig.cjs.json
// tsconfig.cjs.json
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist/cjs",
"rootDir": "./src",
"target": "es6",
"module": "commonjs",
"importHelpers": true,
"noUnusedLocals": false,
"strict": false
}
}
You can see this file extends from the root tsconfig file which I will link below: https://github.com/WalletConnect/walletconnect-monorepo/blob/next/tsconfig.json
Sadly Typescript Declaration generation is currently only experimental: https://kotlinlang.org/docs/js-ir-compiler.html#preview-generation-of-typescript-declaration-files-d-ts