Skip to content

Commit 8b93e04

Browse files
caswelltomclaude
andcommitted
v3.3.0: CDN frontend delivery + avatar refresh
Add optional CDN mode that serves JS/CSS from an external CDN instead of Moodle's filesystem, decoupling frontend updates from plugin upgrades. - Rollup build bundles all 10 AMD modules into single sola.min.js (224KB) - Mini AMD loader with shims for core/ajax (fetch) and core/str (pre-loaded i18n) - Two new admin settings: CDN Base URL + CDN Asset Version (cache busting) - GitHub Actions workflow auto-deploys to gh-pages on push - Clearing CDN URL reverts to local AMD files (zero-risk fallback) - CDN setting strings added to all 46 languages - Replaced avatar SVGs 02-10 with optimized PNGs (13-22KB each) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a9daca1 commit 8b93e04

File tree

59 files changed

+2982
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2982
-5
lines changed

.github/workflows/cdn-deploy.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy CDN Assets
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'amd/src/**'
8+
- 'styles.css'
9+
- 'cdn/**'
10+
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
build-and-deploy:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '22'
27+
28+
- name: Install dependencies
29+
working-directory: cdn
30+
run: npm ci
31+
32+
- name: Build CDN bundle
33+
working-directory: cdn
34+
run: npm run build
35+
36+
- name: Write manifest
37+
working-directory: cdn/dist
38+
run: |
39+
SHA=$(echo $GITHUB_SHA | cut -c1-8)
40+
echo "{\"version\":\"${SHA}\",\"built\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}" > manifest.json
41+
42+
- name: Deploy to GitHub Pages
43+
uses: peaceiris/actions-gh-pages@v4
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
publish_dir: cdn/dist
47+
publish_branch: gh-pages
48+
force_orphan: true

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
*.bak
1818
*.orig
1919

20+
# CDN build output
21+
cdn/dist/
22+
cdn/node_modules/
23+
2024
# Local dev overrides
2125
*.local.php
2226
config.local.php

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
1212
SOLA (Saylor Online Learning Assistant) is a Moodle local plugin that provides an AI-powered learning coach embedded in course pages. Students interact via a floating chat widget.
1313

1414
- **Plugin component:** `local_ai_course_assistant`
15-
- **Current version:** `2026022802`, release `0.8.0`
15+
- **Current version:** `2026032601`, release `3.3.0`
1616
- **Source folder:** `~/Library/CloudStorage/Dropbox/!Saylor/aicoursetutor/ai_course_assistant/`
1717
- **Zip for upload:** `~/Library/CloudStorage/Dropbox/!Saylor/aicoursetutor/ai_course_assistant.zip`
1818
- **GitHub:** `https://github.com/tom4cam/sola-moodle-plugin` (private)

cdn/entry-bundle.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This file is a placeholder. The bundle-amd Rollup plugin generates the actual content
2+
// by concatenating the AMD loader, shims, and all source modules.
3+
// The CSS import is handled in the generated bundle.

0 commit comments

Comments
 (0)