onnxruntime/js/common
Yulong Wang f972d21e81
[js] upgrade dependencies and enable strict mode (#14930)
### Description
This PR includes the following changes:
- upgrade js dependencies
- enable STRICT mode for web assembly build.
- corresponding fix for cmake-js upgrade
- corresponsing fix for linter upgrade
- upgrade default typescript compile option of:
    - `moduleResolution`: from `node` to `node16`
    - `target`: from `es2017` to `es2020`
- fix ESM module import in commonJS source file

## change explanation

### changes to onnxruntime_webassembly.cmake
`-s WASM=1` and `-s LLD_REPORT_UNDEFINED` in latest version is
by-default and deprecated.

### changes to onnxruntime_node.cmake
The npm package `cmake-js` updated its way to find file `node.lib`.
previously it downloads this file from Node.js public release channel,
and now it generates it from a definition file.

The node.js release channel does not contain a windows/arm64 version, so
previously cmake-js will fail to download `node.lib` for that platform.
this is why we made special handling to download the unofficial binary
to build. now this is no longer needed so we removed that from the cmake
file.

### changes to tsconfig.json
`node16` module resolution supports async import and `es2020` as target
supports top level await.
2023-03-22 15:05:04 -07:00
..
lib [js] upgrade dependencies and enable strict mode (#14930) 2023-03-22 15:05:04 -07:00
.gitignore [js/api] add typedoc and revise comments (#9077) 2021-09-20 17:54:46 -07:00
.npmignore [js/api] add typedoc and revise comments (#9077) 2021-09-20 17:54:46 -07:00
package-lock.json [js] upgrade dependencies and enable strict mode (#14930) 2023-03-22 15:05:04 -07:00
package.json [js] upgrade dependencies and enable strict mode (#14930) 2023-03-22 15:05:04 -07:00
README.md Replace 'master' branch ref to 'main' in the code (#12547) 2022-08-22 10:48:12 -07:00
tsconfig.json [web] utility functions for tensor<->image conversion in ORT web (#13603) 2023-01-12 09:05:18 -08:00
typedoc.json [js/api] add typedoc and revise comments (#9077) 2021-09-20 17:54:46 -07:00
webpack.config.js [js/web] optimize bundle file size (#9817) 2021-11-22 13:56:55 -08:00

ONNX Runtime JavaScript API

ONNX Runtime JavaScript API is a unified API for all JavaScript usages. It's dependency of the following NPM packages:

  • onnxruntime-node
  • onnxruntime-web
  • onnxruntime-react-native

This package (onnxruntime-common) is not designed for using directly. Please consider to install one of the NPM packages above according to target platform.

License

License information can be found here.