gt-react-native 0.0.1-alpha.1 → 0.0.1-alpha.3

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.
@@ -43,9 +43,9 @@ public abstract class NativeGtReactNativeSpec extends ReactContextBaseJavaModule
43
43
 
44
44
  @ReactMethod(isBlockingSynchronousMethod = true)
45
45
  @DoNotStrip
46
- public abstract @Nullable String get(String key);
46
+ public abstract @Nullable String nativeStoreGet(String key);
47
47
 
48
48
  @ReactMethod
49
49
  @DoNotStrip
50
- public abstract void set(String key, String value);
50
+ public abstract void nativeStoreSet(String key, String value);
51
51
  }
@@ -22,22 +22,22 @@ static facebook::jsi::Value __hostFunction_NativeGtReactNativeSpecJSI_getNativeL
22
22
  return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, ArrayKind, "getNativeLocales", "()Lcom/facebook/react/bridge/WritableArray;", args, count, cachedMethodId);
23
23
  }
24
24
 
25
- static facebook::jsi::Value __hostFunction_NativeGtReactNativeSpecJSI_get(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
25
+ static facebook::jsi::Value __hostFunction_NativeGtReactNativeSpecJSI_nativeStoreGet(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
26
26
  static jmethodID cachedMethodId = nullptr;
27
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, StringKind, "get", "(Ljava/lang/String;)Ljava/lang/String;", args, count, cachedMethodId);
27
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, StringKind, "nativeStoreGet", "(Ljava/lang/String;)Ljava/lang/String;", args, count, cachedMethodId);
28
28
  }
29
29
 
30
- static facebook::jsi::Value __hostFunction_NativeGtReactNativeSpecJSI_set(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
30
+ static facebook::jsi::Value __hostFunction_NativeGtReactNativeSpecJSI_nativeStoreSet(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
31
31
  static jmethodID cachedMethodId = nullptr;
32
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "set", "(Ljava/lang/String;Ljava/lang/String;)V", args, count, cachedMethodId);
32
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "nativeStoreSet", "(Ljava/lang/String;Ljava/lang/String;)V", args, count, cachedMethodId);
33
33
  }
34
34
 
35
35
  NativeGtReactNativeSpecJSI::NativeGtReactNativeSpecJSI(const JavaTurboModule::InitParams &params)
36
36
  : JavaTurboModule(params) {
37
37
  methodMap_["multiply"] = MethodMetadata {2, __hostFunction_NativeGtReactNativeSpecJSI_multiply};
38
38
  methodMap_["getNativeLocales"] = MethodMetadata {0, __hostFunction_NativeGtReactNativeSpecJSI_getNativeLocales};
39
- methodMap_["get"] = MethodMetadata {1, __hostFunction_NativeGtReactNativeSpecJSI_get};
40
- methodMap_["set"] = MethodMetadata {2, __hostFunction_NativeGtReactNativeSpecJSI_set};
39
+ methodMap_["nativeStoreGet"] = MethodMetadata {1, __hostFunction_NativeGtReactNativeSpecJSI_nativeStoreGet};
40
+ methodMap_["nativeStoreSet"] = MethodMetadata {2, __hostFunction_NativeGtReactNativeSpecJSI_nativeStoreSet};
41
41
  }
42
42
 
43
43
  std::shared_ptr<TurboModule> GtReactNativeSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
@@ -23,15 +23,15 @@ static jsi::Value __hostFunction_NativeGtReactNativeCxxSpecJSI_getNativeLocales(
23
23
  rt
24
24
  );
25
25
  }
26
- static jsi::Value __hostFunction_NativeGtReactNativeCxxSpecJSI_get(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
27
- auto result = static_cast<NativeGtReactNativeCxxSpecJSI *>(&turboModule)->get(
26
+ static jsi::Value __hostFunction_NativeGtReactNativeCxxSpecJSI_nativeStoreGet(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
27
+ auto result = static_cast<NativeGtReactNativeCxxSpecJSI *>(&turboModule)->nativeStoreGet(
28
28
  rt,
29
29
  count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
30
30
  );
31
31
  return result ? jsi::Value(std::move(*result)) : jsi::Value::null();
32
32
  }
33
- static jsi::Value __hostFunction_NativeGtReactNativeCxxSpecJSI_set(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
34
- static_cast<NativeGtReactNativeCxxSpecJSI *>(&turboModule)->set(
33
+ static jsi::Value __hostFunction_NativeGtReactNativeCxxSpecJSI_nativeStoreSet(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
34
+ static_cast<NativeGtReactNativeCxxSpecJSI *>(&turboModule)->nativeStoreSet(
35
35
  rt,
36
36
  count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
37
37
  count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
@@ -43,8 +43,8 @@ NativeGtReactNativeCxxSpecJSI::NativeGtReactNativeCxxSpecJSI(std::shared_ptr<Cal
43
43
  : TurboModule("GtReactNative", jsInvoker) {
44
44
  methodMap_["multiply"] = MethodMetadata {2, __hostFunction_NativeGtReactNativeCxxSpecJSI_multiply};
45
45
  methodMap_["getNativeLocales"] = MethodMetadata {0, __hostFunction_NativeGtReactNativeCxxSpecJSI_getNativeLocales};
46
- methodMap_["get"] = MethodMetadata {1, __hostFunction_NativeGtReactNativeCxxSpecJSI_get};
47
- methodMap_["set"] = MethodMetadata {2, __hostFunction_NativeGtReactNativeCxxSpecJSI_set};
46
+ methodMap_["nativeStoreGet"] = MethodMetadata {1, __hostFunction_NativeGtReactNativeCxxSpecJSI_nativeStoreGet};
47
+ methodMap_["nativeStoreSet"] = MethodMetadata {2, __hostFunction_NativeGtReactNativeCxxSpecJSI_nativeStoreSet};
48
48
  }
49
49
 
50
50
 
@@ -22,8 +22,8 @@ protected:
22
22
  public:
23
23
  virtual double multiply(jsi::Runtime &rt, double a, double b) = 0;
24
24
  virtual jsi::Array getNativeLocales(jsi::Runtime &rt) = 0;
25
- virtual std::optional<jsi::String> get(jsi::Runtime &rt, jsi::String key) = 0;
26
- virtual void set(jsi::Runtime &rt, jsi::String key, jsi::String value) = 0;
25
+ virtual std::optional<jsi::String> nativeStoreGet(jsi::Runtime &rt, jsi::String key) = 0;
26
+ virtual void nativeStoreSet(jsi::Runtime &rt, jsi::String key, jsi::String value) = 0;
27
27
 
28
28
  };
29
29
 
@@ -70,21 +70,21 @@ private:
70
70
  return bridging::callFromJs<jsi::Array>(
71
71
  rt, &T::getNativeLocales, jsInvoker_, instance_);
72
72
  }
73
- std::optional<jsi::String> get(jsi::Runtime &rt, jsi::String key) override {
73
+ std::optional<jsi::String> nativeStoreGet(jsi::Runtime &rt, jsi::String key) override {
74
74
  static_assert(
75
- bridging::getParameterCount(&T::get) == 2,
76
- "Expected get(...) to have 2 parameters");
75
+ bridging::getParameterCount(&T::nativeStoreGet) == 2,
76
+ "Expected nativeStoreGet(...) to have 2 parameters");
77
77
 
78
78
  return bridging::callFromJs<std::optional<jsi::String>>(
79
- rt, &T::get, jsInvoker_, instance_, std::move(key));
79
+ rt, &T::nativeStoreGet, jsInvoker_, instance_, std::move(key));
80
80
  }
81
- void set(jsi::Runtime &rt, jsi::String key, jsi::String value) override {
81
+ void nativeStoreSet(jsi::Runtime &rt, jsi::String key, jsi::String value) override {
82
82
  static_assert(
83
- bridging::getParameterCount(&T::set) == 3,
84
- "Expected set(...) to have 3 parameters");
83
+ bridging::getParameterCount(&T::nativeStoreSet) == 3,
84
+ "Expected nativeStoreSet(...) to have 3 parameters");
85
85
 
86
86
  return bridging::callFromJs<void>(
87
- rt, &T::set, jsInvoker_, instance_, std::move(key), std::move(value));
87
+ rt, &T::nativeStoreSet, jsInvoker_, instance_, std::move(key), std::move(value));
88
88
  }
89
89
 
90
90
  private:
@@ -7,6 +7,7 @@ import com.facebook.react.bridge.Arguments
7
7
  import com.facebook.react.bridge.ReactApplicationContext
8
8
  import com.facebook.react.bridge.WritableArray
9
9
  import com.facebook.react.module.annotations.ReactModule
10
+ import com.facebook.fbreact.specs.NativeGtReactNativeSpec
10
11
  import java.util.Locale
11
12
 
12
13
  @ReactModule(name = GtReactNativeModule.NAME)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gt-react-native",
3
- "version": "0.0.1-alpha.1",
3
+ "version": "0.0.1-alpha.3",
4
4
  "description": "An i18n package for React Native",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -38,8 +38,8 @@
38
38
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
39
39
  "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
40
40
  "prepare": "bob build",
41
- "release": "yarn clean && yarn npm publish --tag latest",
42
- "release:alpha": "yarn clean && npm publish --tag alpha"
41
+ "release": "yarn clean && yarn prepare && npm publish --tag latest",
42
+ "release:alpha": "yarn clean && yarn prepare && npm publish --tag alpha"
43
43
  },
44
44
  "keywords": [
45
45
  "react-native",
@@ -145,7 +145,7 @@
145
145
  "codegenConfig": {
146
146
  "name": "GtReactNativeSpec",
147
147
  "type": "modules",
148
- "jsSrcsDir": "src",
148
+ "jsSrcsDir": "./src",
149
149
  "android": {
150
150
  "javaPackageName": "com.gtreactnative"
151
151
  }