spiegel-keyman/web/src/tools/testing/bulk_rendering/build.sh
Joshua Horton b7975973af maint(web): ensure Web build scripts handle paths with spaces properly
The command shortcuts that were used by Web
scripts to create bundles via `esbuild` were not
properly handling the $KEYMAN_ROOT path when it
contained a space.  These changes will rectify
this behavior and permit builds for such cases.

Build-bot: skip build:web
Test-bot: skip
2026-02-18 09:14:30 +07:00

45 lines
No EOL
1.8 KiB
Bash
Executable file

#! /usr/bin/env bash
#
# Compile the KeymanWeb bulk-renderer module for use with developing/running engine tests.
## 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=tools/testing/bulk_rendering
. "$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 a 'bulk renderer' that loads all the cloud keyboards from api.keyman.com and renders each of them to a document." \
"@/web/src/app/browser build" \
"@/web/src/app/ui build" \
"clean" \
"configure runs 'npm ci' on root folder" \
"build (default) builds bulk_renderer to web/build/$SUBPROJECT_NAME/"
builder_describe_outputs \
configure /node_modules \
build /web/build/$SUBPROJECT_NAME/lib/bulk_render.js
builder_parse "$@"
function do_build ( ) {
tsc --build "$THIS_SCRIPT_PATH/tsconfig.json" $builder_verbose
node "${LIB_BUNDLER}" "${KEYMAN_ROOT}/web/build/$SUBPROJECT_NAME/obj/renderer_core.js" \
--out "${KEYMAN_ROOT}/web/build/$SUBPROJECT_NAME/lib/bulk_render.js" \
--sourceRoot "@keymanapp/keyman/web/build/$SUBPROJECT_NAME/lib/"
# To ensure it's available to the testing pages when served via localhost or build agent.
cp "${KEYMAN_ROOT}/node_modules/@zip.js/zip.js/dist/zip.min.js" \
"${KEYMAN_ROOT}/web/build/$SUBPROJECT_NAME/lib/zip.min.js"
}
builder_run_action configure node_select_version_and_npm_ci
builder_run_action clean rm -rf ../../../../build/$SUBPROJECT_NAME
builder_run_action build do_build