Skip to content

Commit

Permalink
Merge branch 'main' into dependabot-npm_and_yarn-example-babel-plugin…
Browse files Browse the repository at this point in the history
…-module-resolver-5.0.0
  • Loading branch information
tyrauber authored Mar 26, 2024
2 parents e5e8910 + 9a48139 commit 5f60bcd
Show file tree
Hide file tree
Showing 21 changed files with 5,707 additions and 4,578 deletions.
35 changes: 35 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,41 @@ updates:
directory: "/"
schedule:
interval: "monthly"
groups:
core:
patterns:
- "react"
- "react-native"
- "@mapbox/*"
- "@turf/*"
- "@expo/config-plugins"
dev:
patterns:
- "jest"
- "@testing*"
- "@types/*"
- "typescript"
- "@babel/*"
- "babel*"
- "@typescript-eslint/*"
- "eslint-*"
- "eslint"
- "lint*"
- "@react-native-community/*"
- "documentation"
- "ejs*"
- "husky"
- "metro-*"
- "prettier"
example:
patterns:
- "expo*"
- "react-*"
- "react-native*"
- "@react-native*"
- "@react-navigation*"
- "fbjs"
- "detox"
pull-request-branch-name:
separator: "-"
labels:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ios-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
brew install applesimutils
- name: Build for detox
run: yarn detox build
run: yarn detox build -c ios.sim.release

- name: Test with detox
run: yarn detox test --debug-synchronization 200
run: yarn detox test --debug-synchronization 200 -c ios.sim.release
5,624 changes: 3,075 additions & 2,549 deletions .pnp.cjs
100644 → 100755

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@ Please add unreleased changes in the following style:
PR Title ([#123](link to my pr))
```

Update expo-config and expo-scripts ([#47](https://github.com/maplibre/maplibre-react-native/pull/104) and [#69](https://github.com/maplibre/maplibre-react-native/pull/69))
## 10.0.0-alpha.2

Fix: Duplicated Signature issue with Xcode 15 ([#238](https://github.com/maplibre/maplibre-react-native/pull/238))
Update download-style-spec.sh ([#163](https://github.com/maplibre/maplibre-react-native/pull/163))
Update react-maplibre ([#34](https://github.com/maplibre/maplibre-react-native/issues/34))
chore: update support libraries ([#121](https://github.com/maplibre/maplibre-react-native/pull/121)).

## 10.0.0-alpha.1

fix: plugin for debug simulator ([#164](https://github.com/maplibre/maplibre-react-native/pull/164)

## 10.0-alpha.0

chore: update detox ([#207](https://github.com/maplibre/maplibre-react-native/pull/207))
chore: update expo-config and expo-scripts ([#47](https://github.com/maplibre/maplibre-react-native/pull/104) and [#69](https://github.com/maplibre/maplibre-react-native/pull/69))
chore: update prettier and eslint-plugin-prettier ([#111](https://github.com/maplibre/maplibre-react-native/pull/111))
feat: **breaking** migrate repo to typescript ([#55](https://github.com/maplibre/maplibre-react-native/pull/55))

## 9.1.0

Expand Down
14 changes: 7 additions & 7 deletions android/rctmgl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ dependencies {
implementation("com.facebook.react:react-android")

// MapLibre SDK
implementation "org.maplibre.gl:android-sdk:9.6.0"
implementation "org.maplibre.gl:android-sdk:10.2.0"
implementation "org.maplibre.gl:android-sdk-turf:5.9.0"

// Dependencies
implementation "com.android.support:support-vector-drawable:${safeExtGet('supportLibVersion', '28.0.0')}"
implementation "com.android.support:support-annotations:${safeExtGet('supportLibVersion', '28.0.0')}"
implementation "com.android.support:appcompat-v7:${safeExtGet('supportLibVersion', '28.0.0')}"
implementation "androidx.vectordrawable:vectordrawable:1.1.0"
implementation "androidx.annotation:annotation:1.7.0"
implementation "androidx.appcompat:appcompat:1.6.1"
implementation "com.squareup.okhttp3:okhttp:${safeExtGet('okhttpVersion', '4.9.0')}"
implementation "com.squareup.okhttp3:okhttp-urlconnection:${safeExtGet('okhttpVersion', '4.9.0')}"


// MapLibre plugins
implementation ("org.maplibre.gl:android-plugin-localization-v9:1.0.0")
implementation ("org.maplibre.gl:android-plugin-annotation-v9:1.0.0")
implementation ("org.maplibre.gl:android-plugin-markerview-v9:1.0.0")
implementation ("org.maplibre.gl:android-plugin-localization-v9:2.0.1")
implementation ("org.maplibre.gl:android-plugin-annotation-v9:2.0.1")
implementation ("org.maplibre.gl:android-plugin-markerview-v9:2.0.1")
}

allprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.mapbox.android.core.location.LocationEnginePriority;
*/

import com.mapbox.mapboxsdk.location.engine.LocationEngineProvider;
import com.mapbox.mapboxsdk.location.engine.LocationEngineDefault;
import com.mapbox.mapboxsdk.location.engine.LocationEngineRequest;
import com.mapbox.mapboxsdk.location.engine.LocationEngineResult;
import com.mapbox.mapboxsdk.location.permissions.PermissionsManager;
Expand Down Expand Up @@ -63,7 +63,7 @@ private LocationManager(Context context) {

}
private void buildEngineRequest() {
locationEngine = LocationEngineProvider.getBestLocationEngine(this.context.getApplicationContext());
locationEngine = LocationEngineDefault.INSTANCE.getDefaultLocationEngine(this.context.getApplicationContext());
locationEngineRequest = new LocationEngineRequest.Builder(DEFAULT_INTERVAL_MILLIS)
.setFastestInterval(DEFAULT_FASTEST_INTERVAL_MILLIS)
.setPriority(LocationEngineRequest.PRIORITY_HIGH_ACCURACY)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
package com.mapbox.rctmgl.modules;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;

import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.bridge.WritableNativeMap;
import com.facebook.react.bridge.*;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.modules.core.RCTNativeAppEventEmitter;
import com.mapbox.geojson.FeatureCollection;
Expand Down Expand Up @@ -58,12 +51,14 @@ public class RCTMGLOfflineModule extends ReactContextBaseJavaModule {
public static final Double DEFAULT_MIN_ZOOM_LEVEL = 10.0;
public static final Double DEFAULT_MAX_ZOOM_LEVEL = 20.0;

private ReactApplicationContext mReactContext;
private final Context mContext;
private final ReactContext mReactContext;
private Double mProgressEventThrottle = 300.0;

public RCTMGLOfflineModule(ReactApplicationContext reactApplicationContext) {
super(reactApplicationContext);
mReactContext = reactApplicationContext;
mContext = reactApplicationContext.getApplicationContext();
}

@Override
Expand All @@ -84,7 +79,7 @@ public void removeListeners(Integer count) {
@ReactMethod
public void createPack(ReadableMap options, final Promise promise) {
final String name = ConvertUtils.getString("name", options, "");
final OfflineManager offlineManager = OfflineManager.getInstance(mReactContext);
final OfflineManager offlineManager = OfflineManager.Companion.getInstance(mContext);
LatLngBounds latLngBounds = getBoundsFromOptions(options);

OfflineRegionDefinition definition = makeDefinition(latLngBounds, options);
Expand All @@ -110,7 +105,7 @@ public void onError(String error) {
public void getPacks(final Promise promise) {
activateFileSource();

final OfflineManager offlineManager = OfflineManager.getInstance(mReactContext);
final OfflineManager offlineManager = OfflineManager.Companion.getInstance(mContext);

offlineManager.listOfflineRegions(new OfflineManager.ListOfflineRegionsCallback() {
@Override
Expand All @@ -134,7 +129,7 @@ public void onError(String error) {
@ReactMethod
public void invalidateAmbientCache(final Promise promise) {
activateFileSource();
final OfflineManager offlineManager = OfflineManager.getInstance(mReactContext);
final OfflineManager offlineManager = OfflineManager.Companion.getInstance(mContext);
offlineManager.invalidateAmbientCache(new OfflineManager.FileSourceCallback() {
@Override
public void onSuccess() {
Expand All @@ -152,7 +147,7 @@ public void onError(String error) {
public void clearAmbientCache(final Promise promise) {
activateFileSource();

final OfflineManager offlineManager = OfflineManager.getInstance(mReactContext);
final OfflineManager offlineManager = OfflineManager.Companion.getInstance(mContext);

offlineManager.clearAmbientCache(new OfflineManager.FileSourceCallback() {
@Override
Expand All @@ -171,7 +166,7 @@ public void onError(String error) {
public void setMaximumAmbientCacheSize(int size, final Promise promise) {
activateFileSource();

final OfflineManager offlineManager = OfflineManager.getInstance(mReactContext);
final OfflineManager offlineManager = OfflineManager.Companion.getInstance(mContext);

offlineManager.setMaximumAmbientCacheSize(size, new OfflineManager.FileSourceCallback() {
@Override
Expand All @@ -190,7 +185,7 @@ public void onError(String error) {
@ReactMethod
public void resetDatabase(final Promise promise) {
activateFileSource();
final OfflineManager offlineManager = OfflineManager.getInstance(mReactContext);
final OfflineManager offlineManager = OfflineManager.Companion.getInstance(mContext);
offlineManager.resetDatabase(new OfflineManager.FileSourceCallback() {
@Override
public void onSuccess() {
Expand All @@ -208,7 +203,7 @@ public void onError(String error) {
public void getPackStatus(final String name, final Promise promise) {
activateFileSource();

final OfflineManager offlineManager = OfflineManager.getInstance(mReactContext);
final OfflineManager offlineManager = OfflineManager.Companion.getInstance(mContext);

offlineManager.listOfflineRegions(new OfflineManager.ListOfflineRegionsCallback() {
@Override
Expand Down Expand Up @@ -245,7 +240,7 @@ public void onError(String error) {
public void setPackObserver(final String name, final Promise promise) {
activateFileSource();

final OfflineManager offlineManager = OfflineManager.getInstance(mReactContext);
final OfflineManager offlineManager = OfflineManager.Companion.getInstance(mContext);

offlineManager.listOfflineRegions(new OfflineManager.ListOfflineRegionsCallback() {
@Override
Expand All @@ -271,7 +266,7 @@ public void onError(String error) {
public void invalidatePack(final String name, final Promise promise) {
activateFileSource();

final OfflineManager offlineManager = OfflineManager.getInstance(mReactContext);
final OfflineManager offlineManager = OfflineManager.Companion.getInstance(mContext);

offlineManager.listOfflineRegions(new OfflineManager.ListOfflineRegionsCallback() {
@Override
Expand Down Expand Up @@ -308,7 +303,7 @@ public void onError(String error) {
public void deletePack(final String name, final Promise promise) {
activateFileSource();

final OfflineManager offlineManager = OfflineManager.getInstance(mReactContext);
final OfflineManager offlineManager = OfflineManager.Companion.getInstance(mContext);

offlineManager.listOfflineRegions(new OfflineManager.ListOfflineRegionsCallback() {
@Override
Expand Down Expand Up @@ -348,7 +343,7 @@ public void onError(String error) {
public void pausePackDownload(final String name, final Promise promise) {
activateFileSource();

final OfflineManager offlineManager = OfflineManager.getInstance(mReactContext);
final OfflineManager offlineManager = OfflineManager.Companion.getInstance(mContext);

offlineManager.listOfflineRegions(new OfflineManager.ListOfflineRegionsCallback() {
@Override
Expand Down Expand Up @@ -380,7 +375,7 @@ public void onError(String error) {
public void resumePackDownload(final String name, final Promise promise) {
activateFileSource();

final OfflineManager offlineManager = OfflineManager.getInstance(mReactContext);
final OfflineManager offlineManager = OfflineManager.Companion.getInstance(mContext);

offlineManager.listOfflineRegions(new OfflineManager.ListOfflineRegionsCallback() {
@Override
Expand All @@ -407,7 +402,7 @@ public void onError(String error) {
public void mergeOfflineRegions(final String path, final Promise promise) {
activateFileSource();

final OfflineManager offlineManager = OfflineManager.getInstance(mReactContext);
final OfflineManager offlineManager = OfflineManager.Companion.getInstance(mContext);

offlineManager.mergeOfflineRegions(path, new OfflineManager.MergeOfflineRegionsCallback() {
@Override
Expand All @@ -424,7 +419,7 @@ public void onError(String error) {

@ReactMethod
public void setTileCountLimit(int tileCountLimit) {
OfflineManager offlineManager = OfflineManager.getInstance(mReactContext);
OfflineManager offlineManager = OfflineManager.Companion.getInstance(mContext);
offlineManager.setOfflineMapboxTileCountLimit(tileCountLimit);
}

Expand All @@ -439,7 +434,7 @@ private OfflineRegionDefinition makeDefinition(LatLngBounds latLngBounds, Readab
latLngBounds,
ConvertUtils.getDouble("minZoom", options, DEFAULT_MIN_ZOOM_LEVEL),
ConvertUtils.getDouble("maxZoom", options, DEFAULT_MAX_ZOOM_LEVEL),
mReactContext.getResources().getDisplayMetrics().density);
mContext.getResources().getDisplayMetrics().density);
}

private byte[] getMetadataBytes(String metadata) {
Expand Down Expand Up @@ -591,7 +586,7 @@ private OfflineRegion getRegionByName(String name, OfflineRegion[] offlineRegion
}

private void activateFileSource() {
FileSource fileSource = FileSource.getInstance(mReactContext);
FileSource fileSource = FileSource.getInstance(mContext);
fileSource.activate();
}
}
83 changes: 83 additions & 0 deletions example/.detoxrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/** @type {Detox.DetoxConfig} */
module.exports = {
testRunner: {
args: {
'$0': 'jest',
config: 'e2e/jest.config.js'
},
jest: {
setupTimeout: 120000
}
},
apps: {
'ios.debug': {
type: 'ios.app',
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/RNMaplibreExample.app',
build: 'xcodebuild -workspace ios/RNMaplibreExample.xcworkspace -scheme RNMaplibreExample -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build'
},
'ios.release': {
type: 'ios.app',
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/RNMaplibreExample.app',
build: 'xcodebuild -workspace ios/RNMaplibreExample.xcworkspace -scheme RNMaplibreExample -configuration Release -sdk iphonesimulator -derivedDataPath ios/build'
},
'android.debug': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',
build: 'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',
reversePorts: [
8081
]
},
'android.release': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',
build: 'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release'
}
},
devices: {
simulator: {
type: 'ios.simulator',
device: {
type: 'iPhone 14'
}
},
attached: {
type: 'android.attached',
device: {
adbName: '.*'
}
},
emulator: {
type: 'android.emulator',
device: {
avdName: 'Pixel_3a_API_30_x86'
}
}
},
configurations: {
'ios.sim.debug': {
device: 'simulator',
app: 'ios.debug'
},
'ios.sim.release': {
device: 'simulator',
app: 'ios.release'
},
'android.att.debug': {
device: 'attached',
app: 'android.debug'
},
'android.att.release': {
device: 'attached',
app: 'android.release'
},
'android.emu.debug': {
device: 'emulator',
app: 'android.debug'
},
'android.emu.release': {
device: 'emulator',
app: 'android.release'
}
}
};
8 changes: 0 additions & 8 deletions example/e2e/config.json

This file was deleted.

Loading

0 comments on commit 5f60bcd

Please sign in to comment.