diff --git a/.releaserc.json b/.releaserc.json index 6ffd74a..bac320b 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -36,7 +36,23 @@ "assets": [ { "path": "dist/bundle.sh", - "label": "Full Library" + "name": "bundle.bash", + "label": "Bundle > Full Library - containing all files" + }, + { + "path": "dist/logging.sh", + "name": "logging.bash", + "label": "Component > Logging - Provide logging helpers for structured logging" + }, + { + "path": "dist/prompts.sh", + "name": "prompts.bash", + "label": "Component > Logging - Inquirer.js inspired prompts" + }, + { + "path": "dist/user_feedback.sh", + "name": "user-feedback.bash", + "label": "Component > User-Feedback - Provides useful colored outputs for user feedback on actions" } ] } diff --git a/Makefile b/Makefile index 80a31c6..d58b5c9 100644 --- a/Makefile +++ b/Makefile @@ -13,11 +13,23 @@ generate-docs: ## Build documentation using docker container @docker run --rm bash-tui-toolkit/shdoc 'shdoc < prompts.sh ' 2>&1 > docs/modules/Prompts.md @docker run --rm bash-tui-toolkit/shdoc 'shdoc < user_feedback.sh ' 2>&1 > docs/modules/User-Feedback.md -build: ## Bundle script to dist folder and remove all comments +_remove_comments_from_file: + @cat $(file) | sed '/^$$/d' | sed '/^#/d' | sed '/^\s*#/d' | tee $(file) > /dev/null + +_push_module: + echo "=> Push module $(module)" + cp src/$(module).sh dist/$(module).sh + @$(MAKE) _remove_comments_from_file file=dist/$(module).sh + +build: ## Bundle script to dist folder and remove all top level comments + @echo "=> Create dist folder" @rm -rf dist || true @mkdir dist/ + @echo "=> Create builder image" @docker build . -t bash-tui-toolkit/builder -f .development/build/Dockerfile - @docker run --rm bash-tui-toolkit/builder 'bash_bundler bundle --entry src/main.sh --output /dev/stderr' 2> dist/bundle.sh - @sed -i '/^$$/d' dist/bundle.sh - @sed -i '/^#/d' dist/bundle.sh - + @echo "=> Bundle and remove comments from target files" + @docker run --rm bash-tui-toolkit/builder 'bash_bundler bundle --entry src/main.sh --output /dev/stderr' 2>dist/bundle.sh + @$(MAKE) _remove_comments_from_file file=dist/bundle.sh + @$(MAKE) _push_module module=logging + @$(MAKE) _push_module module=prompts + @$(MAKE) _push_module module=user_feedback