mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-15 20:50:42 +00:00
* onnxruntime react native binding * add react native backend * fix lint comments * fix react native backend for ios * remove unnecessary files to check in * move onnxruntime-common to devDependency * create two podspec files for iphoneos and iphonesimulator * revise README.md and add third party notices for react native * rename a package * rename a package and revise README * add a license into package.json * revise README and comments * fix typo * fix lint errors * fix lint errors * add a prepack script. touch index.tsx and App.tsx to resolve CI issue * remove a unsupported tsx format from clang-format * fix a type and add steps tp publish a react native npm package * resolve comments * fix clang format * remove promise wrap. change prepack to typescript
20 lines
876 B
TypeScript
20 lines
876 B
TypeScript
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
import * as fs from 'fs-extra';
|
|
import * as path from 'path';
|
|
|
|
function updatePackageJson() {
|
|
const commonPackageJsonPath = path.join(__dirname, '..', '..', 'common', 'package.json');
|
|
const selfPackageJsonPath = path.join(__dirname, '..', 'package.json');
|
|
console.log(`=== start to update package.json: ${selfPackageJsonPath}`);
|
|
const packageCommon = fs.readJSONSync(commonPackageJsonPath);
|
|
const packageSelf = fs.readJSONSync(selfPackageJsonPath);
|
|
const version = packageCommon.version;
|
|
packageSelf.dependencies['onnxruntime-common'] = `~${version}`;
|
|
fs.writeJSONSync(selfPackageJsonPath, packageSelf, {spaces: 2});
|
|
console.log('=== finished updating package.json.');
|
|
}
|
|
|
|
// update version of dependency "onnxruntime-common" before packing
|
|
updatePackageJson();
|