spiegel-keyman/core/include/ldml/build.sh
Marc Durdin 3265a714f2 chore(common): add missing deps and files for npm publish
The build/ folder for most packages was missing due to being listed in
.gitignore.

Also, @keymanapp/ldml-keyboard-constants package was not being published
despite being a dependency of @keymanapp/kmc-keyboard.

Instead of relying on npm's use of .gitignore / .npmignore (which has
seriously wonky behaviours), we list the files that should be included
in package.json.

NPM Wonky behaviours: it seems that .npmignore causes .gitignore in the
same folder to be ignored. But, higher level .gitignore files still
affect the files included in the package, which makes
specification-by-exclusion painful (negating exclusions, etc). We do not
recommend use of .npmignore anywhere for this reason.
2023-04-12 14:05:05 +07:00

73 lines
2.2 KiB
Bash
Executable file

#!/usr/bin/env bash
#
# Packages the @keymanapp/ldml-keyboard-constants package.
#
# Exit on command failure and when using unset variables:
set -eu
## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh"
## END STANDARD BUILD SCRIPT INCLUDE
cd "$THIS_SCRIPT_PATH"
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
builder_describe "Build Keyman ldml-keyboard-constants package" \
"@/common/web/keyman-version" \
"clean" \
"configure" \
"build" \
"test" \
"pack build a local .tgz pack for testing" \
"publish publish to npm" \
"--dry-run,-n don't actually publish, just dry run"
builder_describe_outputs \
configure /node_modules \
build /core/include/ldml/build/keyboardprocessor_ldml.js
builder_parse "$@"
#-------------------------------------------------------------------------------------------------------------------
if builder_start_action clean; then
rm -rf ./build/
builder_finish_action success clean
fi
#-------------------------------------------------------------------------------------------------------------------
if builder_start_action configure; then
verify_npm_setup
builder_finish_action success configure
fi
#-------------------------------------------------------------------------------------------------------------------
if builder_start_action build; then
tsc --build
builder_finish_action success build
fi
#-------------------------------------------------------------------------------------------------------------------
if builder_start_action test; then
# no tests at this time
builder_finish_action success test
fi
#-------------------------------------------------------------------------------------------------------------------
if builder_start_action publish; then
. "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh"
builder_publish_to_npm
builder_finish_action success publish
elif builder_start_action pack; then
. "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh"
builder_publish_to_pack
builder_finish_action success pack
fi