mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-09 09:35:00 +09:00
Shared library for Anytype clients
https://anytype.io
.circleci | ||
.github/ISSUE_TEMPLATE | ||
anymark | ||
change | ||
clientlibrary | ||
cmd/grpcserver | ||
core | ||
dist | ||
docs | ||
pb | ||
pkg/lib | ||
util | ||
.gitattributes | ||
.gitignore | ||
.pre-commit-config.yaml | ||
go.mod | ||
go.sum | ||
Makefile | ||
package.json | ||
README.md | ||
webpack.config.js |
Anytype Middleware Library
Build from Source
- Install Golang 1.13.* from here
- Follow instructions below for the target systems
Build and install for the desktop client
make install-dev-js
to build the local server and copy it and protobuf binding into../js-anytype
Build for iOS
make build-ios
to build the framework intodist/ios
foldermake protos-swift
to generate swift protobuf bindings intodist/ios/pb
Build for Android
make build-android
to build the library intodist/android
foldermake protos-java
to generate java protobuf bindings intodist/android/pb
Rebuild protobuf generated files
This repo uses custom protoc located at anytypeio/protobuf. It adds gomobile
plugin and some env-controlled options to control the generated code style.
This protobuf generator will replace your protoc
binary, BTW it doesn't have any breaking changes for other protobuf and grpc code
You can install it with a simple command:
make setup-protoc
Then you can easily regenerate proto files:
make protos
Run tests
Generate mocks:
make test-deps
GO test:
make test
NodeJS addon test:
cd jsaddon
npm run test
Run local gRPC server to debug
⚠️ Make sure to update/install protobuf compiler from this repo using make setup-protoc
Commands:
make run-server
- builds proto files for grpc server, builds the binary and runs itmake build-server
- builds proto files for grpc server and builds the binary intodist/server
If you want to change the default port(9999):
ANYTYPE_GRPC_ADDR=127.0.0.1:8888 make run-debug
Useful tools for debug:
GUI
https://github.com/uw-labs/bloomrpc
HowTo: Set the import path to the middleware root, then select commands.proto file
CLI