lilylet-live-editor 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,81 @@
1
+ name: Deploy to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches: ['main', 'master']
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ concurrency:
14
+ group: 'pages'
15
+ cancel-in-progress: true
16
+
17
+ jobs:
18
+ build:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Setup Node
25
+ uses: actions/setup-node@v4
26
+ with:
27
+ node-version: '20'
28
+
29
+ - name: Checkout music-widgets dependency
30
+ uses: actions/checkout@v4
31
+ with:
32
+ repository: k-l-lambda/web-widgets
33
+ path: music-widgets
34
+
35
+ - name: Build music-widgets
36
+ run: |
37
+ cd music-widgets
38
+ npm install --legacy-peer-deps
39
+ npm run build
40
+ # Copy UMD bundle to static folder for direct script loading
41
+ mkdir -p ../static/js
42
+ cp dist/musicWidgetsBrowser.umd.js ../static/js/musicWidgetsBrowser.umd.min.js
43
+
44
+ - name: Update package.json dependencies
45
+ run: |
46
+ # Remove music-widgets from dependencies since we load it via UMD script
47
+ sed -i '/"@k-l-lambda\/music-widgets"/d' package.json
48
+ # Remove lotus from dependencies (optional, requires GitHub Packages auth)
49
+ sed -i '/"@k-l-lambda\/lotus"/d' package.json
50
+ # Remove package-lock.json since dependency paths change
51
+ rm -f package-lock.json
52
+
53
+ - name: Install dependencies
54
+ run: npm install
55
+
56
+ - name: Build docs
57
+ run: npm run build:docs
58
+
59
+ - name: Build
60
+ env:
61
+ NODE_ENV: production
62
+ run: npm run build
63
+
64
+ - name: Setup Pages
65
+ uses: actions/configure-pages@v4
66
+
67
+ - name: Upload artifact
68
+ uses: actions/upload-pages-artifact@v3
69
+ with:
70
+ path: 'build'
71
+
72
+ deploy:
73
+ environment:
74
+ name: github-pages
75
+ url: ${{ steps.deployment.outputs.page_url }}
76
+ runs-on: ubuntu-latest
77
+ needs: build
78
+ steps:
79
+ - name: Deploy to GitHub Pages
80
+ id: deployment
81
+ uses: actions/deploy-pages@v4
package/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # Lilylet Live Editor
2
+
3
+ A web-based editor for [Lilylet](https://github.com/k-l-lambda/lilylet) music notation with real-time rendering and MIDI playback.
4
+
5
+ ## Live Demo
6
+
7
+ - [Live Editor](https://k-l-lambda.github.io/lilylet-live-editor/) - Write Lilylet code and see rendered notation instantly
8
+ - [Markdown Editor](https://k-l-lambda.github.io/lilylet-live-editor/markdown) - Embed music notation in Markdown documents
9
+ - [Tutorial](https://k-l-lambda.github.io/lilylet-live-editor/docs/lilylet-tutorial.html) - Learn Lilylet syntax
10
+
11
+ ## Features
12
+
13
+ ### Live Editor
14
+ - Real-time music notation rendering via [Verovio](https://www.verovio.org/)
15
+ - Syntax highlighting with CodeMirror
16
+ - Shareable URLs with compressed code
17
+
18
+ ### Markdown Editor
19
+ - Embed Lilylet code blocks in Markdown documents
20
+ - Static notation rendering with ` ```lilylet ` code blocks
21
+ - Playable notation with ` ```lilylet.play ` code blocks
22
+ - MIDI playback with note highlighting
23
+ - Live preview as you type
24
+
25
+ ## Development
26
+
27
+ ### Prerequisites
28
+
29
+ - Node.js 18+
30
+ - npm
31
+
32
+ ### Setup
33
+
34
+ ```bash
35
+ # Install dependencies
36
+ npm install
37
+
38
+ # Start development server
39
+ npm run dev
40
+ ```
41
+
42
+ ### Build
43
+
44
+ ```bash
45
+ # Build for production (includes docs)
46
+ npm run build
47
+
48
+ # Build docs only
49
+ npm run build:docs
50
+
51
+ # Preview production build
52
+ npm run preview
53
+ ```
54
+
55
+ ### Deploy
56
+
57
+ ```bash
58
+ # Deploy to GitHub Pages
59
+ npm run deploy
60
+ ```
61
+
62
+ ## Tech Stack
63
+
64
+ - [SvelteKit](https://kit.svelte.dev/) - Web framework
65
+ - [Verovio](https://www.verovio.org/) - Music notation rendering
66
+ - [CodeMirror](https://codemirror.net/) - Code editor
67
+ - [markdown-it](https://github.com/markdown-it/markdown-it) - Markdown parser
68
+ - [@k-l-lambda/lilylet](https://github.com/k-l-lambda/lilylet) - Lilylet parser
69
+ - [@k-l-lambda/lilylet-markdown](https://github.com/k-l-lambda/lilylet) - Markdown plugin for Lilylet
70
+ - [@k-l-lambda/music-widgets](https://github.com/k-l-lambda/web-widgets) - MIDI playback
71
+
72
+ ## Related Projects
73
+
74
+ - [Lilylet](https://github.com/k-l-lambda/lilylet) - The Lilylet language parser and MEI encoder
75
+
76
+ ## License
77
+
78
+ MIT
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "lilylet-live-editor",
3
+ "version": "0.0.4",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite dev",
7
+ "build": "npm run build:docs && vite build",
8
+ "build:docs": "node scripts/build-docs.js",
9
+ "preview": "vite preview",
10
+ "prepare": "svelte-kit sync || echo ''",
11
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
12
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
13
+ "deploy": "NODE_ENV=production npm run build && gh-pages -d build"
14
+ },
15
+ "devDependencies": {
16
+ "@sveltejs/adapter-auto": "^3.0.0",
17
+ "@sveltejs/adapter-static": "^3.0.0",
18
+ "@sveltejs/kit": "^2.0.0",
19
+ "@sveltejs/vite-plugin-svelte": "^3.0.0",
20
+ "@types/markdown-it": "^14.1.2",
21
+ "@types/pako": "^2.0.4",
22
+ "gh-pages": "^6.3.0",
23
+ "markdown-it-anchor": "^9.2.0",
24
+ "svelte": "^4.2.0",
25
+ "svelte-check": "^3.6.0",
26
+ "typescript": "^5.3.0",
27
+ "vite": "^5.0.0"
28
+ },
29
+ "dependencies": {
30
+ "@codemirror/commands": "^6.3.0",
31
+ "@codemirror/lang-javascript": "^6.2.0",
32
+ "@codemirror/language": "^6.10.0",
33
+ "@codemirror/state": "^6.4.0",
34
+ "@codemirror/theme-one-dark": "^6.1.0",
35
+ "@codemirror/view": "^6.25.0",
36
+ "@k-l-lambda/lilylet": "^0.1.34",
37
+ "@k-l-lambda/lilylet-markdown": "^0.1.20",
38
+ "@k-l-lambda/music-widgets": "^1.0.1",
39
+ "codemirror": "^6.0.0",
40
+ "js-base64": "^3.7.0",
41
+ "markdown-it": "^14.1.0",
42
+ "pako": "^2.1.0",
43
+ "sha1": "^1.1.1",
44
+ "verovio": "^4.3.0",
45
+ "vue": "^3.4.0"
46
+ },
47
+ "optionalDependencies": {
48
+ "@k-l-lambda/lotus": "^1.0.3"
49
+ }
50
+ }