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

just-build-tools

v0.0.12

Published

Dependency graph tools for building, testing, and deploying on your CI/CD of choice.

Downloads

542

Readme

just-build-tools

Dependency graph tools for building, testing, and deploying on your CI/CD of choice.

This tool is designed for polyglot monorepo builds, or cases where submodules have different version requirements of same package, or for devs who don't want a heavy handed build framework.

just-build-tools uses the cmd runner just.

Getting Started

Add depends-on.yml and justfile to each subdirectory you want to build. Then run npx just-build-tools run build build all dependent modules in order.

npx just-build-tools run build
Running command build
Deploying project ... root = /Users/matthewsibson/Code/Personal/depends-on/example
Parsed project:

[containing_folder/package_0] - [package_1] - [package_2]
  [package_3]
    [app_1]
      [app_2]
        [containing_folder/app_3]
-----------------------------------------
build package_1...
-----------------------------------------
-----------------------------------------
Finished build package_1
-----------------------------------------
-----------------------------------------
build package_2...
-----------------------------------------
...
-----------------------------------------
build app_1...
-----------------------------------------
-----------------------------------------
Finished build app_1
-----------------------------------------

File convention

Two files are required, justfile depends-on.yml. When running npx just-build-tools run build the cli will find all justfiles with a build command and run them in dependant order.

/
/app_1/
...depends-on.yml
...justfile
/app_2/
...depends-on.yml
...justfile
/package_1/
...depends-on.yml
...justfile
/package_2/
...depends-on.yml
...justfile
/package_3/
...depends-on.yml
...justfile

Example depends-on.yml might look like this,

//frontend-app
depends_on:
  - package_1
  - package_3

Example justfile may look like this

#!/usr/bin/env just --justfile

build:
    yarn
    yarn generate
    yarn build

Creating ci config

(Currently circle ci only supported)

Creating a file in each subdirectory circleci-build.yml allows the just-build-tools to create a top level circle ci config file with required dependencies injected.

Example circleci-build.yml, everything under build is standard job circle ci config. everything under workflow is standard workflow job config.

build:
  - app1-build-step-1:
      working_directory: ~/app_1
      docker:
        - image: circleci/node:latest
      steps:
        - checkout
        - run:
            name: Build app1
            command: just build
  - app1-build-step-2:
      working_directory: ~/app_2
      docker:
        - image: circleci/node:latest
      steps:
        - checkout
        - run:
            name: Do something else
            command: echo do something


workflow:
  - app1-build-step-1:
      context:
        - context-1
        - slack-context
  - app1-build-step-2:
      requires:
        - app1-build-step-1
      context:
        - context-1
        - slack-context

This will be output to out/circle-config.yml, for example.

version: 2
jobs:
  - package-1-build:
      working_directory: ~/package_1
      docker:
        - image: circleci/node:latest
      steps:
        - checkout
        - run:
            name: Build package_1
            command: just build
  - package-3-build:
      working_directory: ~/package_3
      docker:
        - image: circleci/node:latest
      steps:
        - checkout
        - run:
            name: Build package_3
            command: just build
  - app1-build-step-1:
      working_directory: ~/app_1
      docker:
        - image: circleci/node:latest
      steps:
        - checkout
        - run:
            name: Build app1
            command: just build
  - app1-build-step-2:
      working_directory: ~/app_2
      docker:
        - image: circleci/node:latest
      steps:
        - checkout
        - run:
            name: Do something else
            command: echo do something

workflows:
  build:
    jobs:
      - package-1-build:
          context:
            - context-1
            - slack-context
          requires: []
      - package-3-build:
          context:
            - context-3
            - slack-context
      - app1-build-step-1:
          requires:
            - package-1-build
            - package-3-build
          context:
            - context-1
            - slack-context
      - app1-build-step-2:
          requires:
            - app1-build-step-1
            - package-1-build
            - package-3-build
          context:
            - context-1
            - slack-context

Running the cli

Cli can be run via npx

npx just-build-tools run build

All options viewable by

Usage: just-build-tools [options] [command]

A simple CLI tool in TypeScript

Options:
  -V, --version        output the version number
  -h, --help           display help for command

Commands:
  run [options]      Build whole project
  ci [options] <type>  Generate ci config for whole project
  help                 Display help information

Contributing

Requirements

  • Node
  • Yarn

To get setup run,

yarn
yarn build

Testing locally

To test cmd line.

yarn build && yarn start <cli args>

Testing locally in another project

yarn start-registry
yarn build
yarn publish-local
npm_config_registry=http://localhost:4873 npx just-build-tools build -f example