expo-module-template 9.0.1 → 10.2.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/$CHANGELOG.md +11 -0
- package/$package.json +26 -0
- package/.eslintrc.js +5 -0
- package/README.md +2 -12
- package/android/build.gradle +18 -20
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/{%= project.package %}/{%- project.name %}Module.kt +24 -0
- package/android/src/main/java/{%= project.package %}/{%- project.name %}View.kt +6 -0
- package/babel.config.js +1 -1
- package/expo-module.config.json +9 -0
- package/ios/{%- project.name %}.podspec +32 -0
- package/ios/{%- project.name %}Module.swift +21 -0
- package/ios/{%- project.name %}View.swift +5 -0
- package/package.json +11 -6
- package/src/{%- project.name %}.ts +14 -0
- package/src/{%- project.name %}View.tsx +17 -0
- package/CHANGELOG.md +0 -29
- package/android/src/main/java/expo/modules/template/ModuleTemplateModule.kt +0 -30
- package/android/src/main/java/expo/modules/template/ModuleTemplatePackage.kt +0 -17
- package/android/src/main/java/expo/modules/template/ModuleTemplateView.kt +0 -8
- package/android/src/main/java/expo/modules/template/ModuleTemplateViewManager.kt +0 -37
- package/android/src/test/java/expo/modules/template/ModuleTemplateModuleTest.kt +0 -32
- package/build/ExpoModuleTemplate.d.ts +0 -2
- package/build/ExpoModuleTemplate.js +0 -3
- package/build/ExpoModuleTemplate.js.map +0 -1
- package/build/ExpoModuleTemplate.web.d.ts +0 -4
- package/build/ExpoModuleTemplate.web.js +0 -6
- package/build/ExpoModuleTemplate.web.js.map +0 -1
- package/build/ExpoModuleTemplateNativeView.d.ts +0 -2
- package/build/ExpoModuleTemplateNativeView.js +0 -4
- package/build/ExpoModuleTemplateNativeView.js.map +0 -1
- package/build/ExpoModuleTemplateNativeView.web.d.ts +0 -4
- package/build/ExpoModuleTemplateNativeView.web.js +0 -8
- package/build/ExpoModuleTemplateNativeView.web.js.map +0 -1
- package/build/ExpoModuleTemplateView.d.ts +0 -20
- package/build/ExpoModuleTemplateView.js +0 -18
- package/build/ExpoModuleTemplateView.js.map +0 -1
- package/build/ModuleTemplate.d.ts +0 -13
- package/build/ModuleTemplate.js +0 -16
- package/build/ModuleTemplate.js.map +0 -1
- package/build/ModuleTemplate.types.d.ts +0 -3
- package/build/ModuleTemplate.types.js +0 -2
- package/build/ModuleTemplate.types.js.map +0 -1
- package/ios/EXModuleTemplate/EXModuleTemplateModule.h +0 -7
- package/ios/EXModuleTemplate/EXModuleTemplateModule.m +0 -27
- package/ios/EXModuleTemplate/EXModuleTemplateView.h +0 -9
- package/ios/EXModuleTemplate/EXModuleTemplateView.m +0 -19
- package/ios/EXModuleTemplate/EXModuleTemplateViewManager.h +0 -8
- package/ios/EXModuleTemplate/EXModuleTemplateViewManager.m +0 -36
- package/ios/EXModuleTemplate.podspec +0 -20
- package/src/ExpoModuleTemplate.ts +0 -3
- package/src/ExpoModuleTemplate.web.ts +0 -5
- package/src/ExpoModuleTemplateNativeView.ts +0 -5
- package/src/ExpoModuleTemplateNativeView.web.tsx +0 -11
- package/src/ExpoModuleTemplateView.tsx +0 -29
- package/src/ModuleTemplate.ts +0 -19
- package/src/ModuleTemplate.types.ts +0 -3
- package/src/__tests__/ModuleTemplate-test.ts +0 -7
- package/unimodule.json +0 -4
package/$CHANGELOG.md
ADDED
package/$package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%- project.slug %>",
|
|
3
|
+
"version": "<%- project.version %>",
|
|
4
|
+
"description": "<%- project.description %>",
|
|
5
|
+
"main": "build/<%- project.name %>.js",
|
|
6
|
+
"types": "build/<%- project.name %>.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"lint": "eslint ."
|
|
10
|
+
},
|
|
11
|
+
"keywords": ["react-native", "expo", "<%- project.slug %>", "<%- project.name %>"],
|
|
12
|
+
"repository": "<%- repo %>",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "<%- repo %>/issues"
|
|
15
|
+
},
|
|
16
|
+
"author": "<%- author %>",
|
|
17
|
+
"license": "<%- license %>",
|
|
18
|
+
"homepage": "<%- repo %>#readme",
|
|
19
|
+
"dependencies": {},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"expo-module-scripts": "^2.0.0"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"expo": "*"
|
|
25
|
+
}
|
|
26
|
+
}
|
package/.eslintrc.js
ADDED
package/README.md
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# <%- project.slug %>
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## API documentation
|
|
6
|
-
|
|
7
|
-
## Installation in managed Expo projects
|
|
8
|
-
|
|
9
|
-
## Installation in bare React Native projects
|
|
10
|
-
|
|
11
|
-
## Contributing
|
|
12
|
-
|
|
13
|
-
Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing).
|
|
3
|
+
<%- project.description %>
|
package/android/build.gradle
CHANGED
|
@@ -3,8 +3,8 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'kotlin-android-extensions'
|
|
4
4
|
apply plugin: 'maven'
|
|
5
5
|
|
|
6
|
-
group = '
|
|
7
|
-
version = '
|
|
6
|
+
group = '<%- project.package %>'
|
|
7
|
+
version = '10.2.0'
|
|
8
8
|
|
|
9
9
|
buildscript {
|
|
10
10
|
// Simple helper that allows the root project to override versions declared by this library.
|
|
@@ -17,7 +17,7 @@ buildscript {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
dependencies {
|
|
20
|
-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet(
|
|
20
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.4.21')}")
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -47,35 +47,33 @@ uploadArchives {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
android {
|
|
50
|
-
compileSdkVersion safeExtGet("compileSdkVersion",
|
|
50
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 30)
|
|
51
|
+
|
|
52
|
+
compileOptions {
|
|
53
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
54
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
kotlinOptions {
|
|
58
|
+
jvmTarget = JavaVersion.VERSION_1_8
|
|
59
|
+
}
|
|
51
60
|
|
|
52
61
|
defaultConfig {
|
|
53
62
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
54
|
-
targetSdkVersion safeExtGet("targetSdkVersion",
|
|
55
|
-
versionCode
|
|
56
|
-
versionName "
|
|
63
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 30)
|
|
64
|
+
versionCode 1
|
|
65
|
+
versionName "10.2.0"
|
|
57
66
|
}
|
|
58
67
|
lintOptions {
|
|
59
68
|
abortOnError false
|
|
60
69
|
}
|
|
61
70
|
}
|
|
62
71
|
|
|
63
|
-
if (new File(rootProject.projectDir.parentFile, 'package.json').exists()) {
|
|
64
|
-
apply from: project(":unimodules-core").file("../unimodules-core.gradle")
|
|
65
|
-
} else {
|
|
66
|
-
throw new GradleException(
|
|
67
|
-
'\'unimodules-core.gradle\' was not found in the usual React Native dependency location. ' +
|
|
68
|
-
'This package can only be used in such projects. Are you sure you\'ve installed the dependencies properly?')
|
|
69
|
-
}
|
|
70
|
-
|
|
71
72
|
repositories {
|
|
72
73
|
mavenCentral()
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
dependencies {
|
|
76
|
-
|
|
77
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet(
|
|
78
|
-
|
|
79
|
-
testImplementation project(':unimodules-test-core')
|
|
80
|
-
testImplementation 'org.robolectric:robolectric:4.3.1'
|
|
77
|
+
implementation project(':expo-modules-core')
|
|
78
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.4.21')}"
|
|
81
79
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<manifest package="
|
|
1
|
+
<manifest package="<%- project.package %>">
|
|
2
2
|
</manifest>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package <%- project.package %>
|
|
2
|
+
|
|
3
|
+
import expo.modules.kotlin.modules.Module
|
|
4
|
+
import expo.modules.kotlin.modules.ModuleDefinition
|
|
5
|
+
|
|
6
|
+
class <%- project.name %>Module : Module() {
|
|
7
|
+
override fun definition() = ModuleDefinition {
|
|
8
|
+
name("<%- project.name %>")
|
|
9
|
+
|
|
10
|
+
function("helloAsync") { options: Map<String, String> ->
|
|
11
|
+
println("Hello 👋")
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
viewManager {
|
|
15
|
+
view { context ->
|
|
16
|
+
<%- project.name %>View(context)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
prop("name") { view: <%- project.name %>View, prop: String ->
|
|
20
|
+
println(prop)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
package/babel.config.js
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = '<%- project.name %>'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.description = package['description']
|
|
10
|
+
s.license = package['license']
|
|
11
|
+
s.author = package['author']
|
|
12
|
+
s.homepage = package['homepage']
|
|
13
|
+
s.platform = :ios, '12.0'
|
|
14
|
+
s.swift_version = '5.4'
|
|
15
|
+
s.source = { git: '<%- repo %>' }
|
|
16
|
+
s.static_framework = true
|
|
17
|
+
|
|
18
|
+
s.dependency 'ExpoModulesCore'
|
|
19
|
+
|
|
20
|
+
# Swift/Objective-C compatibility
|
|
21
|
+
s.pod_target_xcconfig = {
|
|
22
|
+
'DEFINES_MODULE' => 'YES',
|
|
23
|
+
'SWIFT_COMPILATION_MODE' => 'wholemodule'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if !$ExpoUseSources&.include?(package['name']) && ENV['EXPO_USE_SOURCE'].to_i == 0 && File.exist?("#{s.name}.xcframework") && Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.10.0')
|
|
27
|
+
s.source_files = "**/*.h"
|
|
28
|
+
s.vendored_frameworks = "#{s.name}.xcframework"
|
|
29
|
+
else
|
|
30
|
+
s.source_files = "**/*.{h,m,swift}"
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import ExpoModulesCore
|
|
2
|
+
|
|
3
|
+
public class <%- project.name %>Module: Module {
|
|
4
|
+
public func definition() -> ModuleDefinition {
|
|
5
|
+
name("<%- project.name %>")
|
|
6
|
+
|
|
7
|
+
function("helloAsync") { (options: [String: String]) in
|
|
8
|
+
print("Hello 👋")
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
viewManager {
|
|
12
|
+
view {
|
|
13
|
+
<%- project.name %>View()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
prop("name") { (view: <%- project.name %>View, prop: String) in
|
|
17
|
+
print(prop)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-module-template",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"description": "ExpoModuleTemplate standalone module",
|
|
5
5
|
"main": "build/ModuleTemplate.js",
|
|
6
6
|
"types": "build/ModuleTemplate.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc"
|
|
9
|
-
},
|
|
7
|
+
"scripts": {},
|
|
10
8
|
"keywords": [
|
|
11
9
|
"react-native",
|
|
12
10
|
"expo",
|
|
@@ -22,6 +20,13 @@
|
|
|
22
20
|
},
|
|
23
21
|
"author": "650 Industries, Inc.",
|
|
24
22
|
"license": "MIT",
|
|
25
|
-
"homepage": "https://docs.expo.
|
|
26
|
-
"
|
|
23
|
+
"homepage": "https://docs.expo.dev/versions/latest/sdk/module-template",
|
|
24
|
+
"dependencies": {},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"expo-module-scripts": "^2.0.0"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"expo": "*"
|
|
30
|
+
},
|
|
31
|
+
"gitHead": "c87080dbe1d7cefd66a9f959c090ff1a2d2ab26d"
|
|
27
32
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NativeModulesProxy } from 'expo-modules-core';
|
|
2
|
+
|
|
3
|
+
import <%- project.name %>View, { <%- project.name %>ViewProps } from './<%- project.name %>View'
|
|
4
|
+
|
|
5
|
+
const { <%- project.name %> } = NativeModulesProxy;
|
|
6
|
+
|
|
7
|
+
export async function helloAsync(options: Record<string, string>) {
|
|
8
|
+
return await <%- project.name %>.helloAsync(options);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
<%- project.name %>View,
|
|
13
|
+
<%- project.name %>ViewProps
|
|
14
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { requireNativeViewManager } from 'expo-modules-core';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
export type <%- project.name %>ViewProps = {
|
|
5
|
+
name: number;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type <%- project.name %>ViewState = {}
|
|
9
|
+
|
|
10
|
+
const NativeView: React.ComponentType<<%- project.name %>ViewProps> =
|
|
11
|
+
requireNativeViewManager('<%- project.name %>');
|
|
12
|
+
|
|
13
|
+
export default class <%- project.name %>View extends React.Component<<%- project.name %>ViewProps, <%- project.name %>ViewState> {
|
|
14
|
+
render() {
|
|
15
|
+
return <NativeView name={this.props.name} />;
|
|
16
|
+
}
|
|
17
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## Unpublished
|
|
4
|
-
|
|
5
|
-
### 🛠 Breaking changes
|
|
6
|
-
|
|
7
|
-
### 🎉 New features
|
|
8
|
-
|
|
9
|
-
### 🐛 Bug fixes
|
|
10
|
-
|
|
11
|
-
## 9.0.1 — 2021-03-10
|
|
12
|
-
|
|
13
|
-
### 🐛 Bug fixes
|
|
14
|
-
|
|
15
|
-
- Remove peerDependencies and unimodulePeerDependencies from Expo modules. ([#11980](https://github.com/expo/expo/pull/11980) by [@brentvatne](https://github.com/brentvatne))
|
|
16
|
-
|
|
17
|
-
## 9.0.0 — 2021-01-15
|
|
18
|
-
|
|
19
|
-
### 🛠 Breaking changes
|
|
20
|
-
|
|
21
|
-
- Dropped support for iOS 10.0 ([#11344](https://github.com/expo/expo/pull/11344) by [@tsapeta](https://github.com/tsapeta))
|
|
22
|
-
|
|
23
|
-
## 8.5.0 — 2020-11-17
|
|
24
|
-
|
|
25
|
-
_This version does not introduce any user-facing changes._
|
|
26
|
-
|
|
27
|
-
## 8.4.0 — 2020-08-18
|
|
28
|
-
|
|
29
|
-
_This version does not introduce any user-facing changes._
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
package expo.modules.template
|
|
2
|
-
|
|
3
|
-
import android.content.Context
|
|
4
|
-
|
|
5
|
-
import org.unimodules.core.ExportedModule
|
|
6
|
-
import org.unimodules.core.ModuleRegistry
|
|
7
|
-
import org.unimodules.core.Promise
|
|
8
|
-
import org.unimodules.core.interfaces.ExpoMethod
|
|
9
|
-
|
|
10
|
-
class ModuleTemplateModule(context: Context) : ExportedModule(context) {
|
|
11
|
-
|
|
12
|
-
private var mModuleRegistry: ModuleRegistry? = null
|
|
13
|
-
|
|
14
|
-
override fun getName(): String {
|
|
15
|
-
return NAME
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
override fun onCreate(moduleRegistry: ModuleRegistry) {
|
|
19
|
-
mModuleRegistry = moduleRegistry
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@ExpoMethod
|
|
23
|
-
fun someGreatMethodAsync(options: Map<String, Any>, promise: Promise) {
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
companion object {
|
|
27
|
-
private val NAME = "ExpoModuleTemplate"
|
|
28
|
-
private val TAG = ModuleTemplateModule::class.qualifiedName
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
package expo.modules.template
|
|
2
|
-
|
|
3
|
-
import android.content.Context
|
|
4
|
-
|
|
5
|
-
import org.unimodules.core.BasePackage
|
|
6
|
-
import org.unimodules.core.ExportedModule
|
|
7
|
-
import org.unimodules.core.ViewManager
|
|
8
|
-
|
|
9
|
-
class ModuleTemplatePackage : BasePackage() {
|
|
10
|
-
override fun createExportedModules(context: Context): List<ExportedModule> {
|
|
11
|
-
return listOf(ModuleTemplateModule(context) as ExportedModule)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
override fun createViewManagers(context: Context): List<ViewManager<*>> {
|
|
15
|
-
return listOf(ModuleTemplateViewManager() as ViewManager<*>)
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
package expo.modules.template
|
|
2
|
-
|
|
3
|
-
import android.content.Context
|
|
4
|
-
|
|
5
|
-
import java.util.Arrays
|
|
6
|
-
|
|
7
|
-
import org.unimodules.core.ModuleRegistry
|
|
8
|
-
import org.unimodules.core.ViewManager
|
|
9
|
-
|
|
10
|
-
class ModuleTemplateViewManager : ViewManager<ModuleTemplateView>() {
|
|
11
|
-
|
|
12
|
-
private var mModuleRegistry: ModuleRegistry? = null
|
|
13
|
-
|
|
14
|
-
override fun getName(): String {
|
|
15
|
-
return TAG
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
override fun createViewInstance(context: Context): ModuleTemplateView {
|
|
19
|
-
return ModuleTemplateView(context, mModuleRegistry!!)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
override fun getViewManagerType(): ViewManager.ViewManagerType {
|
|
23
|
-
return ViewManager.ViewManagerType.SIMPLE
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
override fun getExportedEventNames(): List<String> {
|
|
27
|
-
return Arrays.asList("onSomethingHappened")
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
override fun onCreate(moduleRegistry: ModuleRegistry) {
|
|
31
|
-
mModuleRegistry = moduleRegistry
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
companion object {
|
|
35
|
-
private val TAG = "ExpoModuleTemplateView"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
package expo.modules.template
|
|
2
|
-
|
|
3
|
-
import io.mockk.mockk
|
|
4
|
-
import org.junit.Assert.assertTrue
|
|
5
|
-
import org.junit.Before
|
|
6
|
-
import org.junit.Test
|
|
7
|
-
import org.junit.runner.RunWith
|
|
8
|
-
import org.robolectric.RobolectricTestRunner
|
|
9
|
-
import org.unimodules.test.core.PromiseMock
|
|
10
|
-
import org.unimodules.test.core.moduleRegistryMock
|
|
11
|
-
|
|
12
|
-
@RunWith(RobolectricTestRunner::class)
|
|
13
|
-
class ModuleTemplateModuleTest {
|
|
14
|
-
|
|
15
|
-
private var moduleRegistry = moduleRegistryMock()
|
|
16
|
-
|
|
17
|
-
private lateinit var promise: PromiseMock
|
|
18
|
-
|
|
19
|
-
private lateinit var module: ModuleTemplateModule
|
|
20
|
-
|
|
21
|
-
@Before
|
|
22
|
-
fun initializeMock() {
|
|
23
|
-
promise = PromiseMock()
|
|
24
|
-
module = ModuleTemplateModule(mockk())
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@Test
|
|
28
|
-
fun testSomeGreatMethodAsync() {
|
|
29
|
-
assertTrue(true)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoModuleTemplate.js","sourceRoot":"","sources":["../src/ExpoModuleTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,eAAe,kBAAkB,CAAC,kBAAkB,CAAC","sourcesContent":["import { NativeModulesProxy } from '@unimodules/core';\n\nexport default NativeModulesProxy.ExpoModuleTemplate;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoModuleTemplate.web.js","sourceRoot":"","sources":["../src/ExpoModuleTemplate.web.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,IAAI,IAAI;QACN,OAAO,oBAAoB,CAAC;IAC9B,CAAC;CACF,CAAA","sourcesContent":["export default {\n get name(): String {\n return 'ExpoModuleTemplate';\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoModuleTemplateNativeView.js","sourceRoot":"","sources":["../src/ExpoModuleTemplateNativeView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,MAAM,UAAU,GAAG,wBAAwB,CAAC,wBAAwB,CAAC,CAAC;AAEtE,eAAe,UAAU,CAAC","sourcesContent":["import { requireNativeViewManager } from '@unimodules/core';\n\nconst NativeView = requireNativeViewManager('ExpoModuleTemplateView');\n\nexport default NativeView;\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
export default class ExpoModuleTemplateView extends React.Component {
|
|
4
|
-
render() {
|
|
5
|
-
return (React.createElement(View, null));
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=ExpoModuleTemplateNativeView.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoModuleTemplateNativeView.web.js","sourceRoot":"","sources":["../src/ExpoModuleTemplateNativeView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,KAAK,CAAC,SAAS;IACjE,MAAM;QACJ,OAAO,CACL,oBAAC,IAAI,OAAG,CACT,CAAC;IACJ,CAAC;CACF","sourcesContent":["import * as React from 'react';\n\nimport { View } from 'react-native'\n\nexport default class ExpoModuleTemplateView extends React.Component {\n render() {\n return (\n <View />\n );\n }\n}\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface ExpoModuleTemplateViewProps {
|
|
3
|
-
greatProp: string;
|
|
4
|
-
}
|
|
5
|
-
interface ExpoModuleTemplateViewState {
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Great view that would suit your needs!
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* <ExpoModuleTemplateNativeView
|
|
13
|
-
* greatProp="great"
|
|
14
|
-
* />
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export default class ExpoModuleTemplateView extends React.Component<ExpoModuleTemplateViewProps, ExpoModuleTemplateViewState> {
|
|
18
|
-
render(): JSX.Element;
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import NativeView from './ExpoModuleTemplateNativeView';
|
|
3
|
-
/**
|
|
4
|
-
* Great view that would suit your needs!
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```tsx
|
|
8
|
-
* <ExpoModuleTemplateNativeView
|
|
9
|
-
* greatProp="great"
|
|
10
|
-
* />
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
export default class ExpoModuleTemplateView extends React.Component {
|
|
14
|
-
render() {
|
|
15
|
-
return (React.createElement(NativeView, null));
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=ExpoModuleTemplateView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoModuleTemplateView.js","sourceRoot":"","sources":["../src/ExpoModuleTemplateView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,UAAU,MAAM,gCAAgC,CAAC;AAUxD;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,KAAK,CAAC,SAAmE;IAC3H,MAAM;QACJ,OAAO,CACL,oBAAC,UAAU,OAAG,CACf,CAAC;IACJ,CAAC;CACF","sourcesContent":["import * as React from 'react';\n\nimport NativeView from './ExpoModuleTemplateNativeView';\n\nexport interface ExpoModuleTemplateViewProps {\n greatProp: string;\n}\n\ninterface ExpoModuleTemplateViewState {\n\n}\n\n/**\n * Great view that would suit your needs!\n *\n * @example\n * ```tsx\n * <ExpoModuleTemplateNativeView\n * greatProp=\"great\"\n * />\n * ```\n */\nexport default class ExpoModuleTemplateView extends React.Component<ExpoModuleTemplateViewProps, ExpoModuleTemplateViewState> {\n render() {\n return (\n <NativeView />\n );\n }\n}\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SampleOptions } from './ModuleTemplate.types';
|
|
2
|
-
export { default as ExpoModuleTemplateView, ExpoModuleTemplateViewProps } from './ExpoModuleTemplateView';
|
|
3
|
-
export * from './ModuleTemplate.types';
|
|
4
|
-
/**
|
|
5
|
-
* Great method that does a lot great stuff.
|
|
6
|
-
* @param options specifies what great stuff you really want.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* const result = await someGreatMethodAsync({ someOption: 'awesome' });
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
export declare function someGreatMethodAsync(options: SampleOptions): Promise<any>;
|
package/build/ModuleTemplate.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import ExpoModuleTemplate from './ExpoModuleTemplate';
|
|
2
|
-
export { default as ExpoModuleTemplateView } from './ExpoModuleTemplateView';
|
|
3
|
-
export * from './ModuleTemplate.types';
|
|
4
|
-
/**
|
|
5
|
-
* Great method that does a lot great stuff.
|
|
6
|
-
* @param options specifies what great stuff you really want.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* const result = await someGreatMethodAsync({ someOption: 'awesome' });
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
export async function someGreatMethodAsync(options) {
|
|
14
|
-
return await ExpoModuleTemplate.someGreatMethodAsync(options);
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=ModuleTemplate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleTemplate.js","sourceRoot":"","sources":["../src/ModuleTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAA+B,MAAM,0BAA0B,CAAC;AAE1G,cAAc,wBAAwB,CAAC;AAEvC;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAAsB;IAC/D,OAAO,MAAM,kBAAkB,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import ExpoModuleTemplate from './ExpoModuleTemplate';\nimport { SampleOptions } from './ModuleTemplate.types';\n\nexport { default as ExpoModuleTemplateView, ExpoModuleTemplateViewProps } from './ExpoModuleTemplateView';\n\nexport * from './ModuleTemplate.types';\n\n/**\n * Great method that does a lot great stuff.\n * @param options specifies what great stuff you really want.\n *\n * @example\n * ```typescript\n * const result = await someGreatMethodAsync({ someOption: 'awesome' });\n * ```\n */\nexport async function someGreatMethodAsync(options: SampleOptions) {\n return await ExpoModuleTemplate.someGreatMethodAsync(options);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleTemplate.types.js","sourceRoot":"","sources":["../src/ModuleTemplate.types.ts"],"names":[],"mappings":"","sourcesContent":["export interface SampleOptions {\n someOption: string;\n}\n"]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Copyright 2018-present 650 Industries. All rights reserved.
|
|
2
|
-
|
|
3
|
-
#import <EXModuleTemplate/EXModuleTemplateModule.h>
|
|
4
|
-
|
|
5
|
-
@interface EXModuleTemplateModule ()
|
|
6
|
-
|
|
7
|
-
@property (nonatomic, weak) UMModuleRegistry *moduleRegistry;
|
|
8
|
-
|
|
9
|
-
@end
|
|
10
|
-
|
|
11
|
-
@implementation EXModuleTemplateModule
|
|
12
|
-
|
|
13
|
-
UM_EXPORT_MODULE(ExpoModuleTemplate);
|
|
14
|
-
|
|
15
|
-
- (void)setModuleRegistry:(UMModuleRegistry *)moduleRegistry
|
|
16
|
-
{
|
|
17
|
-
_moduleRegistry = moduleRegistry;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
UM_EXPORT_METHOD_AS(someGreatMethodAsync,
|
|
21
|
-
options:(NSDictionary *)options
|
|
22
|
-
resolve:(UMPromiseResolveBlock)resolve
|
|
23
|
-
reject:(UMPromiseRejectBlock)reject)
|
|
24
|
-
{
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Copyright 2016-present 650 Industries. All rights reserved.
|
|
2
|
-
|
|
3
|
-
#import <EXModuleTemplate/EXModuleTemplateView.h>
|
|
4
|
-
|
|
5
|
-
@interface EXModuleTemplateView ()
|
|
6
|
-
|
|
7
|
-
@end
|
|
8
|
-
|
|
9
|
-
@implementation EXModuleTemplateView
|
|
10
|
-
|
|
11
|
-
- (instancetype)initWithModuleRegistry:(UMModuleRegistry *)moduleRegistry
|
|
12
|
-
{
|
|
13
|
-
if ((self = [super init])) {
|
|
14
|
-
// some logic here
|
|
15
|
-
}
|
|
16
|
-
return self;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@end
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// Copyright 2016-present 650 Industries. All rights reserved.
|
|
2
|
-
|
|
3
|
-
#import <EXModuleTemplate/EXModuleTemplateView.h>
|
|
4
|
-
#import <EXModuleTemplate/EXModuleTemplateViewManager.h>
|
|
5
|
-
|
|
6
|
-
@interface EXModuleTemplateViewManager ()
|
|
7
|
-
|
|
8
|
-
@property (nonatomic, weak) UMModuleRegistry *moduleRegistry;
|
|
9
|
-
|
|
10
|
-
@end
|
|
11
|
-
|
|
12
|
-
@implementation EXModuleTemplateViewManager
|
|
13
|
-
|
|
14
|
-
UM_EXPORT_MODULE(ExpoModuleTemplateViewManager);
|
|
15
|
-
|
|
16
|
-
- (UIView *)view
|
|
17
|
-
{
|
|
18
|
-
return [[EXModuleTemplateView alloc] initWithModuleRegistry:_moduleRegistry];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
- (NSString *)viewName
|
|
22
|
-
{
|
|
23
|
-
return @"ExpoModuleTemplateView";
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
- (NSArray<NSString *> *)supportedEvents
|
|
27
|
-
{
|
|
28
|
-
return @[@"onSomethingHappened"];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
- (void)setModuleRegistry:(UMModuleRegistry *)moduleRegistry
|
|
32
|
-
{
|
|
33
|
-
_moduleRegistry = moduleRegistry;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
require 'json'
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
|
-
|
|
5
|
-
Pod::Spec.new do |s|
|
|
6
|
-
s.name = 'EXModuleTemplate'
|
|
7
|
-
s.version = package['version']
|
|
8
|
-
s.summary = package['description']
|
|
9
|
-
s.description = package['description']
|
|
10
|
-
s.license = package['license']
|
|
11
|
-
s.author = package['author']
|
|
12
|
-
s.homepage = package['homepage']
|
|
13
|
-
s.platform = :ios, '11.0'
|
|
14
|
-
s.source = { git: 'https://github.com/expo/expo.git' }
|
|
15
|
-
s.source_files = 'EXModuleTemplate/**/*.{h,m}'
|
|
16
|
-
s.preserve_paths = 'EXModuleTemplate/**/*.{h,m}'
|
|
17
|
-
s.requires_arc = true
|
|
18
|
-
|
|
19
|
-
s.dependency 'UMCore'
|
|
20
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import NativeView from './ExpoModuleTemplateNativeView';
|
|
4
|
-
|
|
5
|
-
export interface ExpoModuleTemplateViewProps {
|
|
6
|
-
greatProp: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface ExpoModuleTemplateViewState {
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Great view that would suit your needs!
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```tsx
|
|
18
|
-
* <ExpoModuleTemplateNativeView
|
|
19
|
-
* greatProp="great"
|
|
20
|
-
* />
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export default class ExpoModuleTemplateView extends React.Component<ExpoModuleTemplateViewProps, ExpoModuleTemplateViewState> {
|
|
24
|
-
render() {
|
|
25
|
-
return (
|
|
26
|
-
<NativeView />
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
}
|
package/src/ModuleTemplate.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import ExpoModuleTemplate from './ExpoModuleTemplate';
|
|
2
|
-
import { SampleOptions } from './ModuleTemplate.types';
|
|
3
|
-
|
|
4
|
-
export { default as ExpoModuleTemplateView, ExpoModuleTemplateViewProps } from './ExpoModuleTemplateView';
|
|
5
|
-
|
|
6
|
-
export * from './ModuleTemplate.types';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Great method that does a lot great stuff.
|
|
10
|
-
* @param options specifies what great stuff you really want.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* const result = await someGreatMethodAsync({ someOption: 'awesome' });
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export async function someGreatMethodAsync(options: SampleOptions) {
|
|
18
|
-
return await ExpoModuleTemplate.someGreatMethodAsync(options);
|
|
19
|
-
}
|
package/unimodule.json
DELETED