Skip to content
/ template Public template

Protobuf, Go, TypeScript, c++ project

License

Notifications You must be signed in to change notification settings

aperturerobotics/template

Repository files navigation

Project Template

GoDoc Widget Go Report Card Widget

This is a template for Aperture Robotics projects.

See protobuf-project for a more extensive example.

Usage

Start by downloading the dependencies:

bun install

Protobuf imports use Go paths and package names:

syntax = "proto3";
package example;

// Import .proto files using Go-style import paths.
import "github.com/aperturerobotics/controllerbus/controller/controller.proto";

// GetBusInfoResponse is the response type for GetBusInfo.
message GetBusInfoResponse {
  // RunningControllers is the list of running controllers.
  repeated controller.Info running_controllers = 1;
}

To generate the protobuf files:

git add -A
bun install
bun run gen

Commands

The aptre CLI replaces Make for building Go projects with protobuf support.

Available bun scripts:

Command Description
bun run gen Generate protobuf code (Go, TypeScript, C++)
bun run gen:force Force regenerate all protobuf files
bun run test Run all tests (Go + JS)
bun run lint Run linters (Go + JS)
bun run lint:go Run golangci-lint
bun run lint:js Run ESLint on TypeScript
bun run format Format all code (Go + JS)
bun run build Build TypeScript and Vite

The aptre CLI can also be used directly:

# Generate protobuf files
go run github.com/aperturerobotics/common/cmd/aptre generate

# Force regeneration
go run github.com/aperturerobotics/common/cmd/aptre generate --force

# Run tests
go run github.com/aperturerobotics/common/cmd/aptre test

# Lint code
go run github.com/aperturerobotics/common/cmd/aptre lint

# Format code
go run github.com/aperturerobotics/common/cmd/aptre format

C++ Support

C++ protobuf files (.pb.cc and .pb.h) are generated alongside Go and TypeScript files. See common for CMake integration instructions.

Support

Please open a GitHub issue with any questions / issues.

... or feel free to reach out on Matrix Chat or Discord.

License

MIT

About

Protobuf, Go, TypeScript, c++ project

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •