feat: Add modules to publish

This commit is contained in:
Timo Reymann
2023-02-15 17:45:32 +01:00
parent 85e9ceda4f
commit e0aeedf190
2 changed files with 34 additions and 6 deletions
+17 -1
View File
@@ -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"
}
]
}
+17 -5
View File
@@ -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