index to ts

This commit is contained in:
Miodec 2022-02-13 00:10:19 +01:00
parent 0101eb5d07
commit 66997a1788
3 changed files with 29 additions and 15 deletions

View file

@ -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;

View file

@ -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"),

View file

@ -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"),