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

@bpmsoasolutions/hexinpkg

v0.9.0

Published

Manage monorepos as private packages

Downloads

3

Readme

hexin :package: Linux Build status Windows Build status

hexin (Héxīn, 核心, core in chinese) is a cli that helps you to use monorepos as private/public container of modules.

The idea comes when appears the need to have all our Frontend dependencies libraries under control, we found that the best way is using a monorepo, like lerna or a custom system, also we started to use monorepos in our projects because in that way we control better the dependencies and we can split in modules our flow and projects. In addition we started to use Typescript everywhere we can, and we need also to find a way to include that Typescript without compiling it, so in that context hexin born.

$ hex

  Usage: hex [options] [command]

  [ 核心 - Hexin ] v0.9.0 Manage monorepos as private packages


  Options:

    -V, --version  output the version number
    --home <name>  Change hexin cache folder
    -h, --help     output usage information


  Commands:

    add <name>             Add package from a repo, previusly downloaded
    append <git_url_repo>  Download a repo to .hexin cache
    bootstrap              Copy neccesary repos and make yarn and lerna bootstrap
    release                Add new version to the releases branch
    unrelease              Remove specific tags
    clean                  Clean directories and package json

Prerequisites

  • NodeJS >= 4.0
  • Yarn >= 1.0.0
  • Git

Installation

Install with npm like normally:

npm install -g @bpmsoasolutions/hexinpkg

Then you will have hex and hexpkg binaries accesible

Needs

  • Have all our UI dependencies in a repository (monorepo)
    • This provides us control over all packages
    • This force us to use same development flow over all libraries
  • Have that packages secured under private git repository
  • Have defined our deps in a file, and understand how dependencies are ours
  • Typescript packages not need to be compiled

What hexin does

The idea is simple, is like a nodejs package manager that takes the packages from a git repository.

For develop the packages

  • In your 'hexin packages' monorepo create your nodejs packages that then can be shared between your projects
  • Once you finished a packages, to mark as an 'hexin package' use hex release command:
    • This put a '@' as a git tag
    • Push the tag to your 'hexin packages' monorepo
  • Congrats now you have your packages 'published'

For develop the app

  • In the destination repository (the project of your app), run hex append url_of_your_git_monorepo, this download the repository in the hexin cache folder
  • To add an 'hexin-package' to the destination repository use:
    • hex add name@version or hex add name
    • this make this modifications in the package.json (this is an example from our test repository):
    "hexDependencies": {
        "https://github.com/bpmsoasolutions/hexin-modules-test.git": {
            "@bss/utils": "1.0.0"
        }
    }
  • Also it copy the directory of that module from the cache of your 'hexin packages' monorepo, to the destination monorepo as a package.
  • Then run hex bootstrap this run yarn and lerna and then remove the hexin packages from the package.json, in this way you can normally work and add packages with yarn.

Note that after every yarn operation such add or remove you should always run hex bootstrap

Commands

  • add : Adds a 'hexin package' previously downloaded from the hexin cache to the monorepo destination, and then run hex bootstrap to link all deps between. It supports:

    • hex add <name>
    • hex add [<@scope>/]<name>
    • add [<@scope>/]<name>@<version>
  • append <git_url_repo>: Download a monorepo to .hexin cache

  • bootstrap: Copy necessary repos wrote on package.json (download to cache if necessary), adds as dependency in package.json and then runs yarn and lerna bootstrap and at last removes packages from package.json

  • release: Tag a new version of the selected package, and push the tag

  • unrelease: ask to remove a git tag from the git tags list, this remove from hexin that package

  • clean: Remove hexin folders and clean package.json from 'hexin' stuff

Todo

  • hexin upgrade to upgrade hexin packages to new versions
  • Wrap yarn commands to always rerun hex bootstrap after installation
  • Make work hexin packages that are children of other hexin packages
  • Resolve better lerna configuration, now packages folder are fixed and only work with 'packages' folder
  • Test test test

We are working in progress