chore(web): renames app/webview output, preserves name within embedding apps

This commit is contained in:
Joshua A. Horton 2023-04-12 09:00:17 +07:00
parent dd34a2606b
commit 7b7fa52a95
12 changed files with 24 additions and 24 deletions

3
android/.gitignore vendored
View file

@ -34,7 +34,8 @@ gradle_models.ser
KMEA/**/assets/ajax-loader.gif
KMEA/**/assets/keymanandroid.js
KMEA/**/assets/keyman.js.map
KMEA/**/assets/keymanandroid.js.map
KMEA/**/assets/keymanweb-webview.js
KMEA/**/assets/keymanweb-webview.js.map
KMEA/**/assets/sentry.min.js
KMEA/**/assets/keyman-sentry.js
KMEA/**/assets/es6-shim.min.js

View file

@ -15,7 +15,7 @@
polyfill.
-->
<script src="es6-shim.min.js"></script>
<script src="keymanandroid.js"></script>
<script src="keymanweb-webview.js"></script>
<script src="sentry.min.js"></script>
<script src="keyman-sentry.js"></script>
<script src="android-host.js"></script>

View file

@ -293,8 +293,8 @@ public final class KMManager {
// Keyman files
protected static final String KMFilename_KeyboardHtml = "keyboard.html";
protected static final String KMFilename_JSEngine = "keymanandroid.js";
protected static final String KMFilename_JSEngine_Sourcemap = "keyman.js.map";
protected static final String KMFilename_JSEngine = "keymanweb-webview.js";
protected static final String KMFilename_JSEngine_Sourcemap = "keymanweb-webview.js.map";
protected static final String KMFilename_JSSentry = "sentry.min.js";
protected static final String KMFilename_JSSentryInit = "keyman-sentry.js";
protected static final String KMFilename_AndroidHost = "android-host.js";

View file

@ -50,7 +50,7 @@ if builder_is_debug_build; then
fi
builder_describe_outputs \
configure:engine /android/KMEA/app/src/main/assets/keymanandroid.js \
configure:engine /android/KMEA/app/src/main/assets/keymanweb-webview.js \
build:engine /android/KMEA/app/build/outputs/aar/${CONFIG}/keyman-engine.aar
#### Build
@ -75,8 +75,8 @@ if builder_start_action configure:engine; then
# Copy KeymanWeb artifacts
echo "Copying Keyman Web artifacts"
cp "$KEYMAN_WEB_ROOT/build/app/webview/$CONFIG/index.js" "$ENGINE_ASSETS/keymanandroid.js"
cp "$KEYMAN_WEB_ROOT/build/app/webview/$CONFIG/index.js.map" "$ENGINE_ASSETS/keymanandroid.js.map"
cp "$KEYMAN_WEB_ROOT/build/app/webview/$CONFIG/index.js" "$ENGINE_ASSETS/keymanweb-webview.js"
cp "$KEYMAN_WEB_ROOT/build/app/webview/$CONFIG/index.js.map" "$ENGINE_ASSETS/keymanweb-webview.js.map"
cp "$KEYMAN_WEB_ROOT/build/app/resources/osk/ajax-loader.gif" "$ENGINE_ASSETS/ajax-loader.gif"
cp "$KEYMAN_WEB_ROOT/build/app/resources/osk/kmwosk.css" "$ENGINE_ASSETS/kmwosk.css"
cp "$KEYMAN_WEB_ROOT/build/app/resources/osk/globe-hint.css" "$ENGINE_ASSETS/globe-hint.css"

View file

@ -26,8 +26,7 @@ export class KeymanSentryManager {
static STANDARD_ALIASABLE_FILES = {
'keymanweb.js': 'keymanweb.js',
'keymanandroid.js': 'keyman.js', // Android's embedded name -> embedded compilation
'keymanios.js': 'keyman.js', // iOS's embedded name -> embedded compilation
'keymanweb-webview.js': 'keymanweb-webview.js',
'kmwuibutton.js': 'kmwuibutton.js',
'kmwuifloat.js': 'kmwuifloat.js',
'kmwuitoggle.js': 'kmwuitoggle.js',
@ -49,8 +48,6 @@ export class KeymanSentryManager {
return null;
}
filename = KeymanSentryManager.STANDARD_ALIASABLE_FILES[filename];
switch(location.protocol) {
case 'http:':
return 'http://' + location.host + '/' + filename;

2
ios/.gitignore vendored
View file

@ -15,6 +15,8 @@ engine/KMEI/KeymanEngine/resources/Keyman.bundle/Contents/Resources/keymanios.js
engine/KMEI/KeymanEngine/resources/Keyman.bundle/Contents/Resources/keymanweb-osk.ttf
engine/KMEI/KeymanEngine/resources/Keyman.bundle/Contents/Resources/kmwosk.css
engine/KMEI/KeymanEngine/resources/Keyman.bundle/Contents/Resources/keyman.js.map
engine/KMEI/KeymanEngine/resources/Keyman.bundle/Contents/Resources/keymanweb-webview.js
engine/KMEI/KeymanEngine/resources/Keyman.bundle/Contents/Resources/keymanweb-webview.js.map
engine/KMEI/KeymanEngine/resources/Keyman.bundle/Contents/Resources/keyman-sentry.js
engine/KMEI/KeymanEngine/resources/Keyman.bundle/Contents/Resources/sentry.min.js
Keyman 2*

View file

@ -225,7 +225,7 @@ extension Storage {
dstDir: baseDir,
excludeFromBackup: true)
try Storage.copy(from: bundle,
resourceName: "keymanios.js",
resourceName: "keymanweb-webview.js",
dstDir: baseDir,
excludeFromBackup: true)
try Storage.copy(from: bundle,
@ -237,9 +237,9 @@ extension Storage {
dstDir: baseDir,
excludeFromBackup: true)
// For debug compilations - IF we have a sourcemap file, copy that over too.
if bundle.url(forResource: "keyman.js.map", withExtension: nil) != nil {
if bundle.url(forResource: "keymanweb-webview.js.map", withExtension: nil) != nil {
try Storage.copy(from: bundle,
resourceName: "keyman.js.map",
resourceName: "keymanweb-webview.js.map",
dstDir: baseDir,
excludeFromBackup: true)
}

View file

@ -3,7 +3,7 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>Keyman</title>
<script src="keymanios.js"></script>
<script src="keymanweb-webview.js"></script>
<script src="sentry.min.js"></script>
<script src="keyman-sentry.js"></script>
<script src="ios-host.js"></script>

View file

@ -180,12 +180,12 @@ update_bundle ( ) {
#Copy over the relevant resources! It's easiest to do if we navigate to the resulting folder.
cp "$KEYMAN_ROOT/$KMW_RESOURCES/osk/kmwosk.css" "$base_dir/$BUNDLE_PATH/kmwosk.css"
cp "$KEYMAN_ROOT/$KMW_RESOURCES/osk/keymanweb-osk.ttf" "$base_dir/$BUNDLE_PATH/keymanweb-osk.ttf"
cp "$KEYMAN_ROOT/$KMW_PRODUCT/index.js" "$base_dir/$BUNDLE_PATH/keymanios.js"
cp "$KEYMAN_ROOT/$KMW_PRODUCT/keymanweb-webview.js" "$base_dir/$BUNDLE_PATH/keymanweb-webview.js"
if [ "$CONFIG" == "Debug" ]; then
cp "$KEYMAN_ROOT/$KMW_PRODUCT/index.js.map" "$base_dir/$BUNDLE_PATH/keyman.js.map"
elif [ -f "$base_dir/$BUNDLE_PATH/keyman.js.map" ]; then
rm "$base_dir/$BUNDLE_PATH/keyman.js.map"
cp "$KEYMAN_ROOT/$KMW_PRODUCT/keymanweb-webview.js.map" "$base_dir/$BUNDLE_PATH/keymanweb-webview.js.map"
elif [ -f "$base_dir/$BUNDLE_PATH/keymanweb-webview.js.map" ]; then
rm "$base_dir/$BUNDLE_PATH/keymanweb-webview.js.map"
fi
# Linked in by dependency for builder scripts... but this script isn't builder-based yet.

View file

@ -38,7 +38,7 @@ await esbuild.build({
entryPoints: {
'index': '../../../build/app/webview/obj/debug-main.js',
},
outfile: '../../../build/app/webview/debug/index.js',
outfile: '../../../build/app/webview/debug/keymanweb-webview.js',
plugins: [ es5ClassAnnotationAsPurePlugin ],
target: "es5",
treeShaking: true,
@ -56,7 +56,7 @@ await esbuild.build({
entryPoints: {
'index': '../../../build/app/webview/obj/release-main.js',
},
outfile: '../../../build/app/webview/release/index.js',
outfile: '../../../build/app/webview/release/keymanweb-webview.js',
plugins: [ es5ClassAnnotationAsPurePlugin ],
target: "es5",
treeShaking: true,

View file

@ -45,7 +45,7 @@ fi
builder_describe_outputs \
configure /node_modules \
build /web/build/$SUBPROJECT_NAME/$config/index.js
build /web/build/$SUBPROJECT_NAME/$config/keymanweb-webview.js
#### Build action definitions ####

View file

@ -39,8 +39,8 @@ fi
if builder_start_action build; then
mkdir -p "host/osk"
cp -R "$KEYMAN_ROOT/android/KMEA/app/src/main/assets/"* "host/"
cp "$KEYMAN_ROOT/web/build/app/webview/debug/index.js" "host/keymanandroid.js"
cp "$KEYMAN_ROOT/web/build/app/webview/debug/index.js.map" "host/keymanandroid.js.map"
cp "$KEYMAN_ROOT/web/build/app/webview/debug/keymanweb-webview.js" "host/keymanweb-webview.js"
cp "$KEYMAN_ROOT/web/build/app/webview/debug/keymanweb-webview.js.map" "host/keymanweb-webview.js.map"
cp "$KEYMAN_ROOT/web/build/app/resources/osk/ajax-loader.gif" "host/ajax-loader.gif"
cp "$KEYMAN_ROOT/web/build/app/resources/osk/kmwosk.css" "host/kmwosk.css"
cp "$KEYMAN_ROOT/web/build/app/resources/osk/globe-hint.css" "host/globe-hint.css"