mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-08 02:28:25 -05:00
[PR #1520] [MERGED] chore(socratiq): post-merge hygiene and bundle-drift CI guard #7386
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1520
Author: @profvjreddi
Created: 4/24/2026
Status: ✅ Merged
Merged: 4/24/2026
Merged by: @profvjreddi
Base:
dev← Head:cleanup/socratiq-hygiene📝 Commits (5)
af45de4chore(socratiq): remove orphan files and unused build configs11d32a0chore(socratiq): remove dead plugins from vite prod config858011achore(socratiq): rename package to @mlsysbook/socratiq6191335ci(socratiq): add bundle drift guard569bfebfix(socratiq): sync lock file with package.json and rebuild bundle📊 Changes
11 files changed (+696 additions, -1295 deletions)
View changed files
➕
.github/workflows/socratiq-bundle-drift.yml(+63 -0)📝
book/quarto/tools/scripts/socratiQ/bundle.js(+613 -641)📝
socratiq/package-lock.json(+16 -15)📝
socratiq/package.json(+3 -2)➖
socratiq/src_shadow/js/components/quiz/create_quiz_button_grp_original_with_good_reinialization.js.js(+0 -291)➖
socratiq/src_shadow/js/components/quiz/testQuiz copy.html(+0 -38)➖
socratiq/vite.config.coop.mjs(+0 -19)📝
socratiq/vite.config.prod.mjs(+1 -29)➖
socratiq/vite.dev.config.mjs(+0 -156)➖
socratiq/webpack.config copy 2.js(+0 -44)➖
socratiq/webpack.config.js(+0 -60)📄 Description
Summary
Post-merge cleanup for #1394 (SocratiQ). Four small, independently
reviewable commits:
zero importers or script references before removal:
webpack.config copy 2.js,testQuiz copy.htmlcreate_quiz_button_grp_original_with_good_reinialization.js.jswebpack.config.js(the widget fully uses Vite's single-file bundle)vite.config.coop.mjsandvite.dev.config.mjs(COOP/COEP headers are already applied by the active configs)
file-watcher/auto-refreshplugins fromvite.config.prod.mjs. Both were no-ops in production:configureServeris dev-only, and thefs.watch()call held anactive handle while only emitting logs. Also drops the now-unused
watch/unlinkSyncimports."injectchat"to"@mlsysbook/socratiq", add a real description, and mark"private": trueso it cannot be accidentally published to npm. Keeps
package-lock.jsonin sync.
socratiq-bundle-drift.ymlCI guard. The book ships aversion-controlled pre-built bundle at
book/quarto/tools/scripts/socratiQ/bundle.js. This workflow rebuildsthe bundle on any PR that touches widget sources / build config / lockfile
and fails if the committed bundle has drifted from what the sources
produce. Scoped
paths:keeps the cost bounded; explicitpermissions: contents: readkeeps it fork-safe.Net effect: +71 lines added, −641 lines removed, across code cleanup and
new CI guardrail. No functional behaviour change to the widget itself — the
committed
bundle.jsis untouched, so the rendered book is bit-identical.Test plan
the socratiq/package-lock.json change in commit 3)
cd socratiq && npm ci && npm run build:vitestill produces a bundlebyte-identical to the committed one
socratiq=true)Related
lazy-load), and adding tests for the 50K-LOC source tree.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.