The Official Python Types for Superblocks
Project description
types
About
This is the NEW HOME for Superblocks types as we migrate to Protobuf! Unsure if you're type should live here? If you answer yes to any of the following, it should live here! Still not sure? Ask Frank!
- Will your type be used across services?
- Are you using gRPC?
- Part of our public APIs?
Usage
Node.js
{
"dependencies": {
"@superblocksteam/types": "*",
"@superblocksteam/types": "file:../path/to/gen/ts"
}
}
import * as Types from '@superblocksteam/types';
import { Kafkav1, Api } from '@superblocksteam/types';
Golang
$ go get -u github.com/superblocksteam/types/gen/go
// Modified go.mod when developing locally.
replace (
github.com/superblocksteam/types/gen/go => ../path/to/gen/go
)
package main
import apiv1 "github.com/superblocksteam/types/gen/go/api/v1"
func main() {
api := new(apiv1.Api)
// your code
}
Python
# Coming Soon!!
Development
# dependencies
$ make deps-local
# generate code
$ make proto[-(js|py|go)]
# format code
$ make fmt
Publishing
This is done automatically by the CI and will bump the packages versions on your behalf. Just make sure to generate the code changes before merging your proto changes.
Rules
- This repo is not for utility function unless it is a method on the type. In these cases, it must be pure!
Troubleshooting
Q: The make proto
target is failing:
{"path":"proto/superblocks/api/v1/api.proto","start_line":5,"start_column":8,"end_line":5,"end_column":8,"type":"COMPILE","message":"superblocks/plugins/javascript/v1/plugin.proto: does not exist"}
make: *** [proto] Error 100
Q: The make proto
target is failing with the following error:
pattern ./...: directory prefix . does not contain main module or its selected dependencies
make: *** [protoc-gen-superblocks] Error 1
We've seen this issue on make
3.81, make sure to upgrade/install the latest make
.
Q: The make proto-go
target is failing with the following error:
Failure: plugin superblocks: could not find protoc plugin for name superblocks - please make sure protoc-gen-superblocks is instaleld and present on your $PATH
Try exporting the following env variables:
export GOPRIVATE=github.com/superblocksteam
export PATH="$(go env GOPATH)/bin:$PATH"
Then build target make protoc-gen-superblocks
Q: I can't import my type in TypeScript
You have to make sure that the types are exported in the npm package you are using. See gen/ts/index.ts and other index.ts files that export types in the gen/ts folder
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file superblocks-types-0.0.1.tar.gz
.
File metadata
- Download URL: superblocks-types-0.0.1.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 609f56b995193f8e4c7e747bc33b4732f3e58843f27b7a86dfc19801cf306790 |
|
MD5 | 34b4e88e66ebf3a1dda1a24167f5c26e |
|
BLAKE2b-256 | 058059e9a524b1c9ab84db3c7fa75ec96e79dd1b0e8456ad75ddf5c519ebbb97 |
File details
Details for the file superblocks_types-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: superblocks_types-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ea4a0b09853b22148ed13d37b3b5cb7d1ceb5e6c5b34a9b1ec6fa0bd6ff89a7 |
|
MD5 | 218e8564ec100230763cd6b6a7c57726 |
|
BLAKE2b-256 | 7bbb0b555a7f1abc98be9f88cda0d78d7c5f1f4b31821f31aa5bbcc924793de7 |