fix(editor): bundle Monaco locally to fix stuck Loading state and CSP block

- Add monaco-editor to frontend deps and configure @monaco-editor/react
  to use the local bundle via loader.config({ monaco }) instead of
  fetching from cdn.jsdelivr.net (blocked by CSP scriptSrc: self)
- Wire editorWorker via Vite ?worker syntax — blob: URLs already
  permitted by existing workerSrc CSP directive, no CSP changes needed
- fix(ci): use DOCS_REPO_TOKEN in release-please so tag creation
  cascades to docker-publish.yml (GITHUB_TOKEN cannot trigger workflows)
- fix(ci): auto-merge screenshots PR via gh pr merge --auto --squash
This commit is contained in:
SaelixCode
2026-03-24 19:43:55 -04:00
parent f93d5bd194
commit 79fde6e2bd
6 changed files with 35 additions and 1 deletions
+14
View File
@@ -3,6 +3,20 @@ import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.tsx'
import ErrorBoundary from './components/ErrorBoundary.tsx'
import * as monaco from 'monaco-editor'
import { loader } from '@monaco-editor/react'
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
// Use the locally bundled Monaco instead of fetching from cdn.jsdelivr.net.
// The CSP (scriptSrc: 'self') blocks external CDN scripts; bundling avoids
// that entirely. Sencho only needs YAML/plaintext so the base editorWorker
// covers all language modes — no additional language workers required.
window.MonacoEnvironment = {
getWorker(_workerId: string, _label: string): Worker {
return new editorWorker()
},
}
loader.config({ monaco })
createRoot(document.getElementById('root')!).render(
<StrictMode>