-
-
Notifications
You must be signed in to change notification settings - Fork 860
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Created config plugin * Update .eslintignore * Added installation guide * Update CHANGELOG.md * Update plugin/src/withMapbox.ts
- Loading branch information
Showing
14 changed files
with
589 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
index.d.ts | ||
scripts/ | ||
/plugin/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,3 +121,6 @@ coverage | |
*.iml | ||
|
||
react-native-mapbox-gl-maps.tgz | ||
|
||
# Config plugin | ||
/plugin/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,3 +42,7 @@ android/local.properties | |
example | ||
__tests__ | ||
coverage | ||
|
||
plugin/src | ||
plugin/jest.config.js | ||
plugin/tsconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./plugin/build/withMapbox'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Expo installation | ||
|
||
> This package cannot be used in the "Expo Go" app because [it requires custom native code](https://docs.expo.io/workflow/customizing/). | ||
First install the package with yarn, npm, or [`expo install`](https://docs.expo.io/workflow/expo-cli/#expo-install). | ||
|
||
```sh | ||
expo install @react-native-mapbox-gl/maps | ||
``` | ||
|
||
After installing this npm package, add the [config plugin](https://docs.expo.io/guides/config-plugins/) to the [`plugins`](https://docs.expo.io/versions/latest/config/app/#plugins) array of your `app.json` or `app.config.js`: | ||
|
||
```json | ||
{ | ||
"expo": { | ||
"plugins": ["@react-native-mapbox-gl/maps"] | ||
} | ||
} | ||
``` | ||
|
||
Next, rebuild your app as described in the ["Adding custom native code"](https://docs.expo.io/workflow/customizing/) guide. | ||
|
||
## API | ||
|
||
This plugin doesn't currently provide any additional properties for customization. The plugin simply generates the pre-install block in the `ios/Podfile` (the post-install block is not required for Expo support). No additional changes are done on Android. | ||
|
||
## Manual Setup | ||
|
||
For bare workflow projects, you can follow the manual setup guides: | ||
|
||
- [iOS](/ios/install.md) | ||
- [Android](/android/install.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('expo-module-scripts/jest-preset-plugin'); |
198 changes: 198 additions & 0 deletions
198
plugin/src/__tests__/__snapshots__/withMapbox-test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`applyCocoaPodsModifications adds blocks to a expo prebuild template podfile 1`] = ` | ||
" | ||
require_relative '../node_modules/react-native/scripts/react_native_pods' | ||
require_relative '../node_modules/react-native-unimodules/cocoapods.rb' | ||
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' | ||
platform :ios, '11.0' | ||
target 'HelloWorld' do | ||
use_unimodules! | ||
config = use_native_modules! | ||
# @generated begin pre_installer - expo prebuild (DO NOT MODIFY) sync-c8812095000d6054b846ce74840f0ffb540c2757 | ||
pre_install do |installer| | ||
# @generated begin @react-native-mapbox-gl/maps-pre_installer - expo prebuild (DO NOT MODIFY) sync-5a7ed0a20d5aff2d61639bc5bb4fd5551233d57c | ||
$RNMBGL.pre_install(installer) | ||
# @generated end @react-native-mapbox-gl/maps-pre_installer | ||
end | ||
# @generated end pre_installer | ||
use_react_native!(:path => config[\\"reactNativePath\\"]) | ||
# Uncomment to opt-in to using Flipper | ||
# | ||
# if !ENV['CI'] | ||
# use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1') | ||
# post_install do |installer| | ||
# flipper_post_install(installer) | ||
# end | ||
# end | ||
end | ||
" | ||
`; | ||
|
||
exports[`applyCocoaPodsModifications adds blocks to a expo prebuild template podfile with custom modifications 1`] = ` | ||
" | ||
require_relative '../node_modules/react-native/scripts/react_native_pods' | ||
require_relative '../node_modules/react-native-unimodules/cocoapods.rb' | ||
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' | ||
platform :ios, '11.0' | ||
target 'HelloWorld' do | ||
use_unimodules! | ||
config = use_native_modules! | ||
# @generated begin pre_installer - expo prebuild (DO NOT MODIFY) sync-c8812095000d6054b846ce74840f0ffb540c2757 | ||
pre_install do |installer| | ||
# @generated begin @react-native-mapbox-gl/maps-pre_installer - expo prebuild (DO NOT MODIFY) sync-5a7ed0a20d5aff2d61639bc5bb4fd5551233d57c | ||
$RNMBGL.pre_install(installer) | ||
# @generated end @react-native-mapbox-gl/maps-pre_installer | ||
end | ||
# @generated end pre_installer | ||
use_react_native!(:path => config[\\"reactNativePath\\"]) | ||
# pre_install do |installer| | ||
# end | ||
# Uncomment to opt-in to using Flipper | ||
# | ||
# if !ENV['CI'] | ||
# use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1') | ||
# post_install do |installer| | ||
# flipper_post_install(installer) | ||
# end | ||
# end | ||
end | ||
" | ||
`; | ||
|
||
exports[`applyCocoaPodsModifications adds blocks to a react native template podfile 1`] = ` | ||
" | ||
require_relative '../node_modules/react-native/scripts/react_native_pods' | ||
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' | ||
platform :ios, '11.0' | ||
target 'HelloWorld' do | ||
config = use_native_modules! | ||
# @generated begin pre_installer - expo prebuild (DO NOT MODIFY) sync-c8812095000d6054b846ce74840f0ffb540c2757 | ||
pre_install do |installer| | ||
# @generated begin @react-native-mapbox-gl/maps-pre_installer - expo prebuild (DO NOT MODIFY) sync-5a7ed0a20d5aff2d61639bc5bb4fd5551233d57c | ||
$RNMBGL.pre_install(installer) | ||
# @generated end @react-native-mapbox-gl/maps-pre_installer | ||
end | ||
# @generated end pre_installer | ||
use_react_native!( | ||
:path => config[:reactNativePath], | ||
# to enable hermes on iOS, change \`false\` to \`true\` and then install pods | ||
:hermes_enabled => false | ||
) | ||
target 'HelloWorldTests' do | ||
inherit! :complete | ||
# Pods for testing | ||
end | ||
# Enables Flipper. | ||
# | ||
# Note that if you have use_frameworks! enabled, Flipper will not work and | ||
# you should disable the next line. | ||
use_flipper!() | ||
post_install do |installer| | ||
react_native_post_install(installer) | ||
end | ||
end | ||
" | ||
`; | ||
|
||
exports[`applyCocoaPodsModifications doesn't work with revisions to blocks after comments 1`] = ` | ||
" | ||
require_relative '../node_modules/react-native/scripts/react_native_pods' | ||
require_relative '../node_modules/react-native-unimodules/cocoapods.rb' | ||
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' | ||
platform :ios, '11.0' | ||
target 'HelloWorld' do | ||
use_unimodules! | ||
config = use_native_modules! | ||
# pre_install do |installer| | ||
# @generated begin @react-native-mapbox-gl/maps-pre_installer - expo prebuild (DO NOT MODIFY) sync-5a7ed0a20d5aff2d61639bc5bb4fd5551233d57c | ||
$RNMBGL.pre_install(installer) | ||
# @generated end @react-native-mapbox-gl/maps-pre_installer | ||
# end | ||
# Uncomment to opt-in to using Flipper | ||
# | ||
# if !ENV['CI'] | ||
# use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1') | ||
# post_install do |installer| | ||
# flipper_post_install(installer) | ||
# end | ||
# end | ||
# @generated begin post_installer - expo prebuild (DO NOT MODIFY) sync-00old-id-2 | ||
INVALID_post_install do |installer| | ||
# @generated begin @react-native-mapbox-gl/maps-post_installer - expo prebuild (DO NOT MODIFY) sync-001 | ||
INVALID_$RNMBGL.post_install(installer) | ||
# @generated end @react-native-mapbox-gl/maps-post_installer | ||
end | ||
# @generated end post_installer | ||
# @generated begin pre_installer - expo prebuild (DO NOT MODIFY) sync-c8812095000d6054b846ce74840f0ffb540c2757 | ||
pre_install do |installer| | ||
end | ||
# @generated end pre_installer | ||
use_react_native!(:path => config[\\"reactNativePath\\"]) | ||
end | ||
" | ||
`; | ||
|
||
exports[`applyCocoaPodsModifications works after revisions to blocks 1`] = ` | ||
" | ||
require_relative '../node_modules/react-native/scripts/react_native_pods' | ||
require_relative '../node_modules/react-native-unimodules/cocoapods.rb' | ||
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' | ||
platform :ios, '11.0' | ||
target 'HelloWorld' do | ||
use_unimodules! | ||
config = use_native_modules! | ||
# @generated begin post_installer - expo prebuild (DO NOT MODIFY) sync-00old-id-2 | ||
INVALID_post_install do |installer| | ||
# @generated begin @react-native-mapbox-gl/maps-post_installer - expo prebuild (DO NOT MODIFY) sync-001 | ||
INVALID_$RNMBGL.post_install(installer) | ||
# @generated end @react-native-mapbox-gl/maps-post_installer | ||
end | ||
# @generated end post_installer | ||
# @generated begin pre_installer - expo prebuild (DO NOT MODIFY) sync-c8812095000d6054b846ce74840f0ffb540c2757 | ||
pre_install do |installer| | ||
# @generated begin @react-native-mapbox-gl/maps-pre_installer - expo prebuild (DO NOT MODIFY) sync-5a7ed0a20d5aff2d61639bc5bb4fd5551233d57c | ||
$RNMBGL.pre_install(installer) | ||
# @generated end @react-native-mapbox-gl/maps-pre_installer | ||
end | ||
# @generated end pre_installer | ||
use_react_native!(:path => config[\\"reactNativePath\\"]) | ||
# pre_install do |installer| | ||
# end | ||
# Uncomment to opt-in to using Flipper | ||
# | ||
# if !ENV['CI'] | ||
# use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1') | ||
# post_install do |installer| | ||
# flipper_post_install(installer) | ||
# end | ||
# end | ||
end | ||
" | ||
`; |
Oops, something went wrong.