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

@rushdigital/checklist-cli

v1.0.0-rc.7

Published

A command line tool to automate some coding standards checks

Downloads

10

Readme

Checklist CLI

A command line tool to automate running checklists on projects, e.g:

  • following development standards, e.g. presense of a README.md
  • release checklists
  • etc.

Installation

Requires Node.js 18 or above.

  1. Install the tool (with global option):

Yarn:

yarn global add @rushdigital/checklist-cli

NPM:

npm install -g @rushdigital/checklist-cli

Usage

  1. Put your checklists into checklists/ directory.

You can also create a repository of checklists, so you can install from it by running:

checklist-cli install

See "Checklists" section below for more details.

  1. Run the tool
checklist-cli check --summary --reason

If you want to specify a subset of checklists use --checklists parameter, e.g:

checklist-cli check --summary --reason --checklists checklists/standard.yaml

Commands

checklist-cli <command>

Commands:

  • config - Configures the tool to be able to install shared checklists repository
  • install - Installs checklists into the current directory
  • update - Updates checklists in the current directory to latest version fron the shared repository
  • check - Runs the checks in the current direcory
  • checklist [url] - Fetches a checklist in a specified format and displays it
  • test <cmd> - Helper to test commands locally

Checklists

Checklists are defined in a yaml file that has the following structure:

manifestVersion: "0.5"
metadata:
  checksVersion: "<version, e.g. 1.0.0>"
  about: <description>
  reportTitle: <title>
checks:
  - id: <id, e.g STD-005>
    description: <description>
    why: <reason>
    category: <category, e.g Documentation>
    notes: <internal notes>
    contexts:
      - <context, e.g. develop or release>
    tags:
      - <tag>
    automation:
      - <automation>

Shared Repository

To create a shared repository of checklists:

  1. Create a NPM package that contains your checklists in a checklists/ directory. Example package.json:
{
  "name": "my-checklists",
  "version": "0.0.1",
  "description": "My custom checklists",
  "files": [
    "checklists/**/*.yaml",
  ]
}
  1. Publish that package to npmjs.com or push to a git repository

  2. Install that package globally using npm:

From npm:

npm i -g my-checklists

Or from Git:

npm i -g [email protected]:<user>/my-checklists.git
  1. Configure checklist to use that package:
checklist-cli config --add my-checklists
  1. Now, when you need to add checklists to a project you can run the following command from the project directory:
checklist-cli install

It will show the list of available checklists to choose from and copy them to checklists/ directory.

Automation

An automation can have the following outcomes:

  • passed - successfully checked
  • failed - check not passed
  • skipped - check is not applicable
  • pending - manual check

The following automations are supported:

Shell automation

shell: <command>

Also a shorthand notation is supported:

<command>

Specifies a shell command which is used to perform the check. Command that returns exit code 0 indicates that the check has passed. Any other code indicates that the check failed.

Conditional automation

if:
  condition: <automation>
  then: <automation>
  else: <automation>

Also a shorthand notation is supported:

condition: <automation>
then: <automation>

Rules:

  • Condition is satisfied if its automation returns passed.
  • Condition that is satisfied and does not have a then will result in pending.
  • Condition that is not satisfied and does not have an else will result in skipped. This is useful to create conditional manual checks.

"Outcome" automation

Specifies the outcome of the check

outcome: <automation>
reason: <reason>

Useful for skipping or enforcing a manual check.

"Any" automation

any:
  - <automation>
  - <automation>

Also a shorthand notation is supported:

- <automation>
- <automation>

This automation is used implicily in the automations: block of the check.

Rules:

  • If no automations then result will be pending.
  • If one automation then result will be of that automation.
  • If more than one automation:
    • if any automation passed then overall result will be passed.
    • if any automation failed then overall result will be failed.
    • if any automation skipped then overall result will be skipped.
    • otherwise the overall result will be pending.

Examples

  - id: STD-001
    description: Ensure README.md exists which describes the project, how to build and deploy it.    
    automation:
      - shell: test -f README.md || test -f readme.md

  - id: STD-002
    description: The README file has been kept up to date
    why: To prevent document rot
    automation:
      - condition: test -f README.md

  - id: STD-003
    description: node_modules should be ignored
    automation:
      - condition: test -d node_modules
        then: grep -q node_modules .gitignor

Security Updates

To fix security updates, in develop branch:

  1. Run npm audit to check for vulnerabilities.
  2. Run npm run update:dependencies to fix discovered vulnerabilities (if fixes are available) and update other dependencies.
  3. Run npm run tests to ensure things are working as expected.
  4. Run npm audit to check that vulnerabilities have been fixed.
  5. Commit changes to the repository, adding details of the vulnerabilities that have been fixed to the commit message (CVE number and vulnerable packages).
  6. Run npm run version:next to bump the version number and create a new tag.
  7. Push to origin and wait for the the build pipeline to finish successfully.
  8. Merge develop to master with Fast-forward strategy.
  9. Push to origin and wait for the the build pipeline to publish a new version of the package to npm.

Support

If you find a bug or have a feature request please log it at https://bitbucket.org/rushdigital/checklist-cli/issues

About RUSH

RUSH Logo

RUSH was founded on a simple principle; the exhilarating feeling of solving a difficult problem, a feeling that is common in the challenging projects RUSH tackles. We’re committed to bringing this enthusiasm to our work as a forward-looking, tech-engaged business with the purpose statement: We design and build technology to better serve humankind.

Our ways of working have been tested in some of the most demanding and impactful projects, resulting in effective and elegant award-winning digital experiences that millions of people benefit from every day.

We strive for continuous improvement to refine our practices and processes - like this tool, created to automate repetitive tasks and make the teams' lives easier. If you'd like to join or learn more about RUSH's team of strategic thinkers, empathetic designers and technical mavericks visit rush.co.nz/careers

License

CC-BY-NC-SA-4.0