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

lolaus

v0.3.1

Published

Simple monorepo lifecycle/pipeline tool for running one or more commands on one or more directories that have diffs compared to an ancestor.

Downloads

1

Readme

lolaus

A simple monorepo lifecycle/pipeline tool for running one or more commands on one or more directories that have diffs compared to an ancestor. The primary use case is selective CI jobs within a trunk based workflow such Git Flow.

Usage

lolaus has for optional positional arguments: lolaus [glob] [command] [target_ref] [source_ref]

  • glob defaults to **

  • command does not default

  • target_ref defaults to next if available and then master

  • source_ref defaults to the current HEAD

Examples:

  lolaus | parallel "wc -l {} > {}.out"
  lolaus "./tests/* :(top,exclude)**requirements.txt" ls
  lolaus "*/*/package.json" "npm test" release_branch
docker_images:
  stage: build
  script:
    - lolaus "services/*/Dockerfile" "docker build -t ${PWD##*/} ."

py_tests:
  image: python
  stage: test
  script:
    - lolaus "apps/*/requirements.txt" "python3 tests.py"

Install

lolaus is a Bash script and should be fairly universal but not tested outside of GNU/Linux. OSX users will have a better shell experience (and perhaps life in general) if they install GNU utilities. Contribs increasing portability or with other packaging (pip|curl|gem|other) would be great!

npm install -g lolaus

Design

lolaus is just a convenience shell wrapper of host's git client. The targeted integration branch is used with git merge-base --fork-point to determine the common ancestor node (CA). This is one of several common ancestry node strategies and others could be supported in lolaus, but this seems to provide the most benefit to the pre-integration, monorepo use case.

git diff from the current git ref (Fh) to the CA to determine which files have changes, filtered by the provided glob. From the list of modified files the command is invoked from a sorted and unique list of directories sequentially via eval in a loop.

graph LR
  m1(("Sc"))
  ca(("CA"))
  mh(("Mh"))
  f1(("Fc"))
  f2(("Fc"))
  fh(("Fh"))

  m1---ca
  ca-- master ---mh
  ca-- feature ---f1
  ca-. git diff .-fh
  f1---f2
  f2---fh

  classDef gitNode fill:#4ED1A1,stroke:#555,stroke-width:4px;
  class m1,m2,mh,f1,f2,fh,ca gitNode

  classDef gitDiff fill:#4E63D1,stroke:#555,stroke-width:4px;
  class fh,ca gitDiff

The design also assumes that each microservice or component is contained in its own directory and can be identified by some sort of file such as a package.json, pom.xml, or requirements.txt via the glob.

There is no parallelism, lolaus is intended to be used pre-integration where only one or two components that are effected in the merge request. In cases where target_ref and source_ref defaults work, the command parameter can be omitted and the list of effected directors can be piped to parallel.