onnxruntime/js/node/test/ort-schema/protobuf
Yulong Wang 34c5424456
[js] update a few packages (#18499)
### Description
[js] update a few packages

- update semver
- update reference of onnx_proto to local folder in order to upgrade
protobufjs@7.2.4

Resolve AB#18513
2023-11-17 22:40:51 -08:00
..
.gitignore [js] update a few packages (#18499) 2023-11-17 22:40:51 -08:00
onnx.d.ts [js] update a few packages (#18499) 2023-11-17 22:40:51 -08:00
onnx.js [js] update a few packages (#18499) 2023-11-17 22:40:51 -08:00
README.md [js] update a few packages (#18499) 2023-11-17 22:40:51 -08:00

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.

The ONNX protobuf uses protobufjs@7.2.4, which depends on long@5.2.3, 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:
    import Long = require("long");
    
    need to be replaced to fix type import error:
    import Long from "long";
    
    this replacement is done and code format is also applied to file 'onnx.d.ts'.