Skip to content

Commit b3e4d64

Browse files
fix: resolve CI and Android build issues with Yarn lockfile and JVM compatibility (#2)
* refactor: README and example documentation to clarify automatic preprocessing features * chore: update CHANGELOG for version 0.1.0 release, add compatibility guide, and enhance example app * chore: remove pre-publish script, enhance example app with improved format selection logic * ci: improve workflow configuration with memory optimization and Yarn Berry support * chore: update CHANGELOG, README, example to clarify preprocessing, enhance ESLint configuration * chore: add podspec and configuration, update Android build settings, refactor image decoding logic * chore: enhance caching strategy in CI workflow, improve Yarn installation process * chore: modify package.json for workspace support * chore: update yarn.lock to use workspace protocol * chore: update CI workflow to cache Expo dependencies and streamline build process for iOS and Android * chore: update CI workflow to set CI environment variable and modify build commands for Android and iOS * chore: set CI environment variable for Android and iOS build jobs in CI workflow * chore: set CI environment variable for build commands in package.json * fix: resolve CI build issue with Expo prebuild in non-interactive mode * fix: correct iOS build sequence by moving pod install after expo prebuild * chore: update Xcode version in CI workflow from 16.2 to 16.4
1 parent eb5f74d commit b3e4d64

23 files changed

+16650
-376
lines changed

.github/actions/setup/action.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,38 @@ runs:
99
with:
1010
node-version-file: .nvmrc
1111

12+
- name: Enable Corepack
13+
run: corepack enable
14+
shell: bash
15+
1216
- name: Restore dependencies
1317
id: yarn-cache
1418
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
1519
with:
1620
path: |
1721
**/node_modules
22+
.yarn/cache
1823
.yarn/install-state.gz
19-
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
24+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('package.json', 'example/package.json') }}
2025
restore-keys: |
2126
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
2227
${{ runner.os }}-yarn-
2328
2429
- name: Install dependencies
2530
if: steps.yarn-cache.outputs.cache-hit != 'true'
26-
run: yarn install --immutable
31+
run: |
32+
# Use immutable install for Yarn v3
33+
yarn install --immutable
2734
shell: bash
35+
env:
36+
NODE_OPTIONS: --max-old-space-size=4096
2837

2938
- name: Cache dependencies
3039
if: steps.yarn-cache.outputs.cache-hit != 'true'
3140
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
3241
with:
3342
path: |
3443
**/node_modules
44+
.yarn/cache
3545
.yarn/install-state.gz
3646
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}

.github/workflows/ci.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ on:
1010
types:
1111
- checks_requested
1212

13+
env:
14+
# Increase Node.js memory to prevent allocation errors
15+
NODE_OPTIONS: --max-old-space-size=4096
16+
# Ensure Yarn uses immutable installs
17+
YARN_ENABLE_IMMUTABLE_INSTALLS: true
18+
1319
jobs:
1420
lint:
1521
runs-on: ubuntu-latest
@@ -54,13 +60,19 @@ jobs:
5460
runs-on: ubuntu-latest
5561
env:
5662
TURBO_CACHE_DIR: .turbo/android
63+
CI: 1
5764
steps:
5865
- name: Checkout
5966
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6067

6168
- name: Setup
6269
uses: ./.github/actions/setup
6370

71+
- name: Install example dependencies
72+
run: cd example && yarn install --immutable
73+
env:
74+
NODE_OPTIONS: --max-old-space-size=4096
75+
6476
- name: Cache turborepo for Android
6577
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
6678
with:
@@ -102,22 +114,29 @@ jobs:
102114
103115
- name: Build example for Android
104116
env:
105-
JAVA_OPTS: "-XX:MaxHeapSize=6g"
117+
JAVA_OPTS: '-XX:MaxHeapSize=6g'
118+
CI: 1
106119
run: |
107120
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
108121
109122
build-ios:
110123
runs-on: macos-latest
111124
env:
112-
XCODE_VERSION: 16.2
125+
XCODE_VERSION: 16.4
113126
TURBO_CACHE_DIR: .turbo/ios
127+
CI: 1
114128
steps:
115129
- name: Checkout
116130
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
117131

118132
- name: Setup
119133
uses: ./.github/actions/setup
120134

135+
- name: Install example dependencies
136+
run: cd example && yarn install --immutable
137+
env:
138+
NODE_OPTIONS: --max-old-space-size=4096
139+
121140
- name: Cache turborepo for iOS
122141
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
123142
with:
@@ -140,14 +159,8 @@ jobs:
140159
with:
141160
xcode-version: ${{ env.XCODE_VERSION }}
142161

143-
- name: Install cocoapods
144-
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
145-
run: |
146-
cd example
147-
bundle install
148-
bundle exec pod repo update --verbose
149-
bundle exec pod install --project-directory=ios
150-
151162
- name: Build example for iOS
163+
env:
164+
CI: 1
152165
run: |
153166
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"

.github/workflows/env.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Environment Configuration
2+
3+
on:
4+
workflow_call:
5+
6+
env:
7+
# Node.js memory settings to prevent OOM errors
8+
NODE_OPTIONS: --max-old-space-size=4096
9+
10+
# Yarn settings for better CI performance
11+
YARN_ENABLE_IMMUTABLE_INSTALLS: true
12+
YARN_ENABLE_GLOBAL_CACHE: false
13+
14+
# Disable telemetry for various tools
15+
NEXT_TELEMETRY_DISABLED: 1
16+
TURBO_TELEMETRY_DISABLED: 1
17+
18+
jobs:
19+
validate-environment:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Check Node version
23+
run: node --version
24+
25+
- name: Check Yarn version
26+
run: yarn --version
27+
28+
- name: Check available memory
29+
run: free -h

CHANGELOG.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
## [0.1.0] - 2025-08-26
10+
## [0.1.0] - 2025-08-27
1111

1212
### Added
13+
1314
- Initial release of React Native Image Code Scanner
1415
- Native implementation for iOS using Vision Framework
1516
- Native implementation for Android using ML Kit
1617
- Support for 13 barcode formats (QR Code, Code 128, Code 39, etc.)
17-
- Advanced image preprocessing options:
18+
- **Automatic image preprocessing** for optimal recognition:
1819
- Contrast enhancement
1920
- Grayscale conversion
20-
- Automatic rotation attempts
21-
- Platform-specific preprocessing overrides
21+
- Multiple rotation attempts (0°, 90°, 180°, 270°)
22+
- **Ultra-simple API** - just pass image path and formats, preprocessing is automatic by default
2223
- Full support for React Native's New Architecture (Turbo Modules)
2324
- TypeScript support with complete type definitions
2425
- Comprehensive documentation and examples
@@ -27,19 +28,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2728
- Cross-platform example app (iOS, Android, Web)
2829

2930
### Features
31+
3032
- Lightweight and performant native implementation
31-
- Smart retry logic with image preprocessing
33+
- **Automatic preprocessing** enabled by default for best results
34+
- Smart retry logic with multiple image enhancement techniques
3235
- No additional setup required for Android
3336
- Minimal iOS setup with just pod install
3437
- **Expo integration** with proper prebuild workflow
3538
- **Modern example app** using Expo Image Picker and StatusBar
36-
- **Real-time configuration** of preprocessing options
39+
- **Simplified API** - just pass image path and formats
3740
- **Performance metrics** and timing measurements
3841

3942
### Example App Features
43+
4044
- Modern Expo-based example application
4145
- Barcode format selection UI with real-time toggles
42-
- Enhanced preprocessing options with visual controls
46+
- Automatic preprocessing info with optional disable switch
4347
- Improved error handling and user feedback
4448
- Comprehensive setup documentation
4549
- Support for both Expo Go (UI testing) and prebuild (full functionality)

0 commit comments

Comments
 (0)