This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(website): fix website tests (#4080)
Also added npm command `compile_to_es5` to make running the website tests easier
- Loading branch information
Showing
9 changed files
with
81 additions
and
29 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
cd "$( dirname "${BASH_SOURCE[0]}" )/.." | ||
|
||
# Check number of parameters | ||
if [ "$#" -gt 0 ]; then | ||
echo "Usage: ./scripts/compile_to_es5.sh" | ||
exit 1 | ||
fi | ||
|
||
echo "Getting types for es6 promises..." | ||
npm install @types/es6-promise | ||
if [ $? -ne 0 ]; then | ||
echo -e "\033[0;31m" 1>&2 # Red | ||
echo "Couldn't get types for es6 promises." | ||
echo -e "\033[0m" 1>&2 # Normal Color | ||
exit 1 | ||
fi | ||
|
||
echo "Compiling down to es5..." | ||
node node_modules/typescript/bin/tsc --target es5 | ||
if [ $? -ne 0 ]; then | ||
echo -e "\033[0;31m" 1>&2 # Red | ||
echo "Couldn't compile for es5." | ||
echo -e "\033[0m" 1>&2 # Normal Color | ||
npm remove @types/es6-promise | ||
exit 1 | ||
fi | ||
|
||
echo "Uninstalling types for es6 promises..." | ||
npm remove @types/es6-promise | ||
if [ $? -ne 0 ]; then | ||
echo -e "\033[0;33m" 1>&2 # Yellow | ||
echo "Warning: couldn't uninstall types for es6 promises" | ||
echo -e "\033[0m" 1>&2 # Normal Color | ||
fi | ||
|
||
echo -e "\033[0;32m" # Green | ||
echo "Compiled to es5" | ||
echo -e "\033[0m" 1>&2 # Normal Color |
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