@xdcobra/react-native-grpc 1.0.0 → 1.1.8

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.
Files changed (96) hide show
  1. package/LICENSE.md +22 -22
  2. package/README.md +284 -114
  3. package/android/build.gradle +127 -127
  4. package/android/gradle.properties +4 -4
  5. package/android/src/main/AndroidManifest.xml +3 -3
  6. package/android/src/main/java/com/reactnativegrpc/GrpcMarshaller.java +27 -27
  7. package/android/src/main/java/com/reactnativegrpc/GrpcModule.java +730 -585
  8. package/android/src/main/java/com/reactnativegrpc/GrpcPackage.java +27 -27
  9. package/android/src/main/java/com/reactnativegrpc/SpkiPinTrustManager.java +101 -101
  10. package/android/src/main/java/com/reactnativegrpc/TrustManagers.java +51 -51
  11. package/ios/Grpc.h +22 -22
  12. package/ios/Grpc.m +625 -439
  13. package/ios/SpkiPinning.h +22 -22
  14. package/ios/SpkiPinning.m +114 -114
  15. package/lib/commonjs/bidi-streaming.js.map +1 -1
  16. package/lib/commonjs/channel.js +84 -0
  17. package/lib/commonjs/channel.js.map +1 -0
  18. package/lib/commonjs/client-streaming.js +3 -3
  19. package/lib/commonjs/client-streaming.js.map +1 -1
  20. package/lib/commonjs/client.js +538 -135
  21. package/lib/commonjs/client.js.map +1 -1
  22. package/lib/commonjs/create-client.js +206 -0
  23. package/lib/commonjs/create-client.js.map +1 -0
  24. package/lib/commonjs/errors.js.map +1 -1
  25. package/lib/commonjs/index.js +32 -1
  26. package/lib/commonjs/index.js.map +1 -1
  27. package/lib/commonjs/interceptors.js +116 -0
  28. package/lib/commonjs/interceptors.js.map +1 -0
  29. package/lib/commonjs/native.js +24 -0
  30. package/lib/commonjs/native.js.map +1 -0
  31. package/lib/commonjs/retry.js +153 -0
  32. package/lib/commonjs/retry.js.map +1 -0
  33. package/lib/commonjs/server-streaming.js.map +1 -1
  34. package/lib/commonjs/status.js +54 -0
  35. package/lib/commonjs/status.js.map +1 -0
  36. package/lib/commonjs/types.js +29 -0
  37. package/lib/commonjs/types.js.map +1 -1
  38. package/lib/commonjs/unary.js.map +1 -1
  39. package/lib/module/bidi-streaming.js.map +1 -1
  40. package/lib/module/channel.js +76 -0
  41. package/lib/module/channel.js.map +1 -0
  42. package/lib/module/client-streaming.js +3 -3
  43. package/lib/module/client-streaming.js.map +1 -1
  44. package/lib/module/client.js +525 -129
  45. package/lib/module/client.js.map +1 -1
  46. package/lib/module/create-client.js +201 -0
  47. package/lib/module/create-client.js.map +1 -0
  48. package/lib/module/errors.js.map +1 -1
  49. package/lib/module/index.js +3 -0
  50. package/lib/module/index.js.map +1 -1
  51. package/lib/module/interceptors.js +104 -0
  52. package/lib/module/interceptors.js.map +1 -0
  53. package/lib/module/native.js +17 -0
  54. package/lib/module/native.js.map +1 -0
  55. package/lib/module/retry.js +141 -0
  56. package/lib/module/retry.js.map +1 -0
  57. package/lib/module/server-streaming.js.map +1 -1
  58. package/lib/module/status.js +46 -0
  59. package/lib/module/status.js.map +1 -0
  60. package/lib/module/types.js +17 -0
  61. package/lib/module/types.js.map +1 -1
  62. package/lib/module/unary.js.map +1 -1
  63. package/lib/typescript/channel.d.ts +27 -0
  64. package/lib/typescript/channel.d.ts.map +1 -0
  65. package/lib/typescript/client.d.ts +56 -49
  66. package/lib/typescript/client.d.ts.map +1 -1
  67. package/lib/typescript/create-client.d.ts +65 -0
  68. package/lib/typescript/create-client.d.ts.map +1 -0
  69. package/lib/typescript/index.d.ts +5 -0
  70. package/lib/typescript/index.d.ts.map +1 -1
  71. package/lib/typescript/interceptors.d.ts +43 -0
  72. package/lib/typescript/interceptors.d.ts.map +1 -0
  73. package/lib/typescript/native.d.ts +53 -0
  74. package/lib/typescript/native.d.ts.map +1 -0
  75. package/lib/typescript/retry.d.ts +56 -0
  76. package/lib/typescript/retry.d.ts.map +1 -0
  77. package/lib/typescript/status.d.ts +24 -0
  78. package/lib/typescript/status.d.ts.map +1 -0
  79. package/lib/typescript/types.d.ts +60 -0
  80. package/lib/typescript/types.d.ts.map +1 -1
  81. package/package.json +209 -169
  82. package/react-native-grpc.podspec +29 -29
  83. package/src/bidi-streaming.ts +78 -78
  84. package/src/channel.ts +110 -0
  85. package/src/client-streaming.ts +106 -106
  86. package/src/client.ts +1046 -521
  87. package/src/create-client.ts +391 -0
  88. package/src/errors.ts +11 -11
  89. package/src/index.ts +28 -11
  90. package/src/interceptors.ts +167 -0
  91. package/src/native.ts +99 -0
  92. package/src/retry.ts +208 -0
  93. package/src/server-streaming.ts +105 -105
  94. package/src/status.ts +50 -0
  95. package/src/types.ts +171 -107
  96. package/src/unary.ts +71 -71
@@ -1,3 +1,5 @@
1
+ import type { GrpcInterceptor } from './interceptors';
2
+ import type { GrpcHedgingPolicy, GrpcRetryPolicy } from './retry';
1
3
  export type GrpcMetadata = Record<string, string>;
2
4
  /** Options for unary / streaming RPCs. */
3
5
  export type GrpcCallOptions = {
@@ -7,11 +9,27 @@ export type GrpcCallOptions = {
7
9
  * `0` = no deadline (Android); iOS still applies a positive timeout when set.
8
10
  */
9
11
  deadlineSeconds?: number;
12
+ /**
13
+ * Extra interceptors for this RPC only (appended after channel interceptors).
14
+ * Prefer channel-level `interceptors` / `setInterceptors` for shared middleware.
15
+ */
16
+ interceptors?: GrpcInterceptor[];
17
+ /**
18
+ * Unary-only retry policy override, or `false` to disable channel retry for this call.
19
+ * Mutually exclusive with `hedging`.
20
+ */
21
+ retry?: GrpcRetryPolicy | false;
22
+ /**
23
+ * Unary-only hedging policy override, or `false` to disable channel hedging for this call.
24
+ * Mutually exclusive with `retry`.
25
+ */
26
+ hedging?: GrpcHedgingPolicy | false;
10
27
  };
11
28
  /**
12
29
  * Channel TLS configuration. Each `setTlsOptions` call **replaces** the prior
13
30
  * config (omitted / null / undefined fields are cleared). Call before
14
31
  * `initGrpcChannel()`. Ignored while `setInsecure(true)`.
32
+ * Prefer binding TLS at `createChannel({ tls })` for multi-host apps.
15
33
  */
16
34
  export type GrpcTlsOptions = {
17
35
  /** PEM trust roots (one or more certs). Clears → platform/gRPC defaults. */
@@ -31,6 +49,48 @@ export type GrpcTlsOptions = {
31
49
  */
32
50
  spkiSha256Pins?: string[] | null;
33
51
  };
52
+ /** Immutable config for {@link createChannel}. Reconfigure by creating a new channel. */
53
+ export type GrpcChannelConfig = {
54
+ /** Target host, e.g. `api.example.com:443` or `10.0.2.2:50051`. */
55
+ host: string;
56
+ /** Plaintext (dev). Default `false`. */
57
+ insecure?: boolean;
58
+ /** TLS options (ignored when `insecure` is true). */
59
+ tls?: GrpcTlsOptions;
60
+ /** Default per-call deadline in seconds. Default 120. */
61
+ callDeadlineSeconds?: number;
62
+ /** Max inbound message size in bytes (Android / iOS). */
63
+ responseSizeLimit?: number;
64
+ /** Message compression. */
65
+ compression?: {
66
+ enable: boolean;
67
+ compressorName: string;
68
+ };
69
+ /** HTTP/2 keepalive (Android primarily). */
70
+ keepAlive?: {
71
+ enable: boolean;
72
+ keepAliveTime: number;
73
+ keepAliveTimeOut: number;
74
+ };
75
+ /**
76
+ * Request/response middleware for all RPCs on this channel (immutable).
77
+ * Per-RPC extras: `GrpcCallOptions.interceptors`.
78
+ */
79
+ interceptors?: GrpcInterceptor[];
80
+ /**
81
+ * Unary-only retry policy (A6-style). Mutually exclusive with `hedging`.
82
+ */
83
+ retry?: GrpcRetryPolicy;
84
+ /**
85
+ * Unary-only hedging policy (A6-style). Mutually exclusive with `retry`.
86
+ */
87
+ hedging?: GrpcHedgingPolicy;
88
+ };
89
+ /** Id of the singleton / legacy channel used by `GrpcClient` setters. */
90
+ export declare const DEFAULT_CHANNEL_ID = "default";
91
+ export type { GrpcInterceptStart, GrpcInterceptor } from './interceptors';
92
+ export type { GrpcHedgingPolicy, GrpcRetryPolicy } from './retry';
93
+ export { GrpcStatusCode } from './status';
34
94
  export type RemoveListener = () => void;
35
95
  export interface GrpcServerInputStream {
36
96
  send(data: Uint8Array): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"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AC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,EAAE,YAAY,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,sBAAsB,CAAC;IAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;CAClC,CAAC;AAEF,4EAA4E;AAC5E,MAAM,MAAM,gCAAgC,GAAG;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,EAAE,YAAY,CAAC;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;CAClC,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,EAAE,YAAY,CAAC;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,sBAAsB,CAAC;IAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;CAClC,CAAC"}
package/package.json CHANGED
@@ -1,169 +1,209 @@
1
- {
2
- "name": "@xdcobra/react-native-grpc",
3
- "version": "1.0.0",
4
- "description": "gRPC for react-native (fork of @krishnafkh/react-native-grpc / Mitch528)",
5
- "main": "lib/commonjs/index",
6
- "module": "lib/module/index",
7
- "types": "lib/typescript/index.d.ts",
8
- "react-native": "src/index",
9
- "source": "src/index",
10
- "files": [
11
- "src",
12
- "lib",
13
- "android",
14
- "ios",
15
- "react-native-grpc.podspec",
16
- "!lib/typescript/example",
17
- "!**/__tests__",
18
- "!**/__fixtures__",
19
- "!**/__mocks__",
20
- "!**/node_modules",
21
- "!android/build",
22
- "!android/.project",
23
- "!android/.settings",
24
- "!android/.gradle",
25
- "!ios/build",
26
- "!ios/Grpc.xcodeproj"
27
- ],
28
- "scripts": {
29
- "test": "jest",
30
- "typescript": "tsc --noEmit -p tsconfig.build.json",
31
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
32
- "lint:fix": "eslint '**/*.{js,ts,tsx}' --fix",
33
- "build": "bob build",
34
- "prepare": "bob build",
35
- "release": "release-it",
36
- "example": "yarn --cwd example",
37
- "pods": "cd example && pod-install --quiet",
38
- "bootstrap": "yarn example && yarn && yarn pods"
39
- },
40
- "keywords": [
41
- "react-native",
42
- "ios",
43
- "android",
44
- "grpc"
45
- ],
46
- "repository": "https://github.com/XDcobra/react-native-grpc",
47
- "author": "XDcobra (fork; original Krishna / Mitch528)",
48
- "license": "MIT",
49
- "bugs": {
50
- "url": "https://github.com/XDcobra/react-native-grpc/issues"
51
- },
52
- "homepage": "https://github.com/XDcobra/react-native-grpc#readme",
53
- "publishConfig": {
54
- "access": "public",
55
- "registry": "https://registry.npmjs.org/"
56
- },
57
- "packageManager": "yarn@1.22.22",
58
- "engines": {
59
- "node": ">=18"
60
- },
61
- "devDependencies": {
62
- "@react-native-community/eslint-config": "^3.0.0",
63
- "@release-it/keep-a-changelog": "^3.0.0",
64
- "@types/jest": "^26.0.23",
65
- "@types/react": "^17.0.11",
66
- "@types/react-native": "0.70.6",
67
- "commitlint": "^12.1.4",
68
- "eslint": "^7.29.0",
69
- "eslint-config-prettier": "^8.3.0",
70
- "eslint-plugin-prettier": "^3.4.0",
71
- "husky": "^4.3.8",
72
- "jest": "^26.6.3",
73
- "pod-install": "^0.1.23",
74
- "prettier": "^2.3.1",
75
- "react": "17.0.2",
76
- "react-native": "0.70.6",
77
- "react-native-builder-bob": "^0.20.1",
78
- "release-it": "^15.0.0",
79
- "typescript": "^5.7.3",
80
- "xcode": "^3.0.1"
81
- },
82
- "peerDependencies": {
83
- "react": "*",
84
- "react-native": "*"
85
- },
86
- "jest": {
87
- "preset": "react-native",
88
- "testMatch": [
89
- "**/__tests__/**/*.(test|spec).[jt]s?(x)"
90
- ],
91
- "modulePathIgnorePatterns": [
92
- "<rootDir>/example/node_modules",
93
- "<rootDir>/lib/"
94
- ]
95
- },
96
- "husky": {
97
- "hooks": {
98
- "pre-commit": "yarn lint && yarn typescript"
99
- }
100
- },
101
- "release-it": {
102
- "git": {
103
- "commitMessage": "chore: release ${version}",
104
- "tagName": "v${version}"
105
- },
106
- "npm": {
107
- "publish": true
108
- },
109
- "github": {
110
- "release": true
111
- },
112
- "plugins": {
113
- "@release-it/keep-a-changelog": {
114
- "filename": "CHANGELOG.md"
115
- }
116
- }
117
- },
118
- "eslintConfig": {
119
- "root": true,
120
- "extends": [
121
- "@react-native-community",
122
- "prettier"
123
- ],
124
- "rules": {
125
- "prettier/prettier": [
126
- "error",
127
- {
128
- "quoteProps": "consistent",
129
- "singleQuote": true,
130
- "tabWidth": 2,
131
- "trailingComma": "es5",
132
- "useTabs": false
133
- }
134
- ]
135
- }
136
- },
137
- "eslintIgnore": [
138
- "node_modules/",
139
- "lib/",
140
- "example/src/_proto/"
141
- ],
142
- "prettier": {
143
- "quoteProps": "consistent",
144
- "singleQuote": true,
145
- "tabWidth": 2,
146
- "trailingComma": "es5",
147
- "useTabs": false,
148
- "endOfLine": "auto"
149
- },
150
- "react-native-builder-bob": {
151
- "source": "src",
152
- "output": "lib",
153
- "targets": [
154
- "commonjs",
155
- "module",
156
- [
157
- "typescript",
158
- {
159
- "project": "tsconfig.build.json"
160
- }
161
- ]
162
- ]
163
- },
164
- "dependencies": {
165
- "abort-controller": "^3.0.0",
166
- "base64-js": "^1.5.1",
167
- "eventemitter3": "^4.0.7"
168
- }
169
- }
1
+ {
2
+ "name": "@xdcobra/react-native-grpc",
3
+ "version": "1.1.8",
4
+ "description": "gRPC for react-native (fork of @krishnafkh/react-native-grpc / Mitch528)",
5
+ "main": "lib/commonjs/index",
6
+ "module": "lib/module/index",
7
+ "types": "lib/typescript/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
+ "exports": {
11
+ ".": {
12
+ "react-native": "./src/index.ts",
13
+ "types": "./lib/typescript/index.d.ts",
14
+ "module": "./lib/module/index.js",
15
+ "default": "./lib/commonjs/index.js"
16
+ },
17
+ "./create-client": {
18
+ "react-native": "./src/create-client.ts",
19
+ "types": "./lib/typescript/create-client.d.ts",
20
+ "module": "./lib/module/create-client.js",
21
+ "default": "./lib/commonjs/create-client.js"
22
+ },
23
+ "./package.json": "./package.json"
24
+ },
25
+ "files": [
26
+ "src",
27
+ "lib",
28
+ "android",
29
+ "ios",
30
+ "react-native-grpc.podspec",
31
+ "!lib/typescript/example",
32
+ "!**/__tests__",
33
+ "!**/__fixtures__",
34
+ "!**/__mocks__",
35
+ "!**/node_modules",
36
+ "!android/build",
37
+ "!android/.project",
38
+ "!android/.settings",
39
+ "!android/.gradle",
40
+ "!ios/build",
41
+ "!ios/Grpc.xcodeproj"
42
+ ],
43
+ "scripts": {
44
+ "test": "jest",
45
+ "typescript": "tsc --noEmit -p tsconfig.build.json",
46
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
47
+ "lint:fix": "eslint '**/*.{js,ts,tsx}' --fix",
48
+ "build": "bob build",
49
+ "prepare": "bob build",
50
+ "release": "release-it",
51
+ "example": "yarn --cwd example",
52
+ "pods": "cd example && pod-install --quiet",
53
+ "bootstrap": "yarn example && yarn && yarn pods"
54
+ },
55
+ "keywords": [
56
+ "react-native",
57
+ "ios",
58
+ "android",
59
+ "grpc"
60
+ ],
61
+ "repository": {
62
+ "type": "git",
63
+ "url": "https://github.com/XDcobra/react-native-grpc.git"
64
+ },
65
+ "author": "XDcobra (fork; original Krishna / Mitch528)",
66
+ "license": "MIT",
67
+ "bugs": {
68
+ "url": "https://github.com/XDcobra/react-native-grpc/issues"
69
+ },
70
+ "homepage": "https://github.com/XDcobra/react-native-grpc#readme",
71
+ "publishConfig": {
72
+ "access": "public",
73
+ "registry": "https://registry.npmjs.org/"
74
+ },
75
+ "packageManager": "yarn@1.22.22",
76
+ "engines": {
77
+ "node": ">=18"
78
+ },
79
+ "devDependencies": {
80
+ "@bufbuild/protobuf": "^2.13.0",
81
+ "@react-native-community/eslint-config": "^3.0.0",
82
+ "@release-it/keep-a-changelog": "^3.0.0",
83
+ "@types/jest": "^26.0.23",
84
+ "@types/react": "^17.0.11",
85
+ "@types/react-native": "0.70.6",
86
+ "commitlint": "^12.1.4",
87
+ "eslint": "^7.29.0",
88
+ "eslint-config-prettier": "^8.3.0",
89
+ "eslint-plugin-prettier": "^3.4.0",
90
+ "husky": "^4.3.8",
91
+ "jest": "^26.6.3",
92
+ "pod-install": "^0.1.23",
93
+ "prettier": "^2.3.1",
94
+ "react": "17.0.2",
95
+ "react-native": "0.70.6",
96
+ "react-native-builder-bob": "^0.20.1",
97
+ "release-it": "^15.0.0",
98
+ "typescript": "^5.7.3",
99
+ "xcode": "^3.0.1"
100
+ },
101
+ "peerDependencies": {
102
+ "@bufbuild/protobuf": "^2.0.0",
103
+ "react": "*",
104
+ "react-native": "*"
105
+ },
106
+ "peerDependenciesMeta": {
107
+ "@bufbuild/protobuf": {
108
+ "optional": true
109
+ }
110
+ },
111
+ "jest": {
112
+ "preset": "react-native",
113
+ "testMatch": [
114
+ "**/__tests__/**/*.(test|spec).[jt]s?(x)"
115
+ ],
116
+ "modulePathIgnorePatterns": [
117
+ "<rootDir>/example/node_modules",
118
+ "<rootDir>/lib/"
119
+ ],
120
+ "moduleNameMapper": {
121
+ "^@bufbuild/protobuf/codegenv2$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/index.js",
122
+ "^@bufbuild/protobuf/codegenv1$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/index.js",
123
+ "^@bufbuild/protobuf/reflect$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/index.js",
124
+ "^@bufbuild/protobuf/wkt$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/index.js",
125
+ "^@bufbuild/protobuf/wire$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.js",
126
+ "^@bufbuild/protobuf$": "<rootDir>/node_modules/@bufbuild/protobuf/dist/commonjs/index.js"
127
+ },
128
+ "transformIgnorePatterns": [
129
+ "node_modules/(?!((jest-)?react-native|@react-native(-community)?|@bufbuild)/)"
130
+ ]
131
+ },
132
+ "husky": {
133
+ "hooks": {
134
+ "pre-commit": "yarn lint && yarn typescript"
135
+ }
136
+ },
137
+ "release-it": {
138
+ "git": {
139
+ "commitMessage": "chore: release ${version}",
140
+ "tagName": "v${version}",
141
+ "allowEmptyCommit": true,
142
+ "push": true
143
+ },
144
+ "npm": {
145
+ "publish": false
146
+ },
147
+ "github": {
148
+ "release": false
149
+ },
150
+ "plugins": {
151
+ "@release-it/keep-a-changelog": {
152
+ "filename": "CHANGELOG.md"
153
+ }
154
+ }
155
+ },
156
+ "eslintConfig": {
157
+ "root": true,
158
+ "extends": [
159
+ "@react-native-community",
160
+ "prettier"
161
+ ],
162
+ "rules": {
163
+ "prettier/prettier": [
164
+ "error",
165
+ {
166
+ "quoteProps": "consistent",
167
+ "singleQuote": true,
168
+ "tabWidth": 2,
169
+ "trailingComma": "es5",
170
+ "useTabs": false
171
+ }
172
+ ]
173
+ }
174
+ },
175
+ "eslintIgnore": [
176
+ "node_modules/",
177
+ "lib/",
178
+ "example/src/_proto/",
179
+ "example/src/gen/",
180
+ "src/__fixtures__/"
181
+ ],
182
+ "prettier": {
183
+ "quoteProps": "consistent",
184
+ "singleQuote": true,
185
+ "tabWidth": 2,
186
+ "trailingComma": "es5",
187
+ "useTabs": false,
188
+ "endOfLine": "auto"
189
+ },
190
+ "react-native-builder-bob": {
191
+ "source": "src",
192
+ "output": "lib",
193
+ "targets": [
194
+ "commonjs",
195
+ "module",
196
+ [
197
+ "typescript",
198
+ {
199
+ "project": "tsconfig.build.json"
200
+ }
201
+ ]
202
+ ]
203
+ },
204
+ "dependencies": {
205
+ "abort-controller": "^3.0.0",
206
+ "base64-js": "^1.5.1",
207
+ "eventemitter3": "^4.0.7"
208
+ }
209
+ }
@@ -1,30 +1,30 @@
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 = "react-native-grpc"
7
- s.version = package["version"]
8
- s.summary = package["description"]
9
- s.homepage = package["homepage"]
10
- s.license = package["license"]
11
- s.authors = package["author"]
12
-
13
- s.platforms = { :ios => "10.0" }
14
- s.source = { :git => "https://github.com/XDcobra/react-native-grpc.git", :tag => "#{s.version}" }
15
-
16
-
17
- s.source_files = "ios/**/*.{h,m,mm,swift}"
18
-
19
-
20
- s.dependency "React-Core"
21
- s.dependency "gRPC"
22
-
23
- # Pods directory corresponding to this app's Podfile, relative to the location of this podspec.
24
- pods_root = 'Pods'
25
-
26
- s.pod_target_xcconfig = {
27
- # This is needed by all pods that depend on gRPC-RxLibrary:
28
- 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
29
- }
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 = "react-native-grpc"
7
+ s.version = package["version"]
8
+ s.summary = package["description"]
9
+ s.homepage = package["homepage"]
10
+ s.license = package["license"]
11
+ s.authors = package["author"]
12
+
13
+ s.platforms = { :ios => "10.0" }
14
+ s.source = { :git => "https://github.com/XDcobra/react-native-grpc.git", :tag => "#{s.version}" }
15
+
16
+
17
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
18
+
19
+
20
+ s.dependency "React-Core"
21
+ s.dependency "gRPC"
22
+
23
+ # Pods directory corresponding to this app's Podfile, relative to the location of this podspec.
24
+ pods_root = 'Pods'
25
+
26
+ s.pod_target_xcconfig = {
27
+ # This is needed by all pods that depend on gRPC-RxLibrary:
28
+ 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
29
+ }
30
30
  end