Skip to content

Refactor: delegate nosdav install to jss install (consolidate install plumbing) #30

Description

@melvincarvalho

Now that JSS 0.0.198 ships its own `jss install` subcommand (Phases 1+2+4 of JSS#464), nosdav's wrapper-side install is duplicated infrastructure. The same code was ported into both jspod and nosdav; the two are now drift candidates.

Why consolidate

  • Single source of truth. Future install features (Phase 3 `--did`, Phase 5 curated set, Phase 6 `--bundle`) land in JSS first. If nosdav's install stays separate, every new feature requires re-porting.
  • Wrapper shrinks ~150 LoC (`runInstall`, `parseAppSpec`, `printInstallHelp` in `bin/nosdav.js`).
  • Behavior unchanged for users — `npx nosdav-server install chrome` keeps working.

When (not yet)

Hold until JSS install stabilizes:

  • JSS#464 Phase 5 (curated set)
  • JSS#464 Phase 6 (`--bundle`)
  • One release cycle in the wild

Sketch

Replace `runInstall` with a ~10-line delegation that spawns `jss install` from the bundled `node_modules/.bin/jss`, defaulting `--pod` to nosdav's port (5544) when the user hasn't overridden.

```js
async function runInstall(rest) {
const args = ['install', ...rest];
if (!rest.includes('--pod')) {
args.push('--pod', `http://localhost:\${options.port}\`);
}
const jssBin = join(pkgRoot, 'node_modules', '.bin', 'jss');
const child = spawn(jssBin, args, { stdio: 'inherit' });
await new Promise((resolve) => child.on('exit', (code) => process.exit(code || 0)));
}
```

Drop `parseAppSpec` and `printInstallHelp` — `jss install --help` is the source of truth.

Bonus

Because nosdav defaults to `--provision-keys ON`, the pod has a Schnorr keypair at `/private/privkey.jsonld` by default. A nosdav-specific affordance: when the user runs `nosdav install` without auth flags, nosdav could read its own privkey and pass it to `jss install --nostr-privkey ` automatically. Zero-config installs against a Nostr-keyed pod. ~10 more LoC; consider folding in.

Sibling

  • jspod#48 tracks the parallel refactor on the Solid-default wrapper.

Activity

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