Repository navigation
feat(rich-media): asciinema player for ::cast recordings (rich-media Task 4.1/4.2) - #3037
Merged
Merged
Conversation
…ntry
- Add scripts/vendor-asciinema.mjs: ESM download script for asciinema-player
v3.18.0 JS + CSS from GitHub releases; idempotent via versioned sentinel
file (.asciinema-vendored-3.18.0); guarded against test import side-effects
via process.argv[1] check
- Add scripts/__tests__/vendor-asciinema.test.mjs: offline unit tests using
vi.stubGlobal + vi.spyOn(fs); two cases: non-ok fetch exits 1, sentinel
present skips download; fixed vi.stubGlobal return-value quirk by capturing
mock fn before passing to stubGlobal (documented in test comment)
- Update vitest.config.ts: extend unit include patterns from {js,ts} to
{js,mjs,ts} so .mjs test files are picked up
- Update package.json: add vendor:asciinema script; prepend to build:apps;
append to setup
- Update REUSE.toml: add Apache-2.0 annotation for asciinema-player.css
…or:asciinema into build:apps
…ath regardless of sentinel state
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What / Why
Completes spec tasks 4.1 and 4.2 of the tutorial-rich-media-and-tables openspec. The `::cast` directive grammar was merged but nothing played — `hugo/assets/js/cast.ts` was a stub (`export {};`) and no player was vendored.
Changes
License
asciinema-player v3.18.0: Apache-2.0 (confirmed from source). REUSE.toml records both vendored files with `SPDX-License-Identifier: Apache-2.0` and `SPDX-FileCopyrightText: asciinema contributors`.
How tested
npx vitest run scripts/__tests__/vendor-asciinema.test.mjs— 2/2 passnpx vitest run hugo/assets/js/__tests__/cast.test.ts— 5/5 passnpx vitest run scripts/parsers/directives/__tests__/cast-diagram.test.ts— 6/6 passnpx vitest run --project unit— full unit suite exits 0node scripts/vendor-asciinema.mjs— confirmed downloads asciinema-player.min.js (226 KB) + asciinema-player.css (19 KB) from GitHub releasesDeploy scope
Frontend / Hugo only. No CAP server changes. No new npm runtime deps. The
vendor:asciinemadownload runs duringbuild:apps(part ofbuild:all); CI already runsnpm run build:allbefore Hugo.