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
17 changes: 6 additions & 11 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
{
"printWidth": 110,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"quoteProps": "consistent",
"jsxSingleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": true,
"arrowParens": "always"
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"arrowParens": "always",
"endOfLine": "lf",
"printWidth": 100,
"tabWidth": 4,
"trailingComma": "all"
}
6 changes: 2 additions & 4 deletions backend/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import bodyParser from "body-parser";
import express, { Response } from "express";

import {
Course,
CourseDetails,
Expand All @@ -13,7 +10,6 @@ import {
SubmissionResponse,
SubmissionStatusReport,
} from "../src/api/types";

import { applicationRouter, langsRounter, oauthRouter } from "./controllers";
import {
BackendCourse,
Expand All @@ -27,6 +23,8 @@ import {
passingExerciseId,
respondWithFile,
} from "./utils";
import bodyParser from "body-parser";
import express, { Response } from "express";

const PORT = 4001;

Expand Down
5 changes: 2 additions & 3 deletions backend/setup.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import * as config from "../config";
import { getLangsCLIForPlatform, getPlatform } from "../src/utilities/env";
import archiver from "archiver";
import fs from "fs";
import { ncp } from "ncp";
import path from "path";

import * as config from "../config";
import { getLangsCLIForPlatform, getPlatform } from "../src/utilities/env";

const TMC_LANGS_DL_URL = config.productionApi.__TMC_LANGS_DL_URL__.replace(/"/g, "");
const TMC_LANGS_VERSION = config.productionApi.__TMC_LANGS_VERSION__.replace(/"/g, "");

Expand Down
5 changes: 2 additions & 3 deletions backend/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import { Response } from "express";
import path from "path";

import {
Course,
CourseDetails,
Expand All @@ -12,6 +9,8 @@ import {
Organization,
SubmissionResultReport,
} from "../src/api/types";
import { Response } from "express";
import path from "path";

interface CreateOrganizationParams {
information: string;
Expand Down
6 changes: 3 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import prettier from "eslint-plugin-prettier";
import sortClassMembers from "eslint-plugin-sort-class-members";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand Down
51 changes: 47 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -457,13 +457,6 @@
"eslint src --cache --max-warnings 0"
]
},
"prettier": {
"arrowParens": "always",
"endOfLine": "lf",
"printWidth": 100,
"tabWidth": 4,
"trailingComma": "all"
},
"dependencies": {
"@aws-crypto/sha256-js": "^5.2.0",
"del": "^8.0.0",
Expand All @@ -486,6 +479,7 @@
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.10.0",
"@playwright/test": "1.46.1",
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/chai": "^4.3.3",
"@types/chai-as-promised": "^7.1.8",
"@types/du": "^1.0.3",
Expand Down Expand Up @@ -513,7 +507,7 @@
"husky": "^9.1.5",
"lint-staged": "^15.2.9",
"mocha": "^10.7.3",
"prettier": "^3.3.3",
"prettier": "^3.6.2",
"raw-loader": "^4.0.2",
"terser-webpack-plugin": "^5.3.10",
"tmp": "0.2.3",
Expand Down
3 changes: 1 addition & 2 deletions playwright/pages/course.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { FrameLocator, Page } from "@playwright/test";

import { TmcPage } from "./tmc";
import { FrameLocator, Page } from "@playwright/test";

export class CoursePage extends TmcPage {
constructor(
Expand Down
3 changes: 1 addition & 2 deletions playwright/pages/login.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { FrameLocator, Page } from "@playwright/test";

import { TmcPage } from "./tmc";
import { FrameLocator, Page } from "@playwright/test";

export class LoginPage extends TmcPage {
constructor(
Expand Down
3 changes: 1 addition & 2 deletions playwright/pages/my-courses.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { FrameLocator, Page } from "@playwright/test";

import { SelectCourse } from "./select-course";
import { SelectOrganization } from "./select-organization";
import { TmcPage } from "./tmc";
import { FrameLocator, Page } from "@playwright/test";

export class MyCoursesPage extends TmcPage {
constructor(
Expand Down
3 changes: 1 addition & 2 deletions playwright/pages/select-course.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { FrameLocator, Page } from "@playwright/test";

import { TmcPage } from "./tmc";
import { FrameLocator, Page } from "@playwright/test";

export class SelectCourse extends TmcPage {
constructor(
Expand Down
3 changes: 1 addition & 2 deletions playwright/pages/select-organization.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { FrameLocator, Page } from "@playwright/test";

import { TmcPage } from "./tmc";
import { FrameLocator, Page } from "@playwright/test";

export class SelectOrganization extends TmcPage {
constructor(
Expand Down
3 changes: 1 addition & 2 deletions playwright/pages/test-results.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { FrameLocator, Page } from "@playwright/test";

import { TmcPage } from "./tmc";
import { FrameLocator, Page } from "@playwright/test";

export class TestResultsPage extends TmcPage {
constructor(
Expand Down
3 changes: 1 addition & 2 deletions playwright/pages/test-submission.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { FrameLocator, Page } from "@playwright/test";

import { TmcPage } from "./tmc";
import { FrameLocator, Page } from "@playwright/test";

export class TestSubmissionPage extends TmcPage {
constructor(
Expand Down
3 changes: 1 addition & 2 deletions playwright/tests/add-new-course.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { expect } from "@playwright/test";

import { vsCodeTest } from "../fixtures";
import { LoginPage } from "../pages/login";
import { MyCoursesPage } from "../pages/my-courses";
import { expect } from "@playwright/test";

vsCodeTest("can add new course", async ({ page, webview }) => {
const loginPage = new LoginPage(page, webview);
Expand Down
3 changes: 1 addition & 2 deletions playwright/tests/complete-exercise.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { expect } from "@playwright/test";

import { vsCodeTest } from "../fixtures";
import { CoursePage } from "../pages/course";
import { ExplorerPage } from "../pages/explorer";
import { LoginPage } from "../pages/login";
import { MyCoursesPage } from "../pages/my-courses";
import { TestResultsPage } from "../pages/test-results";
import { TestSubmissionPage } from "../pages/test-submission";
import { expect } from "@playwright/test";

type Exercise = {
course: string;
Expand Down
3 changes: 1 addition & 2 deletions playwright/tests/login.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { expect } from "@playwright/test";

import { vsCodeTest } from "../fixtures";
import { LoginPage } from "../pages/login";
import { expect } from "@playwright/test";

vsCodeTest("can interact with the login page", async ({ page, webview }) => {
const loginPage = new LoginPage(page, webview);
Expand Down
6 changes: 2 additions & 4 deletions shared/lib.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
/*
* ======== state ========
*/

import { Uri } from "vscode";
import * as util from "node:util";

import {
Course,
Organization,
RunResult,
StyleValidationResult,
SubmissionFinished,
} from "./langsSchema";
import * as util from "node:util";
import { createIs } from "typia";
import { Uri } from "vscode";

/**
* Contains the state of the webview.
Expand Down
4 changes: 1 addition & 3 deletions src/actions/addNewCourse.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Err, Result } from "ts-results";

import { LocalCourseData } from "../api/storage";
import { Logger } from "../utilities";
import { combineApiExerciseData } from "../utilities/apiData";

import { refreshLocalExercises } from "./refreshLocalExercises";
import { ActionContext } from "./types";
import { Err, Result } from "ts-results";

/**
* Adds a new course to user's courses.
Expand Down
6 changes: 2 additions & 4 deletions src/actions/checkForExerciseUpdates.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { flatten } from "lodash";
import { Err, Ok, Result } from "ts-results";

import { Logger } from "../utilities";

import { ActionContext } from "./types";
import { flatten } from "lodash";
import { Err, Ok, Result } from "ts-results";

interface Options {
forceRefresh?: boolean;
Expand Down
4 changes: 1 addition & 3 deletions src/actions/downloadNewExercisesForCourse.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Err, Ok, Result } from "ts-results";

import { TmcPanel } from "../panels/TmcPanel";
import { Logger } from "../utilities";

import { downloadOrUpdateExercises } from "./downloadOrUpdateExercises";
import { refreshLocalExercises } from "./refreshLocalExercises";
import { ActionContext } from "./types";
import { Err, Ok, Result } from "ts-results";

/**
* Downloads course's new exercises using relevate data from the context's UserData. Also handles
Expand Down
4 changes: 1 addition & 3 deletions src/actions/downloadOrUpdateExercises.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Err, Ok, Result } from "ts-results";

import { TmcPanel } from "../panels/TmcPanel";
import { ExtensionToWebview } from "../shared/shared";
import { ExerciseStatus } from "../ui/types";
import { Logger } from "../utilities";

import { ActionContext } from "./types";
import { Err, Ok, Result } from "ts-results";

interface DownloadResults {
successful: number[];
Expand Down
8 changes: 3 additions & 5 deletions src/actions/moveExtensionDataPath.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { Logger } from "../utilities";
import { refreshLocalExercises } from "./refreshLocalExercises";
import { ActionContext } from "./types";
import * as fs from "fs-extra";
import * as path from "path";
import { Err, Result } from "ts-results";
import * as vscode from "vscode";

import { Logger } from "../utilities";

import { refreshLocalExercises } from "./refreshLocalExercises";
import { ActionContext } from "./types";

/**
* Moves physical location of all exercises on disk. Closes active course workspace's exercises for
* the duration of transfer.
Expand Down
Loading
Loading