npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@aitmed/protorepo-test

v1.0.20

Published

## Required File Structure ``` $GOPATH ├── bin │   ├── pkg │   └── mod └── (anyname other than src) ├── protorepo * ```

Downloads

39

Readme

protorepo

Required File Structure

$GOPATH
├── bin
│   
├── pkg
│   └── mod
└── (anyname other than src)
    ├── protorepo *

Dependencies

  1. prototool:

    brew install prototool
  2. grpc-gateway

    go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
    go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
    go get -u github.com/golang/protobuf/protoc-gen-go
  3. ts-protoc-gen

    npm install ts-protoc-gen

Usage

Create a new service

  1. Create a new dir:
mkdir -p proto/new_service/v1beta1/
  1. (Optional) Create a config file if extra configs are needed:
prototool config init proto/new_service
  1. Create a protobuf template:
prototool create proto/new_service/v1beta1/new_service.proto
  1. Write API definition Note:

  2. all those definitions must follow the protobuf lint rules. Uber's lint rule v2 is recommended and set as the default lint rule since it is strict.

  3. If extra REST interfaces are needed, follow the tutorial of grpc-gateway.

  4. Lint your API:

prototool lint proto/new_service/v1beta1/new_service.proto

Note we are think of adding this lint process in our CI pipeline, any commit with lint error will be intolerant.

  1. Generate your API pb files:
prototool generate proto/new_service/v1beta1/new_service.proto

Generated pb files will be under pkg/new_service/v1beta1

  1. Import file into your service codebase
package main

import "gitlab.aitmed.io/backend/protorepo/go/new_service/v1beta1"

Supported language pb files repo

Once a set of protobuf files is designed, language-specific code templates called pb files will be automatically generated by the CI. Javascript (frontend client), golang and python (cross-service communication) are the major customers of those files. Note that those files should be considered as library files thus cannot be modified. The very problem remains how to package files into library.

Golang

Dependency management in golang is easy since golang has built-in git support for fetching 3rd-party libraries and this only happens during development and build time. Simply import files like gitlab.aitmed.io/backend/protorepo/pkg/... should be fine.

Javascript/Typescript

Private javascript repo.

Python

python will be packaged as an egg file, simply import those files should be fine.

Java

Java pb files will be packed into a jar file for easy import. Upload to the central maven repo if needed.

API changes

API is always changing. The basic idea is any API version number with suffix alpha# beta# might introduces breaking changes. Other APIs will not break, however.