Skip to content

Commit

Permalink
chore: rename rctmgl-v10 to rnbmx (#3064)
Browse files Browse the repository at this point in the history
* chore: rename everything from rctmgl to rnmbx
* chore: rename java-v10 to java
* chore: rename package name
* chore: remove v10

---------

Co-authored-by: Wojciech Lewicki <[email protected]>
  • Loading branch information
mfazekas and WoLewicki authored Sep 20, 2023
1 parent f34aa2f commit c72d4da
Show file tree
Hide file tree
Showing 347 changed files with 3,239 additions and 3,236 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ ios/Mapbox.framework
ios/temp.zip
ios/.framework_version
ios/Pods/
ios/RCTMGL.xcodeproj/xcshareddata/
ios/RNMBX.xcodeproj/xcshareddata/
android/build/
android/rctmgl/build/
android/rnmbx/build/
android/.gradle/
android/.idea/
android/android.iml
Expand Down
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Path to sources
sonar.sources=src,android/src,ios/RCTMGL
sonar.sources=src,android/src,ios/RNMBX
#sonar.exclusions=
#sonar.inclusions=

Expand Down
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ PR Title ([#123](link to my pr))
#### Breaking changes:

The setup was changed - see install instructions for more details. In a nuthsell:
* On both android/ios to select mapbox implementation use `RNMapboxMapsImpl`/`$RNMapboxMapsImpl` variable which can be one of (`maplibre`,`mapbox`(aka v10),`mapbox-gl`)
* Default implementation is `maplibre` as it requires not further setup. *WARNING* using mapbox styles from `maplibre` has different pricing than mapbox native sdk-s.
* On Podfile `$RNMBGL.(pre|post)_install` was changed `$RNMapboxMaps.(pre|post)_install`
* Package name was changed from `@react-native-mapbox-gl/maps` to `@rnmapbox/maps`. If you just testing with the v10 version you can use something like [babel-plugin-transform-rename-import](https://www.npmjs.com/package/babel-plugin-transform-rename-import) to keep using the old imports for a while.
* `MapboxGL.setAccessToken` now requires `MapboxGL.setWellKnownTileServer` on maplibre.

- On both android/ios to select mapbox implementation use `RNMapboxMapsImpl`/`$RNMapboxMapsImpl` variable which can be one of (`maplibre`,`mapbox`(aka v10),`mapbox-gl`)
- Default implementation is `maplibre` as it requires not further setup. _WARNING_ using mapbox styles from `maplibre` has different pricing than mapbox native sdk-s.
- On Podfile `$RNMBGL.(pre|post)_install` was changed `$RNMapboxMaps.(pre|post)_install`
- Package name was changed from `@react-native-mapbox-gl/maps` to `@rnmapbox/maps`. If you just testing with the v10 version you can use something like [babel-plugin-transform-rename-import](https://www.npmjs.com/package/babel-plugin-transform-rename-import) to keep using the old imports for a while.
- `MapboxGL.setAccessToken` now requires `MapboxGL.setWellKnownTileServer` on maplibre.

#### Changes:

Expand Down Expand Up @@ -97,7 +97,7 @@ Add Expo config plugin ([#1388](https://github.com/rnmapbox/maps/pull/1388))
Android: Bump `okhttp` to `4.9.0` ([#1390](https://github.com/rnmapbox/maps/pull/1390))
Support dynamically changing local JSON in styleURL ([#1399](https://github.com/rnmapbox/maps/pull/1399))
Add missing types to `SymbolLayerStyle` & `ImagesProps` ([#1360](https://github.com/rnmapbox/maps/pull/1360))
Fix error while updating coordinates of RCTMGLImageSource ([#1310](https://github.com/rnmapbox/maps/pull/1310))
Fix error while updating coordinates of RNMBXImageSource ([#1310](https://github.com/rnmapbox/maps/pull/1310))

## 8.2.0-beta2

Expand Down
6 changes: 3 additions & 3 deletions __tests__/components/Callout.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Callout', () => {
describe('_renderDefaultCallout', () => {
test('renders default children', () => {
const { UNSAFE_getByType, UNSAFE_getAllByType } = render(<Callout />);
const callout = UNSAFE_getByType('RCTMGLCallout');
const callout = UNSAFE_getByType('RNMBXCallout');

expect(callout).toBeDefined();
expect(UNSAFE_getAllByType(Text).length).toBe(1);
Expand All @@ -34,7 +34,7 @@ describe('Callout', () => {
<Callout {...testProps} />,
);

const callout = UNSAFE_getByType('RCTMGLCallout');
const callout = UNSAFE_getByType('RNMBXCallout');
const views = UNSAFE_getAllByType(View);
const text = UNSAFE_getByType(Text);

Expand Down Expand Up @@ -76,7 +76,7 @@ describe('Callout', () => {
<View>{'Foo Bar'}</View>
</Callout>,
);
const callout = UNSAFE_getByType('RCTMGLCallout');
const callout = UNSAFE_getByType('RNMBXCallout');
const views = UNSAFE_getAllByType(View);

const calloutWrapperTestStyle = callout.props.style[1].width;
Expand Down
4 changes: 2 additions & 2 deletions __tests__/components/Light.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Light from '../../src/components/Light';
describe('Light', () => {
test('renders correctly', () => {
const { queryByTestId } = render(<Light />);
const light = queryByTestId('rctmglLight');
const light = queryByTestId('RNMBXLight');
expect(light).toBeDefined();
});

Expand All @@ -21,7 +21,7 @@ describe('Light', () => {

const { queryByTestId } = render(<Light style={testStyles} />);

const customStyles = queryByTestId('rctmglLight').props.reactStyle;
const customStyles = queryByTestId('RNMBXLight').props.reactStyle;
const { anchor } = customStyles;
const { color } = customStyles;
const { position } = customStyles;
Expand Down
4 changes: 2 additions & 2 deletions __tests__/modules/location/locationManager.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import LocationManager, {
LocationModuleEventEmitter,
} from '../../../src/modules/location/locationManager';

const MapboxGL = NativeModules.MGLModule;
const MapboxGLLocationManager = NativeModules.MGLLocationModule;
const MapboxGL = NativeModules.RNMBXModule;
const MapboxGLLocationManager = NativeModules.RNMBXLocationModule;

const location = {
coords: {
Expand Down
9 changes: 6 additions & 3 deletions __tests__/modules/offline/OfflinePack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('OfflinePack', () => {

it('should resume pack download', () => {
const spy = jest.spyOn(
NativeModules.MGLOfflineModule,
NativeModules.RNMBXOfflineModule,
'resumePackDownload',
);
const offlinePack = new OfflinePack(fakeNativePack);
Expand All @@ -30,15 +30,18 @@ describe('OfflinePack', () => {
});

it('should pause pack download', () => {
const spy = jest.spyOn(NativeModules.MGLOfflineModule, 'pausePackDownload');
const spy = jest.spyOn(
NativeModules.RNMBXOfflineModule,
'pausePackDownload',
);
const offlinePack = new OfflinePack(fakeNativePack);
offlinePack.pause();
expect(spy).toHaveBeenCalled();
spy.mockRestore();
});

it('should get pack status', () => {
const spy = jest.spyOn(NativeModules.MGLOfflineModule, 'getPackStatus');
const spy = jest.spyOn(NativeModules.RNMBXOfflineModule, 'getPackStatus');
const offlinePack = new OfflinePack(fakeNativePack);
offlinePack.status();
expect(spy).toHaveBeenCalled();
Expand Down
24 changes: 18 additions & 6 deletions __tests__/modules/offline/offlineManager.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('offlineManager', () => {

it('should migrate offline cache', async () => {
const spy = jest.spyOn(
NativeModules.MGLOfflineModule,
NativeModules.RNMBXOfflineModule,
'migrateOfflineCache',
);
await MapboxGL.offlineManager.migrateOfflineCache();
Expand All @@ -80,7 +80,10 @@ describe('offlineManager', () => {

it('should set max tile count limit', () => {
const expectedLimit = 2000;
const spy = jest.spyOn(NativeModules.MGLOfflineModule, 'setTileCountLimit');
const spy = jest.spyOn(
NativeModules.RNMBXOfflineModule,
'setTileCountLimit',
);
MapboxGL.offlineManager.setTileCountLimit(expectedLimit);
expect(spy).toHaveBeenCalledWith(expectedLimit);
spy.mockRestore();
Expand All @@ -89,7 +92,7 @@ describe('offlineManager', () => {
it('should set progress event throttle value', () => {
const expectedThrottleValue = 500;
const spy = jest.spyOn(
NativeModules.MGLOfflineModule,
NativeModules.RNMBXOfflineModule,
'setProgressEventThrottle',
);
MapboxGL.offlineManager.setProgressEventThrottle(expectedThrottleValue);
Expand Down Expand Up @@ -195,7 +198,10 @@ describe('offlineManager', () => {
beforeEach(() => (Platform.OS = 'android'));

it('should set pack observer manually', async () => {
const spy = jest.spyOn(NativeModules.MGLOfflineModule, 'setPackObserver');
const spy = jest.spyOn(
NativeModules.RNMBXOfflineModule,
'setPackObserver',
);

const name = `test-${Date.now()}`;
const noop = () => {};
Expand All @@ -208,7 +214,10 @@ describe('offlineManager', () => {
});

it('should not set pack observer manually during create flow', async () => {
const spy = jest.spyOn(NativeModules.MGLOfflineModule, 'setPackObserver');
const spy = jest.spyOn(
NativeModules.RNMBXOfflineModule,
'setPackObserver',
);

const name = `test-${Date.now()}`;
const noop = () => {};
Expand All @@ -224,7 +233,10 @@ describe('offlineManager', () => {
beforeEach(() => (Platform.OS = 'ios'));

it('should not set pack observer manually', async () => {
const spy = jest.spyOn(NativeModules.MGLOfflineModule, 'setPackObserver');
const spy = jest.spyOn(
NativeModules.RNMBXOfflineModule,
'setPackObserver',
);

const name = `test-${Date.now()}`;
const noop = () => {};
Expand Down
6 changes: 3 additions & 3 deletions __tests__/modules/snapshot/SnapshotOptions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('SnapshotOptions', () => {
const options = new SnapshotOptions({ centerCoordinate });

expect(options.toJSON()).toEqual({
styleURL: NativeModules.MGLModule.StyleURL.Street,
styleURL: NativeModules.RNMBXModule.StyleURL.Street,
heading: 0.0,
pitch: 0.0,
zoomLevel: 16.0,
Expand All @@ -36,7 +36,7 @@ describe('SnapshotOptions', () => {
height: 600,
writeToDisk: true,
withLogo: true,
styleURL: NativeModules.MGLModule.StyleURL.Dark,
styleURL: NativeModules.RNMBXModule.StyleURL.Dark,
};

const options = new SnapshotOptions(expectedOptions);
Expand All @@ -56,7 +56,7 @@ describe('SnapshotOptions', () => {
],
width: 400,
height: 600,
styleURL: NativeModules.MGLModule.StyleURL.Light,
styleURL: NativeModules.RNMBXModule.StyleURL.Light,
writeToDisk: false,
withLogo: true,
};
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ android {
else if (safeExtGet("RNMapboxMapsImpl", defaultMapboxMapsImpl) == "mapbox") {
sourceSets {
main {
java.srcDirs = ['src/main/java-v10']
java.srcDirs = ['src/main/java']
if (safeExtGet("RNMapboxMapsUseV11", false)) {
java.srcDirs += 'src/main/mapbox-v11-compat/v11'
} else {
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.mapbox.rctmgl">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.rnmapbox.rnmbx">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
Expand Down
Loading

0 comments on commit c72d4da

Please sign in to comment.