merge: import

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas Winther
2026-10-30 14:41:36 +01:00
co-authored by Claude Opus 5.5
40 changed files with 2146 additions and 2 deletions
+6
View File
@@ -2,7 +2,9 @@ import type { AppConfig, AuthService, Feature, JobHandler, JobQueue, ServerConte
import { createApp, createJobQueue, loadConfig } from "@stc/core";
import { createCourseRepository } from "@stc/course-format";
import { connect, migrate } from "@stc/db";
import { importFeature } from "@stc/feature-import";
import { learnerFeature } from "@stc/feature-learner";
import { resolve } from "node:path";
import indexHtml from "../../web/index.html";
// Used until a feature supplies an `auth` service (the learner package does).
@@ -49,8 +51,12 @@ export async function startServer(
if (import.meta.main) {
const config = loadConfig();
// Contract request (import.md): core config should include <dataDir>/courses itself.
const generated = resolve(config.dataDir, "courses");
if (!config.courseDirs.some((c) => resolve(c) === generated)) config.courseDirs.push(generated);
const { server } = await startServer(config, [
learnerFeature,
(ctx) => importFeature(ctx),
]);
console.log(`STCourses listening on ${server.url}`);
}