From a499706831bb1efde60431987034233b7b89c589 Mon Sep 17 00:00:00 2001 From: Lewis Nelson Date: Tue, 24 Jan 2023 23:41:00 +0000 Subject: [PATCH 1/4] chore: enable publishing from Circle CI --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fbec5cb..29031fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,7 +39,7 @@ jobs: - checkout - node/install-packages - run: npm run build - - run: npx semantic-release -d + - run: npx semantic-release workflows: version: 2 From be417f586b3c62843c923e02c6f8fd05fef557b3 Mon Sep 17 00:00:00 2001 From: Lewis Nelson Date: Tue, 24 Jan 2023 23:45:57 +0000 Subject: [PATCH 2/4] fix: set access to public for npm --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index c30dc64..7637b24 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,9 @@ "promises", "async" ], + "publishConfig": { + "access": "public" + }, "homepage": "https://github.com/lewnelson/grpc-ts#readme", "bugs": { "url": "https://github.com/lewnelson/grpc-ts/issues" From 025fd882e42439fc37fe72dff9db9cdf19cc3e2a Mon Sep 17 00:00:00 2001 From: Lewis Nelson Date: Tue, 24 Jan 2023 23:55:50 +0000 Subject: [PATCH 3/4] fix: remove unneccessary files from published package --- .npmignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.npmignore b/.npmignore index 7f38592..cf148d9 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,5 @@ .circleci/ +.husky/ coverage/ scripts/ test/ @@ -7,7 +8,8 @@ test/ .gitignore .nvmrc .prettierrc +.releaserc jest.config.js -jest.setup.js +jest.setup.ts tsconfig.src.json tsconfig.cli.json From 8deb5ad5f53d42d3915c7efe65ced172b389c7a3 Mon Sep 17 00:00:00 2001 From: Lewis Nelson Date: Wed, 25 Jan 2023 00:02:17 +0000 Subject: [PATCH 4/4] docs: updated README.md --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index b141337..a9f452c 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,20 @@ This library is an abstraction on [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master) to provide a simpler interface for making requests from a gRPC client and generating fully typed gRPC clients from `.proto` files. +Go from this: + +```typescript +client.getName(new GetNameRequest(), (error: Error | null, response: GetNameResponse | undefined) => { + // handle response in callback +}); +``` + +to this: + +```typescript +const response = await client.unaryRequest("getName", new GetNameRequest()); +``` + ## Install ```bash