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

@klient/open-stack-cli

v1.5.4

Published

A cli for managing project based on Klient open-stack template

Downloads

36

Readme

Klient OpenStack CLI

coverage-badge

Introduction

This package contains a CLI able to make actions on project based on the Klient open-stack template, with useful commands provided.

You should respect following steps to initialize a new project based on open-stack template :

  1. Duplicate open-stack repository (from github, or clone open-stack and reset git history). You can also use the "create" command !
  2. Initialize your project with "npm run configure" (the "create" command lunch it by default)
  3. Commit the changes related to project configuration
  4. Optionally, you can install and configure an external library with "setup" command (such as React)

Installation

# <--- In a project --->

$ npm install --save-dev @klient/open-stack-cli

# <--- Globally (in your $PATH) --->

$ npm install -g @klient/open-stack-cli

Usage

$ npx open-stack [command] <options>

Common options

  • --verbose : verbose mode
  • --raw : disable colors
  • --silent : disable output

Commands

Create

This command must be run with open-stack bin installed globally

This command is useful to create a new project based on open-stack template. It will clone stack repository on specified version (latest by default), it will launch "configure" command and create commits for every initialization step. By using this command, you just need to create an empty repository in github and launch "git push" after create command.

$ npm install -g @klient/open-stack-cli

$ open-stack create path/to/dir --version latest --verbose
# "npm run configure" will be run and will ask you
# few question for configurating your project

$ cd path/to/dir            # Move to fresh created dir
$ git log                   # See created commits
$ git remote get-url origin # Verify the remote before push
$ git push                  # Push project !

Configure

This command must be lunched after clone to initialize your project. It will remove content related to open-stack repository and configure the project files for the new package. This command should be run after FIRST npm install.

$ npx open-stack configure

Setup

This command is useful to setup an external library in open-stack project.

For now, you can you following libraries :

react : Setup your project for exporting React components (for React components libraries only)

react-app : Setup your project as create-react-app does (for web application only)

Caution : This should be used just after "configure" command (in fresh blank project) with no untracked files present

$ npx open-stack create ./example
$ cd ./example
$ npx open-stack setup react-app

# Project has been updated, you can change diff with git commands
$ git status
$ git diff

# Commit changes made if all is clean for you
$ git add .
$ git commit -m"chore(stack): setup react-app"
$ git push

Badge

Create svg coverage badge by making a request to https://img.shields.io

# Create badge based on all coverage members (lines, statements, functions, branches)
$ npx open-stack badge --input coverage/coverage-summary.json --output badge.svg

# Create badge based on statements only
$ npx open-stack badge --input coverage/coverage-summary.json --output badge.svg --incomplete

Note that the badge color is determinated by following rules :

  • red : 0 to 60%
  • orange : 60% to 70%
  • yellow : 70% to 80%
  • lightgreen : 80% to 90%
  • green : 90% to 95%
  • brightgreen : 95% to 100%

Update

Try to update files of a project based on open-stack template. The changes are applied only on elements which are not in conflict, else it must be updated manually. A mardown report can be generated to check all changes.

Caution, if you are not using dry option, changes will be applied.

Check for update analyze

$ npx open-stack update path/to/dir --to latest --dry --verbose

Apply changes on elements which are not in conflict

$ npx open-stack update path/to/dir --to latest

Generate report file

# Markdown
$ npx open-stack update path/to/dir --dry --report path/to/report.md
# JSON
$ npx open-stack update path/to/dir --dry --report path/to/report.json

Complete example

$ npx open-stack update path/to/dir
    # Target version (tag or latest, branches are not accepted)
    --to latest
    # Version currently used by project
    --from 1.0.2
    # The template source repository
    --repository https://github.com/klientjs/open-stack.git
    # The glob for specifying files to update
    --files .github/ISSUE_TEMPLATES/*
    --files .eslintrc
    # Generate a report file
    --report report.{md|json}
    # Read only mode
    --dry
    # Verbose output
    --verbose