Skip to content

Commit

Permalink
fix all paths
Browse files Browse the repository at this point in the history
  • Loading branch information
hannojg committed Oct 17, 2024
1 parent dd8233e commit 904f855
Show file tree
Hide file tree
Showing 23 changed files with 64 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ body:
attributes:
label: Can you reproduce this issue in the VisionCamera Example app?
description: >
Try to build the example app (`package/example/`) and see if the issue is reproduceable here.
Try to build the example app (`example/`) and see if the issue is reproduceable here.
**Note:** If you don't try this in the example app, I most likely won't help you with your issue.
options:
- I didn't try (⚠️ your issue might get ignored & closed if you don't try this)
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUILD_ERROR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ body:
attributes:
label: Can you build the VisionCamera Example app?
description: >
Try to build the example app (`package/example/`) and see if the issue is reproduceable here.
Try to build the example app (`example/`) and see if the issue is reproduceable here.
**Note:** If you don't try to build the example app, I most likely won't help you with your issue.
options:
- I didn't try (⚠️ your issue might get ignored & closed if you don't try this)
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ updates:
# - "🛠 dependencies"
# - "☕️ js"
# - package-ecosystem: "npm"
# directory: "/package/example/"
# directory: "/example/"
# schedule:
# interval: "monthly"
# labels:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ on:
paths:
- ".github/workflows/build-android.yml"
- "package/android/**"
- "package/example/android/**"
- "package/yarn.lock"
- "package/example/yarn.lock"
- "example/android/**"
- "package/bun.lockb"
- "example/bun.lockb"
pull_request:
paths:
- ".github/workflows/build-android.yml"
- "package/android/**"
- "package/example/android/**"
- "package/yarn.lock"
- "package/example/yarn.lock"
- "example/android/**"
- "package/bun.lockb"
- "example/bun.lockb"

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ on:
- ".github/workflows/build-ios.yml"
- "package/ios/**"
- "package/*.podspec"
- "package/example/ios/**"
- "example/ios/**"
pull_request:
paths:
- ".github/workflows/build-ios.yml"
- "package/ios/**"
- "package/*.podspec"
- "package/example/ios/**"
- "example/ios/**"

jobs:
build:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/validate-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ on:
- "package/*.json"
- "package/*.js"
- "package/*.lock"
- "package/example/src/**"
- "package/example/*.json"
- "package/example/*.js"
- "package/example/*.lock"
- "package/example/*.tsx"
- "example/src/**"
- "example/*.json"
- "example/*.js"
- "example/*.lock"
- "example/*.tsx"
pull_request:
paths:
- ".github/workflows/validate-js.yml"
- "package/src/**"
- "package/*.json"
- "package/*.js"
- "package/*.lock"
- "package/example/src/**"
- "package/example/*.json"
- "package/example/*.js"
- "package/example/*.lock"
- "package/example/*.tsx"
- "example/src/**"
- "example/*.json"
- "example/*.js"
- "example/*.lock"
- "example/*.tsx"

jobs:
compile:
Expand Down
10 changes: 0 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ example/vendor/
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log

# Bun
package-lock.json
Expand All @@ -66,14 +64,6 @@ buck-out/
android/app/libs
android/keystores/debug.keystore

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Expo
.expo/

Expand Down
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
```
cd react-native-vision-camera
cd package
yarn bootstrap
bun bootstrap
```

Read the READMEs in [`android/`](android/README.md) and [`ios/`](ios/README.md) for a quick overview of the native development workflow.
Expand All @@ -22,10 +22,10 @@ Read the READMEs in [`android/`](android/README.md) and [`ios/`](ios/README.md)
### JS/TS

1. Open the entire folder in Visual Studio Code
2. Start the metro bundler in the `example/` directory using `yarn start`
2. Start the metro bundler in the `example/` directory using `bun start`
3. Run either the iOS or Android project to test changes

> Run `yarn check-js` to validate codestyle
> Run `bun check-js` to validate codestyle
### iOS

Expand All @@ -34,27 +34,27 @@ Read the READMEs in [`android/`](android/README.md) and [`ios/`](ios/README.md)
3. Select your device in the devices drop-down
4. Hit run

> Run `yarn check-ios` to validate codestyle
> Run `bun check-ios` to validate codestyle
### Android

1. Open the `example/android/` folder with Android Studio
2. Start the metro bundler in the `example/` directory using `yarn start`
2. Start the metro bundler in the `example/` directory using `bun start`
3. Select your device in the devices drop-down
4. Once your device is connected, make sure it can find the metro bundler's port:
```
adb reverse tcp:8081 tcp:8081
```
6. Hit run

> Run `yarn check-android` to validate codestyle
> Run `bun check-android` to validate codestyle
### Docs

1. Edit the relevant file, it may be easiest to search for what you're editing to find the right file
2. Install all dependencies by running `yarn` inside the `docs` folder
2. Install all dependencies by running `bun` inside the `docs` folder

> Run `yarn start` to generate the docs, you can then view them in your browser to confirm your changes
> Run `bun start` to generate the docs, you can then view them in your browser to confirm your changes
## Committing

Expand All @@ -65,14 +65,14 @@ Great code produces great products. That's why we love to keep our codebases cle
Before pushing your changes, you can verify that everything is still correctly formatted by running all linters:

```
yarn check-all
bun check-all
```

This validates Swift, Kotlin, C++ and JS/TS code:

```bash
$ yarn check-all
yarn run v1.22.10
$ bun check-all
bun run v1.22.10
Formatting Swift code..
Linting Swift code..
Linting Kotlin code..
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cd ios && pod install

* [Guides](https://react-native-vision-camera.com/docs/guides)
* [API](https://react-native-vision-camera.com/docs/api)
* [Example](./package/example/)
* [Example](./example/)
* [Frame Processor Plugins](https://react-native-vision-camera.com/docs/guides/frame-processor-plugins-community)

### ShadowLens
Expand Down Expand Up @@ -74,7 +74,7 @@ function App() {
}
```

> See the [example](./package/example/) app
> See the [example](./example/) app
### Adopting at scale

Expand Down
3 changes: 1 addition & 2 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*



# TypeDoc/Docusaurus stuff
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/FRAME_PROCESSORS_TIPS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ In my benchmarks, Frame Processors can run more than 1000 times a second.

Frame Processor Plugins are native functions (written in Objective-C, Swift, C++, Java or Kotlin) that are injected into the VisionCamera JS-Runtime. They can be synchronously called from your JS Frame Processors (using JSI) without ever going over the bridge. Because VisionCamera provides an easy-to-use plugin API, you can easily create a Frame Processor Plugin yourself. Some examples include [Barcode Scanning](https://developers.google.com/ml-kit/vision/barcode-scanning), [Face Detection](https://developers.google.com/ml-kit/vision/face-detection), [Image Labeling](https://developers.google.com/ml-kit/vision/image-labeling), [Text Recognition](https://developers.google.com/ml-kit/vision/text-recognition) and more.

> Learn how to [create Frame Processor Plugins](frame-processors-plugins-overview), or check out the [example Frame Processor Plugin for iOS](https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example/ios/Frame%20Processors%20Plugins/Example%20Swift%20Plugin/ExampleSwiftFrameProcessor.swift) or [Android](https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example/android/app/src/main/java/com/mrousavy/camera/example/ExampleKotlinFrameProcessorPlugin.kt).
> Learn how to [create Frame Processor Plugins](frame-processors-plugins-overview), or check out the [example Frame Processor Plugin for iOS](https://github.com/mrousavy/react-native-vision-camera/blob/main/example/ios/Frame%20Processors%20Plugins/Example%20Swift%20Plugin/ExampleSwiftFrameProcessor.swift) or [Android](https://github.com/mrousavy/react-native-vision-camera/blob/main/example/android/app/src/main/java/com/mrousavy/camera/example/ExampleKotlinFrameProcessorPlugin.kt).
### The `Frame` object

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/FRAME_PROCESSOR_CREATE_PLUGIN_ANDROID.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class FaceDetectorFrameProcessorPlugin extends FrameProcessorPlugin {
}
```

4. **Implement your Frame Processing.** See the [Example Plugin (Java)](https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example/android/app/src/main/java/com/mrousavy/camera/example/ExampleFrameProcessorPlugin.java) for reference.
4. **Implement your Frame Processing.** See the [Example Plugin (Java)](https://github.com/mrousavy/react-native-vision-camera/blob/main/example/android/app/src/main/java/com/mrousavy/camera/example/ExampleFrameProcessorPlugin.java) for reference.
5. Create a new Java file which registers the Frame Processor Plugin in a React Package, for the Face Detector plugin this file will be called `FaceDetectorFrameProcessorPluginPackage.java`:

```java
Expand Down Expand Up @@ -148,7 +148,7 @@ class FaceDetectorFrameProcessorPlugin(proxy: VisionCameraProxy, options: Map<St
}
```

4. **Implement your Frame Processing.** See the [Example Plugin (Kotlin)](https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example/android/app/src/main/java/com/mrousavy/camera/example/ExampleKotlinFrameProcessorPlugin.kt) for reference.
4. **Implement your Frame Processing.** See the [Example Plugin (Kotlin)](https://github.com/mrousavy/react-native-vision-camera/blob/main/example/android/app/src/main/java/com/mrousavy/camera/example/ExampleKotlinFrameProcessorPlugin.kt) for reference.
5. Create a new Kotlin file which registers the Frame Processor Plugin in a React Package, for the Face Detector plugin this file will be called `FaceDetectorFrameProcessorPluginPackage.kt`:

```kotlin
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/FRAME_PROCESSOR_CREATE_PLUGIN_IOS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ VISION_EXPORT_FRAME_PROCESSOR(FaceDetectorFrameProcessorPlugin, detectFaces)
The Frame Processor Plugin can be initialized from JavaScript using `VisionCameraProxy.initFrameProcessorPlugin("detectFaces")`.
:::
4. **Implement your Frame Processing.** See the [Example Plugin (Objective-C)](https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example/ios/Frame%20Processor%20Plugins/Example%20Plugin/ExampleFrameProcessorPlugin.m) for reference.
4. **Implement your Frame Processing.** See the [Example Plugin (Objective-C)](https://github.com/mrousavy/react-native-vision-camera/blob/main/example/ios/Frame%20Processor%20Plugins/Example%20Plugin/ExampleFrameProcessorPlugin.m) for reference.
</TabItem>
<TabItem value="swift">
Expand Down Expand Up @@ -118,7 +118,7 @@ VISION_EXPORT_SWIFT_FRAME_PROCESSOR(FaceDetectorFrameProcessorPlugin, detectFace
// highlight-end
```
5. **Implement your frame processing.** See [Example Plugin (Swift)](https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example/ios/Frame%20Processor%20Plugins/Example%20Swift%20Plugin/ExampleSwiftFrameProcessor.swift) for reference.
5. **Implement your frame processing.** See [Example Plugin (Swift)](https://github.com/mrousavy/react-native-vision-camera/blob/main/example/ios/Frame%20Processor%20Plugins/Example%20Swift%20Plugin/ExampleSwiftFrameProcessor.swift) for reference.
</TabItem>
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/guides/TROUBLESHOOTING.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ If you're experiencing build issues or runtime issues in VisionCamera, make sure
```sh
./android/gradlew clean
rm -rf android/.gradle android/.idea android/app/build android/build
rm -rf package-lock.json yarn.lock node_modules
yarn # or `npm i`
rm -rf package-lock.json bun.lockb node_modules
bun install # or `npm i`
```
4. Make sure you have installed the [Android NDK](https://developer.android.com/ndk).
5. Make sure your minimum SDK version is **21 or higher**, and target SDK version is **33 or higher**. See [the example's `build.gradle`](https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example/android/build.gradle#L5-L9) for reference.
5. Make sure your minimum SDK version is **21 or higher**, and target SDK version is **33 or higher**. See [the example's `build.gradle`](https://github.com/mrousavy/react-native-vision-camera/blob/main/example/android/build.gradle#L5-L9) for reference.
1. Open your `build.gradle`
2. Set `buildToolsVersion` to `33.0.0` or higher
3. Set `compileSdkVersion` to `33` or higher
Expand Down Expand Up @@ -127,7 +127,7 @@ If you're experiencing build issues or runtime issues in VisionCamera, make sure

## Issues

If nothing has helped so far, try browsing the [GitHub issues](https://github.com/mrousavy/react-native-vision-camera/issues?q=is%3Aissue). If your issue doesn't exist, [create a new one](https://github.com/mrousavy/react-native-vision-camera/issues/new/choose). Make sure to fill out the template and include as many details as possible. Also try to reproduce the issue in the [example app](https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example).
If nothing has helped so far, try browsing the [GitHub issues](https://github.com/mrousavy/react-native-vision-camera/issues?q=is%3Aissue). If your issue doesn't exist, [create a new one](https://github.com/mrousavy/react-native-vision-camera/issues/new/choose). Make sure to fill out the template and include as many details as possible. Also try to reproduce the issue in the [example app](https://github.com/mrousavy/react-native-vision-camera/blob/main/example).


<br />
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/ZOOMING.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ A Camera's `zoom` property is represented in a **logarithmic scale**. That means

## Pinch-to-zoom

The above example only demonstrates how to animate the `zoom` property. To actually implement pinch-to-zoom or pan-to-zoom, take a look at the [VisionCamera example app](https://github.com/mrousavy/react-native-vision-camera/tree/main/package/example), the pinch-to-zoom gesture can be found [here](https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example/src/views/CaptureButton.tsx#L189-L208), and the pan-to-zoom gesture can be found [here](https://github.com/mrousavy/react-native-vision-camera/blob/d8551792e97eaa6fa768f54059ffce054bf748d9/example/src/views/CaptureButton.tsx#L185-L205). They implement a real world use-case, where the maximum zoom value is clamped to a realistic value, and the zoom responds very gracefully by using a logarithmic scale.
The above example only demonstrates how to animate the `zoom` property. To actually implement pinch-to-zoom or pan-to-zoom, take a look at the [VisionCamera example app](https://github.com/mrousavy/react-native-vision-camera/tree/main/example), the pinch-to-zoom gesture can be found [here](https://github.com/mrousavy/react-native-vision-camera/blob/main/example/src/views/CaptureButton.tsx#L189-L208), and the pan-to-zoom gesture can be found [here](https://github.com/mrousavy/react-native-vision-camera/blob/d8551792e97eaa6fa768f54059ffce054bf748d9/example/src/views/CaptureButton.tsx#L185-L205). They implement a real world use-case, where the maximum zoom value is clamped to a realistic value, and the zoom responds very gracefully by using a logarithmic scale.

## Example (Reanimated + Gesture Handler)

Expand Down
4 changes: 2 additions & 2 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module.exports = {
position: 'left'
},
{
href: 'https://github.com/mrousavy/react-native-vision-camera/tree/main/package/example',
href: 'https://github.com/mrousavy/react-native-vision-camera/tree/main/example',
label: 'Example App',
position: 'left'
},
Expand Down Expand Up @@ -127,7 +127,7 @@ module.exports = {
},
{
label: 'Example App',
href: 'https://github.com/mrousavy/react-native-vision-camera/tree/main/package/example',
href: 'https://github.com/mrousavy/react-native-vision-camera/tree/main/example',
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To try the playground out for yourself, run the following commands:
```sh
git clone https://github.com/mrousavy/react-native-vision-camera
cd react-native-vision-camera/package
yarn bootstrap
bun bootstrap
```

### iOS
Expand Down
8 changes: 4 additions & 4 deletions example/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

echo "rm -rf node_modules"
rm -rf node_modules
echo "rm -rf yarn.lock"
rm -rf yarn.lock
echo "rm -rf bun.lockb"
rm -rf bun.lockb
rm -rf package-lock.json

echo "rm -rf ~/Library/Caches/CocoaPods"
Expand All @@ -25,7 +25,7 @@ echo "pod deintegrate"
pod deintegrate
echo "pod setup"
pod setup
echo "yarn"
yarn
echo "bun install"
bun install
echo "pod install"
pod install
9 changes: 0 additions & 9 deletions package/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ local.properties
#
node_modules/
npm-debug.log
yarn-error.log

# fastlane
#
Expand All @@ -65,14 +64,6 @@ yarn-error.log
# testing
/coverage

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# TypeScript output
/lib
/example/lib
Expand Down
2 changes: 1 addition & 1 deletion package/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can however still edit the library project here by opening this folder with
Before committing, make sure that you're not violating the Kotlin codestyles. To do that, run the following command:
```bash
yarn check-android
bun check-android
```
This will also try to automatically fix any errors by re-formatting the Kotlin code.
4 changes: 2 additions & 2 deletions package/scripts/check-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ echo "Formatting C++ code.."
./scripts/clang-format.sh

echo "Linting JS/TS code.."
yarn lint --fix
yarn typescript
bun lint --fix
bun typescript

echo "All done!"
Loading

0 comments on commit 904f855

Please sign in to comment.