Skip to content

Commit f7283d9

Browse files
committed
hyperbook: package the embedded IDE for hyperbook
Everything needed to ship this fork's embedded build as a hyperbook element, kept apart from the IDE changes so that rebasing onto upstream stays cheap: - a release workflow that builds the embedded bundle and attaches it to a GitHub release - includeIDE.js points at onlineide2.openpatch.org rather than learnj.de - EmbeddedIndexedDB stores scripts and databases through hyperbook's own Dexie database instead of opening an IndexedDB of its own, so a reader's work lives with the rest of the book's state - package-lock.json is tracked (upstream ignores it) so the release workflow installs the exact tree that was tested The tables are reached as `hyperbook.store.db.sqlideScripts` and `.sqlideDatabases`. `hyperbook.store` itself only carries db, export, reset and import, so the tables were undefined one level up: open() took the "not available" branch, never called back, and nothing was ever loaded or saved.
1 parent 4b81b4d commit f7283d9

5 files changed

Lines changed: 1683 additions & 127 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release Embedded Build
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Build embedded
26+
run: npm run build-embedded
27+
28+
- name: Remove source maps
29+
run: find dist-embedded -name "*.map" -type f -delete
30+
31+
- name: Create zip file
32+
run: |
33+
cd dist-embedded
34+
zip -r ../dist-embedded.zip . -x embedded.html
35+
cd ..
36+
37+
- name: Upload release asset
38+
uses: softprops/action-gh-release@v1
39+
if: github.event_name == 'release'
40+
with:
41+
files: dist-embedded.zip
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Upload artifact (for workflow_dispatch)
46+
if: github.event_name == 'workflow_dispatch'
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: dist-embedded
50+
path: dist-embedded.zip

0 commit comments

Comments
 (0)