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

octopus-cli

v0.0.16

Published

Multi-module repo build helper

Downloads

24

Readme

octopus-cli

An opinionated tool for building, managing and releasing a multi-module npm projects.

install

npm install -g octopus-cli

About

Managing mono-repo or multi-module npm-based repos is hard and cumbersome. Some challenges that octo tries to solve:

  • dependency version across modules get desynced easily. octo allows to define single version of dependency (say mocha) and enforce it for all modules.
  • updating module versions - if you have a module that is used by other modules within same repo and you want to update a version, you have to go over modules that use it and update version in dependencies/devDependencies. Octo automates that;
  • setting up a multi-module project in idea - idea has no native support for multi-modules npm projects. octo solves that;
  • building multi-module project - octo helps you with that - install, link, build only changed modules (and dependencies within mono-repo).

Set-up

Run octo init that will:

  • add pre-push hooks for syncing module and dependency versions;
  • create new octopus.json if there is no one present.

octopus.json

octopus.json is a configuration file for octo which can contain:

  • engine - npm or yarn that is used for install, run, link commands;
  • exclude - array of modules to be excluded;
  • dependencies, peerDependencies - hash of dependency names and versions that are enforced across monorepo. Note that dependencies listend in dependencies are enforced both for npm dependencies and devDependencies.

Example:

{
 "engine": "yarn",
 "scripts": {
   "clean": "echo run me before each bootstrapped module if -c is provided"
 },
 "exclude": ["some-module-to-exclude"],
 "dependencies": {
   "chai": "~3.5.0",
   "eslint": "~3.10.2"
 },
 "peerDependencies": {
   "eslint-plugin-mocha": ">=2.0.0"
 }
}

octo

octo is a command line tool for:

  • building monorepo (octo bootstrap -n && octo run build test) (with support of building only changed modules with proper module graph support);
  • running arbitrary npm scripts and commands for all/changed modules - octo run test, octo exec 'echo 1';
  • managing module versions across monorepo - octo modules;
  • managing module dependency version across monorepo - octo deps;
  • generating intellij idea project for all modules within repo (with proper es6 setup, node_modules ignore and test runners) - octo idea;
  • self-updating - octo selfupdate.

octo init

Should be used both for adding octo support for new project and setting-up local environment for cleanly checked-out octo-enabled project.

For a non-octo-enabled project:

  • add pre-push hooks for syncing module and dependency versions;
  • create new octopus.json if there is no one present.

For octo-enabled project:

  • add pre-push hooks for syncing module and dependency versions;

octo bootstrap

Runs npm|yarn install for all modules and also links inter-dependent modules across monorepo.

To check available options run octo help bootstrap;

octo run [...npm scripts]

Runs scripts defined in package.json for all|changed modules. This is useful to run tests for all modules.

Example:

octo run -a build test

Will run build and test scripts defined in module package.json for all modules (-a).

To check available options run octo help run;

octo exec '[cmd]'

Execute arbitrary script for all modules in monorepo.

Example:

octo exec -a 'rm -f .nvmrc && echo 6.9.2 > .nvmrc'

Will update version of node in .nvmrc to 6.9.2 for all modules (-a).

To check available options run octo help exec;

octo idea

Generate/regenerate Intellij idea project for all modules within repo (Note that you might need to restart idea for changes to take effect). Generated project will have:

  • es6 js code style set-up;
  • node_modules set as ignored for indexing (to make sure intellij does actually work with 20+ modules);
  • run configurations generated for all modules (mocha).

Example:

octo idea

octo deps

Manage dependencies across all modules. Common scenario is:

  • octo deps latest - to get a list of dependencies, that are defined in octopus.json and have newer version in registry.
  • update dependenciy versions in octopus.json;
  • octo deps sync --save - to update package.json for modules that need updating as per definitions in octopus.json;
  • octo run bootstrap -n && octo run test - to intsall updated dependencies and run tests to verify if nothing broke.

To check available options run octo help deps;

octo modules

Manage module versions and mark build/unbuild.

Common scenarion could be to update module version:

  • update version of a module in package.json;
  • run octo modules sync --save to update dependency version in modules that use a module with updated version.

To check available options run octo help modules;

octo selfupdate

Update version of octopus-cli:)