Skip to content

feat(views) Relax! 🛋️ views are a useful analysis tool for datasets of unstructured metadata#21

Merged
indexzero merged 6 commits intomainfrom
query/1
Feb 2, 2026
Merged

feat(views) Relax! 🛋️ views are a useful analysis tool for datasets of unstructured metadata#21
indexzero merged 6 commits intomainfrom
query/1

Conversation

@indexzero
Copy link
Copy Markdown
Owner

@indexzero indexzero commented Feb 1, 2026

  • View system for registry data queries: CouchDB and jq inspired operations over cached packuments without loading everything into memory

    • View class defines origin filter + field projection
    • ViewStore persists definitions as JSON in XDG config directory
    • queryView streams cached packuments through projections
    • joinViews performs O(1) joins by constructing cache keys directly
  • Projection system with jq-inspired syntax: supports field selection, transforms, and aliases

    • Dot notation for nested fields (repository.url)
    • Pipe transforms (versions|keys, dependencies|length)
    • Aliases (versions|keys as versionList)
    • Bracket notation for dynamic keys (time["4.17.21"])
  • CLI commands for view management: full CRUD plus query and join operations

    • view define creates named views with --origin/--registry and --select
    • view query streams projected records with --limit, --where, --progress
    • view join supports left, inner, right, and full join types
    • view list, view show, view delete for management
  • Cache module exports for view integration: exposes internals needed by view system

    • Export encodeOrigin for consistent origin key generation
    • Add config to XDG directories for view storage

indexzero and others added 6 commits February 1, 2026 01:46
Introduces a view abstraction over cached packument data:
- View: defines origin + projection over cached data
- ViewStore: persists view definitions as JSON
- Projection: jq-like field selection with transforms
- Query: stream cached packuments through projections
- Join: O(1) joins between views using cache key construction

Views enable SQL-like queries over registry data without loading
everything into memory.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Export encodeOrigin from cache module for view system
- Add config directory to XDG dirs for view storage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
CLI commands for the view system:
- view define: create named views with origin and projection
- view list: show all defined views
- view show: display view configuration
- view delete: remove a view definition
- view query: stream records from a view
- view join: join two views on package name

Example usage:
  _all_docs view define npm-pkgs --origin npm --select 'name, versions|keys'
  _all_docs view query npm-pkgs --limit 100
  _all_docs view join npm-pkgs cgr-pkgs --inner

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add example: find packages with install scripts but no node-gyp dep
- Add example: coverage gap analysis between registries
- Remove generic "private-pkgs" examples that didn't show real value

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace generic private registry examples with:
- Supply chain security: packages with install scripts but no node-gyp
- Graph extraction: deps.dev style dependency edges

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@indexzero indexzero merged commit 5961dec into main Feb 2, 2026
1 check passed
@indexzero indexzero deleted the query/1 branch February 2, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant