Fixed declarations

This commit is contained in:
WolverinDEV 2019-07-03 14:15:57 +02:00
parent 94820eb6f4
commit 5733a250b0
4 changed files with 32 additions and 4 deletions

2
.gitignore vendored
View File

@ -15,6 +15,6 @@ updater/postzip/TeaClient-linux.tar.gz
.deploy_secret
**/*.d.ts
!modules/imports/copy_*
!modules/renderer/imports/copy_*.d.ts
package-lock.json

View File

@ -5,8 +5,8 @@ cd "${BASEDIR}"
file_paths=(
"$(pwd ~)/../../Web-Client/shared/declarations"
"$(pwd ~)/TeaSpeak/Web-Client/shared/declarations"
"$(pwd ~)/../../TeaSpeak/Web-Client/shared/declarations"
# "$(pwd ~)/TeaSpeak/Web-Client/shared/declarations"
# "$(pwd ~)/../../TeaSpeak/Web-Client/shared/declarations"
"app/dummy-declarations"
#TODO Windows path
)
@ -50,12 +50,36 @@ path_found=0
echo "Linking \"${path_target}/${dst_file}\" to \"${path}/${src_file}\""
cp "${path}/${src_file}" "${path_target}/copy_${dst_file}"
echo "Create copy \"${path_target}/${dst_file}\" to \"${path}/${src_file}\""
echo "Create copy \"${path}/${src_file}\" to \"${path_target}/copy_${dst_file}\""
done
break
done
}
if [[ ${path_found} -eq 0 ]]; then
echo "Could not import a link to shared imports. Trying copied import."
for file in "${files[@]}"
do
file_mapping=$(echo ${file_mapping} | tr ";" "\n")
dst_file=${file_mapping[1]}
if [[ -e "${path_target}/${dst_file}" ]] || [[ -L "${path_target}/${dst_file}" ]]; then
echo "Hmm target file already exists even thou it hasn't been found yet... Deleting it!"
rm "${path_target}/${dst_file}"
fi
if [[ ! -e "${path_target}/copy_${dst_file}" ]]; then
echo "Missing copy of file ${dst_file} because we cant find any valid link!"
exit 1
fi
ln -rs "${path_target}/copy_${dst_file}" "${path_target}/${dst_file}"
echo "Linking \"${path_target}/${dst_file}\" to \"${path_target}/copy_${dst_file}\""
done
path_found=1
fi
if [[ path_found -eq 0 ]]; then
echo "Failed to find UI imports"
echo "Add your path to 'file_paths' and build the declarations first"

View File

@ -16,6 +16,9 @@ function install_npm() {
function compile_scripts() {
begin_task "${project_name}_tsc_sass" "Compiling TypeScript & SASS"
./build_declarations.sh
check_err_exit ${project_name} "Failed to build shared ui import declarations!"
npm run compile-tsc -- -p modules/tsconfig_main.json
npm run compile-tsc -- -p modules/tsconfig_renderer.json
npm run compile-tsc -- -p installer/tsconfig_linux.json

View File

@ -9,6 +9,7 @@
"./renderer",
"./crash_handler",
"./shared",
"./shared/imports/*.d.ts",
"../native/*/exports/"
],