Files
blockly/tests/scripts/compile_typings.sh
Christopher Allen 37ecce8d80 Have npm run typings use built directory; fix typescript tests
* Modify scripts/gulpfiles/typings.js to write typings to BUILD_DIR.
* Modify tests/scripts/compile_typings.sh to check compilability of
  resulting output from BUILD_DIR.
* Rename checkin script to checkin:built, add a checkin:typings script
  to do the same for .d.ts files, and a new checkin script to do both.
* Have recompile run checkin:typings.
2021-06-30 15:34:54 +01:00

30 lines
614 B
Bash
Executable File

#!/bin/bash
# Location that npm run typings will write .d.ts files to.
readonly BUILD_DIR='built'
# ANSI colors
BOLD_GREEN='\033[1;32m'
BOLD_RED='\033[1;31m'
ANSI_RESET='\033[0m'
# Generate Blockly typings.
echo "Generating Blockly typings"
npm run typings
# Use the TypeScript compiler to compile the generated typings.
echo "Compiling typings"
cd "${BUILD_DIR}"
../node_modules/.bin/tsc blockly.d.ts
if [ $? -eq 0 ]
then
echo -e "${BOLD_GREEN}TypeScript typings compiled successfully.${ANSI_RESET}"
exit 0
else
echo -e "${BOLD_RED}Failed to compile TypeScript typings.${ANSI_RESET}" >&2
exit 1
fi