Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate grpc-es #29

Merged
merged 5 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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
Loading