-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gai: Work in progress on scripting extensions.
- Loading branch information
1 parent
f5661ad
commit 826a8c3
Showing
25 changed files
with
750 additions
and
182 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,6 @@ __pycache__ | |
|
||
*~ | ||
|
||
cfg_server_test.json | ||
venv | ||
env.sh |
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 |
---|---|---|
|
@@ -49,3 +49,5 @@ deploy-pat.sh | |
|
||
set_providers.sh | ||
|
||
web/lib/extensions/*.js | ||
web/index.html.new |
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,32 @@ | ||
#!/bin/sh | ||
set -euo pipefail | ||
|
||
base=$(dirname "$(realpath "$0")") | ||
cd "$base" || exit | ||
|
||
# if the tsc command is not installed tell the user to install typescript | ||
if ! [ -x "$(command -v tsc)" ]; then | ||
echo 'Error: Typescript is not installed. Install with "npm -g install typescript"' >&2 | ||
exit 1 | ||
fi | ||
|
||
src="lib/chat/scripting" | ||
ext_src="$src/extensions" | ||
|
||
# Compile the scripting api typescript to js | ||
mkdir -p ./web/lib | ||
tsc --outFile ./web/lib/extensions/chat.js $src/chat_scripting_api.ts | ||
|
||
# Build extensions | ||
cd $ext_src || exit | ||
for file in *.ts; do | ||
echo "Building extension $file" | ||
# rename the file to js | ||
jsfile=$(echo $file | sed 's/\.ts/\.js/') | ||
tsc --outFile "$jsfile" "$file" | ||
mv "$jsfile" "$base/web/lib/extensions/" | ||
done | ||
|
||
# Create a declaration file for development time use | ||
#tsc $SRC/chat_scripting_api.ts --declaration --emitDeclarationOnly --outDir $SRC | ||
|
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
Oops, something went wrong.