expo-cellular 4.2.0 β†’ 4.3.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 CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### πŸ’‘ Others
12
12
 
13
+ ## 4.3.0 β€” 2022-07-07
14
+
15
+ ### πŸ’‘ Others
16
+
17
+ - Migrated Expo modules definitions to the new naming convention. ([#17193](https://github.com/expo/expo/pull/17193) by [@tsapeta](https://github.com/tsapeta))
18
+
13
19
  ## 4.2.0 β€” 2022-04-18
14
20
 
15
21
  ### ⚠️ Notices
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '4.2.0'
6
+ version = '4.3.0'
7
7
 
8
8
  buildscript {
9
9
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
@@ -74,7 +74,7 @@ android {
74
74
  minSdkVersion safeExtGet("minSdkVersion", 21)
75
75
  targetSdkVersion safeExtGet("targetSdkVersion", 31)
76
76
  versionCode 11
77
- versionName '4.2.0'
77
+ versionName '4.3.0'
78
78
  }
79
79
  lintOptions {
80
80
  abortOnError false
@@ -13,8 +13,8 @@ const val moduleName = "ExpoCellular"
13
13
 
14
14
  class CellularModule : Module() {
15
15
  override fun definition() = ModuleDefinition {
16
- name(moduleName)
17
- constants {
16
+ Name(moduleName)
17
+ Constants {
18
18
  val telephonyManager = telephonyManager()
19
19
  mapOf(
20
20
  "allowsVoip" to SipManager.isVoipSupported(context),
@@ -25,7 +25,7 @@ class CellularModule : Module() {
25
25
  )
26
26
  }
27
27
 
28
- function("getCellularGenerationAsync") {
28
+ AsyncFunction("getCellularGenerationAsync") {
29
29
  try {
30
30
  getCurrentGeneration()
31
31
  } catch (e: SecurityException) {
@@ -34,23 +34,23 @@ class CellularModule : Module() {
34
34
  }
35
35
  }
36
36
 
37
- function("allowsVoipAsync") {
37
+ AsyncFunction("allowsVoipAsync") {
38
38
  SipManager.isVoipSupported(context)
39
39
  }
40
40
 
41
- function("getIsoCountryCodeAsync") {
41
+ AsyncFunction("getIsoCountryCodeAsync") {
42
42
  telephonyManager()?.simCountryIso
43
43
  }
44
44
 
45
- function("getCarrierNameAsync") {
45
+ AsyncFunction("getCarrierNameAsync") {
46
46
  telephonyManager()?.simOperatorName
47
47
  }
48
48
 
49
- function("getMobileCountryCodeAsync") {
49
+ AsyncFunction("getMobileCountryCodeAsync") {
50
50
  telephonyManager()?.simOperator?.substring(0, 3)
51
51
  }
52
52
 
53
- function("getMobileNetworkCodeAsync") {
53
+ AsyncFunction("getMobileNetworkCodeAsync") {
54
54
  telephonyManager()?.simOperator?.substring(3)
55
55
  }
56
56
  }
@@ -3,33 +3,33 @@ import ExpoModulesCore
3
3
 
4
4
  public class CellularModule: Module {
5
5
  public func definition() -> ModuleDefinition {
6
- name("ExpoCellular")
6
+ Name("ExpoCellular")
7
7
 
8
- constants {
8
+ Constants {
9
9
  Self.getCurrentCellularInfo()
10
10
  }
11
11
 
12
- function("getCellularGenerationAsync") { () -> Int in
12
+ AsyncFunction("getCellularGenerationAsync") { () -> Int in
13
13
  Self.currentCellularGeneration().rawValue
14
14
  }
15
15
 
16
- function("allowsVoipAsync") { () -> Bool? in
16
+ AsyncFunction("allowsVoipAsync") { () -> Bool? in
17
17
  Self.currentCarrier()?.allowsVOIP
18
18
  }
19
19
 
20
- function("getIsoCountryCodeAsync") { () -> String? in
20
+ AsyncFunction("getIsoCountryCodeAsync") { () -> String? in
21
21
  Self.currentCarrier()?.isoCountryCode
22
22
  }
23
23
 
24
- function("getCarrierNameAsync") { () -> String? in
24
+ AsyncFunction("getCarrierNameAsync") { () -> String? in
25
25
  Self.currentCarrier()?.carrierName
26
26
  }
27
27
 
28
- function("getMobileCountryCodeAsync") { () -> String? in
28
+ AsyncFunction("getMobileCountryCodeAsync") { () -> String? in
29
29
  Self.currentCarrier()?.mobileCountryCode
30
30
  }
31
31
 
32
- function("getMobileNetworkCodeAsync") { () -> String? in
32
+ AsyncFunction("getMobileNetworkCodeAsync") { () -> String? in
33
33
  Self.currentCarrier()?.mobileNetworkCode
34
34
  }
35
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-cellular",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "description": "Provides information about the user’s cellular service provider",
5
5
  "main": "build/Cellular.js",
6
6
  "types": "build/Cellular.d.ts",
@@ -36,5 +36,5 @@
36
36
  "peerDependencies": {
37
37
  "expo": "*"
38
38
  },
39
- "gitHead": "89a27c0ca0ca8becd7546697298e874a15e94faf"
39
+ "gitHead": "e893ff2b01e108cf246cec02318c0df9d6bc603c"
40
40
  }
package/tsconfig.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "outDir": "./build"
6
6
  },
7
7
  "include": ["./src"],
8
- "exclude": ["**/__mocks__/*", "**/__tests__/*"]
8
+ "exclude": ["**/__mocks__/*", "**/__tests__/*", "**/__stories__/*"]
9
9
  }