Skip to content

Commit

Permalink
[js] update a few packages (microsoft#18499)
Browse files Browse the repository at this point in the history
### Description
[js] update a few packages

- update semver
- update reference of onnx_proto to local folder in order to upgrade
[email protected]

Resolve AB#18513
  • Loading branch information
fs-eire authored and kleiti committed Mar 22, 2024
1 parent d2dd653 commit 28c9168
Show file tree
Hide file tree
Showing 8 changed files with 10,341 additions and 64 deletions.
79 changes: 23 additions & 56 deletions js/node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion js/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"scripts": {
"buildr": "tsc && node ./script/build --config=RelWithDebInfo",
"preprepare": "node -e \"require('node:fs').copyFileSync('./node_modules/long/index.d.ts', './node_modules/long/umd/index.d.ts')\"",
"prepare": "tsc --build script test .",
"rebuild": "tsc && node ./script/build --rebuild",
"rebuildd": "tsc && node ./script/build --rebuild --config=Debug",
Expand All @@ -39,7 +40,7 @@
"jsonc": "^2.0.0",
"minimist": "^1.2.8",
"node-addon-api": "^6.0.0",
"onnx-proto": "^8.0.1"
"protobufjs": "^7.2.4"
},
"main": "dist/index.js",
"os": [
Expand Down
2 changes: 2 additions & 0 deletions js/node/test/ort-schema/protobuf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!onnx.js
!onnx.d.ts
21 changes: 21 additions & 0 deletions js/node/test/ort-schema/protobuf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ONNX protobuf

This directory contains generated protobuf definition for onnx:

- onnx.js
- onnx.d.ts

These files are generated from [a fork of onnx-proto](https://github.com/fs-eire/onnx-proto/tree/update-v9).

The ONNX protobuf uses [email protected], which depends on [email protected], the version contains 2 bugs:

- type export does not work with commonjs. described in https://github.com/dcodeIO/long.js/pull/124. added a "postinstall" script to fix.
- in the generated typescript declaration file 'onnx.d.ts', the following line:
```ts
import Long = require("long");
```
need to be replaced to fix type import error:
```ts
import Long from "long";
```
this replacement is done and code format is also applied to file 'onnx.d.ts'.
Loading

0 comments on commit 28c9168

Please sign in to comment.