Skip to content

Dependencies / imports via git repos #333

@kylewlacy

Description

@kylewlacy

Today, projects can be included either via the Brioche Registry or via a local path (inside or outside the current workspace). While Brioche can be configured to use a self-hosted registry to retrieve projects, this is a fairly hefty burden, especially if you want to share projects within a small team!

We should also allow importing Brioche projects via git repos. Brioche's dependency management is inspired by Cargo, and Cargo allows specifying dependencies via git.

For explicit dependencies, we should use a similar schema to Cargo:

import foobar from "foobar";

export const project = {
  dependencies: {
    foobar: {
      git: "https://github.com/kylewlacy/foobar.git",
      // ref: "main", // Optional
      // commit: "<full commit hash>", // Optional
    },
  },
};

We should also support implicit dependencies as well, specifying the repo as a URL in the import specifier:

import foobar from "git+https://github.com/kylewlacy/foobar.git#main";

(If this turns out to be too difficult, or if there's ambiguities or blockers for supporting implicit dependencies, we could keep it out of scope for the initial implementation)

In either case, the git repo would be recorded in the lockfile exactly like a Brioche.gitRef static is today (the exception being if the commit hash is specified exactly).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions