foundry
has been a great tool for personal use. However, when adding to a project, I always feel scared that it will break for someone who has never used it before (on occasion, it will choke during publication). Additionally, it has shortcomings like no configuration setup at the moment.
Today I had an epitome to refactor to a different CLI. Instead of providing a single command to release (i.e. foundry release
) which magically runs all installed plugins. We should consider making a CLI framework that the release libraries sit on top of as well as a boilerplate script for releasing:
#!/usr/bin/env bash
# Exit on first error
set -e
# Usage: `./release.sh 1.0.0`
foundry-release-git release $*
foundry-release-npm release $*
foundry-release-bower release $*
foundry-release-component release $*
Then, if anyone wants a magical wrapper, we can sniff node_modules/.bin
for these modules ;)
This fixes a few things:
- Handles specific tasks failing more easily (e.g. not being logged in to
npm
) - Allows for per-task configuration (e.g. adding a custom message to
foundry-release-git
via a-m/--message
hook) - Transparency about what is going on rather than looking up module on GitHub
- Makes re-running specific task easier (e.g. look at
./release.sh
and find what failed
...
After typing all this out, I have realized that this is flawed. We need to run all updateFiles
tasks at once, then all register
tasks, then all publish
tasks. Unless we somehow change the paradigm but nothing is coming to mind =(
...
We could require specifying --plugins
but it doesn't fix the core problem of a lack of transparency.