-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
publish
@penumbra-zone/protobuf
(#1016)
- Loading branch information
1 parent
499c0e5
commit 6fb898a
Showing
16 changed files
with
204 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@penumbra-zone/protobuf': major | ||
'@penumbra-zone/types': major | ||
--- | ||
|
||
initial release of `@penumbra-zone/protobuf` package containing `typeRegistry`. same removed from `@penumbra-zone/types` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['custom'], | ||
parserOptions: { | ||
project: true, | ||
tsconfigRootDir: __dirname, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# `@penumbra-zone/protobuf` | ||
|
||
This package exports a `typeRegistry` (and inclusive `jsonOptions`) for use with | ||
`@bufbuild` and `@connectrpc` tooling, particularly | ||
`@penumbra-zone/transport-dom`. | ||
|
||
All message types necessary for a Connect `Transport` to serialize/deserialize | ||
communication with Prax or any other Penumbra extension are included. | ||
|
||
## If you simply need a Penumbra extension client | ||
|
||
You're looking for `@penumbra-zone/client`, which handles this process for you | ||
and also performs some basic safety checks. | ||
|
||
This package is provided for those who are interested in lower-level work or | ||
more detailed configuration. | ||
|
||
### Simple example | ||
|
||
```ts | ||
import { jsonOptions } from '@penumbra-zone/protobuf'; | ||
|
||
import { createChannelTransport } from '@penumbra-zone/transport-dom'; | ||
import type { ServiceType } from '@bufbuild/protobuf'; | ||
|
||
// unsafely get first available provider | ||
const getPort = () => Object.values(window[Symbol.for('penumbra')])[0].connect(); | ||
|
||
// establish transport | ||
const transport = createChannelTransport({ jsonOptions, getPort }); | ||
|
||
// function to create client | ||
export const createPenumbraClient = (serviceType: ServiceType) => | ||
createPromiseClient(serviceType, transport); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name": "@penumbra-zone/protobuf", | ||
"version": "0.0.0", | ||
"license": "(MIT OR Apache-2.0)", | ||
"description": "Exports a `@bufbuild/protobuf` type registry with all message types necessary to communicate with a Penumbra extension", | ||
"type": "module", | ||
"scripts": { | ||
"build": "tsc --build", | ||
"clean": "rm -rfv dist", | ||
"lint": "eslint src", | ||
"prepack": "pnpm clean && pnpm build" | ||
}, | ||
"exports": { | ||
".": "./src/registry.ts" | ||
}, | ||
"publishConfig": { | ||
"exports": { | ||
".": { | ||
"import": "./dist/registry.js", | ||
"types": "./dist/registry.d.ts" | ||
} | ||
} | ||
}, | ||
"bundleDependencies": [ | ||
"@buf/cosmos_ibc.bufbuild_es", | ||
"@buf/cosmos_ibc.connectrpc_es", | ||
"@buf/penumbra-zone_penumbra.bufbuild_es", | ||
"@buf/penumbra-zone_penumbra.connectrpc_es" | ||
], | ||
"devDependencies": { | ||
"@bufbuild/protobuf": "^1.9.0", | ||
"@connectrpc/connect": "^1.4.0" | ||
}, | ||
"peerDependencies": { | ||
"@buf/cosmos_ibc.bufbuild_es": "1.9.0-20240327103030-e2006674271c.1", | ||
"@buf/cosmos_ibc.connectrpc_es": "1.4.0-20240327103030-e2006674271c.2", | ||
"@buf/penumbra-zone_penumbra.bufbuild_es": "1.9.0-20240429125510-24b08e70bbc2.1", | ||
"@buf/penumbra-zone_penumbra.connectrpc_es": "1.4.0-20240429125510-24b08e70bbc2.2", | ||
"@bufbuild/protobuf": "^1.9.0", | ||
"@connectrpc/connect": "^1.4.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "tsconfig/base.json", | ||
"include": ["src/*.ts"], | ||
"exclude": ["node_modules", "dist"], | ||
"compilerOptions": { | ||
"outDir": "dist" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.