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

submodule-version

v2.0.4

Published

Git <S>ubmodule <V>ersioning tool

Downloads

47

Readme

Submodule version

Git Submodule Version tool

NPM

Submodule version is a tool to manage git submodules as versioned packages.

This tool designed to split projects in-to submodules without npm-packages headache.

With submodule version code can be organized like a single monorepo, but each submodule can be easily reused in another projects like npm-package.

Problem to solve

Take a look on the next situation:

  • Project has 2 submodules ui-button-element and render-engine
  • Package ui-button-element dependents on the render-engine
  • Third repo ui-slider-element dependets on newest version of the render-engine and not included in the project

This cause next problems:

  • Add submodule ui-slider-element cause difficulties with handle different render-engine versions
  • Manual swithing branches in submodules with big codebase can confuse
  • Updated ui-button-element with new version of render-engine should be used in another project with the same version

Submodule version helps to

  • Handle which project should be updated and which version should be installed
  • Help update submodules and theirs dependencies
  • Install new submodules

Installation

  • Install sv tool npm i -D submodule-version
  • Add workspaces section in package.json
      "workspaces": [
          "modules/*"
      ],
  • Install first submodule npx sv i <git_repo>
  • Install npm dependencies npm i. Submodule will be linked in node_modules and its dependencies will be installed
  • Use your submodule in code import submodule from 'submodule-name' 🔥

How it works

  • Each submodule and main project has own package.json with sv object inside. sv object will be generated automatically and will contain every dependency version
    "sv": {
        "[email protected]:guljeny/submodule-version.git": "^1.0.0"
    }
  • Each submodule has a version tags, and sv use list of this tags to resolve dependencies
  • Submodule version creates a graph of whole project and install only possible and actual versions

Versioning

Sumodules without specified version tags will be installed with ref to the latest commit. You should manage them manually.

To add new version in submodule:

  • Specify version in package.json
  • Add and push git tag with the same version (git tag 1.0.1)

Commands

  • npx sv validate - Validate all dependencis and install missing modules
  • npx sv install <git_url> [target_submodule] - Install new dependency
  • npx sv update - Update all dependencies to the latest possible versions
  • npx sv help - Description of all commands

Submodule dependencies

Sumbodules can contains their own dependencies specified in package.json as sv object.

To install submodule in submodule run npx install <git_url> [target_submodule]