refactor: Replace Webpack with Vite (#53)

This commit is contained in:
Razboy20
2024-01-24 19:40:30 -06:00
committed by GitHub
parent 1629c85818
commit 0560a01a55
112 changed files with 7322 additions and 32180 deletions

View File

@@ -1,8 +1,7 @@
import { Serialized } from 'chrome-extension-toolkit';
import { Course, Status, InstructionMode, ScrapedRow, Semester } from 'src/shared/types/Course';
import { CourseSchedule } from 'src/shared/types/CourseSchedule';
import Instructor from 'src/shared/types/Instructor';
import { SiteSupport } from 'src/views/lib/getSiteSupport';
import { Course, InstructionMode, ScrapedRow, Semester, Status } from '@shared/types/Course';
import { CourseSchedule } from '@shared/types/CourseSchedule';
import Instructor from '@shared/types/Instructor';
import { SiteSupport } from '@views/lib/getSiteSupport';
/**
* The selectors that we use to scrape the course catalog list table (https://utdirect.utexas.edu/apps/registrar/course_schedule/20239/results/?fos_fl=C+S&level=U&search_type_main=FIELD)

View File

@@ -1,7 +1,8 @@
import initSqlJs from 'sql.js/dist/sql-wasm';
const WASM_FILE_URL = chrome.runtime.getURL('database/sql-wasm.wasm');
const DB_FILE_URL = chrome.runtime.getURL('database/grades.db');
import DB_FILE_URL from '@public/database/grades.db?url';
import WASM_FILE_URL from 'sql.js/dist/sql-wasm.wasm?url';
// import WASM_FILE_URL from '../../../../public/database/sql-wasm.wasm?url';
/**
* A utility type for the SQL.js Database type

View File

@@ -1,5 +1,5 @@
import { Course, Semester } from 'src/shared/types/Course';
import { CourseSQLRow, Distribution } from 'src/shared/types/Distribution';
import { Course, Semester } from '@shared/types/Course';
import { CourseSQLRow, Distribution } from '@shared/types/Distribution';
import { initializeDB } from './initializeDB';
/**

View File

@@ -9,6 +9,7 @@ export enum AutoLoadStatus {
LOADING = 'LOADING',
IDLE = 'IDLE',
ERROR = 'ERROR',
DONE = 'DONE',
}
let isLoading = false;
@@ -24,7 +25,7 @@ let nextPageURL = getNextButton(document)?.href;
export async function loadNextCourseCatalogPage(): Promise<[AutoLoadStatus, HTMLTableRowElement[]]> {
// if there is no more nextPageURL, then we have reached the end of the course catalog, so we can stop
if (!nextPageURL) {
return [AutoLoadStatus.IDLE, []];
return [AutoLoadStatus.DONE, []];
}
// remove the next button so that we don't load the same page twice
removePaginationButtons(document);