mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-10 10:00:46 +09:00
Shared library for Anytype clients
https://anytype.io
.circleci | ||
.github/ISSUE_TEMPLATE | ||
anymark | ||
build | ||
change | ||
core | ||
dist | ||
docs | ||
jsaddon | ||
lib | ||
lib-debug | ||
pb | ||
util | ||
.gitattributes | ||
.gitignore | ||
.pre-commit-config.yaml | ||
go.mod | ||
go.sum | ||
Makefile | ||
package.json | ||
README.md |
Anytype Middleware Library
How to build
- Install Golang 1.13.* from here
make setup
to install depsmake build-lib
to build C-archived(lib.a + lib.h
) library intodist
foldermake build-js
to build NodeJS Addon intojsaddon/build
npm install & npm build:ts
to compile proto files for TS/JS intobuild/ts
make install-dev-js
to copy the compiled NodeJS addon and protobuf binding into../js-anytype
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
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-debug
- builds proto files for grpc server, builds the binary and runs itmake build-debug
- builds proto files for grpc server and builds the binary intodist/debug
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