TeaWeb/scripts/build_declarations.sh

69 lines
2.1 KiB
Bash
Raw Normal View History

2018-10-28 22:01:09 +00:00
#!/usr/bin/env bash
2018-10-28 22:59:15 +00:00
BASEDIR=$(dirname "$0")
2020-03-28 12:58:36 +00:00
# shellcheck disable=SC1090
2018-10-28 22:59:15 +00:00
source "${BASEDIR}/resolve_commands.sh"
2020-03-28 12:58:36 +00:00
cd "$BASEDIR/../" || { echo "Failed to enter parent directory!"; exit 1; }
2018-10-28 22:59:15 +00:00
2018-10-28 22:01:09 +00:00
function generate_link() {
Implemented the Material Design and fixed some bugs (#33) * cleaned up some files * Fundamental style update * Redesigned some style * fixed hostbanner popup * Removed old identity stuff * fixed close listener * Fixed changelog date * fixed release chat icons * fixed url * Fixed hostbanner * Uploaded missing images * Improved update handling * Improved script files * Fixed loading error and icon error * fixed Yes/No modal * Fixed loader issues with MS Edge * fixed modal style bug * Fixed control bar overflow for small devices * Improved error handling on identity creation * Logging generate error to terminal * fixed possible php error * fixed some possible loading errors when other files have'nt been already loaded. * removed debug message * Changed emsrcypten flags * Improved codec error handling * removed webassembly as required dependency * Improved and fixed channel tree issues * Improved the sliders * Removed unneeded files * fixed loader versions cache * second slight performance improved (dont animate elements anymore if they are not shown) * Fixed query visibility setting * not showing useless client infos for query clients * Added an auto reconnect system * Added a canceled message and increased reconnect interval * removed implemented todo * fixed repetitive channel names * Reworked the channel tree selected lines * Fixed channel tree names * Fixed name alignment * fixed the native client * added min width to the server select groups to avoid a disappearing effect on shrink * fixed bugged downloaded icons
2019-02-17 15:08:10 +00:00
if [[ ! -L $2 ]] || [[ "${BASH_ARGV[0]}" == "force" ]]; then
if [[ -e $2 ]] || [[ -L $2 ]]; then
2018-10-28 22:01:09 +00:00
rm $2
fi
ln -rs $1 $2
fi
}
2018-11-26 20:30:08 +00:00
function replace_tribble() {
#${1} => file name
echo "$(cat ${1} | sed -E 's/\/\/\/[ ]+<reference [a-zA-Z.-=_ ]+\/>.*/\n/')" > ${1}
}
2018-12-26 13:17:12 +00:00
2018-10-28 22:01:09 +00:00
2018-12-04 18:02:45 +00:00
#Building the generator
2020-03-28 12:58:36 +00:00
./tools/build_dtsgen.sh; _exit_code=$?
if [[ $_exit_code -ne 0 ]]; then
echo "Failed to build typescript declaration generator ($_exit_code)"
2018-12-04 18:02:45 +00:00
exit 1
fi
2020-03-28 12:58:36 +00:00
#Shared
./shared/generate_declarations.sh; _exit_code=$?
[[ $_exit_code -ne 0 ]] && {
echo "Failed to generate shared ($_exit_code)"
}
exit 0
2018-10-28 22:01:09 +00:00
#Easy going: Each "module" has it's exports and imports
#So lets first build the exports and ignore any errors
#Note: For the client we have to use the given file
#Web
2018-12-04 17:48:35 +00:00
npm run dtsgen -- --config web/tsconfig/dtsconfig.json -v
2018-11-26 20:30:08 +00:00
replace_tribble web/declarations/exports.d.ts
2018-10-28 22:01:09 +00:00
echo "Generated web declarations"
#Client
npm run dtsgen -- --config client/tsconfig/dtsconfig.json -v
replace_tribble client/declarations/exports.d.ts
echo "Generated client declarations"
2019-09-01 15:24:06 +00:00
#replace_tribble shared/declarations/exports.d.ts
2018-10-28 22:01:09 +00:00
echo "Generated shared declarations"
#Now build the merged declaration for the shared project
#Link the declaration files (All interface declarations should be equal!)
Implemented the Material Design and fixed some bugs (#33) * cleaned up some files * Fundamental style update * Redesigned some style * fixed hostbanner popup * Removed old identity stuff * fixed close listener * Fixed changelog date * fixed release chat icons * fixed url * Fixed hostbanner * Uploaded missing images * Improved update handling * Improved script files * Fixed loading error and icon error * fixed Yes/No modal * Fixed loader issues with MS Edge * fixed modal style bug * Fixed control bar overflow for small devices * Improved error handling on identity creation * Logging generate error to terminal * fixed possible php error * fixed some possible loading errors when other files have'nt been already loaded. * removed debug message * Changed emsrcypten flags * Improved codec error handling * removed webassembly as required dependency * Improved and fixed channel tree issues * Improved the sliders * Removed unneeded files * fixed loader versions cache * second slight performance improved (dont animate elements anymore if they are not shown) * Fixed query visibility setting * not showing useless client infos for query clients * Added an auto reconnect system * Added a canceled message and increased reconnect interval * removed implemented todo * fixed repetitive channel names * Reworked the channel tree selected lines * Fixed channel tree names * Fixed name alignment * fixed the native client * added min width to the server select groups to avoid a disappearing effect on shrink * fixed bugged downloaded icons
2019-02-17 15:08:10 +00:00
if [[ ! -d shared/declarations ]]; then
2018-10-28 22:01:09 +00:00
mkdir shared/declarations
Implemented the Material Design and fixed some bugs (#33) * cleaned up some files * Fundamental style update * Redesigned some style * fixed hostbanner popup * Removed old identity stuff * fixed close listener * Fixed changelog date * fixed release chat icons * fixed url * Fixed hostbanner * Uploaded missing images * Improved update handling * Improved script files * Fixed loading error and icon error * fixed Yes/No modal * Fixed loader issues with MS Edge * fixed modal style bug * Fixed control bar overflow for small devices * Improved error handling on identity creation * Logging generate error to terminal * fixed possible php error * fixed some possible loading errors when other files have'nt been already loaded. * removed debug message * Changed emsrcypten flags * Improved codec error handling * removed webassembly as required dependency * Improved and fixed channel tree issues * Improved the sliders * Removed unneeded files * fixed loader versions cache * second slight performance improved (dont animate elements anymore if they are not shown) * Fixed query visibility setting * not showing useless client infos for query clients * Added an auto reconnect system * Added a canceled message and increased reconnect interval * removed implemented todo * fixed repetitive channel names * Reworked the channel tree selected lines * Fixed channel tree names * Fixed name alignment * fixed the native client * added min width to the server select groups to avoid a disappearing effect on shrink * fixed bugged downloaded icons
2019-02-17 15:08:10 +00:00
if [[ $? -ne 0 ]]; then
2018-10-28 22:01:09 +00:00
echo "Failed to create directory shared/declarations"
exit 1
fi
fi
#Last but not least the client imports
2019-09-01 15:24:06 +00:00
generate_link shared/declarations/exports_app.d.ts web/declarations/imports_shared.d.ts
2019-08-30 21:06:39 +00:00
generate_link shared/declarations/exports_loader_app.d.ts web/declarations/imports_shared_loader.d.ts
2019-09-01 15:24:06 +00:00
generate_link shared/declarations/exports_app.d.ts client/declarations/imports_shared.d.ts
2019-08-30 21:06:39 +00:00
generate_link shared/declarations/exports_loader_app.d.ts client/declarations/imports_shared_loader.d.ts