Repository navigation
Closed
Description
Phase 2 of the phased install plan (#464 comment). Phase 1 (#478 / #479) shipped a working jss install <name> against the default registry; this generalizes the input.
What
Extend parseAppSpec in src/cli/install.js to accept three input shapes plus two suffixes:
| Input | Resolves to | Pod path |
|---|---|---|
chrome |
github.com/solid-apps/chrome (default registry) |
/public/apps/chrome/ |
JavaScriptSolidServer/git |
github.com/JavaScriptSolidServer/git |
/public/apps/git/ |
https://github.com/foo/bar |
as-is | /public/apps/bar/ |
chrome#v1 |
github.com/solid-apps/chrome @ ref v1 |
/public/apps/chrome/ |
litecut/litecut.github.io=litecut |
github.com/litecut/litecut.github.io → renamed |
/public/apps/litecut/ |
Optional suffixes apply to any form:
#<branch-or-tag>— pin a ref (usesgit clone --branch <ref>)=<name>— rename the pod path
Reference
jspod's parseAppSpec (source) — already shipped, verified across many repos. Port it directly.
Acceptance criteria
$ jss install chrome # Phase 1: backward compatible
✓ chrome → http://localhost:4443/public/apps/chrome/
$ jss install JavaScriptSolidServer/git # Phase 2: any GitHub org/repo
✓ JavaScriptSolidServer/git → http://localhost:4443/public/apps/git/
$ jss install litecut/litecut.github.io=litecut # rename pod path
✓ litecut/litecut.github.io=litecut → http://localhost:4443/public/apps/litecut/
$ jss install solid-apps/chrome#v1 # pin a tag or branch
✓ solid-apps/chrome#v1 → http://localhost:4443/public/apps/chrome/
$ jss install https://github.com/foo/bar # full URL
✓ https://github.com/foo/bar → http://localhost:4443/public/apps/bar/Scope
~30 LoC delta in src/cli/install.js:
- Expand
parseAppSpecto handle ref + rename suffixes and three input shapes - Adjust
installOneto add--branch <ref>togit clonewhen ref is set - Validate ref against
/^[a-z0-9][a-z0-9_./-]*$/i(allows tag/branch shapes, rejects shell metacharacters) - Validate derived name against the existing
/^[a-z0-9][a-z0-9_.-]*$/i
No new dependencies. Per-app output keeps printing the user's input verbatim so they recognize which line failed.
Test plan
- All five shapes above produce 200 on
/public/apps/<derived-name>/ - Invalid shapes (
foo/bar/baz,=name-only,#ref-only) → validation error, exit 1 - Ref pinning actually checks out the named ref (smoke test: install
solid-apps/chrome#v1after we tag a v1)
Parent
#464 (phased plan in the comment thread)
Metadata
Metadata
Assignees
Labels
No labels
Activity
feat(cli): generalize \`jss install\` spec (#480, Phase 2 of #464) (#481