Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions curl.txt

This file was deleted.

58 changes: 0 additions & 58 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// eslint.config.js
import js from '@eslint/js';
import globals from 'globals';
import react from 'eslint-plugin-react'; // For general React rules
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';
import prettierConfig from 'eslint-config-prettier';
import { defineConfig } from 'eslint/config';
Expand Down Expand Up @@ -94,59 +91,4 @@ export default defineConfig([
},
},

// --- 4. Configuration for Webview UI (React/TypeScript) ---
{
files: ['webview-ui/src/**/*.{ts,tsx}'], // Only apply to your React webview files
// Specific language options for the React part of the project
languageOptions: {
ecmaVersion: 2020, // Or 2021/2022 if your target environment supports it
sourceType: 'module',
// Define global variables for the browser environment
globals: {
...globals.browser,
},
// Specify the TypeScript parser for these files
parser: tseslint.parser,
// Configuration for the TypeScript parser, including JSX support
parserOptions: {
// project: ['./webview-ui/tsconfig.json'], // Path to your webview's tsconfig.json
tsconfigRootDir: import.meta.dirname,
ecmaFeatures: {
jsx: true, // Enable JSX parsing
},
},
},
// Define plugins specific to the React environment
plugins: {
react, // General React rules
'react-hooks': reactHooks, // Rules for React Hooks
'react-refresh': reactRefresh, // Rules for React Fast Refresh
},
// Specific rules for your React/TypeScript files
rules: {
// General React rules (e.g., props validation, accessibility)
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules, // Use this for React 17+ with new JSX transform

// React Hooks specific rules
...reactHooks.configs.recommended.rules,

// React Refresh specific rule
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],

// Override or add other React/TypeScript specific rules
'react/prop-types': 'off', // Often not needed with TypeScript
'react/react-in-jsx-scope': 'off', // Not needed for React 17+ with new JSX transform
'@typescript-eslint/explicit-function-return-type': 'off', // Often too verbose in React components
'semi': 'off', // Let Prettier handle semicolons
},
settings: {
react: {
version: 'detect', // Automatically detect the React version
},
},
},
]);
26 changes: 5 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"engines": {
"vscode": "^1.95.0"
},
"extensionDependencies": [
"vscode.git"
],
"categories": [
"Other"
],
Expand Down Expand Up @@ -42,17 +45,10 @@
"viewsContainers": {
"activitybar": [
{
"id": "reactWebview",
"id": "submittySidebar",
"title": "Submitty",
"icon": "media/duck.png"
}
],
"panel": [
{
"id": "reactWebview",
"title": "React Webview",
"icon": "$(file-code)"
}
]
},
"views": {
Expand All @@ -63,13 +59,6 @@
"name": "Sidebar",
"icon": "media/duck.png"
}
],
"reactWebview": [
{
"type": "webview",
"id": "reactWebview",
"name": "React Webview"
}
]
}
},
Expand All @@ -83,9 +72,7 @@
"lint:fix": "eslint --fix .",
"format": "prettier --write .",
"format:check": "prettier --check .",
"test": "vscode-test",
"build:webview-ui": "cd webview-ui && npm install && npm run build",
"watch:webview-ui": "cd webview-ui && npm run dev"
"test": "vscode-test"
},
"devDependencies": {
"@eslint/js": "^9.39.1",
Expand All @@ -96,9 +83,6 @@
"@vscode/test-electron": "^2.4.0",
"eslint": "^9.39.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.4.24",
"globals": "^16.5.0",
"prettier": "^3.3.3",
"rimraf": "^3.0.2",
Expand Down
17 changes: 6 additions & 11 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
import * as vscode from 'vscode';
import { SidebarProvider } from './sidebarProvider';
import ReactWebview from './reactWebview';
import { ExtensionContextUtil } from './util/extensionContextUtil';
import { ApiService } from './services/apiService';
import { TestingService } from './services/testingService';

export function activate(context: vscode.ExtensionContext) {
ExtensionContextUtil.getExtensionContext(context)
const sidebarProvider = new SidebarProvider(context);
export function activate(context: vscode.ExtensionContext): void {
const apiService = ApiService.getInstance(context, '');
const testingService = new TestingService(context, apiService);
const sidebarProvider = new SidebarProvider(context, testingService);

context.subscriptions.push(
vscode.window.registerWebviewViewProvider('submittyWebview', sidebarProvider)
);

context.subscriptions.push(
vscode.window.registerWebviewViewProvider(
ReactWebview.viewType,
ReactWebview.getInstance(context.extensionUri),
)
);
}

export function deactivate() { }

Check warning on line 17 in src/extension.ts

View workflow job for this annotation

GitHub Actions / test

Missing return type on function
42 changes: 42 additions & 0 deletions src/interfaces/AutoGraderDetails.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
export interface AutoGraderDetails {
status: string
data: AutoGraderDetailsData
}

export interface AutoGraderDetailsData {
is_queued: boolean
queue_position: number
is_grading: boolean
has_submission: boolean
autograding_complete: boolean
has_active_version: boolean
highest_version: number
total_points: number
total_percent: number
test_cases: TestCase[]
}

export interface TestCase {
name: string
details: string
is_extra_credit: boolean
points_available: number
has_extra_results: boolean
points_received: number
testcase_message: string
autochecks: Autocheck[]
}

export interface Autocheck {
description: string
messages: Message[]
diff_viewer: Record<string, string>
expected: string
actual: string
}

export interface Message {
message: string
type: string
}

8 changes: 8 additions & 0 deletions src/interfaces/Courses.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export interface Course {
semester: string;
title: string;
display_name: string;
display_semester: string;
user_group: number;
registration_section: string;
}
18 changes: 18 additions & 0 deletions src/interfaces/Gradables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export interface Gradable {
id: string
title: string
instructions_url: string
gradeable_type: string
syllabus_bucket: string
section: number
section_name: string
due_date: DueDate
vcs_repository: string
vcs_subdirectory: string
}

export interface DueDate {
date: string
timezone_type: number
timezone: string
}
20 changes: 20 additions & 0 deletions src/interfaces/Responses.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Course } from "./Courses";
import { Gradable } from "./Gradables";


export interface ApiResponse<T> {
status: string;
data: T;
message?: string;
}

export type CourseResponse = ApiResponse<{
unarchived_courses: Course[];
dropped_courses: Course[];
}>;

export type LoginResponse = ApiResponse<{
token: string;
}>;

export type GradableResponse = ApiResponse<Gradable[]>;
Loading
Loading