Skip to content

Commit

Permalink
Deprecate grpc-es (#29)
Browse files Browse the repository at this point in the history
* Deprecate and Delete grpc-es

* Fix lint

* Fix deps

* Fix CI

* Update README.md
  • Loading branch information
kanziw authored Aug 14, 2024
1 parent d51f301 commit fe4b1f3
Show file tree
Hide file tree
Showing 91 changed files with 174 additions and 1,640 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/fsevents-patch-6b67494872-10.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/tsx-npm-4.6.2-0721a68f14-451b23ed99.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A collection of utility libraries used by other Kanziw JS/TS projects.
- [date](./packages/date): [@kanziw/date](https://www.npmjs.com/package/@kanziw/date)
- [error](./packages/error): [@kanziw/error](https://www.npmjs.com/package/@kanziw/error)
- [eslint-config-kanziw](./packages/eslint-config-kanziw): [@kanziw/eslint-config-kanziw](https://www.npmjs.com/package/eslint-config-kanziw) `DEPRECATED`
- [grpc-es](./packages/grpc-es): [@kanziw/grpc-es](https://www.npmjs.com/package/@kanziw/grpc-es)
- [grpc-es](./packages/grpc-es): [@kanziw/grpc-es](https://www.npmjs.com/package/@kanziw/grpc-es) `DEPRECATED`
- [promise](./packages/promise): [@kanziw/promise](https://www.npmjs.com/package/@kanziw/promise)
- [stream](./packages/stream): [@kanziw/stream](https://www.npmjs.com/package/@kanziw/stream)
- [time](./packages/time): [@kanziw/time](https://www.npmjs.com/package/@kanziw/time)
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://biomejs.dev/schemas/1.4.1/schema.json",
"files": {
"ignore": ["node_modules/", ".yarn/", "lib/", "coverage/", "package.json", "packages/grpc-es/example/gen/"]
"ignore": ["node_modules/", ".yarn/", "lib/", "coverage/", "package.json", "packages/grpc-es/"]
},
"organizeImports": {
"enabled": true
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/pkce.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @see https://dropbox.tech/developers/pkce--what-and-why-
*/
import crypto from 'crypto'
import crypto from 'node:crypto'

interface PKCE {
codeChallengeMethod: 'S256'
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"outDir": "lib"
},
"include": ["src"]
}
4 changes: 2 additions & 2 deletions packages/cipher/src/aes256gcm.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'assert'
import crypto from 'crypto'
import assert from 'node:assert'
import crypto from 'node:crypto'

import type { Cipher } from './cipher'

Expand Down
2 changes: 1 addition & 1 deletion packages/cipher/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"outDir": "lib"
},
"include": ["src"]
}
2 changes: 1 addition & 1 deletion packages/crypto/src/sha256.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import crypto from 'crypto'
import crypto from 'node:crypto'

export const sha256 = (str: string): Buffer => crypto.createHash('sha256').update(str).digest()
2 changes: 1 addition & 1 deletion packages/crypto/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"outDir": "lib"
},
"include": ["src"]
}
2 changes: 1 addition & 1 deletion packages/date/src/__tests__/isValidDate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('isValidDate', () => {
[new Date(-8640000000000000 - 1), false],
[new Date(8640000000000000 + 1), false],
[new Date(''), false],
[new Date(NaN), false],
[new Date(Number.NaN), false],
[new Date(Number.MAX_SAFE_INTEGER + 1), false],
])('isValidDate(%p) === %p', (date, expected) => {
expect(isValidDate(date)).toBe(expected)
Expand Down
2 changes: 1 addition & 1 deletion packages/date/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"outDir": "lib"
},
"include": ["src"]
}
2 changes: 1 addition & 1 deletion packages/error/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"outDir": "lib"
},
"include": ["src"]
}
6 changes: 0 additions & 6 deletions packages/grpc-es/.npmignore

This file was deleted.

52 changes: 2 additions & 50 deletions packages/grpc-es/README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,4 @@
# @kanziw/grpc-es

[![npm version](https://img.shields.io/npm/v/@kanziw/grpc-es)](https://www.npmjs.com/package/@kanziw/grpc-es)
[![license](https://img.shields.io/npm/l/@kanziw/grpc-es)](https://www.npmjs.com/package/@kanziw/grpc-es)
[![npm downloads](https://img.shields.io/npm/dt/@kanziw/grpc-es)](https://www.npmjs.com/package/@kanziw/grpc-es)

## GrpcEsServer

with [example.proto](./example/proto/example/v1/example.proto),

```typescript
import { Code, ConnectError } from '@connectrpc/connect'
import { GrpcEsServer, stdoutUnaryServerInterceptor } from '@kanziw/grpc-es/server'
import { ExampleService } from './gen/example/v1/example_connect'

const PORT = 8080

new GrpcEsServer({ jsonOptions: { useProtoFieldName: true } })
.use(stdoutUnaryServerInterceptor())
.register(ExampleService, {
echo: (req) => ({ message: `you said: ${req.message}` }),
add: (req) => {
switch (req.args.case) {
case 'int32Args':
return {
result: {
case: 'int32Result',
value: req.args.value.first + req.args.value.second,
},
}
case 'int64Args':
return {
result: {
case: 'int64Result',
value: req.args.value.first + req.args.value.second,
},
}
default:
throw new ConnectError('no args', Code.InvalidArgument)
}
},
})
.listenAndServe(PORT)

console.log(`🏃 Grpc Server is running on port ${PORT}`)
```

### Limitations

This project currently supports only "UnaryCall" in gRPC calls. Other gRPC call types, such as server streaming, client streaming, and bidirectional streaming, are not supported at this time.

For more information, see the [documentation](https://connectrpc.com/docs/node/getting-started).
> [!CAUTION]
> DEPRECATED! Use [connect-node](https://www.npmjs.com/package/@connectrpc/connect-node) directry instead.
12 changes: 0 additions & 12 deletions packages/grpc-es/buf.gen.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions packages/grpc-es/buf.lock

This file was deleted.

12 changes: 0 additions & 12 deletions packages/grpc-es/buf.yaml

This file was deleted.

62 changes: 0 additions & 62 deletions packages/grpc-es/example/gen/example/v1/example_connect.ts

This file was deleted.

Loading

0 comments on commit fe4b1f3

Please sign in to comment.