mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-21 21:37:50 +00:00
Consolidates the node-related script functions into node.inc.sh, as part of cleaning up the build scripts and making them easier to maintain into the future. Fixes: #14447
47 lines
No EOL
1.5 KiB
Bash
Executable file
47 lines
No EOL
1.5 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
## START STANDARD BUILD SCRIPT INCLUDE
|
|
# adjust relative paths as necessary
|
|
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
|
|
. "${THIS_SCRIPT%/*}/../../../../resources/build/builder-full.inc.sh"
|
|
## END STANDARD BUILD SCRIPT INCLUDE
|
|
|
|
SUBPROJECT_NAME=engine/element-wrappers
|
|
. "$KEYMAN_ROOT/web/common.inc.sh"
|
|
. "$KEYMAN_ROOT/resources/build/utils.inc.sh"
|
|
. "$KEYMAN_ROOT/resources/build/node.inc.sh"
|
|
|
|
# ################################ Main script ################################
|
|
|
|
builder_describe "Builds DOM-based OutputTarget subclasses used by the Keyman Engine for Web (KMW)." \
|
|
"@/web/src/engine/js-processor" \
|
|
"clean" \
|
|
"configure" \
|
|
"build" \
|
|
"test"
|
|
|
|
# Possible TODO?
|
|
# "upload-symbols Uploads build product to Sentry for error report symbolification. Only defined for $DOC_BUILD_EMBED_WEB" \
|
|
|
|
builder_describe_outputs \
|
|
configure /node_modules \
|
|
build /web/build/$SUBPROJECT_NAME/lib/index.mjs
|
|
|
|
builder_parse "$@"
|
|
|
|
#### Build action definitions ####
|
|
|
|
do_build () {
|
|
compile $SUBPROJECT_NAME
|
|
|
|
$BUNDLE_CMD "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/obj/index.js" \
|
|
--out "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}/lib/index.mjs" \
|
|
--format esm
|
|
}
|
|
|
|
builder_run_action configure node_select_version_and_npm_ci
|
|
builder_run_action clean rm -rf "$KEYMAN_ROOT/web/build/$SUBPROJECT_NAME"
|
|
builder_run_action build do_build
|
|
|
|
# No headless tests for this child project. Currently, DOM-based unit &
|
|
# integrated tests are run solely by the top-level $KEYMAN_ROOT/web project. |