Skip to content

Generalize jss install spec: <org>/<repo>, URLs, refs, rename (Phase 2 of #464) #480

Closed

Description

@melvincarvalho

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 (uses git 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 parseAppSpec to handle ref + rename suffixes and three input shapes
  • Adjust installOne to add --branch <ref> to git clone when 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#v1 after we tag a v1)

Parent

#464 (phased plan in the comment thread)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions