Skip to content

feat: extract @libscope/registry — git-backed pack registry #494

@RobertLD

Description

@RobertLD

Summary

Part of #488. Extract src/registry/ into a standalone @libscope/registry package. The registry depends almost entirely on Node.js stdlib and is one of the cleanest extractions in the split.

Problem / Motivation

The registry system (git-backed pack sync, publish, resolve, checksum) is a self-contained utility with minimal dependencies on the rest of libscope. It's unrelated to semantic search or document indexing from a consumer's perspective, and shouldn't be bundled with the core search engine.

Proposed Solution

Move src/registry/ into packages/registry/ with its own package.json. The registry depends on @libscope/core only for pack import/export — that interface should be kept minimal.

Acceptance Criteria

  • @libscope/registry builds and tests pass independently
  • The package depends only on @libscope/core (for pack import/export) and Node.js stdlib (fs, path, crypto, zlib)
  • Existing CLI registry commands (libscope registry add, libscope pack install, etc.) work correctly
  • Path validation logic (reject .., /, \, null bytes) is preserved and tested

Out of Scope

  • Changes to the registry format or protocol
  • Adding new registry features

Technical Notes

  • src/registry/ contains: config.ts, git.ts, sync.ts, publish.ts, search.ts, checksum.ts, resolve.ts
  • Key stdlib deps: fs, path, crypto, zlib — no external npm deps beyond @libscope/core
  • Registry names validation: /^[a-zA-Z0-9_-]+$/, 2–64 chars
  • Git URLs: https://, ssh://, or git@host:path (no embedded credentials)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrefactorCode refactoring

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions