This commit is contained in:
2026-04-24 14:03:17 +02:00
commit 0191347312
31 changed files with 16354 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# depends on
declare -r readme='bs/README.md'
isHelp() {
for arg in "$@"; do
[[ "$arg" == '-h' || "$arg" == '--help' ]] && return 0
done
return 1
}
echoReadmeInfo() {
local -r script="bs/${0##*/}"
local info
info="$(grep -A1 "## $script" "$readme" | tail -n1)"
cat <<-EOF
$info
Usage: $script [options]
Options:
-h, --help: Show this help
EOF
}
+29
View File
@@ -0,0 +1,29 @@
# bs: Build system based on executables
This project uses [jaandrle/bs: The simplest possible build system using executable/bash scripts](https://github.com/jaandrle/bs).
## Available executables
If it makes sense, arguments are passed to internally used commands (e.g. `tsc`), e. g. `--help`.
### bs/lint
This lints the project using `tsc`.
### bs/test
This lints the project and runs tests using `wtr`.
### bs/start
This starts the development server using `web-dev-server`.
### bs/build
This builds the project using `rollup`.
### bs/analyze
This analyze Custom Element manifest using the `@custom-elements-manifest/analyzer`.
### bs/npm/lint
Linted projects npm dependencies.
### bs/npm/update
Updates projects npm dependencies.
### bs/npm/install-audit
Audits projects npm dependencies to be installed.
Executable
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -eo pipefail # this can be harmful, see https://www.youtube.com/watch?v=4Jo3Ml53kvc
. bs/.common || {
echo 'Please run this script from the project root directory' >&2;
exit 1;
}
# depends on
declare -r app='src/app-cfpodcasts.ts'
declare -r cem='node_modules/.bin/cem'
help(){
if ! isHelp "${@}"; then return 0; fi
echoReadmeInfo
echo
$cem --help
exit 0
}
main(){
help "${@}"
$cem analyze --litelement --globs "$app" "${@}"
}
main "${@}"
Executable
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -eo pipefail # this can be harmful, see https://www.youtube.com/watch?v=4Jo3Ml53kvc
. bs/.common || {
echo 'Please run this script from the project root directory' >&2;
exit 1;
}
# depends on
declare -r rollup='node_modules/.bin/rollup'
declare -r analyze='bs/analyze'
declare -r config='rollup.config.js'
declare -r dist='dist/'
help(){
if ! isHelp "${@}"; then return 0; fi
echoReadmeInfo
echo
$rollup --help
exit 0
}
main(){
help "${@}"
rm -rf "$dist"
$rollup -c $config "${@}"
$analyze --exclude "$dist"
}
main "${@}"
Executable
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -eo pipefail # this can be harmful, see https://www.youtube.com/watch?v=4Jo3Ml53kvc
. bs/.common || {
echo 'Please run this script from the project root directory' >&2;
exit 1;
}
# depends on
declare -r tsc='node_modules/.bin/tsc'
help(){
if ! isHelp "${@}"; then return 0; fi
echoReadmeInfo
echo
$tsc --help
exit 0
}
main(){
help "${@}"
$tsc "${@}"
}
main "${@}"
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
npx npq install "$1" --dry-run
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
npx lockfile-lint --path package.json
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
npx npm-check-updates --interactive --format group --cooldown 7
Executable
+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
set -eo pipefail # this can be harmful, see https://www.youtube.com/watch?v=4Jo3Ml53kvc
. bs/.common || {
echo 'Please run this script from the project root directory' >&2;
exit 1;
}
# "start:build": "web-dev-server --root-dir dist --app-index index.html --open",
# "start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"web-dev-server\""
# depends on
declare -r server='node_modules/.bin/web-dev-server'
declare -r lint='bs/lint'
declare -r index='index.html'
help(){
if ! isHelp "${@}"; then return 0; fi
echoReadmeInfo
cat <<-EOF
Options:
./src Starts the development server (default)
./dist Starts the production server
EOF
$server --help
exit 0
}
main(){
help "${@}"
local -r target="${1:-./src}" # ./src or ./dist
if [[ "$target" == './dist' ]]; then
# console warns because of config file, use npx serve?
$server --root-dir "$target" --app-index $index --open
else
$lint --watch --preserveWatchOutput &
$server &
wait
fi
}
main "${@}"
Executable
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -eo pipefail # this can be harmful, see https://www.youtube.com/watch?v=4Jo3Ml53kvc
. bs/.common || {
echo 'Please run this script from the project root directory' >&2;
exit 1;
}
# depends on
declare -r lint='bs/lint'
declare -r wtr='node_modules/.bin/wtr'
help(){
if ! isHelp "${@}"; then return 0; fi
echoReadmeInfo
cat <<EOF
Options:
--watch, -w Runs in watch mode
EOF
$wtr --help
exit 0
}
main(){
help "$1"
if [[ "$1" != "--watch" ]]; then
$lint
$wtr "$@" --coverage
exit
fi
$lint --watch --preserveWatchOutput &
$wtr "${*}" &
wait
}
main "$@"