Skip to content

Commit

Permalink
fix(web): add dependency output
Browse files Browse the repository at this point in the history
This fixes building all dependencies, e.g. when running `./build.sh test`
which previously failed because it didn't build all necessary targets.
  • Loading branch information
ermshiperete committed Jul 4, 2024
1 parent 3fd1514 commit a1bdce0
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions web/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,32 @@ builder_describe "Builds engine modules for Keyman Engine for Web (KMW)." \
# 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

builder_parse "$@"

config=release
if builder_is_debug_build; then
config=debug
fi

builder_describe_outputs \
configure "/node_modules" \
build "/web/build/test/dom/cases/attachment/outputTargetForElement.spec.html" \
build:app/browser "/web/build/app/browser/lib/index.mjs" \
build:app/WebViews "/web/build/app/webview/${config}/keymanweb-webview.js" \
build:app/ui "/web/build/app/ui/${config}/kmwuitoggle.js" \
build:engine/attachment "/web/build/engine/attachment/lib/index.mjs" \
build:engine/device-detect "/web/build/engine/device-detect/lib/index.mjs" \
build:engine/dom-utils "/web/build/engine/dom-utils/obj/index.js" \
build:engine/events "/web/build/engine/events/lib/index.mjs" \
build:engine/element-wrappers "/web/build/engine/element-wrappers/lib/index.mjs" \
build:engine/main "/web/build/engine/main/lib/index.mjs" \
build:engine/osk "/web/build/engine/osk/lib/index.mjs" \
build:engine/package-cache "/web/build/engine/package-cache/lib/index.mjs" \
build:engine/paths "/web/build/engine/paths/lib/index.mjs" \
build:samples "/web/src/samples/simplest/keymanweb.js" \
build:tools "/web/build/tools/building/sourcemap-root/index.js" \
build:test-pages "/web/build/test-resources/sentry-manager.js"

BUNDLE_CMD="node ${KEYMAN_ROOT}/common/web/es-bundling/build/common-bundle.mjs"

#### Build action definitions ####
Expand All @@ -68,6 +89,8 @@ precompile() {
local DIR
DIR="$1"

builder_echo "Pre-compiling ${DIR}..."

# pre-compile bundle for use in DOM testing. When running in the browser several
# types built-in to Node aren't available, and @web/test-runner doesn't do
# treeshaking when loading the imports. We work around by pre-compiling.
Expand All @@ -79,6 +102,7 @@ precompile() {
}

build_action() {
builder_echo "Building auto tests..."
tsc --project "${KEYMAN_ROOT}/web/src/test/auto/tsconfig.json"

for dir in \
Expand Down

0 comments on commit a1bdce0

Please sign in to comment.