Repository navigation
feat: bundle the example scripts (--script example:<name>); README: npx fails inside a clone - #8
Merged
Merged
Conversation
The README's first example worked neither inside a clone (npx resolves to the project itself, which has no .bin entry, even after a build) nor outside one (avatars/ and examples/ are not in the package). Ship examples/*.avs, let --script name one, make the first README example npx-only, and warn prominently that npx avatarscript fails inside a clone. Refs #7 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Closes #7. The README's first command-line example worked neither inside a clone of this repo nor outside one. This PR:
examples/*.avsin the npm package and adds--script example:<name>to read one (src/examples.ts, wired insrc/cli.ts;--helplists the bundled names, and an unknown name fails with the list)--script example:hello-janpx avatarscriptfails inside a clone withcommand not found, even afternpm run build, plus the three commands that do work thereItems to Confirm / Review
filesgainsexamples/*.avs(the three.avsfiles only;examples/make-video.tsstays out).npm pack --dry-runshows them.provenance.scriptrecordsexample:<name>instead of a path into the npx cache. Other scripts are unchanged (path relative to the score).<pkg>/examplesnext todist/orsrc/), so it works both from source and from the installed package.--avatar; fetching scripts from URLs.Verification
npm run lint,npm run typecheck,npm testpass (newtests/examples.test.tscovers valid names, pass-through of other values, and unknown/empty/path-like names).scripts/smoke.sh avatars/anipasses; it now also compiles--script example:hello-enfrom the installed tarball and checks the provenance.npx --package=<tgz> avatarscript make --avatar <mulmocast-media URL> --script example:hello-ja --tts mockfrom an empty folder outside the repo → an H.264 + AAC MP4; an extracted frame shows the avatar.npx avatarscriptstill fails afternpm run build, and thatnpm run avatarscript -- ...,node dist/cli.js ...andnpx avatarscript@latest ...work.--tts elevenlabs(needs a key);mockruns the same script path.Approach
Bundled rather than fetched from a URL: the scripts are tiny, always match the installed CLI's syntax, and a fetched script would also need its relative background images fetched (
src/view.tsresolves them against the script's folder).src/examples.tsis pure (no fs) so the name mapping is unit-tested; the CLI supplies the directory listing.User Prompt
npx avatarscript make --avatar avatars/ani --script examples/hello-ja.avs ...fails withsh: avatarscript: command not found— does npx require installing avatarscript first?🤖 Generated with Claude Code