diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 000000000..0d2c8db78 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,55 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --type=bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +rm -rf dist + +#npx prettier -w . +npx --yes -p prettier@latest -p pretty-quick pretty-quick +git update-index --again + +# If there are whitespace errors, print the offending file names and fail. +#exec git diff-index --check --cached $against -- diff --git a/.gitignore b/.gitignore index e9f3f39c9..9629f85c1 100644 --- a/.gitignore +++ b/.gitignore @@ -19,5 +19,6 @@ api/assets/plugins/*.js bundle/depclean.* *.tmp tmp/ - -assets/cache/ \ No newline at end of file +assets/cache/ +*.generated +initial.json diff --git a/.prettierrc b/.prettierrc index 0defea238..cf69bed02 100644 --- a/.prettierrc +++ b/.prettierrc @@ -2,5 +2,7 @@ "tabWidth": 4, "useTabs": true, "printWidth": 140, - "trailingComma": "none" -} \ No newline at end of file + "trailingComma": "none", + "pluginSearchDirs": ["./node_modules"], + "plugins": ["prettier-plugin-organize-imports"] +} diff --git a/assets/checkLocale.js b/assets/checkLocale.js index 016d66c80..091add1fc 100644 --- a/assets/checkLocale.js +++ b/assets/checkLocale.js @@ -1,47 +1,47 @@ - const localStorage = window.localStorage; - // TODO: remote auth - // window.GLOBAL_ENV.REMOTE_AUTH_ENDPOINT = window.GLOBAL_ENV.GATEWAY_ENDPOINT.replace(/wss?:/, ""); - localStorage.setItem("gatewayURL", window.GLOBAL_ENV.GATEWAY_ENDPOINT); - localStorage.setItem( - "DeveloperOptionsStore", - `{"trace":false,"canary":false,"logGatewayEvents":true,"logOverlayEvents":true,"logAnalyticsEvents":true,"sourceMapsEnabled":false,"axeEnabled":false}` - ); +const localStorage = window.localStorage; +// TODO: remote auth +// window.GLOBAL_ENV.REMOTE_AUTH_ENDPOINT = window.GLOBAL_ENV.GATEWAY_ENDPOINT.replace(/wss?:/, ""); +localStorage.setItem("gatewayURL", window.GLOBAL_ENV.GATEWAY_ENDPOINT); +localStorage.setItem( + "DeveloperOptionsStore", + `{"trace":false,"canary":false,"logGatewayEvents":true,"logOverlayEvents":true,"logAnalyticsEvents":true,"sourceMapsEnabled":false,"axeEnabled":false}` +); - const supportedLocales = [ - "bg", - "cs", - "da", - "de", - "el", - "en-GB", - "es-ES", - "fi", - "fr", - "hi", - "hr", - "hu", - "it", - "ja", - "ko", - "lt", - "nl", - "no", - "pl", - "pt-BR", - "ro", - "ru", - "sv-SE", - "th", - "tr", - "uk", - "vi", - "zh-CN", - "zh-TW" - ]; +const supportedLocales = [ + "bg", + "cs", + "da", + "de", + "el", + "en-GB", + "es-ES", + "fi", + "fr", + "hi", + "hr", + "hu", + "it", + "ja", + "ko", + "lt", + "nl", + "no", + "pl", + "pt-BR", + "ro", + "ru", + "sv-SE", + "th", + "tr", + "uk", + "vi", + "zh-CN", + "zh-TW" +]; - const settings = JSON.parse(localStorage.getItem("UserSettingsStore")); - if (settings && !supportedLocales.includes(settings.locale)) { - // fix client locale wrong and client not loading at all - settings.locale = "en-US"; - localStorage.setItem("UserSettingsStore", JSON.stringify(settings)); - } \ No newline at end of file +const settings = JSON.parse(localStorage.getItem("UserSettingsStore")); +if (settings && !supportedLocales.includes(settings.locale)) { + // fix client locale wrong and client not loading at all + settings.locale = "en-US"; + localStorage.setItem("UserSettingsStore", JSON.stringify(settings)); +} diff --git a/assets/developers.html b/assets/developers.html index 87595e779..b33009ddd 100644 --- a/assets/developers.html +++ b/assets/developers.html @@ -1,44 +1,42 @@ +
+ + - - - + + +