Create a CLI for this?
See original GitHub issueIt 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:
- Created 5 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top GitHub Comments
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
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. : )