Skip to content

[Feature Request] Intelligent Usage with monorepo tools (Like Nrwl Nx) #817

@wSedlacek

Description

@wSedlacek

Context

I recently had the thought of overlaying git repos for the needs of a project I am working on and I can across this project.
I have worked with git submodules before but they were clunky to mange commits across repos.
I want to use this with Nrwl Nx and take heavy advantage of it's dependency graph and boundaries.

Request

After looking over git meta it seems super cool, but with large repos it seems like a lot of manual work of opening repos and closing them especially when they have a large number of dependencies. This being said I think combining the work done in git meta with a mono repo management tool like like Nwrl Nx could be extremely powerful.

Specifically I am looking for a CLI that leverages both git meta and Nrwl Nx to provide a simple set of commands that anyone on a team can easily pick up and be effective with but have enough power for Dev Ops and organization to have full control over their code base.

Here are some of my thoughts on what commands would be specifically useful.

// `git nx` could be replaced by another name, it was simply used as a placeholder for these examples
// <project-name> refers to the name of the project in the mono repo's schema

// Checkout a specific app or lib to disk including it's dependencies
git nx open <project-name>

// Checkout a specific app or lib to disk including not only it's depends but anything that depends on it (used for testing if a change to a specific lib broke something downstream)
git nx evaluate <project-name>

// Remove a specific app or lib from disk including any dependencies that are not used by other checked out projects
git nx close <project-name>

// Closes all open projects
git nx clear

// Open all projects
git nx flatten

// Reevaluates all open projects, any unused dependencies are closed, any unopenned dependencies are opened 
git nx update

// Creates a new submodule out of a given project with the remote of of a specified git url (optional), could possibly even use the `gh` or `gitlab` CLI to create the repo automatically, the `--private` flag can be used to create a private repo
git nx split <project-name> <git-url> (--private)

// Removes a project from a submodule joining it back into the meta/root repo, private repos will be blocked from using this command unless the `--force` flag is specified
git nx join <project-name> (--force)

// Converts a given project and all it's dependencies to public (gh/gitlab integration)
git nx publish <project-name>

// Converts a given project and all it's dependencies to private (gh/gitlab integration)
git nx unpublish <project-name>

// Configure default organization
git nx config org <organization>

// Configure default git provider (gh/gitlab)
git nx config provider <provider>

Given the nature of this request being an integration it very well may be out of scope for this project. That being said I do think git meta is the underlying ground work for such a CLI to be based off of and I would be interested in hearing any thoughts on how this might be done or what other solutions there might be to this problem.

User Stories

As a developer in a large mono repo, I want an easy way to get only the code I need to work on without unnecessary distractions.

As a dev ops engineer of a large mono repo, I want my CI/CD engine to only fetch what is necessary for a given pipeline to run.

As an organization who works with both open and closed source projects, I want to be able to control what parts of my mono repo are available to the public without needing to burden my developers with context switching.

As a developer advocate, I want to get my team on board with mono repos without requiring extensive knowledge of our architecture for us to be effective with the paradigm.

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