diff --git a/.eslintrc.json b/.eslintrc.json index 61da5b7d1..4f51b03bc 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -23,7 +23,6 @@ "ecmaVersion": 12, "sourceType": "module" }, - // "parser": "@typescript-eslint/parser", "rules": { "json/*": ["error"], "indent": ["off"], diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index f2e04639c..4110ff93a 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -28,20 +28,18 @@ jobs: - 'frontend/static/layouts/*.json' any-tsscss: - 'frontend/**/*.scss' - - 'frontend/**/*.js' - 'frontend/**/*.ts' - - 'backend/**/*.{js,ts}' + - 'backend/**/*.ts' ts-scss-fe: - - 'frontend/**/*.js' - 'frontend/**/*.ts' - 'frontend/**/*.scss' ts-be: - - 'backend/**/*.{js,ts}' + - 'backend/**/*.ts' anti-cheat: - 'backend/**/anticheat/**' - name: Create stub firebase config - working-directory: ./frontend/src/scripts/constants + working-directory: ./frontend/src/ts/constants run: mv ./firebase-config-example.ts ./firebase-config-live.ts - name: Check Anti-cheat diff --git a/.gitignore b/.gitignore index 3c0d78497..edaa84faa 100644 --- a/.gitignore +++ b/.gitignore @@ -78,8 +78,8 @@ node_modules_bak/ .firebaserc .firebaserc_copy serviceAccountKey*.json -frontend/src/scripts/constants/firebase-config.ts -frontend/src/scripts/constants/firebase-config-live.ts +frontend/src/ts/constants/firebase-config.ts +frontend/src/ts/constants/firebase-config-live.ts #generated files dist/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a751ef75c..af97aecba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,7 +64,7 @@ Alternatively, if you use `nvm` then you can run `nvm install` and `nvm use` (yo - Run `firebase projects:list` to find your firebase project id. -1. Within the `frontend/src/scripts/constants` directory, duplicate `firebase-config-example.ts`, rename it to `firebase-config.ts` and paste in your firebase config +1. Within the `frontend/src/ts/constants` directory, duplicate `firebase-config-example.ts`, rename it to `firebase-config.ts` and paste in your firebase config - To find it, go to the Firebase console - Navigate to `Project Settings > General > Your apps` diff --git a/frontend/gulpfile.js b/frontend/gulpfile.js index 2ab98e011..07e5e0a5b 100644 --- a/frontend/gulpfile.js +++ b/frontend/gulpfile.js @@ -8,7 +8,7 @@ const JSONValidation = require("./scripts/json-validation"); const eslintConfig = "../.eslintrc.json"; task("lint", function () { - return src(["./src/scripts/**/*.js", "./src/scripts/**/*.ts"]) + return src(["./src/ts/**/*.ts"]) .pipe(eslint(eslintConfig)) .pipe(eslint.format()) .pipe(eslint.failAfterError()); @@ -57,15 +57,7 @@ task( ); task("watch", function () { - watch( - [ - "./src/scripts/**/*.js", - "./src/scripts/**/*.ts", - "./src/scripts/*.js", - "./src/scripts/*.ts", - ], - series("lint") - ); + watch(["./src/ts/**/*.ts", "./src/ts/*.ts"], series("lint")); watch(["./static/**/*.*", "./static/*.*"], series("lint-json")); }); diff --git a/frontend/package.json b/frontend/package.json index ea3a0a1a0..e9a051264 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,7 +6,7 @@ "scripts": { "live": "npm run build:live && cd public && npx serve -p 5000", "audit": "npx webpack --config ./webpack/config.audit.js", - "dep-graph": "madge -c -i \"dep-graph.png\" ./src/scripts", + "dep-graph": "madge -c -i \"dep-graph.png\" ./src/ts", "build": "npx gulp build", "build:live": "npx gulp build-production", "dev": "concurrently \"webpack serve --config=./webpack/config.dev.js\" \"npx gulp watch\"", diff --git a/frontend/src/scripts/account/all-time-stats.ts b/frontend/src/ts/account/all-time-stats.ts similarity index 100% rename from frontend/src/scripts/account/all-time-stats.ts rename to frontend/src/ts/account/all-time-stats.ts diff --git a/frontend/src/scripts/account/mini-result-chart.ts b/frontend/src/ts/account/mini-result-chart.ts similarity index 100% rename from frontend/src/scripts/account/mini-result-chart.ts rename to frontend/src/ts/account/mini-result-chart.ts diff --git a/frontend/src/scripts/account/pb-tables.ts b/frontend/src/ts/account/pb-tables.ts similarity index 100% rename from frontend/src/scripts/account/pb-tables.ts rename to frontend/src/ts/account/pb-tables.ts diff --git a/frontend/src/scripts/account/result-filters.ts b/frontend/src/ts/account/result-filters.ts similarity index 100% rename from frontend/src/scripts/account/result-filters.ts rename to frontend/src/ts/account/result-filters.ts diff --git a/frontend/src/scripts/account/sign-out-button.ts b/frontend/src/ts/account/sign-out-button.ts similarity index 100% rename from frontend/src/scripts/account/sign-out-button.ts rename to frontend/src/ts/account/sign-out-button.ts diff --git a/frontend/src/scripts/ape/endpoints/ape-keys.ts b/frontend/src/ts/ape/endpoints/ape-keys.ts similarity index 100% rename from frontend/src/scripts/ape/endpoints/ape-keys.ts rename to frontend/src/ts/ape/endpoints/ape-keys.ts diff --git a/frontend/src/scripts/ape/endpoints/configs.ts b/frontend/src/ts/ape/endpoints/configs.ts similarity index 100% rename from frontend/src/scripts/ape/endpoints/configs.ts rename to frontend/src/ts/ape/endpoints/configs.ts diff --git a/frontend/src/scripts/ape/endpoints/index.ts b/frontend/src/ts/ape/endpoints/index.ts similarity index 100% rename from frontend/src/scripts/ape/endpoints/index.ts rename to frontend/src/ts/ape/endpoints/index.ts diff --git a/frontend/src/scripts/ape/endpoints/leaderboards.ts b/frontend/src/ts/ape/endpoints/leaderboards.ts similarity index 100% rename from frontend/src/scripts/ape/endpoints/leaderboards.ts rename to frontend/src/ts/ape/endpoints/leaderboards.ts diff --git a/frontend/src/scripts/ape/endpoints/presets.ts b/frontend/src/ts/ape/endpoints/presets.ts similarity index 100% rename from frontend/src/scripts/ape/endpoints/presets.ts rename to frontend/src/ts/ape/endpoints/presets.ts diff --git a/frontend/src/scripts/ape/endpoints/psas.ts b/frontend/src/ts/ape/endpoints/psas.ts similarity index 100% rename from frontend/src/scripts/ape/endpoints/psas.ts rename to frontend/src/ts/ape/endpoints/psas.ts diff --git a/frontend/src/scripts/ape/endpoints/quotes.ts b/frontend/src/ts/ape/endpoints/quotes.ts similarity index 100% rename from frontend/src/scripts/ape/endpoints/quotes.ts rename to frontend/src/ts/ape/endpoints/quotes.ts diff --git a/frontend/src/scripts/ape/endpoints/results.ts b/frontend/src/ts/ape/endpoints/results.ts similarity index 100% rename from frontend/src/scripts/ape/endpoints/results.ts rename to frontend/src/ts/ape/endpoints/results.ts diff --git a/frontend/src/scripts/ape/endpoints/users.ts b/frontend/src/ts/ape/endpoints/users.ts similarity index 100% rename from frontend/src/scripts/ape/endpoints/users.ts rename to frontend/src/ts/ape/endpoints/users.ts diff --git a/frontend/src/scripts/ape/index.ts b/frontend/src/ts/ape/index.ts similarity index 100% rename from frontend/src/scripts/ape/index.ts rename to frontend/src/ts/ape/index.ts diff --git a/frontend/src/scripts/ape/types/ape.d.ts b/frontend/src/ts/ape/types/ape.d.ts similarity index 100% rename from frontend/src/scripts/ape/types/ape.d.ts rename to frontend/src/ts/ape/types/ape.d.ts diff --git a/frontend/src/scripts/config-validation.ts b/frontend/src/ts/config-validation.ts similarity index 100% rename from frontend/src/scripts/config-validation.ts rename to frontend/src/ts/config-validation.ts diff --git a/frontend/src/scripts/config.ts b/frontend/src/ts/config.ts similarity index 100% rename from frontend/src/scripts/config.ts rename to frontend/src/ts/config.ts diff --git a/frontend/src/scripts/constants/default-config.ts b/frontend/src/ts/constants/default-config.ts similarity index 100% rename from frontend/src/scripts/constants/default-config.ts rename to frontend/src/ts/constants/default-config.ts diff --git a/frontend/src/scripts/constants/default-snapshot.ts b/frontend/src/ts/constants/default-snapshot.ts similarity index 100% rename from frontend/src/scripts/constants/default-snapshot.ts rename to frontend/src/ts/constants/default-snapshot.ts diff --git a/frontend/src/scripts/constants/firebase-config-example.ts b/frontend/src/ts/constants/firebase-config-example.ts similarity index 100% rename from frontend/src/scripts/constants/firebase-config-example.ts rename to frontend/src/ts/constants/firebase-config-example.ts diff --git a/frontend/src/scripts/controllers/account-controller.ts b/frontend/src/ts/controllers/account-controller.ts similarity index 100% rename from frontend/src/scripts/controllers/account-controller.ts rename to frontend/src/ts/controllers/account-controller.ts diff --git a/frontend/src/scripts/controllers/analytics-controller.ts b/frontend/src/ts/controllers/analytics-controller.ts similarity index 100% rename from frontend/src/scripts/controllers/analytics-controller.ts rename to frontend/src/ts/controllers/analytics-controller.ts diff --git a/frontend/src/scripts/controllers/challenge-controller.ts b/frontend/src/ts/controllers/challenge-controller.ts similarity index 100% rename from frontend/src/scripts/controllers/challenge-controller.ts rename to frontend/src/ts/controllers/challenge-controller.ts diff --git a/frontend/src/scripts/controllers/chart-controller.ts b/frontend/src/ts/controllers/chart-controller.ts similarity index 100% rename from frontend/src/scripts/controllers/chart-controller.ts rename to frontend/src/ts/controllers/chart-controller.ts diff --git a/frontend/src/scripts/controllers/input-controller.ts b/frontend/src/ts/controllers/input-controller.ts similarity index 100% rename from frontend/src/scripts/controllers/input-controller.ts rename to frontend/src/ts/controllers/input-controller.ts diff --git a/frontend/src/scripts/controllers/page-controller.ts b/frontend/src/ts/controllers/page-controller.ts similarity index 100% rename from frontend/src/scripts/controllers/page-controller.ts rename to frontend/src/ts/controllers/page-controller.ts diff --git a/frontend/src/scripts/controllers/preset-controller.ts b/frontend/src/ts/controllers/preset-controller.ts similarity index 100% rename from frontend/src/scripts/controllers/preset-controller.ts rename to frontend/src/ts/controllers/preset-controller.ts diff --git a/frontend/src/scripts/controllers/quotes-controller.ts b/frontend/src/ts/controllers/quotes-controller.ts similarity index 100% rename from frontend/src/scripts/controllers/quotes-controller.ts rename to frontend/src/ts/controllers/quotes-controller.ts diff --git a/frontend/src/scripts/controllers/route-controller.ts b/frontend/src/ts/controllers/route-controller.ts similarity index 100% rename from frontend/src/scripts/controllers/route-controller.ts rename to frontend/src/ts/controllers/route-controller.ts diff --git a/frontend/src/scripts/controllers/sound-controller.ts b/frontend/src/ts/controllers/sound-controller.ts similarity index 100% rename from frontend/src/scripts/controllers/sound-controller.ts rename to frontend/src/ts/controllers/sound-controller.ts diff --git a/frontend/src/scripts/controllers/tag-controller.ts b/frontend/src/ts/controllers/tag-controller.ts similarity index 100% rename from frontend/src/scripts/controllers/tag-controller.ts rename to frontend/src/ts/controllers/tag-controller.ts diff --git a/frontend/src/scripts/controllers/theme-controller.ts b/frontend/src/ts/controllers/theme-controller.ts similarity index 100% rename from frontend/src/scripts/controllers/theme-controller.ts rename to frontend/src/ts/controllers/theme-controller.ts diff --git a/frontend/src/scripts/controllers/verification-controller.ts b/frontend/src/ts/controllers/verification-controller.ts similarity index 100% rename from frontend/src/scripts/controllers/verification-controller.ts rename to frontend/src/ts/controllers/verification-controller.ts diff --git a/frontend/src/scripts/db.ts b/frontend/src/ts/db.ts similarity index 100% rename from frontend/src/scripts/db.ts rename to frontend/src/ts/db.ts diff --git a/frontend/src/scripts/elements/account-button.ts b/frontend/src/ts/elements/account-button.ts similarity index 100% rename from frontend/src/scripts/elements/account-button.ts rename to frontend/src/ts/elements/account-button.ts diff --git a/frontend/src/scripts/elements/commandline-lists.ts b/frontend/src/ts/elements/commandline-lists.ts similarity index 100% rename from frontend/src/scripts/elements/commandline-lists.ts rename to frontend/src/ts/elements/commandline-lists.ts diff --git a/frontend/src/scripts/elements/commandline.ts b/frontend/src/ts/elements/commandline.ts similarity index 100% rename from frontend/src/scripts/elements/commandline.ts rename to frontend/src/ts/elements/commandline.ts diff --git a/frontend/src/scripts/elements/custom-background-filter.ts b/frontend/src/ts/elements/custom-background-filter.ts similarity index 100% rename from frontend/src/scripts/elements/custom-background-filter.ts rename to frontend/src/ts/elements/custom-background-filter.ts diff --git a/frontend/src/scripts/elements/keymap.ts b/frontend/src/ts/elements/keymap.ts similarity index 100% rename from frontend/src/scripts/elements/keymap.ts rename to frontend/src/ts/elements/keymap.ts diff --git a/frontend/src/scripts/elements/last-10-average.ts b/frontend/src/ts/elements/last-10-average.ts similarity index 100% rename from frontend/src/scripts/elements/last-10-average.ts rename to frontend/src/ts/elements/last-10-average.ts diff --git a/frontend/src/scripts/elements/leaderboards.ts b/frontend/src/ts/elements/leaderboards.ts similarity index 100% rename from frontend/src/scripts/elements/leaderboards.ts rename to frontend/src/ts/elements/leaderboards.ts diff --git a/frontend/src/scripts/elements/loader.ts b/frontend/src/ts/elements/loader.ts similarity index 100% rename from frontend/src/scripts/elements/loader.ts rename to frontend/src/ts/elements/loader.ts diff --git a/frontend/src/scripts/elements/modes-notice.ts b/frontend/src/ts/elements/modes-notice.ts similarity index 100% rename from frontend/src/scripts/elements/modes-notice.ts rename to frontend/src/ts/elements/modes-notice.ts diff --git a/frontend/src/scripts/elements/monkey-power.ts b/frontend/src/ts/elements/monkey-power.ts similarity index 100% rename from frontend/src/scripts/elements/monkey-power.ts rename to frontend/src/ts/elements/monkey-power.ts diff --git a/frontend/src/scripts/elements/notifications.ts b/frontend/src/ts/elements/notifications.ts similarity index 100% rename from frontend/src/scripts/elements/notifications.ts rename to frontend/src/ts/elements/notifications.ts diff --git a/frontend/src/scripts/elements/psa.ts b/frontend/src/ts/elements/psa.ts similarity index 100% rename from frontend/src/scripts/elements/psa.ts rename to frontend/src/ts/elements/psa.ts diff --git a/frontend/src/scripts/elements/scroll-to-top.ts b/frontend/src/ts/elements/scroll-to-top.ts similarity index 100% rename from frontend/src/scripts/elements/scroll-to-top.ts rename to frontend/src/ts/elements/scroll-to-top.ts diff --git a/frontend/src/scripts/elements/theme-colors.ts b/frontend/src/ts/elements/theme-colors.ts similarity index 100% rename from frontend/src/scripts/elements/theme-colors.ts rename to frontend/src/ts/elements/theme-colors.ts diff --git a/frontend/src/scripts/elements/version-check.ts b/frontend/src/ts/elements/version-check.ts similarity index 100% rename from frontend/src/scripts/elements/version-check.ts rename to frontend/src/ts/elements/version-check.ts diff --git a/frontend/src/scripts/firebase.ts b/frontend/src/ts/firebase.ts similarity index 100% rename from frontend/src/scripts/firebase.ts rename to frontend/src/ts/firebase.ts diff --git a/frontend/src/scripts/index.ts b/frontend/src/ts/index.ts similarity index 96% rename from frontend/src/scripts/index.ts rename to frontend/src/ts/index.ts index a924c53a2..a672c07b3 100644 --- a/frontend/src/scripts/index.ts +++ b/frontend/src/ts/index.ts @@ -1,4 +1,4 @@ -// this file should be concatenated at the top of the legacy js files +// this file should be concatenated at the top of the legacy ts files import "../styles/index.scss"; import "./firebase"; diff --git a/frontend/src/scripts/modules.d.ts b/frontend/src/ts/modules.d.ts similarity index 100% rename from frontend/src/scripts/modules.d.ts rename to frontend/src/ts/modules.d.ts diff --git a/frontend/src/scripts/observables/config-event.ts b/frontend/src/ts/observables/config-event.ts similarity index 100% rename from frontend/src/scripts/observables/config-event.ts rename to frontend/src/ts/observables/config-event.ts diff --git a/frontend/src/scripts/observables/google-sign-up-event.ts b/frontend/src/ts/observables/google-sign-up-event.ts similarity index 100% rename from frontend/src/scripts/observables/google-sign-up-event.ts rename to frontend/src/ts/observables/google-sign-up-event.ts diff --git a/frontend/src/scripts/observables/timer-event.ts b/frontend/src/ts/observables/timer-event.ts similarity index 100% rename from frontend/src/scripts/observables/timer-event.ts rename to frontend/src/ts/observables/timer-event.ts diff --git a/frontend/src/scripts/pages/about.ts b/frontend/src/ts/pages/about.ts similarity index 100% rename from frontend/src/scripts/pages/about.ts rename to frontend/src/ts/pages/about.ts diff --git a/frontend/src/scripts/pages/account.ts b/frontend/src/ts/pages/account.ts similarity index 100% rename from frontend/src/scripts/pages/account.ts rename to frontend/src/ts/pages/account.ts diff --git a/frontend/src/scripts/pages/loading.ts b/frontend/src/ts/pages/loading.ts similarity index 100% rename from frontend/src/scripts/pages/loading.ts rename to frontend/src/ts/pages/loading.ts diff --git a/frontend/src/scripts/pages/login.ts b/frontend/src/ts/pages/login.ts similarity index 100% rename from frontend/src/scripts/pages/login.ts rename to frontend/src/ts/pages/login.ts diff --git a/frontend/src/scripts/pages/page.ts b/frontend/src/ts/pages/page.ts similarity index 100% rename from frontend/src/scripts/pages/page.ts rename to frontend/src/ts/pages/page.ts diff --git a/frontend/src/scripts/pages/settings.ts b/frontend/src/ts/pages/settings.ts similarity index 100% rename from frontend/src/scripts/pages/settings.ts rename to frontend/src/ts/pages/settings.ts diff --git a/frontend/src/scripts/pages/test.ts b/frontend/src/ts/pages/test.ts similarity index 100% rename from frontend/src/scripts/pages/test.ts rename to frontend/src/ts/pages/test.ts diff --git a/frontend/src/scripts/popups/ape-keys-popup.ts b/frontend/src/ts/popups/ape-keys-popup.ts similarity index 100% rename from frontend/src/scripts/popups/ape-keys-popup.ts rename to frontend/src/ts/popups/ape-keys-popup.ts diff --git a/frontend/src/scripts/popups/contact-popup.ts b/frontend/src/ts/popups/contact-popup.ts similarity index 100% rename from frontend/src/scripts/popups/contact-popup.ts rename to frontend/src/ts/popups/contact-popup.ts diff --git a/frontend/src/scripts/popups/custom-test-duration-popup.ts b/frontend/src/ts/popups/custom-test-duration-popup.ts similarity index 100% rename from frontend/src/scripts/popups/custom-test-duration-popup.ts rename to frontend/src/ts/popups/custom-test-duration-popup.ts diff --git a/frontend/src/scripts/popups/custom-text-popup.ts b/frontend/src/ts/popups/custom-text-popup.ts similarity index 100% rename from frontend/src/scripts/popups/custom-text-popup.ts rename to frontend/src/ts/popups/custom-text-popup.ts diff --git a/frontend/src/scripts/popups/custom-theme-popup.ts b/frontend/src/ts/popups/custom-theme-popup.ts similarity index 100% rename from frontend/src/scripts/popups/custom-theme-popup.ts rename to frontend/src/ts/popups/custom-theme-popup.ts diff --git a/frontend/src/scripts/popups/custom-word-amount-popup.ts b/frontend/src/ts/popups/custom-word-amount-popup.ts similarity index 100% rename from frontend/src/scripts/popups/custom-word-amount-popup.ts rename to frontend/src/ts/popups/custom-word-amount-popup.ts diff --git a/frontend/src/scripts/popups/edit-preset-popup.ts b/frontend/src/ts/popups/edit-preset-popup.ts similarity index 100% rename from frontend/src/scripts/popups/edit-preset-popup.ts rename to frontend/src/ts/popups/edit-preset-popup.ts diff --git a/frontend/src/scripts/popups/edit-tags-popup.ts b/frontend/src/ts/popups/edit-tags-popup.ts similarity index 100% rename from frontend/src/scripts/popups/edit-tags-popup.ts rename to frontend/src/ts/popups/edit-tags-popup.ts diff --git a/frontend/src/scripts/popups/google-sign-up-popup.ts b/frontend/src/ts/popups/google-sign-up-popup.ts similarity index 100% rename from frontend/src/scripts/popups/google-sign-up-popup.ts rename to frontend/src/ts/popups/google-sign-up-popup.ts diff --git a/frontend/src/scripts/popups/import-export-settings-popup.ts b/frontend/src/ts/popups/import-export-settings-popup.ts similarity index 100% rename from frontend/src/scripts/popups/import-export-settings-popup.ts rename to frontend/src/ts/popups/import-export-settings-popup.ts diff --git a/frontend/src/scripts/popups/mobile-test-config-popup.ts b/frontend/src/ts/popups/mobile-test-config-popup.ts similarity index 100% rename from frontend/src/scripts/popups/mobile-test-config-popup.ts rename to frontend/src/ts/popups/mobile-test-config-popup.ts diff --git a/frontend/src/scripts/popups/pb-tables-popup.ts b/frontend/src/ts/popups/pb-tables-popup.ts similarity index 100% rename from frontend/src/scripts/popups/pb-tables-popup.ts rename to frontend/src/ts/popups/pb-tables-popup.ts diff --git a/frontend/src/scripts/popups/quote-approve-popup.ts b/frontend/src/ts/popups/quote-approve-popup.ts similarity index 100% rename from frontend/src/scripts/popups/quote-approve-popup.ts rename to frontend/src/ts/popups/quote-approve-popup.ts diff --git a/frontend/src/scripts/popups/quote-rate-popup.ts b/frontend/src/ts/popups/quote-rate-popup.ts similarity index 100% rename from frontend/src/scripts/popups/quote-rate-popup.ts rename to frontend/src/ts/popups/quote-rate-popup.ts diff --git a/frontend/src/scripts/popups/quote-report-popup.ts b/frontend/src/ts/popups/quote-report-popup.ts similarity index 100% rename from frontend/src/scripts/popups/quote-report-popup.ts rename to frontend/src/ts/popups/quote-report-popup.ts diff --git a/frontend/src/scripts/popups/quote-search-popup.ts b/frontend/src/ts/popups/quote-search-popup.ts similarity index 100% rename from frontend/src/scripts/popups/quote-search-popup.ts rename to frontend/src/ts/popups/quote-search-popup.ts diff --git a/frontend/src/scripts/popups/quote-submit-popup.ts b/frontend/src/ts/popups/quote-submit-popup.ts similarity index 100% rename from frontend/src/scripts/popups/quote-submit-popup.ts rename to frontend/src/ts/popups/quote-submit-popup.ts diff --git a/frontend/src/scripts/popups/result-tags-popup.ts b/frontend/src/ts/popups/result-tags-popup.ts similarity index 100% rename from frontend/src/scripts/popups/result-tags-popup.ts rename to frontend/src/ts/popups/result-tags-popup.ts diff --git a/frontend/src/scripts/popups/saved-texts-popup.ts b/frontend/src/ts/popups/saved-texts-popup.ts similarity index 100% rename from frontend/src/scripts/popups/saved-texts-popup.ts rename to frontend/src/ts/popups/saved-texts-popup.ts diff --git a/frontend/src/scripts/popups/share-test-settings-popup.ts b/frontend/src/ts/popups/share-test-settings-popup.ts similarity index 100% rename from frontend/src/scripts/popups/share-test-settings-popup.ts rename to frontend/src/ts/popups/share-test-settings-popup.ts diff --git a/frontend/src/scripts/popups/simple-popups.ts b/frontend/src/ts/popups/simple-popups.ts similarity index 100% rename from frontend/src/scripts/popups/simple-popups.ts rename to frontend/src/ts/popups/simple-popups.ts diff --git a/frontend/src/scripts/popups/support-popup.ts b/frontend/src/ts/popups/support-popup.ts similarity index 100% rename from frontend/src/scripts/popups/support-popup.ts rename to frontend/src/ts/popups/support-popup.ts diff --git a/frontend/src/scripts/popups/version-popup.ts b/frontend/src/ts/popups/version-popup.ts similarity index 100% rename from frontend/src/scripts/popups/version-popup.ts rename to frontend/src/ts/popups/version-popup.ts diff --git a/frontend/src/scripts/popups/word-filter-popup.ts b/frontend/src/ts/popups/word-filter-popup.ts similarity index 100% rename from frontend/src/scripts/popups/word-filter-popup.ts rename to frontend/src/ts/popups/word-filter-popup.ts diff --git a/frontend/src/scripts/ready.ts b/frontend/src/ts/ready.ts similarity index 100% rename from frontend/src/scripts/ready.ts rename to frontend/src/ts/ready.ts diff --git a/frontend/src/scripts/settings/language-picker.ts b/frontend/src/ts/settings/language-picker.ts similarity index 100% rename from frontend/src/scripts/settings/language-picker.ts rename to frontend/src/ts/settings/language-picker.ts diff --git a/frontend/src/scripts/settings/settings-group.ts b/frontend/src/ts/settings/settings-group.ts similarity index 100% rename from frontend/src/scripts/settings/settings-group.ts rename to frontend/src/ts/settings/settings-group.ts diff --git a/frontend/src/scripts/settings/theme-picker.ts b/frontend/src/ts/settings/theme-picker.ts similarity index 100% rename from frontend/src/scripts/settings/theme-picker.ts rename to frontend/src/ts/settings/theme-picker.ts diff --git a/frontend/src/scripts/states/active-page.ts b/frontend/src/ts/states/active-page.ts similarity index 100% rename from frontend/src/scripts/states/active-page.ts rename to frontend/src/ts/states/active-page.ts diff --git a/frontend/src/scripts/states/glarses-mode.ts b/frontend/src/ts/states/glarses-mode.ts similarity index 100% rename from frontend/src/scripts/states/glarses-mode.ts rename to frontend/src/ts/states/glarses-mode.ts diff --git a/frontend/src/scripts/states/page-transition.ts b/frontend/src/ts/states/page-transition.ts similarity index 100% rename from frontend/src/scripts/states/page-transition.ts rename to frontend/src/ts/states/page-transition.ts diff --git a/frontend/src/scripts/states/slow-timer.ts b/frontend/src/ts/states/slow-timer.ts similarity index 100% rename from frontend/src/scripts/states/slow-timer.ts rename to frontend/src/ts/states/slow-timer.ts diff --git a/frontend/src/scripts/states/test-active.ts b/frontend/src/ts/states/test-active.ts similarity index 100% rename from frontend/src/scripts/states/test-active.ts rename to frontend/src/ts/states/test-active.ts diff --git a/frontend/src/scripts/states/time.ts b/frontend/src/ts/states/time.ts similarity index 100% rename from frontend/src/scripts/states/time.ts rename to frontend/src/ts/states/time.ts diff --git a/frontend/src/scripts/test/british-english.ts b/frontend/src/ts/test/british-english.ts similarity index 100% rename from frontend/src/scripts/test/british-english.ts rename to frontend/src/ts/test/british-english.ts diff --git a/frontend/src/scripts/test/caps-warning.ts b/frontend/src/ts/test/caps-warning.ts similarity index 100% rename from frontend/src/scripts/test/caps-warning.ts rename to frontend/src/ts/test/caps-warning.ts diff --git a/frontend/src/scripts/test/caret.ts b/frontend/src/ts/test/caret.ts similarity index 100% rename from frontend/src/scripts/test/caret.ts rename to frontend/src/ts/test/caret.ts diff --git a/frontend/src/scripts/test/custom-text.ts b/frontend/src/ts/test/custom-text.ts similarity index 100% rename from frontend/src/scripts/test/custom-text.ts rename to frontend/src/ts/test/custom-text.ts diff --git a/frontend/src/scripts/test/english-punctuation.ts b/frontend/src/ts/test/english-punctuation.ts similarity index 100% rename from frontend/src/scripts/test/english-punctuation.ts rename to frontend/src/ts/test/english-punctuation.ts diff --git a/frontend/src/scripts/test/focus.ts b/frontend/src/ts/test/focus.ts similarity index 100% rename from frontend/src/scripts/test/focus.ts rename to frontend/src/ts/test/focus.ts diff --git a/frontend/src/scripts/test/funbox.ts b/frontend/src/ts/test/funbox.ts similarity index 100% rename from frontend/src/scripts/test/funbox.ts rename to frontend/src/ts/test/funbox.ts diff --git a/frontend/src/scripts/test/layout-emulator.ts b/frontend/src/ts/test/layout-emulator.ts similarity index 100% rename from frontend/src/scripts/test/layout-emulator.ts rename to frontend/src/ts/test/layout-emulator.ts diff --git a/frontend/src/scripts/test/lazy-mode.ts b/frontend/src/ts/test/lazy-mode.ts similarity index 100% rename from frontend/src/scripts/test/lazy-mode.ts rename to frontend/src/ts/test/lazy-mode.ts diff --git a/frontend/src/scripts/test/live-acc.ts b/frontend/src/ts/test/live-acc.ts similarity index 100% rename from frontend/src/scripts/test/live-acc.ts rename to frontend/src/ts/test/live-acc.ts diff --git a/frontend/src/scripts/test/live-burst.ts b/frontend/src/ts/test/live-burst.ts similarity index 100% rename from frontend/src/scripts/test/live-burst.ts rename to frontend/src/ts/test/live-burst.ts diff --git a/frontend/src/scripts/test/live-wpm.ts b/frontend/src/ts/test/live-wpm.ts similarity index 100% rename from frontend/src/scripts/test/live-wpm.ts rename to frontend/src/ts/test/live-wpm.ts diff --git a/frontend/src/scripts/test/manual-restart-tracker.ts b/frontend/src/ts/test/manual-restart-tracker.ts similarity index 100% rename from frontend/src/scripts/test/manual-restart-tracker.ts rename to frontend/src/ts/test/manual-restart-tracker.ts diff --git a/frontend/src/scripts/test/monkey.ts b/frontend/src/ts/test/monkey.ts similarity index 100% rename from frontend/src/scripts/test/monkey.ts rename to frontend/src/ts/test/monkey.ts diff --git a/frontend/src/scripts/test/out-of-focus.ts b/frontend/src/ts/test/out-of-focus.ts similarity index 100% rename from frontend/src/scripts/test/out-of-focus.ts rename to frontend/src/ts/test/out-of-focus.ts diff --git a/frontend/src/scripts/test/pace-caret.ts b/frontend/src/ts/test/pace-caret.ts similarity index 100% rename from frontend/src/scripts/test/pace-caret.ts rename to frontend/src/ts/test/pace-caret.ts diff --git a/frontend/src/scripts/test/pb-crown.ts b/frontend/src/ts/test/pb-crown.ts similarity index 100% rename from frontend/src/scripts/test/pb-crown.ts rename to frontend/src/ts/test/pb-crown.ts diff --git a/frontend/src/scripts/test/poetry.ts b/frontend/src/ts/test/poetry.ts similarity index 100% rename from frontend/src/scripts/test/poetry.ts rename to frontend/src/ts/test/poetry.ts diff --git a/frontend/src/scripts/test/practise-words.ts b/frontend/src/ts/test/practise-words.ts similarity index 100% rename from frontend/src/scripts/test/practise-words.ts rename to frontend/src/ts/test/practise-words.ts diff --git a/frontend/src/scripts/test/replay.ts b/frontend/src/ts/test/replay.ts similarity index 100% rename from frontend/src/scripts/test/replay.ts rename to frontend/src/ts/test/replay.ts diff --git a/frontend/src/scripts/test/result.ts b/frontend/src/ts/test/result.ts similarity index 100% rename from frontend/src/scripts/test/result.ts rename to frontend/src/ts/test/result.ts diff --git a/frontend/src/scripts/test/shift-tracker.ts b/frontend/src/ts/test/shift-tracker.ts similarity index 100% rename from frontend/src/scripts/test/shift-tracker.ts rename to frontend/src/ts/test/shift-tracker.ts diff --git a/frontend/src/scripts/test/test-config.ts b/frontend/src/ts/test/test-config.ts similarity index 100% rename from frontend/src/scripts/test/test-config.ts rename to frontend/src/ts/test/test-config.ts diff --git a/frontend/src/scripts/test/test-input.ts b/frontend/src/ts/test/test-input.ts similarity index 100% rename from frontend/src/scripts/test/test-input.ts rename to frontend/src/ts/test/test-input.ts diff --git a/frontend/src/scripts/test/test-logic.ts b/frontend/src/ts/test/test-logic.ts similarity index 100% rename from frontend/src/scripts/test/test-logic.ts rename to frontend/src/ts/test/test-logic.ts diff --git a/frontend/src/scripts/test/test-state.ts b/frontend/src/ts/test/test-state.ts similarity index 100% rename from frontend/src/scripts/test/test-state.ts rename to frontend/src/ts/test/test-state.ts diff --git a/frontend/src/scripts/test/test-stats.ts b/frontend/src/ts/test/test-stats.ts similarity index 100% rename from frontend/src/scripts/test/test-stats.ts rename to frontend/src/ts/test/test-stats.ts diff --git a/frontend/src/scripts/test/test-timer.ts b/frontend/src/ts/test/test-timer.ts similarity index 100% rename from frontend/src/scripts/test/test-timer.ts rename to frontend/src/ts/test/test-timer.ts diff --git a/frontend/src/scripts/test/test-ui.ts b/frontend/src/ts/test/test-ui.ts similarity index 100% rename from frontend/src/scripts/test/test-ui.ts rename to frontend/src/ts/test/test-ui.ts diff --git a/frontend/src/scripts/test/test-words.ts b/frontend/src/ts/test/test-words.ts similarity index 100% rename from frontend/src/scripts/test/test-words.ts rename to frontend/src/ts/test/test-words.ts diff --git a/frontend/src/scripts/test/timer-progress.ts b/frontend/src/ts/test/timer-progress.ts similarity index 100% rename from frontend/src/scripts/test/timer-progress.ts rename to frontend/src/ts/test/timer-progress.ts diff --git a/frontend/src/scripts/test/today-tracker.ts b/frontend/src/ts/test/today-tracker.ts similarity index 100% rename from frontend/src/scripts/test/today-tracker.ts rename to frontend/src/ts/test/today-tracker.ts diff --git a/frontend/src/scripts/test/tts.ts b/frontend/src/ts/test/tts.ts similarity index 100% rename from frontend/src/scripts/test/tts.ts rename to frontend/src/ts/test/tts.ts diff --git a/frontend/src/scripts/test/weak-spot.ts b/frontend/src/ts/test/weak-spot.ts similarity index 100% rename from frontend/src/scripts/test/weak-spot.ts rename to frontend/src/ts/test/weak-spot.ts diff --git a/frontend/src/scripts/test/wikipedia.ts b/frontend/src/ts/test/wikipedia.ts similarity index 98% rename from frontend/src/scripts/test/wikipedia.ts rename to frontend/src/ts/test/wikipedia.ts index 5812e422b..3e3931e59 100644 --- a/frontend/src/scripts/test/wikipedia.ts +++ b/frontend/src/ts/test/wikipedia.ts @@ -94,22 +94,22 @@ export async function getSection(language: string): Promise
{ // Converting to one paragraph sectionText = sectionText.replace(/<\/p>

+/g, " "); - + // Convert HTML to text sectionText = $("

").html(sectionText).text(); - + // Remove reference links sectionText = sectionText.replace(/\[\d+\]/gi, ""); - + // Remove invisible characters sectionText = sectionText.replace(/[\u200B-\u200D\uFEFF]/g, ""); - + // Convert all whitespace to space sectionText = sectionText.replace(/\s+/g, " "); - + // Removing whitespace before and after text sectionText = sectionText.trim(); - + const words = sectionText.split(" "); const section = new Section( diff --git a/frontend/src/scripts/test/wordset.ts b/frontend/src/ts/test/wordset.ts similarity index 100% rename from frontend/src/scripts/test/wordset.ts rename to frontend/src/ts/test/wordset.ts diff --git a/frontend/src/scripts/types/types.d.ts b/frontend/src/ts/types/types.d.ts similarity index 100% rename from frontend/src/scripts/types/types.d.ts rename to frontend/src/ts/types/types.d.ts diff --git a/frontend/src/scripts/ui.ts b/frontend/src/ts/ui.ts similarity index 100% rename from frontend/src/scripts/ui.ts rename to frontend/src/ts/ui.ts diff --git a/frontend/src/scripts/utils/misc.ts b/frontend/src/ts/utils/misc.ts similarity index 100% rename from frontend/src/scripts/utils/misc.ts rename to frontend/src/ts/utils/misc.ts diff --git a/frontend/src/scripts/utils/search-service.ts b/frontend/src/ts/utils/search-service.ts similarity index 100% rename from frontend/src/scripts/utils/search-service.ts rename to frontend/src/ts/utils/search-service.ts diff --git a/frontend/src/scripts/utils/strings.ts b/frontend/src/ts/utils/strings.ts similarity index 100% rename from frontend/src/scripts/utils/strings.ts rename to frontend/src/ts/utils/strings.ts diff --git a/frontend/src/scripts/utils/url-handler.ts b/frontend/src/ts/utils/url-handler.ts similarity index 100% rename from frontend/src/scripts/utils/url-handler.ts rename to frontend/src/ts/utils/url-handler.ts diff --git a/frontend/src/scripts/version.ts b/frontend/src/ts/version.ts similarity index 100% rename from frontend/src/scripts/version.ts rename to frontend/src/ts/version.ts diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 3034dd549..d2acd0495 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -44,5 +44,5 @@ "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, "include": ["./src/**/*.ts"], - "files": ["src/scripts/modules.d.ts"] + "files": ["src/ts/modules.d.ts"] } diff --git a/frontend/webpack/config.base.js b/frontend/webpack/config.base.js index 575d469b3..a9c089ca3 100644 --- a/frontend/webpack/config.base.js +++ b/frontend/webpack/config.base.js @@ -24,7 +24,7 @@ const htmlWebpackPlugins = [ /** @type { import('webpack').Configuration } */ const BASE_CONFIG = { entry: { - monkeytype: resolve(__dirname, "../src/scripts/index.ts"), + monkeytype: resolve(__dirname, "../src/ts/index.ts"), }, resolve: { extensions: [".ts", ".js"] }, output: { diff --git a/frontend/webpack/config.prod.js b/frontend/webpack/config.prod.js index 59cee9c6a..7f2dbca22 100644 --- a/frontend/webpack/config.prod.js +++ b/frontend/webpack/config.prod.js @@ -52,17 +52,6 @@ const PRODUCTION_CONFIG = { flags: "g", }, }, - // { - // test: /\.m?js$/, - // exclude: /(node_modules)/, - // use: { - // loader: "babel-loader", - // options: { - // presets: ["@babel/preset-env"], - // plugins: ["@babel/plugin-transform-runtime"], - // }, - // }, - // }, ], }, optimization: { diff --git a/package.json b/package.json index f1ba01c55..042df42ff 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,9 @@ "deploy:live": "cd frontend && npm run deploy:live", "install:all": "sh ./bin/install.sh", "install:windows": ".\\bin\\install.cmd", - "lint": "eslint \"./backend/**/*.{ts,js}\" \"./frontend/src/scripts/**/*.{ts,js}\"", + "lint": "eslint \"./backend/**/*.ts\" \"./frontend/src/ts/**/*.ts\"", "build:live": "cd ./frontend && npm run build:live", - "pretty": "prettier --check './backend/**/*.js' './frontend/src/**/*.{js,scss}' './frontend/static/**/*.{json,html}'", + "pretty": "prettier --check './backend/**/*.ts' './frontend/src/**/*.{ts,scss}' './frontend/static/**/*.{json,html}'", "pr-check-lint-json": "cd frontend && npx gulp pr-check-lint-json", "pr-check-quote-json": "cd frontend && npx gulp pr-check-quote-json", "pr-check-language-json": "cd frontend && npx gulp pr-check-language-json",