Fix @iroha2/crypto-target-web → @iroha2/crypto-core dependency - change dev to prod
Define packages exports with exports field too. Also use .mjs for ESM and .cjs for CJS bundles.
Drop API Extractor and esbuild. Use rollup for everything.
API Extractor broke after moving to tsconfig paths monorepo approach. It was done to define actual packages main/module/exports fields in their package.json. I moved to Rollup and rollup-plugin-dts.
esbuild doesn't eliminate dead code in case like if (undefined) - proof. It brokes in-source testing by Vitest. Thus, I moved again to Rollup.
Drop @iroha2/client-isomorphic-*. Instead client library provides additional entrypoints for isomorphic adapters, like it is done at isomorphic-git.
For WebSocket, it has 2 entrypoints:
// where native `WebSocket` exists
import { adapter } from '@iroha2/client/web-socket/native'
// Uses `ws` package for node.js
import { adapter } from '@iroha2/client/web-socket/node'
new Client({ ws: adapter })
fetch could be provided in the same way, but @iroha2/client does not provide it by itself. There are node-fetch and undici packages that could solve it:
import { fetch } from 'undici'
import fetch from 'node-fetch'
new Client({ fetch })
List of changes
Fix
@iroha2/crypto-target-web
→@iroha2/crypto-core
dependency - changedev
toprod
Define packages exports with
exports
field too. Also use.mjs
for ESM and.cjs
for CJS bundles.Drop API Extractor and esbuild. Use
rollup
for everything.API Extractor broke after moving to
tsconfig
paths monorepo approach. It was done to define actual packagesmain
/module
/exports
fields in theirpackage.json
. I moved to Rollup androllup-plugin-dts
.esbuild
doesn't eliminate dead code in case likeif (undefined)
- proof. It brokes in-source testing by Vitest. Thus, I moved again to Rollup.Drop
@iroha2/client-isomorphic-*
. Instead client library provides additional entrypoints for isomorphic adapters, like it is done atisomorphic-git
.For WebSocket, it has 2 entrypoints:
fetch
could be provided in the same way, but@iroha2/client
does not provide it by itself. There arenode-fetch
andundici
packages that could solve it:E2e tests - Migrate to Cypress 10