projects

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 10 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 projects owns the M4 "projects" plugin. The plugin is gated by the `read:project` OAuth scope; when the active token does not advertise the scope, Run returns Skipped=true. In M4 the actual GraphQL fetch is deferred — the scope-gate path is wired and tests exercise it, but a real `user.projects` GraphQL query lands as a follow-up.

Index

Constants

View Source
const Name = "projects"

Name is the canonical plugin slug.

Variables

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

Plugin is the singleton registered with the global plugin registry.

Functions

func Partial

Partial renders the classic SVG fragment for the projects plugin. Mirrors upstream org_repo/source/templates/classic/partials/projects.ejs for the fields the M4 data model exposes (name, description, updatedAt, url). Progress bars + items rows are upstream-only until the GraphQL fetch lands (see projects.go Run TODO).

Empty state: upstream gates only on `<% if (plugins.projects) { %>` (object presence) and unconditionally prints `<%= plugins.projects.totalCount %> Project<s>` in the header, so a `0 Projects` header is emitted whenever the plugin is enabled — even with an empty project list. The dispatcher (classic.go) already gates on `plugin_projects` truthy + non-Skipped, so the only guard here is `r.Skipped`; an empty List still renders the header + empty `<section class="project">`, matching sponsors (#451) / starlists.

Output structure:

<section data-section="projects">
  <h2 class="field"><svg project/>N Project(s)</h2>
  <div class="row"><section class="project">
    [for each project]:
      <div class="row fill-width"><section>
        <div class="field"><svg roadmap/>${name}</div>
      </section></div>
      [if description]:
        <div class="row fill-width"><section>
          <div class="field description">${description}</div>
        </section></div>
      <div class="row"><section>
        <div class="field"><svg clock/>Updated ${date}</div>
      </section></div>
  </section></div>
</section>

Types

type Project

type Project struct {
	Name        string    `json:"name"`
	Description string    `json:"description"`
	URL         string    `json:"url"`
	UpdatedAt   time.Time `json:"updatedAt"`
	Closed      bool      `json:"closed,omitempty"`
}

Project mirrors one upstream project entry.

type Result

type Result struct {
	Skipped       bool      `json:"skipped,omitempty"`
	SkippedReason string    `json:"-"`
	Mode          string    `json:"mode,omitempty"`
	List          []Project `json:"list"`
	Limit         int       `json:"limit"`
}

Result is the JSON payload published under data.Plugins["projects"].

func (*Result) IsSkipped

func (r *Result) IsSkipped() bool

IsSkipped lets the classic dispatcher detect the skipped path.

Jump to

Keyboard shortcuts

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