question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Create a CLI for this?

See original GitHub issue

It would be pretty easy, just pass parsed argv as options to the library and output the svg?

Iā€™m working on setuping huge monorepo of all my packages - both scoped and non-scoped ones. And so, I have idea to generate build badges on successful build per package.

For example

{
  "scripts": {
    "build": "(yarn build:dist && yarn build:status) || yarn build:status",
    "build:dist": "babel src -d dist -x .js,.jsx,.ts,.tsx,.mjs --delete-dir-on-start",
    "build:status": "echo \"Result(${npm_package_name}): $?\"",
  }
}

Which will be called from CI after all linting, typechecking, testing, coverage, and build. So in that build:status script I want to generate a badge which I will put in a directory, so I can show separate build status badge on the readme of each package.

So if we have badgen-cli, I can do


{
  "scripts": {
    "build": "(yarn build:dist && yarn build:success) || yarn build:failed",
    "build:dist": "babel src -d dist -x .js,.jsx,.ts,.tsx,.mjs --delete-dir-on-start",
    "build:status": "badgen --subject build",
    "build:success": "yarn build:status --status success --color green > dist/build-status.svg",
    "build:failed": "yarn build:status --status failed --color red > dist/build-status.svg"
  }
}

The https://github.com/amio/badgen-service/issues/222 is related to all that too. I will have build, npm and github badges for each package in the monorepo. The only missing part is coverage badge, but I may figure it out in future.


Btw, what about creating monorepo for Badgen - the cli, the lib, the web, and the service. Actually the CLI doesnā€™t need to be as separate package. We can add it here, with just one dependency - mri or minimist.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
amiocommented, Jan 20, 2019

Cool idea! Use badgen-cli directly in CI process šŸ‘

For the monorepo thoughts, since the cli, lib, service have different release schedules, I prefer to keep them in separated repos. But Iā€™m planning to put them under the org https://github.com/badgen

0reactions
tunnckoCorecommented, May 6, 2019

yes but one flat dependency isnā€™t a big problem, thatā€™s why I always prefer it that way, if it does not need bigger functionality and deps. : )

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build a CLI with Node.js - DEV Community ā€ ā€
Building the basic CLI Ā· Create a folder named bin in the root directory of your project. Ā· Inside bin create a file...
Read more >
Let's Build a CLI | Command Line Interface with Node.js |
Today we will learn how can we create our own CLI tool. Setting up the project. We'll be setting up a basic Node.jsĀ ......
Read more >
Let's Build a CLI | Command Line Interface Tutorial by ...
To start, when we say "CLI" or "command line utility," we're talking about a program that we can run at the command line...
Read more >
Creating a CLI tool with Node.js - LogRocket Blog
In this article, you'll learn how to create a CLI tool using Node.js, test it, and then publish it on npm.
Read more >
How to build your own CLI (Command Line Interface) with ...
Building your own CLI is easier than you might think with Node.js. ... Step 1: Create a folder for the project and open...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found