-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3130 from keymanapp/refactor/web/engine/web-utils…
…-package refactor(web/engine): Moves common utility functions into separate `web-utils` package
- Loading branch information
Showing
38 changed files
with
198 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Build products | ||
src/environment.inc.ts | ||
|
||
# Legacy build folders. | ||
output/ | ||
build/ | ||
embedded/ | ||
|
||
# Current build output folder (matches standard node publish location). | ||
dist/ | ||
|
||
# Other local files. | ||
node_modules/ | ||
unit_tests/modernizr.js | ||
source/environment.inc.ts | ||
**/.idea/**/*.xml | ||
**/*.iml | ||
**/*.kpj.user |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "@keymanapp/web-utils", | ||
"version": "14.0.76", | ||
"description": "Common utility functions used throughout other Keyman packages", | ||
"main": "index.js", | ||
"scripts": { | ||
"tsc": "tsc" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/keymanapp/keyman.git" | ||
}, | ||
"author": "SIL International", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/keymanapp/keyman/issues" | ||
}, | ||
"homepage": "https://github.com/keymanapp/keyman#readme", | ||
"devDependencies": { | ||
"typescript": "^3.7.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#! /bin/bash | ||
# | ||
# Compiles common TS-based utility functions for use among Keyman's codebase | ||
|
||
## START STANDARD BUILD SCRIPT INCLUDE | ||
# adjust relative paths as necessary | ||
THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" | ||
SCRIPT_DIR="$(dirname "$THIS_SCRIPT")" | ||
KEYMAN_ROOT="$(dirname "$THIS_SCRIPT")/../../../../.." | ||
. "$KEYMAN_ROOT/resources/build/build-utils.sh" | ||
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" | ||
## END STANDARD BUILD SCRIPT INCLUDE | ||
|
||
display_usage ( ) { | ||
echo "build.sh [-skip-dependency-install]" | ||
echo | ||
echo " -skip-dependency-install skips the `lerna bootstrap` dependency check." | ||
echo " (or -S) Intended for use when this script is called by another build script." | ||
echo "" | ||
echo " If more than one target is specified, the last one will take precedence." | ||
exit 1 | ||
} | ||
|
||
# Establish default build parameters | ||
set_default_vars ( ) { | ||
FETCH_DEPS=true | ||
} | ||
|
||
set_default_vars | ||
|
||
# Generates a linkable TS file; defined in resources/build-utils.sh. | ||
exportEnvironmentDefinitionTS | ||
|
||
# Parse args | ||
while [[ $# -gt 0 ]] ; do | ||
key="$1" | ||
case $key in | ||
-skip-package-install|-S) | ||
set_default_vars | ||
FETCH_DEPS=false | ||
;; | ||
esac | ||
shift # past argument | ||
done | ||
|
||
if [ $FETCH_DEPS = true ]; then | ||
verify_npm_setup | ||
fi | ||
|
||
# Definition of global compile constants | ||
OUTPUT_DIR="dist" | ||
OUTPUT="index.js" | ||
|
||
# Ensures that we rely first upon the local npm-based install of Typescript. | ||
# (Facilitates automated setup for build agents.) | ||
PATH="../node_modules/.bin:$PATH" | ||
|
||
compiler="npm run tsc --" | ||
compilecmd="$compiler" | ||
|
||
$compilecmd -p "$SCRIPT_DIR/tsconfig.json" | ||
if [ $? -ne 0 ]; then | ||
fail "Utility-function package compilation failed." | ||
fi |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// References all utility includes from a single file, making import/export simple. | ||
///<reference path="deepCopy.ts" /> | ||
///<reference path="globalObject.ts" /> | ||
///<reference path="version.ts" /> | ||
///<reference path="kmwstring.ts" /> |
8 changes: 6 additions & 2 deletions
8
.../keyboard-processor/src/text/kmwstring.ts → common/core/web/utils/src/kmwstring.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"module": "none", | ||
"outDir": "../dist/", | ||
"inlineSources": true, | ||
"sourceMap": true, | ||
"target": "es5", | ||
"types": ["node"], | ||
"lib": ["es6"], | ||
"outFile": "../dist/index.js" | ||
}, | ||
"files": [ | ||
"index.ts" | ||
] | ||
} |
2 changes: 1 addition & 1 deletion
2
...b/keyboard-processor/src/utils/version.ts → common/core/web/utils/src/version.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.