@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.
- package/LICENSE.md +22 -22
- package/README.md +284 -114
- package/android/build.gradle +127 -127
- package/android/gradle.properties +4 -4
- package/android/src/main/AndroidManifest.xml +3 -3
- package/android/src/main/java/com/reactnativegrpc/GrpcMarshaller.java +27 -27
- package/android/src/main/java/com/reactnativegrpc/GrpcModule.java +730 -585
- package/android/src/main/java/com/reactnativegrpc/GrpcPackage.java +27 -27
- package/android/src/main/java/com/reactnativegrpc/SpkiPinTrustManager.java +101 -101
- package/android/src/main/java/com/reactnativegrpc/TrustManagers.java +51 -51
- package/ios/Grpc.h +22 -22
- package/ios/Grpc.m +625 -439
- package/ios/SpkiPinning.h +22 -22
- package/ios/SpkiPinning.m +114 -114
- package/lib/commonjs/bidi-streaming.js.map +1 -1
- package/lib/commonjs/channel.js +84 -0
- package/lib/commonjs/channel.js.map +1 -0
- package/lib/commonjs/client-streaming.js +3 -3
- package/lib/commonjs/client-streaming.js.map +1 -1
- package/lib/commonjs/client.js +538 -135
- package/lib/commonjs/client.js.map +1 -1
- package/lib/commonjs/create-client.js +206 -0
- package/lib/commonjs/create-client.js.map +1 -0
- package/lib/commonjs/errors.js.map +1 -1
- package/lib/commonjs/index.js +32 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interceptors.js +116 -0
- package/lib/commonjs/interceptors.js.map +1 -0
- package/lib/commonjs/native.js +24 -0
- package/lib/commonjs/native.js.map +1 -0
- package/lib/commonjs/retry.js +153 -0
- package/lib/commonjs/retry.js.map +1 -0
- package/lib/commonjs/server-streaming.js.map +1 -1
- package/lib/commonjs/status.js +54 -0
- package/lib/commonjs/status.js.map +1 -0
- package/lib/commonjs/types.js +29 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/unary.js.map +1 -1
- package/lib/module/bidi-streaming.js.map +1 -1
- package/lib/module/channel.js +76 -0
- package/lib/module/channel.js.map +1 -0
- package/lib/module/client-streaming.js +3 -3
- package/lib/module/client-streaming.js.map +1 -1
- package/lib/module/client.js +525 -129
- package/lib/module/client.js.map +1 -1
- package/lib/module/create-client.js +201 -0
- package/lib/module/create-client.js.map +1 -0
- package/lib/module/errors.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/interceptors.js +104 -0
- package/lib/module/interceptors.js.map +1 -0
- package/lib/module/native.js +17 -0
- package/lib/module/native.js.map +1 -0
- package/lib/module/retry.js +141 -0
- package/lib/module/retry.js.map +1 -0
- package/lib/module/server-streaming.js.map +1 -1
- package/lib/module/status.js +46 -0
- package/lib/module/status.js.map +1 -0
- package/lib/module/types.js +17 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/unary.js.map +1 -1
- package/lib/typescript/channel.d.ts +27 -0
- package/lib/typescript/channel.d.ts.map +1 -0
- package/lib/typescript/client.d.ts +56 -49
- package/lib/typescript/client.d.ts.map +1 -1
- package/lib/typescript/create-client.d.ts +65 -0
- package/lib/typescript/create-client.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +5 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/interceptors.d.ts +43 -0
- package/lib/typescript/interceptors.d.ts.map +1 -0
- package/lib/typescript/native.d.ts +53 -0
- package/lib/typescript/native.d.ts.map +1 -0
- package/lib/typescript/retry.d.ts +56 -0
- package/lib/typescript/retry.d.ts.map +1 -0
- package/lib/typescript/status.d.ts +24 -0
- package/lib/typescript/status.d.ts.map +1 -0
- package/lib/typescript/types.d.ts +60 -0
- package/lib/typescript/types.d.ts.map +1 -1
- package/package.json +209 -169
- package/react-native-grpc.podspec +29 -29
- package/src/bidi-streaming.ts +78 -78
- package/src/channel.ts +110 -0
- package/src/client-streaming.ts +106 -106
- package/src/client.ts +1046 -521
- package/src/create-client.ts +391 -0
- package/src/errors.ts +11 -11
- package/src/index.ts +28 -11
- package/src/interceptors.ts +167 -0
- package/src/native.ts +99 -0
- package/src/retry.ts +208 -0
- package/src/server-streaming.ts +105 -105
- package/src/status.ts +50 -0
- package/src/types.ts +171 -107
- 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"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAElD,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAElE,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAElD,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,eAAe,GAAG,KAAK,CAAC;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,GAAG,KAAK,CAAC;CACrC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,wEAAwE;IACxE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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
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
"react
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
"
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
"
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
"
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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
|