Skip to content

Commit

Permalink
↩️ Revert: Expo-Related Changes
Browse files Browse the repository at this point in the history
Revert "📦 Package: Add `react-native-ios-utilities`"

This reverts commit 8d8c104.

Revert "⚙️ Chore: `expo-module.config.json`"

This reverts commit 9a75128.

Revert "❌ Remove: Expo-Module Generated Template"

This reverts commit 3c7f180.

Revert "📦 Package: Add `@types/react-native`"

This reverts commit d2e9607.

Revert "💄 Gloss: Add Comments"

This reverts commit b00b396.

Revert "🆕 Add: Init. Impl. for `RNIModalView`"

This reverts commit 7eb0a9e.

Revert "❌ Remove: All iOS Sources and Related Files"

This reverts commit 8fce587.

Revert "⚙️ Chore: Ex - Run `pod install`"

This reverts commit a64819c.

Revert "📦 Package: Ex - Add `react-native-ios-utilities`"

This reverts commit 5992cda.

Revert "🆕 Add: Re-Add iOS-Related Source Files"

This reverts commit d38b8b5.

Revert "📝 Docs: Update TODO"

This reverts commit bd52878.

Revert "🆕 Add: Expo Modules Template"

This reverts commit 1da688b.

Revert "📝 Docs: Update TODO"

This reverts commit f60d27b.

Revert "❌ Remove: All Sources and Related Files"

This reverts commit 9533ae9.
  • Loading branch information
dominicstop committed Jun 4, 2024
1 parent 8d8c104 commit e62ec7e
Show file tree
Hide file tree
Showing 367 changed files with 33,621 additions and 41,151 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

indent_style = space
indent_size = 2

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
src/temp
lib
example
5 changes: 0 additions & 5 deletions .eslintrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pbxproj -text
# specific for windows script files
*.bat text eol=crlf
23 changes: 13 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#
.DS_Store

# XDE
.expo/

# VSCode
.vscode/
jsconfig.json
Expand All @@ -28,30 +31,30 @@ project.xcworkspace

# Android/IJ
#
.classpath
.cxx
.gradle
.idea
.project
.settings
.gradle
local.properties
android.iml
android/app/libs
android/keystores/debug.keystore

# Cocoapods
#
example/ios/Pods

# Ruby
example/vendor/

# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore

# Expo
.expo/*

# generated by bob
lib/
11 changes: 0 additions & 11 deletions .npmignore

This file was deleted.

1 change: 1 addition & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Override Yarn command so we can automatically setup the repo on running `yarn`

yarn-path "scripts/bootstrap.js"
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// CGPoint+RNIDictionaryRepresentable.swift
// react-native-ios-modal
//
// Created by Dominic Go on 5/3/23.
//

import Foundation

extension CGPoint: RNIDictionaryRepresentable {
public var asDictionary: [String: Any] {
var dict: [String: Any] = [:];
dict["x"] = self.x;
dict["y"] = self.y;

return dict;
};
};
181 changes: 119 additions & 62 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,89 +1,146 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'

group = 'expo.modules.iosmodal'
version = '0.1.0'

buildscript {
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
if (expoModulesCorePlugin.exists()) {
apply from: expoModulesCorePlugin
applyKotlinExpoModulesCorePlugin()
}

// Simple helper that allows the root project to override versions declared by this library.
ext.safeExtGet = { prop, fallback ->
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

// Ensures backward compatibility
ext.getKotlinVersion = {
if (ext.has("kotlinVersion")) {
ext.kotlinVersion()
} else {
ext.safeExtGet("kotlinVersion", "1.8.10")
}
}
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['IosModal_kotlinVersion']

repositories {
mavenCentral()
google()
mavenCentral()
}

dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
classpath 'com.android.tools.build:gradle:3.5.3'
// noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
}
}
repositories {
maven {
url = mavenLocal().url
}
}
}
def isNewArchitectureEnabled() {
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
}

android {
compileSdkVersion safeExtGet("compileSdkVersion", 33)
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
if (isNewArchitectureEnabled()) {
apply plugin: 'com.facebook.react'
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.majorVersion
}
def getExtOrDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['IosModal_' + name]
}

def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['IosModal_' + name]).toInteger()
}

android {
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')

namespace "expo.modules.iosmodal"
defaultConfig {
minSdkVersion safeExtGet("minSdkVersion", 21)
targetSdkVersion safeExtGet("targetSdkVersion", 33)
versionCode 1
versionName "0.1.0"
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
}
buildTypes {
release {
minifyEnabled false
}
}

lintOptions {
abortOnError false
disable 'GradleCompatible'
}
publishing {
singleVariant("release") {
withSourcesJar()
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

}

repositories {
mavenCentral()
google()

def found = false
def defaultDir = null
def androidSourcesName = 'React Native sources'

if (rootProject.ext.has('reactNativeAndroidRoot')) {
defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
} else {
defaultDir = new File(
projectDir,
'/../../../node_modules/react-native/android'
)
}

if (defaultDir.exists()) {
maven {
url defaultDir.toString()
name androidSourcesName
}

logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
found = true
} else {
def parentDir = rootProject.projectDir

1.upto(5, {
if (found) return true
parentDir = parentDir.parentFile

def androidSourcesDir = new File(
parentDir,
'node_modules/react-native'
)

def androidPrebuiltBinaryDir = new File(
parentDir,
'node_modules/react-native/android'
)

if (androidPrebuiltBinaryDir.exists()) {
maven {
url androidPrebuiltBinaryDir.toString()
name androidSourcesName
}

logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
found = true
} else if (androidSourcesDir.exists()) {
maven {
url androidSourcesDir.toString()
name androidSourcesName
}

logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
found = true
}
})
}

if (!found) {
throw new GradleException(
"${project.name}: unable to locate React Native android sources. " +
"Ensure you have you installed React Native as a dependency in your project and try again."
)
}
}

def kotlin_version = getExtOrDefault('kotlinVersion')

dependencies {
implementation project(':expo-modules-core')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// From node_modules
}

if (isNewArchitectureEnabled()) {
react {
jsRootDir = file("../src/")
libraryName = "IosModal"
codegenJavaPackageName = "com.reactnativeiosmodal"
}
}
5 changes: 5 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
IosModal_kotlinVersion=1.7.0
IosModal_minSdkVersion=21
IosModal_targetSdkVersion=31
IosModal_compileSdkVersion=31
IosModal_ndkversion=21.4.7075529
4 changes: 3 additions & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
<manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.reactnativeiosmodal">

</manifest>
16 changes: 16 additions & 0 deletions android/src/main/java/com/reactnativeiosmodal/IosModalPackage.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.reactnativeiosmodal
import com.facebook.react.ReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager


class IosModalPackage : ReactPackage {
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
return emptyList()
}

override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
return listOf(IosModalViewManager())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.reactnativeiosmodal
import android.graphics.Color
import android.view.View
import com.facebook.react.uimanager.SimpleViewManager
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.annotations.ReactProp

class IosModalViewManager : SimpleViewManager<View>() {
override fun getName() = "IosModalView"

override fun createViewInstance(reactContext: ThemedReactContext): View {
return View(reactContext)
}

@ReactProp(name = "color")
fun setColor(view: View, color: String) {
view.setBackgroundColor(Color.parseColor(color))
}
}
Loading

0 comments on commit e62ec7e

Please sign in to comment.