Giter Site home page Giter Site logo

repo-package-manager's Introduction

Repo Package Manager

The intent is to serve as a sample or template of how to use any public source code repo as a package manager repository.

What is a Package Manager?

Package Managers offer a lot of benefits when distributing binaries (aka packages), such as automatic checksum validation, determining compatible versions, consistent distribution model, integration with build systems, and installation.

For more info see:

Examples of package managers include:

  • Cocoapods - for Obj-C and Swift libs
  • Maven - for Java libs
  • NPM - for NodeJS libs
  • NuGet - for C# libs
  • among others such as Carthage and so on

What is a Package Manager Repository?

These package managers depend on a Repository (also known as a Registry) to store and distribute the actual packages (the binaries). A repository is really just a directory structure that conforms to a specific way of structuring the packages. Usually package managers have a well-known, or a few well-known, public repositories. Software distributors will sometimes host their own public package manager repositories, and enterpises tend to host their own private repositories.

Examples of well-known package manager repositories include:

Why not use an existing Package Manager Repository?

The biggest reason is typically because you wish to distribute an SDK or some other type of library that is not open-source. The development of package managers came about mostly as a result of the open-source community, to easily share and distribute their creations. Sometimes enterprises, even those who contribute to (and create) open-source projects, also need to distribute binaries without the source code for legal or other reasons.

Not all public package manager repositories allow closed-source binaries to be distributed from their repository. Others do, but have other problems such as requiring authentication.

Why use a Code Repo as a Package Manager Repository?

Public source code repositories, such as github.com and others, offer a convenient way to make available source code and other artifacts. They are increasingly being used for other purposes as well, such as for documentation, meeting notes, wikis, bug tracking, release binaries, and anything else that is tangentially related to code.

As noted, it's not uncommon for source code repositories to also host the binaries, as a convenience to developers.

Turning a source code repository into a package manager repository is therefore just a matter of structuring the directory layout to conform to the package manager's specification.

Github in particular also provides built-in support for publishing packages to the repo. See https://docs.github.com/en/packages/manage-packages/viewing-packages for more information. However they don't support all package managers, such as Cocoapods. Worse, it also (as of April 2021) requires user authentication in order to use it, which makes it incredibly impractical to use.

Hermes-Messenger

This repo is an example of how to structure a source code repository to also act as package manager repository, either along-side the actual source code or even exclusively just as a package manager repository.

To do so, a sample app is provided that consumes a very simple library called hermes-messenger. This library offers only one function, and all it does is print a message. The hermes-messenger library is written as a library for Obj-C and Java, and published as a Cocoapod package (for Obj-C) and Maven package (for Java).

The sample app then consumes the hermes-messenger package just like it would use any other package from a public package manager repository.

Structure

This code repo has the following 4 main directories:

  • cocoapod
    • Holds the Cocoapod package for hermes-messenger. Used by Obj-C sample app.
  • maven
    • Holds the Maven package for hermes-messenger. Used by Java sample app.
  • sources/hermes-messenger
    • Holds the source code for the hermes-messenger library.
  • sources/sample-app
    • Holds the source code for the sample app which uses the hermes-messenger packge.

repo-package-manager's People

Stargazers

 avatar Terry Duchastel avatar

Watchers

James Cloos avatar Terry Duchastel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.