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

thrift-god

v2.1.2

Published

A god repository for all your thrifts

Downloads

17

Readme

thrift-god

A god repository for all your thrifts

Introduction

thrift-god provides a "package manager" for thrift interfaces. It comes with two CLI commands, thrift-god and thrift-get.

Motivation

  • The source of truth for a service should live with the service. You want the thrift definition to be checked into the repository
  • Every service needs a copy of the thrift definition for any service That it wants to talk too. This definition should be static. You do not want it to change at run-time.
  • There should only be one version of the world. Your company runs at a single version in production; all the files should ultimately be under one version.
  • The one version should be live. Developers should not manually publish new versions; instead we should just take master as the source of truth.

As a client: thrift-get

As a developer I want to be able to talk to other services; To do this I need to find their Thrift interface definitions.

I can run thrift-get list to show all available services and their IDL files.

If I want to download one of these files I can thrift-get fetch {service} and it will fetch the IDL file into ./thrift/{service}.thrift.

Once you fetch your first service we also write the ./thrift/meta.json meta file that contains the version of the file as well as the time it was last changed.

All thrift files are under one version; If you want to update to the latest version just run thrift-get update and it will update all thrift files to the latest version as well as updating the ./thrift/meta.json.

Since the thrift definitions define the interfaces of the services in production, there is only one version for all files. When you update anything, you update everything to the current version.

As a server:

If your developing the backend for a new service you just have to commit the thrift definition into git; by convention we place it in ./thrift/service.thrift.

The thrift-god daemon will fetch it and put it in the repository.

As an adminstrator: thrift-god

To set up the thrift interface repository you can run the thrift-god deamon. You just run thrift-god --config-file={path} and it will populate the thrift remote repository.

The config file contains the following fields

{
    "upstream": "git+ssh://[email protected]/my-company/thrift-files",
    "repositoryFolder": "/var/lib/my-company/thrift-god/repo",
    "cacheLocation": "/var/lib/my-company/thrift-god/cache",
    "remotes": [{
        "repository": "git+ssh://[email protected]/my-company/user-service",
        "branch": "master",
        "thriftFile": "thrift/service.thrift"
    }, {
        "repository": "git+ssh://[email protected]/my-company/product-service",
        "branch": "master",
        "thriftFile": "thrift/service.thrift"
    }]
}

The thrift-god daemon will fetch all the remotes and place their thrift files in the upstream repository. You can use thrift-get to fetch from the upstream repository.

TODO:

This project is not done yet:

  • [x] Implement thrift-god config loader
  • [x] Implement fetching from remotes into upstream
  • [x] Make thrift-god a repeating cron job
  • [x] Support localFileName in config.
  • [x] Support branch in config.
  • [x] Implement thrift-get binary.

Installation

npm install thrift-god --global

Tests

npm test

Contributors

  • Raynos

MIT Licensed