diff --git a/frontend/src/scripts/index.js b/frontend/src/scripts/index.ts similarity index 85% rename from frontend/src/scripts/index.js rename to frontend/src/scripts/index.ts index a5c96987c..47fbd081a 100644 --- a/frontend/src/scripts/index.js +++ b/frontend/src/scripts/index.ts @@ -1,17 +1,31 @@ /* eslint-disable no-unused-vars */ //this file should be concatenated at the top of the legacy js files +// @ts-ignore import Chart from "chart.js"; +// @ts-ignore import chartTrendline from "chartjs-plugin-trendline"; +// @ts-ignore import chartAnnotation from "chartjs-plugin-annotation"; Chart.plugins.register(chartTrendline); Chart.plugins.register(chartAnnotation); +// @ts-ignore import * as DB from "./db"; -import * as Misc from "./misc"; -import "./controllers/account-controller"; +// @ts-ignore import Config from "./config"; +// @ts-ignore +import * as TestStats from "./test/test-stats"; +// @ts-ignore +import * as Replay from "./test/replay"; +// @ts-ignore +import * as TestTimer from "./test/test-timer"; +// @ts-ignore +import * as Result from "./test/result"; +// @ts-ignore +import * as TestInput from "./test/test-input"; +import "./controllers/account-controller"; import { enable } from "./states/glarses-mode"; import "./test/caps-warning"; import "./popups/support-popup"; @@ -27,30 +41,30 @@ import "./popups/pb-tables-popup"; import "./elements/scroll-to-top"; import "./popups/mobile-test-config-popup"; import "./popups/edit-tags-popup"; -import * as TestStats from "./test/test-stats"; -import * as Replay from "./test/replay"; -import * as TestTimer from "./test/test-timer"; -import * as Result from "./test/result"; -import * as TestInput from "./test/test-input"; -//try to keep this list short because we need to eliminate it eventually -global.getuid = Misc.getuid; - -//these exports are just for debugging in the browser +// @ts-ignore global.snapshot = DB.getSnapshot; -global.config = Config; -// global.addnotif = Notifications.add; +// @ts-ignore +global.config = Config; + +// @ts-ignore global.glarsesMode = enable; +// @ts-ignore global.stats = TestStats.getStats; +// @ts-ignore global.replay = Replay.getReplayExport; +// @ts-ignore global.enableTimerDebug = TestTimer.enableTimerDebug; +// @ts-ignore global.getTimerStats = TestTimer.getTimerStats; +// @ts-ignore global.toggleUnsmoothedRaw = Result.toggleUnsmoothedRaw; +// @ts-ignore global.enableSpacingDebug = TestInput.enableSpacingDebug; diff --git a/frontend/webpack-production.config.js b/frontend/webpack-production.config.js index 5a1fdb864..cf5ff7bb3 100644 --- a/frontend/webpack-production.config.js +++ b/frontend/webpack-production.config.js @@ -5,7 +5,7 @@ let circularImportNum = 0; module.exports = { mode: "production", - entry: path.resolve(__dirname, "src/scripts/index.js"), + entry: path.resolve(__dirname, "src/scripts/index.ts"), resolve: { fallback: { crypto: require.resolve("crypto-browserify"), diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index 771ba9d06..d5be0ef86 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -6,7 +6,7 @@ let circularImportNum = 0; module.exports = { mode: "development", // Change to 'production' for production devtool: false, - entry: path.resolve(__dirname, "src/scripts/index.js"), + entry: path.resolve(__dirname, "src/scripts/index.ts"), resolve: { fallback: { crypto: require.resolve("crypto-browserify"),