Skip to content

Commit 9ed9ead

Browse files
committed
Update deps
1 parent a7e2e55 commit 9ed9ead

File tree

18 files changed

+163
-129
lines changed

18 files changed

+163
-129
lines changed

Cargo.lock

Lines changed: 120 additions & 109 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ tmc-langs-util = { path = "crates/tmc-langs-util" }
3939
tmc-mooc-client = { path = "crates/tmc-mooc-client" }
4040
tmc-server-mock = { path = "crates/helpers/tmc-server-mock" }
4141
tmc-testmycode-client = { path = "crates/tmc-testmycode-client" }
42-
ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "16362e1936b328f92cff3eedfd23f05c674aa336" }
42+
ts-rs = { git = "https://github.com/Heliozoa/ts-rs.git", rev = "769feca36b46854ee9a8660a1d8e18938763ba66" }
4343

4444
# [patch.'https://github.com/Heliozoa/ts-rs.git']
4545
# ts-rs = { path = "../ts-rs/ts-rs" }

crates/bindings/tmc-langs-node/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,18 @@ fn unset_setting(mut cx: FunctionContext) -> JsResult<JsValue> {
818818

819819
#[neon::main]
820820
fn main(mut cx: ModuleContext) -> NeonResult<()> {
821+
// do not use outside export_function argument
822+
fn unsafe_set_env(mut cx: FunctionContext) -> JsResult<JsNull> {
823+
parse_args!(cx, key: String, value: String);
824+
// SAFETY: node is single-threaded so calling set_var is always fine
825+
unsafe {
826+
std::env::set_var(key, value);
827+
}
828+
Ok(cx.null())
829+
}
830+
821831
cx.export_function("initLogging", init_logging)?;
832+
cx.export_function("setEnv", unsafe_set_env)?;
822833

823834
cx.export_function("checkstyle", checkstyle)?;
824835
cx.export_function("clean", clean)?;

crates/bindings/tmc-langs-node/ts/functions.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function getExercisePackagingConfiguration(
3434
export function listLocalCourseExercises(
3535
clientName: string,
3636
courseSlug: string
37-
): Array<types.LocalExercise>;
37+
): Array<types.LocalTmcExercise>;
3838
export function prepareSolution(exercisePath: string, outputPath: string): void;
3939
export function prepareStub(exercisePath: string, outputPath: string): void;
4040
export function prepareSubmission(

crates/bindings/tmc-langs-node/ts/tmc.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import tmc, { Token } from "./functions";
1+
import * as tmc from "./functions"
2+
import { Token } from "./functions";
23
import types, { Compression } from "./generated";
34

45
export { types, Token };
@@ -82,7 +83,7 @@ export class Tmc {
8283
return tmc.getExercisePackagingConfiguration(exercisePath);
8384
}
8485

85-
listLocalCourseExercises(courseSlug: string): Array<types.LocalExercise> {
86+
listLocalCourseExercises(courseSlug: string): Array<types.LocalTmcExercise> {
8687
return tmc.listLocalCourseExercises(this.clientName, courseSlug);
8788
}
8889

crates/tmc-langs-cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ dirs = "6.0.0"
2020
env_logger = "0.11.2"
2121
log = "0.4.14"
2222
rpassword = "7.0.0"
23-
schemars = "0.9.0"
23+
schemars = "1.0.4"
2424
serde = "1.0.136"
2525
serde_json = "1.0.78"
2626
tempfile = "3.3.0"
2727
thiserror = "2.0.3"
28-
toml = "0.8.2"
28+
toml = "0.9.2"
2929
url = "2.2.2"
3030
uuid = { version = "1.3.4", features = ["v4"] }
3131
walkdir = "2.3.2"

crates/tmc-langs-cli/bindings.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,12 @@ export type UpdatedExercise = { id: number, }
136136

137137
export type DownloadOrUpdateTmcCourseExercisesResult = { downloaded: Array<TmcExerciseDownload>, skipped: Array<TmcExerciseDownload>, failed?: Array<[TmcExerciseDownload, Array<string>]>, }
138138

139+
export type DownloadOrUpdateMoocCourseExercisesResult = { downloaded: Array<MoocExerciseDownload>, skipped: Array<MoocExerciseDownload>, failed?: Array<[MoocExerciseDownload, Array<string>]>, }
140+
139141
export type TmcExerciseDownload = { id: number, "course-slug": string, "exercise-slug": string, path: string, }
140142

143+
export type MoocExerciseDownload = { id: string, path: string, }
144+
141145
export type CombinedCourseData = { details: CourseDetails, exercises: Array<CourseExercise>, settings: CourseData, }
142146

143147
export type CourseDetails = { unlockables: Array<string>, exercises: Array<Exercise>, id: number, name: string, title: string, description: string | null,

crates/tmc-langs-cli/src/app.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,9 @@ mod test {
12501250
tmc_langs::UpdatedExercise,
12511251
// downloadOrUpdateCourseExercises
12521252
tmc_langs::DownloadOrUpdateTmcCourseExercisesResult,
1253+
tmc_langs::DownloadOrUpdateMoocCourseExercisesResult,
12531254
tmc_langs::TmcExerciseDownload,
1255+
tmc_langs::MoocExerciseDownload,
12541256
// getCourseData
12551257
tmc_langs::CombinedCourseData,
12561258
// getCourseDetails

crates/tmc-langs-framework/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ nom = { version = "8.0.0", features = ["alloc"] }
1818
nom-language = "0.1.0"
1919
once_cell = "1.9.0"
2020
regex = "1.10.6"
21-
schemars = "0.9.0"
21+
schemars = "1.0.4"
2222
serde = { version = "1.0.136", features = ["derive"] }
2323
serde_yaml = "0.9.10"
2424
subprocess = "0.2.8"

crates/tmc-langs-util/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ serde_path_to_error = "0.1.7"
2020
serde_yaml = "0.9.10"
2121
tempfile = "3.3.0"
2222
thiserror = "2.0.3"
23-
toml = "0.8.2"
23+
toml = "0.9.2"
2424
type-map = "0.5.0"
2525
walkdir = "2.3.2"
2626

0 commit comments

Comments
 (0)