Skip to content

Support PURL-style inputs from the main search field #69

Description

@t128n

It would be useful if the homepage search input became the main entry point for different lookup modes, including PURL-style package references.

Examples:

  • express
  • @iarna/toml
  • pkg:github/expressjs/express
  • pkg:github/jonschlinkert/is-number
  • github.com/expressjs/express
  • https://github.com/expressjs/express
  • pkg:npm/is-number
  • blob:3c3f7bfd0b05c602ac26b1915bf960b4aa76ff9a

Expected behavior:

  • plain package names continue to navigate to replacement pages

    • express → replacement page if exists, if not redirect to purl
    • @iarna/toml → replacement page if exists, if not redirect to purl
  • pkg:github/... inputs navigate to the GitHub package.json scan flow

  • GitHub repository URLs are normalized to pkg:github/... where possible

  • pkg:npm/... inputs navigate to the npm package scan flow, if supported

  • blob:<sha> inputs navigate to a scan result for uploaded or pasted package.json content

This would make the homepage input the canonical entry point for replacements.fyi, while still keeping lookup modes explicit through prefixes.

The routing model could roughly be:

  • <package-name> -> module replacement lookup, fallback to scan
  • pkg:github/... -> GitHub package/repository scan
  • pkg:npm/... -> npm package scan
  • blob:<sha> -> uploaded or pasted package.json

I'm open to help implementing this if this direction makes sense.

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