fix: enable added week deletion and preserve learning concepts when cloning courses

This commit is contained in:
2026-09-22 15:32:22 +09:00
parent 1d959e2c51
commit 33aac68f16
18 changed files with 633 additions and 61 deletions
+21
View File
@@ -0,0 +1,21 @@
import { AsyncLocalStorage } from 'node:async_hooks'
export const moduleProgress = new AsyncLocalStorage<(message: string) => void>()
export function reportModuleProgress(message: string): void {
moduleProgress.getStore()?.(message)
}
export function createModuleProgressParser(): (chunk: string) => void {
const report = moduleProgress.getStore()
let pending = ''
return (chunk) => {
if (!report) return
pending += chunk
const lines = pending.split('\n')
pending = lines.pop()!.slice(-4096)
for (const line of lines) {
if (line.startsWith('LMS_MODULE_PROGRESS:')) report(line.slice('LMS_MODULE_PROGRESS:'.length).trim())
}
}
}