TeaWeb/scripts/build_declarations.sh
WolverinDEV 664f8b2abd
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 16:08:10 +01:00

57 lines
No EOL
1.6 KiB
Bash
Executable file

#!/usr/bin/env bash
BASEDIR=$(dirname "$0")
source "${BASEDIR}/resolve_commands.sh"
cd "$BASEDIR/../"
function generate_link() {
if [[ ! -L $2 ]] || [[ "${BASH_ARGV[0]}" == "force" ]]; then
if [[ -e $2 ]] || [[ -L $2 ]]; then
rm $2
fi
ln -rs $1 $2
fi
}
function replace_tribble() {
#${1} => file name
echo "$(cat ${1} | sed -E 's/\/\/\/[ ]+<reference [a-zA-Z.-=_ ]+\/>.*/\n/')" > ${1}
}
#Building the generator
./tools/build_dtsgen.sh
if [ $? -ne 0 ]; then
echo "Failed to build typescript declaration generator"
exit 1
fi
#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
npm run dtsgen -- --config web/tsconfig/dtsconfig.json -v
replace_tribble web/declarations/exports.d.ts
echo "Generated web declarations"
#Shared
npm run dtsgen -- --config shared/tsconfig/dtsconfig.json -v
replace_tribble shared/declarations/exports.d.ts
echo "Generated shared declarations"
#Now build the merged declaration for the shared project
#Link the declaration files (All interface declarations should be equal!)
if [[ ! -d shared/declarations ]]; then
mkdir shared/declarations
if [[ $? -ne 0 ]]; then
echo "Failed to create directory shared/declarations"
exit 1
fi
fi
generate_link client/declarations/exports.d.ts shared/declarations/imports_client.d.ts
generate_link web/declarations/exports.d.ts shared/declarations/imports_web.d.ts
#Last but not least the client imports
generate_link shared/declarations/exports.d.ts web/declarations/imports_shared.d.ts