KHex icon indicating copy to clipboard operation
KHex copied to clipboard

Publish JS artifacts to npm

Open fullkomnun opened this issue 4 years ago • 3 comments

Publish to npm / GitHub Packages npm registry, possibly using 'npm-pubish' gradle plugin.

Other resources about publication to npm:

With the new IR backend, it is also possible to generate [TypeScript declaration files](TypeScript declaration files)

fullkomnun avatar Feb 23 '21 09:02 fullkomnun

Really great to hear! Especially the TypeScript part - cc @pedrouid

ligi avatar Feb 23 '21 11:02 ligi

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

pedrouid avatar Mar 03 '21 12:03 pedrouid

Sadly Typescript Declaration generation is currently only experimental: https://kotlinlang.org/docs/js-ir-compiler.html#preview-generation-of-typescript-declaration-files-d-ts

BierDav avatar May 17 '23 21:05 BierDav