Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate yarn to npm #22116

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ From ORT v1.19 onwards, the ONNX Runtime Mobile packages are no longer published
From `<ORT_ROOT>/js/react_native,

```sh
yarn bootstrap
npm run bootstrap
```

When testing with a custom built ONNX Runtime Android package, copy `<BUILD_DIRECTORY>/aar_out/MinSizeRel/com/microsoft/onnxruntime/onnxruntime-android/<version>/onnxruntime-android-<version>.aar` into the `<ORT_ROOT>/js/react_native/e2e/android/app/libs` directory.
Expand All @@ -377,7 +377,7 @@ From ORT v1.19 onwards, the ONNX Runtime Mobile packages are no longer published
Install detox command line tools:

```
yarn global add detox-cli
npm install -g detox-cli
```

Install applesimutils which is required by Detox to work with iOS simulators. (Requires a MacOS device)
Expand Down Expand Up @@ -439,13 +439,13 @@ From ORT v1.19 onwards, the ONNX Runtime Mobile packages are no longer published
To record logs for testing results, add `--record-logs`. Output logs and test results will be produced in the `e2e/artifacts/` folder.
See: [Detox/logger#artifacts](https://wix.github.io/Detox/docs/api/logger#artifacts)

**_`yarn bootstrap` changes `packages.json` and `yarn.lock` files. Once testing is done, restore changes to avoid unwanted commit._**
**_`npm run bootstrap` changes `packages.json` and `pacakge-lock.json` files. Once testing is done, restore changes to avoid unwanted commit._**

5. Run Android and iOS apps.

```sh
yarn e2e android
yarn e2e ios
npm run e2e:android
npm run e2e:ios
```

### NPM Packaging
Expand All @@ -460,4 +460,4 @@ From ORT v1.19 onwards, the ONNX Runtime Mobile packages are no longer published

### Distribution

It should be able to consumed by React Native projects that uses Yarn packages through `yarn add onnxruntime-react-native`.
It should be able to consumed by React Native projects that uses npm packages through `npm install onnxruntime-react-native`.
2 changes: 1 addition & 1 deletion js/react_native/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ With ONNX Runtime React Native, React Native developers can score pre-trained ON
### Installation

```sh
yarn add onnxruntime-react-native
npm install onnxruntime-react-native
```

### Usage
Expand Down
3 changes: 2 additions & 1 deletion js/react_native/e2e/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ project.ext.react = [
entryFile: "index.tsx",
]

apply from: "../../node_modules/react-native/react.gradle"
// For 'react-native' >= 0.73.x, the react-native/react.gradle file is no longer used
// apply from: "../../node_modules/react-native/react.gradle"

/**
* Set this to true to create two separate APKs instead of one:
Expand Down
6 changes: 3 additions & 3 deletions js/react_native/e2e/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '13.0'
platform :ios, '15.0'

pre_install do |installer|
# Custom pre-install script or commands
Expand All @@ -15,7 +15,7 @@ end
target 'OnnxruntimeModuleExample' do
config = use_native_modules!

use_react_native!(:path => config["reactNativePath"])
use_react_native!(:path => '../node_modules/react-native')

use_frameworks!

Expand All @@ -32,7 +32,7 @@ post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'
end
end
end
Expand Down
Loading
Loading