Skip to content

Commit 678787a

Browse files
committed
chore: add support for React Native 0.81.0+
2 parents 18788a6 + 96a8dc0 commit 678787a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+5632
-5705
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
*.pbxproj -text
22
# specific for windows script files
3-
*.bat text eol=crlf
3+
*.bat text eol=crlf
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: 🐛 Bug report
2+
description: Report a reproducible bug or regression in this library.
3+
labels: [bug]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
# Bug report
9+
10+
👋 Hi!
11+
12+
**Please fill the following carefully before opening a new issue ❗**
13+
*(Your issue may be closed if it doesn't provide the required pieces of information)*
14+
- type: checkboxes
15+
attributes:
16+
label: Before submitting a new issue
17+
description: Please perform simple checks first.
18+
options:
19+
- label: I tested using the latest version of the library, as the bug might be already fixed.
20+
required: true
21+
- label: I tested using a [supported version](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md) of react native.
22+
required: true
23+
- label: I checked for possible duplicate issues, with possible answers.
24+
required: true
25+
- type: textarea
26+
id: summary
27+
attributes:
28+
label: Bug summary
29+
description: |
30+
Provide a clear and concise description of what the bug is.
31+
If needed, you can also provide other samples: error messages / stack traces, screenshots, gifs, etc.
32+
validations:
33+
required: true
34+
- type: input
35+
id: library-version
36+
attributes:
37+
label: Library version
38+
description: What version of the library are you using?
39+
placeholder: "x.x.x"
40+
validations:
41+
required: true
42+
- type: textarea
43+
id: react-native-info
44+
attributes:
45+
label: Environment info
46+
description: Run `react-native info` in your terminal and paste the results here.
47+
render: shell
48+
validations:
49+
required: true
50+
- type: textarea
51+
id: steps-to-reproduce
52+
attributes:
53+
label: Steps to reproduce
54+
description: |
55+
You must provide a clear list of steps and code to reproduce the problem.
56+
value: |
57+
1. …
58+
2. …
59+
validations:
60+
required: true
61+
- type: input
62+
id: reproducible-example
63+
attributes:
64+
label: Reproducible example repository
65+
description: Please provide a link to a repository on GitHub with a reproducible example.
66+
validations:
67+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Feature Request 💡
4+
url: https://github.com/SpeedcuberOSS/react-native-location-status/discussions/new?category=ideas
5+
about: If you have a feature request, please create a new discussion on GitHub.
6+
- name: Discussions on GitHub 💬
7+
url: https://github.com/SpeedcuberOSS/react-native-location-status/discussions
8+
about: If this library works as promised but you need help, please ask questions there.

.github/actions/setup/action.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ runs:
55
using: composite
66
steps:
77
- name: Setup Node.js
8-
uses: actions/setup-node@v3
8+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
99
with:
1010
node-version-file: .nvmrc
1111

12-
- name: Cache dependencies
12+
- name: Restore dependencies
1313
id: yarn-cache
14-
uses: actions/cache@v3
14+
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
1515
with:
1616
path: |
1717
**/node_modules
@@ -25,3 +25,12 @@ runs:
2525
if: steps.yarn-cache.outputs.cache-hit != 'true'
2626
run: yarn install --immutable
2727
shell: bash
28+
29+
- name: Cache dependencies
30+
if: steps.yarn-cache.outputs.cache-hit != 'true'
31+
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
32+
with:
33+
path: |
34+
**/node_modules
35+
.yarn/install-state.gz
36+
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}

.github/workflows/ci.yml

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

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
lint:
1519
runs-on: ubuntu-latest
20+
1621
steps:
1722
- name: Checkout
18-
uses: actions/checkout@v3
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1924

2025
- name: Setup
2126
uses: ./.github/actions/setup
@@ -28,9 +33,10 @@ jobs:
2833

2934
test:
3035
runs-on: ubuntu-latest
36+
3137
steps:
3238
- name: Checkout
33-
uses: actions/checkout@v3
39+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3440

3541
- name: Setup
3642
uses: ./.github/actions/setup
@@ -40,9 +46,10 @@ jobs:
4046

4147
build-library:
4248
runs-on: ubuntu-latest
49+
4350
steps:
4451
- name: Checkout
45-
uses: actions/checkout@v3
52+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4653

4754
- name: Setup
4855
uses: ./.github/actions/setup
@@ -52,17 +59,19 @@ jobs:
5259

5360
build-android:
5461
runs-on: ubuntu-latest
62+
5563
env:
5664
TURBO_CACHE_DIR: .turbo/android
65+
5766
steps:
5867
- name: Checkout
59-
uses: actions/checkout@v3
68+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6069

6170
- name: Setup
6271
uses: ./.github/actions/setup
6372

6473
- name: Cache turborepo for Android
65-
uses: actions/cache@v3
74+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
6675
with:
6776
path: ${{ env.TURBO_CACHE_DIR }}
6877
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
@@ -79,7 +88,7 @@ jobs:
7988
8089
- name: Install JDK
8190
if: env.turbo_cache_hit != 1
82-
uses: actions/setup-java@v3
91+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
8392
with:
8493
distribution: 'zulu'
8594
java-version: '17'
@@ -91,7 +100,7 @@ jobs:
91100
92101
- name: Cache Gradle
93102
if: env.turbo_cache_hit != 1
94-
uses: actions/cache@v3
103+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
95104
with:
96105
path: |
97106
~/.gradle/wrapper
@@ -107,18 +116,23 @@ jobs:
107116
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
108117
109118
build-ios:
110-
runs-on: macos-14
119+
runs-on: macos-latest
120+
111121
env:
122+
XCODE_VERSION: 16.3
112123
TURBO_CACHE_DIR: .turbo/ios
124+
RCT_USE_RN_DEP: 1
125+
RCT_USE_PREBUILT_RNCORE: 1
126+
113127
steps:
114128
- name: Checkout
115-
uses: actions/checkout@v3
129+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
116130

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

120134
- name: Cache turborepo for iOS
121-
uses: actions/cache@v3
135+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
122136
with:
123137
path: ${{ env.TURBO_CACHE_DIR }}
124138
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
@@ -133,24 +147,19 @@ jobs:
133147
echo "turbo_cache_hit=1" >> $GITHUB_ENV
134148
fi
135149
136-
- name: Cache cocoapods
150+
- name: Use appropriate Xcode version
137151
if: env.turbo_cache_hit != 1
138-
id: cocoapods-cache
139-
uses: actions/cache@v3
152+
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
140153
with:
141-
path: |
142-
**/ios/Pods
143-
key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
144-
restore-keys: |
145-
${{ runner.os }}-cocoapods-
154+
xcode-version: ${{ env.XCODE_VERSION }}
146155

147156
- name: Install cocoapods
148157
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
149158
run: |
150-
cd example/ios
151-
pod install
152-
env:
153-
NO_FLIPPER: 1
159+
cd example
160+
bundle install
161+
bundle exec pod repo update --verbose
162+
bundle exec pod install --project-directory=ios
154163
155164
- name: Build example for iOS
156165
run: |

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ DerivedData
2828
*.ipa
2929
*.xcuserstate
3030
project.xcworkspace
31-
.xcode.env.local
31+
**/.xcode.env.local
3232

3333
# Android/IJ
3434
#
@@ -81,3 +81,6 @@ lib/
8181
# React Native Codegen
8282
ios/generated
8383
android/generated
84+
85+
# React Native Nitro Modules
86+
nitrogen/

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18
1+
v22.20.0

CONTRIBUTING.md

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,23 @@ This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/f
1111
- The library package in the root directory.
1212
- An example app in the `example/` directory.
1313

14-
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
14+
To get started with the project, make sure you have the correct version of [Node.js](https://nodejs.org/) installed. See the [`.nvmrc`](./.nvmrc) file for the version used in this project.
15+
16+
Run `yarn` in the root directory to install the required dependencies for each package:
1517

1618
```sh
1719
yarn
1820
```
1921

20-
> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.
22+
> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development without manually migrating.
2123
2224
> If you have `node` installed, then to install Yarn simply run `corepack enable`
2325
2426
The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.
2527

2628
It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app.
2729

28-
If you want to use Android Studio or XCode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/LocationStatusExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-location-status`.
30+
If you want to use Android Studio or Xcode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/LocationStatusExample.xcworkspace` in Xcode and find the source files at `Pods > Development Pods > react-native-location-status`.
2931

3032
To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-location-status` under `Android`.
3133

@@ -49,29 +51,6 @@ To run the example app on iOS:
4951
yarn example ios
5052
```
5153

52-
By default, the example is configured to build with the old architecture. To run the example with the new architecture, you can do the following:
53-
54-
1. For Android, run:
55-
56-
```sh
57-
ORG_GRADLE_PROJECT_newArchEnabled=true yarn example android
58-
```
59-
60-
2. For iOS, run:
61-
62-
```sh
63-
cd example/ios
64-
RCT_NEW_ARCH_ENABLED=1 pod install
65-
cd -
66-
yarn example ios
67-
```
68-
69-
If you are building for a different architecture than your previous build, make sure to remove the build folders first. You can run the following command to cleanup all build folders:
70-
71-
```sh
72-
yarn clean
73-
```
74-
7554
To confirm that the app is running with the new architecture, you can check the Metro logs for a message like this:
7655

7756
```sh
@@ -106,7 +85,7 @@ We follow the [conventional commits specification](https://www.conventionalcommi
10685
- `fix`: bug fixes, e.g. fix crash due to deprecated method.
10786
- `feat`: new features, e.g. add new method to the module.
10887
- `refactor`: code refactor, e.g. migrate from class components to hooks.
109-
- `docs`: changes into documentation, e.g. add usage example for the module..
88+
- `docs`: changes into documentation, e.g. add usage example for the module.
11089
- `test`: adding or updating tests, e.g. add integration tests using detox.
11190
- `chore`: tooling changes, e.g. change CI config.
11291

LocationStatus.podspec

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
require "json"
2+
3+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4+
5+
Pod::Spec.new do |s|
6+
s.name = "LocationStatus"
7+
s.version = package["version"]
8+
s.summary = package["description"]
9+
s.homepage = package["homepage"]
10+
s.license = package["license"]
11+
s.authors = package["author"]
12+
13+
s.platforms = { :ios => min_ios_version_supported }
14+
s.source = { :git => "https://github.com/SpeedcuberOSS/react-native-location-status.git", :tag => "#{s.version}" }
15+
16+
s.source_files = "ios/**/*.{h,m,mm,cpp}"
17+
s.private_header_files = "ios/**/*.h"
18+
19+
20+
install_modules_dependencies(s)
21+
end

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ Checks if location is enabled on the device
1010

1111
## Installation
1212

13+
1314
```sh
1415
npm install react-native-location-status
1516
```
1617

18+
1719
## Usage
1820

1921

@@ -31,7 +33,9 @@ always return `false`.</sub>
3133

3234
## Contributing
3335

34-
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
36+
- [Development workflow](CONTRIBUTING.md#development-workflow)
37+
- [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
38+
- [Code of conduct](CODE_OF_CONDUCT.md)
3539

3640
## License
3741

0 commit comments

Comments
 (0)