expo-module-template 10.2.0 → 10.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/$package.json
CHANGED
|
@@ -5,8 +5,13 @@
|
|
|
5
5
|
"main": "build/<%- project.name %>.js",
|
|
6
6
|
"types": "build/<%- project.name %>.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "
|
|
9
|
-
"
|
|
8
|
+
"build": "expo-module build",
|
|
9
|
+
"clean": "expo-module clean",
|
|
10
|
+
"lint": "expo-module lint",
|
|
11
|
+
"test": "expo-module test",
|
|
12
|
+
"prepare": "expo-module prepare",
|
|
13
|
+
"prepublishOnly": "expo-module prepublishOnly",
|
|
14
|
+
"expo-module": "expo-module"
|
|
10
15
|
},
|
|
11
16
|
"keywords": ["react-native", "expo", "<%- project.slug %>", "<%- project.name %>"],
|
|
12
17
|
"repository": "<%- repo %>",
|
|
@@ -18,7 +23,8 @@
|
|
|
18
23
|
"homepage": "<%- repo %>#readme",
|
|
19
24
|
"dependencies": {},
|
|
20
25
|
"devDependencies": {
|
|
21
|
-
"expo-module-scripts": "^2.0.0"
|
|
26
|
+
"expo-module-scripts": "^2.0.0",
|
|
27
|
+
"expo-modules-core": "^0.9.0"
|
|
22
28
|
},
|
|
23
29
|
"peerDependencies": {
|
|
24
30
|
"expo": "*"
|
package/android/build.gradle
CHANGED
|
@@ -1,68 +1,81 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
apply plugin: 'kotlin-android'
|
|
3
3
|
apply plugin: 'kotlin-android-extensions'
|
|
4
|
-
apply plugin: 'maven'
|
|
4
|
+
apply plugin: 'maven-publish'
|
|
5
5
|
|
|
6
6
|
group = '<%- project.package %>'
|
|
7
|
-
version = '
|
|
7
|
+
version = '<%- project.version %>'
|
|
8
8
|
|
|
9
9
|
buildscript {
|
|
10
|
+
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
11
|
+
if (expoModulesCorePlugin.exists()) {
|
|
12
|
+
apply from: expoModulesCorePlugin
|
|
13
|
+
applyKotlinExpoModulesCorePlugin()
|
|
14
|
+
}
|
|
15
|
+
|
|
10
16
|
// Simple helper that allows the root project to override versions declared by this library.
|
|
11
17
|
ext.safeExtGet = { prop, fallback ->
|
|
12
18
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
13
19
|
}
|
|
14
20
|
|
|
21
|
+
// Ensures backward compatibility
|
|
22
|
+
ext.getKotlinVersion = {
|
|
23
|
+
if (ext.has("kotlinVersion")) {
|
|
24
|
+
ext.kotlinVersion()
|
|
25
|
+
} else {
|
|
26
|
+
ext.safeExtGet("kotlinVersion", "1.6.10")
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
15
30
|
repositories {
|
|
16
31
|
mavenCentral()
|
|
17
32
|
}
|
|
18
33
|
|
|
19
34
|
dependencies {
|
|
20
|
-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${
|
|
35
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
|
|
21
36
|
}
|
|
22
37
|
}
|
|
23
38
|
|
|
24
|
-
// Upload android library to maven with javadoc and android sources
|
|
25
|
-
configurations {
|
|
26
|
-
deployerJars
|
|
27
|
-
}
|
|
28
|
-
|
|
29
39
|
// Creating sources with comments
|
|
30
40
|
task androidSourcesJar(type: Jar) {
|
|
31
41
|
classifier = 'sources'
|
|
32
42
|
from android.sourceSets.main.java.srcDirs
|
|
33
43
|
}
|
|
34
44
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
afterEvaluate {
|
|
46
|
+
publishing {
|
|
47
|
+
publications {
|
|
48
|
+
release(MavenPublication) {
|
|
49
|
+
from components.release
|
|
50
|
+
// Add additional sourcesJar to artifacts
|
|
51
|
+
artifact(androidSourcesJar)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
repositories {
|
|
55
|
+
maven {
|
|
56
|
+
url = mavenLocal().url
|
|
57
|
+
}
|
|
45
58
|
}
|
|
46
59
|
}
|
|
47
60
|
}
|
|
48
61
|
|
|
49
62
|
android {
|
|
50
|
-
compileSdkVersion safeExtGet("compileSdkVersion",
|
|
63
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 31)
|
|
51
64
|
|
|
52
65
|
compileOptions {
|
|
53
|
-
sourceCompatibility JavaVersion.
|
|
54
|
-
targetCompatibility JavaVersion.
|
|
66
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
67
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
55
68
|
}
|
|
56
|
-
|
|
69
|
+
|
|
57
70
|
kotlinOptions {
|
|
58
|
-
jvmTarget = JavaVersion.
|
|
71
|
+
jvmTarget = JavaVersion.VERSION_11.majorVersion
|
|
59
72
|
}
|
|
60
73
|
|
|
61
74
|
defaultConfig {
|
|
62
75
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
63
|
-
targetSdkVersion safeExtGet("targetSdkVersion",
|
|
76
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
64
77
|
versionCode 1
|
|
65
|
-
versionName "
|
|
78
|
+
versionName "<%- project.version %>"
|
|
66
79
|
}
|
|
67
80
|
lintOptions {
|
|
68
81
|
abortOnError false
|
|
@@ -75,5 +88,5 @@ repositories {
|
|
|
75
88
|
|
|
76
89
|
dependencies {
|
|
77
90
|
implementation project(':expo-modules-core')
|
|
78
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${
|
|
91
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
79
92
|
}
|
|
@@ -5,18 +5,18 @@ import expo.modules.kotlin.modules.ModuleDefinition
|
|
|
5
5
|
|
|
6
6
|
class <%- project.name %>Module : Module() {
|
|
7
7
|
override fun definition() = ModuleDefinition {
|
|
8
|
-
|
|
8
|
+
Name("<%- project.name %>")
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
AsyncFunction("helloAsync") { options: Map<String, String> ->
|
|
11
11
|
println("Hello 👋")
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
ViewManager {
|
|
15
|
+
View { context ->
|
|
16
16
|
<%- project.name %>View(context)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Prop("name") { view: <%- project.name %>View, prop: String ->
|
|
20
20
|
println(prop)
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -2,18 +2,18 @@ import ExpoModulesCore
|
|
|
2
2
|
|
|
3
3
|
public class <%- project.name %>Module: Module {
|
|
4
4
|
public func definition() -> ModuleDefinition {
|
|
5
|
-
|
|
5
|
+
Name("<%- project.name %>")
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
AsyncFunction("helloAsync") { (options: [String: String]) in
|
|
8
8
|
print("Hello 👋")
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
ViewManager {
|
|
12
|
+
View {
|
|
13
13
|
<%- project.name %>View()
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Prop("name") { (view: <%- project.name %>View, prop: String) in
|
|
17
17
|
print(prop)
|
|
18
18
|
}
|
|
19
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-module-template",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.5.0",
|
|
4
4
|
"description": "ExpoModuleTemplate standalone module",
|
|
5
5
|
"main": "build/ModuleTemplate.js",
|
|
6
6
|
"types": "build/ModuleTemplate.d.ts",
|
|
@@ -22,11 +22,7 @@
|
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"homepage": "https://docs.expo.dev/versions/latest/sdk/module-template",
|
|
24
24
|
"dependencies": {},
|
|
25
|
-
"devDependencies": {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"peerDependencies": {
|
|
29
|
-
"expo": "*"
|
|
30
|
-
},
|
|
31
|
-
"gitHead": "c87080dbe1d7cefd66a9f959c090ff1a2d2ab26d"
|
|
25
|
+
"devDependencies": {},
|
|
26
|
+
"peerDependencies": {},
|
|
27
|
+
"gitHead": "0df2d4a2b2d494826ebd4355d4246bc66781c5b2"
|
|
32
28
|
}
|