starlists

package
v1.2.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package starlists owns the M4 "starlists" plugin. It uses GitHub's `user.lists` GraphQL field (verified live, May 2026) to fetch starlists + their items in one round trip. No headless browser required.

Same Navigator-based test seam as the topics plugin: production code uses graphqlNavigator from graphql_navigator.go; non-network tests substitute a fake.

Index

Constants

View Source
const Name = "starlists"

Name is the canonical plugin slug.

View Source
const NavigatorKey = "_test_starlists_navigator"

NavigatorKey is the inputs map slot tests use to inject a fake Navigator. Production code never sets this — the plugin falls back to pc.Render.

Variables

View Source
var Plugin plugins.Plugin = &starlistsPlugin{}

Plugin is the singleton registered with the global plugin registry.

Functions

func Partial

Partial renders the classic SVG fragment for the starlists plugin. Mirrors upstream org_repo/source/templates/classic/partials/starlists.ejs.

Output structure (top-level):

<section data-section="starlists">
  <h2 class="field"><svg/>N Star list(s)</h2>
  <div class="row"><section>
    [for each starlist]:
      <div class="starlist">
        <h2 class="field"><svg/>${name}</h2>
        <div class="count">${count} repositor(y|ies)</div>
        <div class="description">${description}</div>
        [if languages]:
          <div class="languages">
            <div class="row">
              <svg class="bar"><mask>...</mask><rect.../></svg>
            </div>
            <div class="row">
              <section>...details column 1 (even idx)...</section>
              <section>...details column 2 (odd idx)...</section>
            </div>
          </div>
      </div>
  </section></div>
</section>

Repos rendering (the per-repo card block in upstream lines 56-85) is omitted because the M4 data model only carries repo names (Starlist.Repos) — no stargazers/forks/language details. Restoring that needs a follow-up in starlists.go (per-repo enrichment via repository GraphQL fragment).

Types

type Navigator interface {
	FetchLists(ctx context.Context, url string) ([]Starlist, error)
	FetchRepos(ctx context.Context, listURL string) ([]string, error)
}

Navigator abstracts the upstream-data fetch so non-network tests can inject a fake. FetchLists returns the list overview; FetchRepos enumerates a single list's repos for language analysis. The production implementation is graphqlNavigator (single GraphQL query answers both — see graphql_navigator.go).

func NewGraphQLNavigator added in v1.1.0

func NewGraphQLNavigator(client graphqlClient, login string, listsFirst, itemsFirst int) Navigator

NewGraphQLNavigator returns a Navigator backed by the project's GraphQL client. login must match the user the plugin is rendering for. listsFirst caps the number of lists fetched; itemsFirst caps the items per list (GitHub's GraphQL `first` limit is 100).

type Result

type Result struct {
	Skipped       bool       `json:"skipped,omitempty"`
	SkippedReason string     `json:"-"`
	List          []Starlist `json:"list"`
	Languages     bool       `json:"languages,omitempty"`
}

Result is the JSON payload published under data.Plugins["starlists"]. Field set mirrors data-model E-024.

func (*Result) IsSkipped

func (r *Result) IsSkipped() bool

IsSkipped lets the classic dispatcher detect the skipped path.

type Starlist

type Starlist struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Count       int                    `json:"count"`
	Languages   []plugins.LanguageStat `json:"languages,omitempty"`
	URL         string                 `json:"-"` // internal: used by language analysis
	Repos       []string               `json:"-"` // internal: repos extracted from detail page
}

Starlist is one starlist entry. When the user requested per-list language analysis (_languages=true), Languages holds the aggregated breakdown across the list's repositories.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL