@heusalagroup/hgm

0.0.6 • Public • Published

@heusalagroup/hgm

This is Heusala Group's git module manager.

In reality, it is just a smarter command line interface to use Git's SubModules.

Note! It's still quite experimental and in active development.

Install the command globally from NPM

npm i -g @heusalagroup/hgm

Install fi.hg.core as a git submodule to ./src/fi/hg/core

hgm update fi.hg.core

This is essentially same as following raw commands:

mkdir -p src/fi/hg
git submodule add git@github.com:heusalagroup/fi.hg.core.git src/fi/hg/core
git config -f .gitmodules submodule.src/fi/hg/core.branch main
(cd src/fi/hg/core && git pull --recurse-submodules && git submodule update --init)

...except it can detect current state and only execute steps which are needed.

Update all local git submodules

hgm update

This is essentially same as following raw commands:

git pull --recurse-submodules
git submodule update --init --recursive

Configuring user defined scopes

Our package system is user extendable.

You can configure your own namespaces by registering the domain and using our HTTP metadata service to configure your Github organization name.

When you own the domain example.com, it gives you access to define packages under com.example.

You just need to:

  1. Register or already own the domain name
  2. Configure the Github organization name by creating an JSON web resource at a URL https://example.com/.well-known/fi.hg.m.json with the content as:
{
  "fi.hg.github.org": "example"
}

The implementation uses the .well-known HTTP interface.

Configuring user defined scopes using nginx

Using the nginx web server you can configure it with the following configuration:

location /.well-known/fi.hg.m.json {
    default_type application/json;
    return 200 '{"fi.hg.github.org": "example"}';
}

Configuring user defined scopes using Github Pages

Github pages do not by default include .well-known folder.

Append to your _config.yml an include configuration:

include: [".well-known"]

...and add a JSON file at ./.well-known/fi.hg.m.json with content:

{
  "fi.hg.github.org": "example"
}

Configuring user defined scopes using Nginx

Let Nginx serve the JSON directly:

location /.well-known/fi.hg.m.json {
  default_type application/json;
  return 200 '{"fi.hg.github.org": "heusalagroup"}';
}

License

Copyright (c) Heusala Group. All rights reserved. Licensed under the MIT License (the "License");

Package Sidebar

Install

npm i @heusalagroup/hgm

Weekly Downloads

0

Version

0.0.6

License

MIT

Unpacked Size

589 kB

Total Files

141

Last publish

Collaborators

  • jhh