colophon: a Colophon page and one catalog of what the suite is built from
A scriptless, fontless Colophon page and per-entry license pages, sectioned by kind, read from one catalog (colophon/projects.json) of 103 projects with a plain blurb, the license's copyright holders, license, home and source, and per-app usage notes. Apps generate their list from what they actually ship; a test fails on any drift. Landed on local make test (go1.26.5): hub CI's vet failure is runner-only (go.mod identical to main, which passes), on Paul's ruling. Reviewed by Claude Fable 5.1 (#27). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Squashed from feat/colophon into main.
10 files changed,
+4,160
−0
README.md+14 −0colophon/colophon.css+63 −0colophon/colophon.go+556 −0colophon/colophon_test.go+469 −0colophon/inventory.go+296 −0colophon/inventory_test.go+194 −0colophon/projects.json+2,495 −0colophon/templates/colophon.html+57 −0credits/catalog/catalog.go+6 −0implementation/colophon.json+10 −0
CI passed — run details
diff --git a/README.md b/README.md| index 268327e..a356674 100644 |
| --- a/README.md |
| +++ b/README.md |
| @@ -40,6 +40,20 @@ platform's invoker command (`menu.Item.Dialog`); `Bar.Actions` is |
| the one `estilo-menus` group, menubar menus included, on Escape (in the |
| capture phase) and an outside click. |
| +`colophon` is the suite's Colophon, reached from Help: every open-source |
| +project an app is made with, in sections (typefaces, libraries by |
| +runtime, icons and artwork, data, tools), each with a sentence or two on |
| +what it is and what the app uses it for, who made it, its licence (linked |
| +to the text the app serves) and its home and source. `projects.json` is |
| +the one catalog of those words, so every app describes Yjs the same way. |
| +An app never lists projects by hand: it collects what it ships (Go |
| +modules through `credits/catalog`, npm packages from esbuild's metafile |
| +with `CollectNPM`, crates from `cargo metadata` with `CollectCargo`, plus |
| +its fonts and vendored files) and `colophon.Build` refuses a package the |
| +catalog does not know, a usage note for something no longer shipped, or a |
| +shipped package without its licence text. No script, no webfont. Docs |
| +adopted first. |
| + |
| Permission and session logic stay app-owned. There is no |
| shared component gallery yet. |
diff --git a/colophon/colophon.css b/colophon/colophon.css| new file mode 100644 |
| index 0000000..d6a3138 |
| --- /dev/null |
| +++ b/colophon/colophon.css |
| @@ -0,0 +1,63 @@ |
| +/* colophon/colophon.css: the Colophon and its licence pages. Chrome, so |
| + it declares no face: everything inherits the system UI face (AGENTS.md |
| + row 9), the licence texts included, and nothing here can flash. Links |
| + are 24px targets, the measure keeps prose readable, and at 320px |
| + everything reflows: long names and URLs break rather than scroll. */ |
| +[estilo-colophon] { |
| + max-inline-size: 46rem; |
| + min-inline-size: 0; |
| + overflow-wrap: anywhere; |
| +} |
| +[estilo-colophon] h2 { |
| + margin-block-start: var(--rst-sp-6); |
| + padding-block-end: var(--rst-sp-2); |
| + border-block-end: 1px solid var(--rst-line); |
| +} |
| +[estilo-colophon] a { display: inline-block; min-block-size: 24px; max-inline-size: 100%; } |
| +[estilo-colophon] ul[role="list"] { list-style: none; padding: 0; margin: 0; } |
| + |
| +[estilo-colophon-contents] ul { display: flex; flex-wrap: wrap; gap: var(--rst-sp-2) var(--rst-sp-4); } |
| +[estilo-colophon-count] { color: var(--rst-text-muted); font-size: var(--rst-fs-sm); } |
| + |
| +[estilo-colophon-entry] { |
| + padding-block: var(--rst-sp-3); |
| + border-block-end: 1px solid var(--rst-line); |
| +} |
| +[estilo-colophon-entry] h3 { margin-block: 0 var(--rst-sp-2); font-size: 1.0625rem; } |
| +[estilo-colophon-entry] p { margin-block: 0 var(--rst-sp-2); } |
| +[estilo-colophon-entry] dl { |
| + display: flex; |
| + flex-wrap: wrap; |
| + gap: 0 var(--rst-sp-4); |
| + margin-block: 0 var(--rst-sp-2); |
| + font-size: var(--rst-fs-sm); |
| +} |
| +[estilo-colophon-entry] dl > div { display: flex; gap: var(--rst-sp-2); align-items: baseline; min-inline-size: 0; } |
| +/* The label never shrinks: under overflow-wrap: anywhere a flex item may |
| + be squeezed to one character, and "Version" beside nine versions wrapped |
| + to four lines at 320px. The value takes the rest and wraps instead. */ |
| +[estilo-colophon-entry] dt { color: var(--rst-text-muted); flex: none; } |
| +[estilo-colophon-entry] dd { margin: 0; min-inline-size: 0; flex: 1 1 auto; } |
| +[estilo-colophon-links] { display: flex; flex-wrap: wrap; gap: var(--rst-sp-4); font-size: var(--rst-fs-sm); } |
| + |
| +[estilo-colophon-licence] pre { |
| + white-space: pre-wrap; |
| + overflow-wrap: anywhere; |
| + font: inherit; |
| + font-size: var(--rst-fs-sm); |
| + padding: var(--rst-sp-3); |
| + background: var(--rst-surface-2); |
| + border-radius: var(--rst-radius-sm); |
| +} |
| + |
| +/* A table in a colophon page (an app's own, such as Docs' font pairs): |
| + rules between rows, labels at the start, the measure's width at most. */ |
| +[estilo-colophon] table { border-collapse: collapse; margin-block: var(--rst-sp-3); min-inline-size: 0; } |
| +[estilo-colophon] th, [estilo-colophon] td { |
| + text-align: start; |
| + vertical-align: top; |
| + padding: var(--rst-sp-2) var(--rst-sp-4) var(--rst-sp-2) 0; |
| + border-block-end: 1px solid var(--rst-line); |
| +} |
| +[estilo-colophon] thead th { color: var(--rst-text-muted); font-weight: inherit; font-size: var(--rst-fs-sm); } |
| +[estilo-colophon] tbody th { font-weight: 600; } |
diff --git a/colophon/colophon.go b/colophon/colophon.go| new file mode 100644 |
| index 0000000..5b1278b |
| --- /dev/null |
| +++ b/colophon/colophon.go |
| @@ -0,0 +1,556 @@ |
| +// Package colophon is the suite's Colophon: every open-source project an |
| +// app is made with, said in a sentence or two, with who made it, the |
| +// licence it is under and where it lives. |
| +// |
| +// The words are the catalog's (projects.json), one entry per project, so |
| +// every app that ships Yjs describes Yjs the same way. What an app uses a |
| +// project for is the entry's usage note for that app. The list is not |
| +// written by hand: an app collects what it actually ships (Go modules from |
| +// its production build, JavaScript packages from its bundles, Rust crates |
| +// from its WebAssembly, fonts, icons and vendored files) and Build matches |
| +// that against the catalog. Build refuses a shipped package the catalog |
| +// does not know, a usage note for something the app no longer ships, and |
| +// a package without its licence text, so an app's own test of Build is |
| +// the test that the Colophon and the shipped set cannot differ. |
| +// |
| +// The page needs no script and downloads no font: it is chrome, set in the |
| +// system UI face it inherits (AGENTS.md row 9). |
| +package colophon |
| + |
| +import ( |
| + "bytes" |
| + "embed" |
| + "encoding/json" |
| + "errors" |
| + "fmt" |
| + "net/url" |
| + "regexp" |
| + "sort" |
| + "strings" |
| + "unicode" |
| + "unicode/utf8" |
| + |
| + "amadan.net/oficina/estilo.git/credits" |
| +) |
| + |
| +//go:embed projects.json |
| +var projectsJSON []byte |
| + |
| +//go:embed templates/*.html |
| +var templateFS embed.FS |
| + |
| +//go:embed colophon.css |
| +var stylesheet []byte |
| + |
| +// Templates holds "estilo/colophon" (Page) and "estilo/colophon-licence" |
| +// (LicencePage). |
| +func Templates() embed.FS { return templateFS } |
| + |
| +// CSS is the page's stylesheet, linked after estilo's base. |
| +func CSS() []byte { return append([]byte(nil), stylesheet...) } |
| + |
| +// Kind is what sort of thing a project is, and so which section it is in. |
| +type Kind string |
| + |
| +const ( |
| + Typeface Kind = "typeface" |
| + Library Kind = "library" |
| + Icons Kind = "icons" |
| + Data Kind = "data" |
| + Tool Kind = "tool" |
| + Service Kind = "service" |
| +) |
| + |
| +// Ecosystems: where a package's name comes from. |
| +const ( |
| + Go = "go" // a Go module path |
| + NPM = "npm" // an npm package name |
| + Cargo = "cargo" // a crates.io crate name |
| + Swift = "swift" // a Swift package's identity in Package.resolved |
| + Font = "font" // a font family's name |
| + Asset = "asset" // a vendored file or set of files |
| + Toolchain = "toolchain" // a language's compiler and standard library |
| + Pip = "pip" // a Python package used by a script |
| +) |
| + |
| +// NoAssertion is the licence of a package published with no licence file |
| +// (SPDX's own word for it). It is the one licence a package may ship |
| +// without a notice, and the page says so. |
| +const NoAssertion = "NOASSERTION" |
| + |
| +// Licence is a project's licence: its SPDX expression and its name as a |
| +// person reads it. |
| +type Licence struct { |
| + SPDX string `json:"spdx"` |
| + Name string `json:"name"` |
| +} |
| + |
| +// Ref names a package a project publishes. |
| +type Ref struct { |
| + Ecosystem string `json:"ecosystem"` |
| + Name string `json:"name"` |
| +} |
| + |
| +func (r Ref) String() string { return r.Ecosystem + ":" + r.Name } |
| + |
| +// Project is one catalog entry. |
| +type Project struct { |
| + ID string `json:"id"` |
| + Name string `json:"name"` |
| + Kind Kind `json:"kind"` |
| + // Blurb says what the project is, in one or two sentences. |
| + Blurb string `json:"blurb"` |
| + // Author is who holds the copyright, as its licence file names them, |
| + // not a package manifest's list of maintainers. Where the licence names |
| + // no one (many MIT and Apache texts), it is the project's own authors. |
| + Author string `json:"author"` |
| + Licence Licence `json:"licence"` |
| + Home string `json:"home"` |
| + Source string `json:"source"` |
| + // Packages are every package of the project an app might ship. |
| + Packages []Ref `json:"packages"` |
| + // Uses is what each app uses it for, keyed by the app's colophon key |
| + // ("docs", "docs-native"), one or two sentences each. "*" is the note |
| + // for every app without its own ("Yrs uses it."), so a transitive |
| + // dependency is written once, not once per app. Only an app's own |
| + // note can be stale. |
| + Uses map[string]string `json:"uses"` |
| +} |
| + |
| +var projects = func() []Project { |
| + var file struct { |
| + Comment string `json:"comment"` |
| + Projects []Project `json:"projects"` |
| + } |
| + decoder := json.NewDecoder(bytes.NewReader(projectsJSON)) |
| + decoder.DisallowUnknownFields() |
| + if err := decoder.Decode(&file); err != nil { |
| + panic("colophon: projects.json: " + err.Error()) |
| + } |
| + if err := Validate(file.Projects); err != nil { |
| + panic(err) |
| + } |
| + return file.Projects |
| +}() |
| + |
| +// Catalog is a copy of every project in the catalog. |
| +func Catalog() []Project { |
| + out := make([]Project, len(projects)) |
| + for i, p := range projects { |
| + p.Packages = append([]Ref(nil), p.Packages...) |
| + uses := make(map[string]string, len(p.Uses)) |
| + for k, v := range p.Uses { |
| + uses[k] = v |
| + } |
| + p.Uses = uses |
| + out[i] = p |
| + } |
| + return out |
| +} |
| + |
| +var ( |
| + idPattern = regexp.MustCompile(`^[a-z0-9]+(-[a-z0-9]+)*$`) |
| + sentenceEnd = regexp.MustCompile(`[.!?]["”’)]?(\s+|$)`) |
| + knownKinds = map[Kind]bool{Typeface: true, Library: true, Icons: true, Data: true, Tool: true, Service: true} |
| + knownSystems = map[string]bool{Go: true, NPM: true, Cargo: true, Swift: true, Font: true, Asset: true, Toolchain: true, Pip: true} |
| +) |
| + |
| +// sentences counts the sentences in s, roughly: a full stop, question or |
| +// exclamation mark followed by a space or the end. Abbreviations count |
| +// too, which errs towards shorter blurbs. |
| +func sentences(s string) int { return len(sentenceEnd.FindAllStringIndex(s, -1)) } |
| + |
| +// sentence reports whether s is written as sentences: it ends with a full |
| +// stop. A usage note may open with a project's own lower-case name |
| +// ("wasmi uses it."); a blurb opens with a capital (capitalised). |
| +func sentence(s string) bool { |
| + s = strings.TrimSpace(s) |
| + return s != "" && sentenceEnd.MatchString(s) && strings.HasSuffix(strings.TrimRight(s, `"”’)`), ".") |
| +} |
| + |
| +// capitalised reads the first letter, not the first byte: "Łukasz" is |
| +// capitalised, and Validate runs at init. |
| +func capitalised(s string) bool { |
| + r, _ := utf8.DecodeRuneInString(strings.TrimSpace(s)) |
| + return r != utf8.RuneError && !unicode.IsLower(r) |
| +} |
| + |
| +func httpsURL(s string) bool { |
| + u, err := url.Parse(s) |
| + return err == nil && u.Scheme == "https" && u.Host != "" |
| +} |
| + |
| +// Validate reports every way a list of projects falls short of a catalog: |
| +// an entry without a blurb of one or two sentences, an author, a licence, |
| +// an https home and source, or a package; a package two projects claim; |
| +// and a usage note that is not a sentence. |
| +func Validate(projects []Project) error { |
| + var problems []string |
| + ids := map[string]bool{} |
| + owner := map[Ref]string{} |
| + for _, p := range projects { |
| + bad := func(format string, args ...any) { |
| + problems = append(problems, p.ID+": "+fmt.Sprintf(format, args...)) |
| + } |
| + if !idPattern.MatchString(p.ID) { |
| + bad("id is not lower-case words joined by hyphens") |
| + } |
| + if ids[p.ID] { |
| + bad("id is used twice") |
| + } |
| + for _, s := range sectionOrder { |
| + if p.ID == s { |
| + bad("id is a section's, and the page anchors both") |
| + } |
| + } |
| + ids[p.ID] = true |
| + if strings.TrimSpace(p.Name) == "" { |
| + bad("no name") |
| + } |
| + if !knownKinds[p.Kind] { |
| + bad("unknown kind %q", p.Kind) |
| + } |
| + if !sentence(p.Blurb) || !capitalised(p.Blurb) || sentences(p.Blurb) > 2 { |
| + bad("the blurb must be one or two sentences") |
| + } |
| + if strings.TrimSpace(p.Author) == "" { |
| + bad("no author") |
| + } |
| + if strings.TrimSpace(p.Licence.SPDX) == "" || strings.TrimSpace(p.Licence.Name) == "" { |
| + bad("no licence") |
| + } |
| + if !httpsURL(p.Home) || !httpsURL(p.Source) { |
| + bad("home and source must be https URLs") |
| + } |
| + if len(p.Packages) == 0 { |
| + bad("no packages") |
| + } |
| + for _, r := range p.Packages { |
| + if !knownSystems[r.Ecosystem] || r.Name == "" { |
| + bad("unknown package %s", r) |
| + continue |
| + } |
| + if other, taken := owner[r]; taken { |
| + bad("%s is also %s's", r, other) |
| + } |
| + owner[r] = p.ID |
| + } |
| + for app, use := range p.Uses { |
| + if !sentence(use) || sentences(use) > 2 { |
| + bad("the usage note for %s must be one or two sentences", app) |
| + } |
| + } |
| + } |
| + if len(problems) > 0 { |
| + sort.Strings(problems) |
| + return errors.New("colophon: catalog:\n " + strings.Join(problems, "\n ")) |
| + } |
| + return nil |
| +} |
| + |
| +// Package is one package an app ships, as its collector found it. |
| +type Package struct { |
| + Ecosystem string `json:"ecosystem"` |
| + Name string `json:"name"` |
| + Version string `json:"version,omitempty"` |
| + // Tool marks a package the app is built or tested with that is not in |
| + // what it ships. |
| + Tool bool `json:"tool,omitempty"` |
| + // Platforms limits a package to some of the app's platforms ("mac"); |
| + // empty is all of them. |
| + Platforms []string `json:"platforms,omitempty"` |
| + // Notices are the package's own licence files, unaltered. |
| + Notices []credits.Notice `json:"notices"` |
| +} |
| + |
| +func (p Package) ref() Ref { return Ref{p.Ecosystem, p.Name} } |
| + |
| +// Entry is one project as an app's Colophon shows it. |
| +type Entry struct { |
| + ID string `json:"id"` |
| + Name string `json:"name"` |
| + Blurb string `json:"blurb"` |
| + Usage string `json:"usage"` |
| + Author string `json:"author"` |
| + Licence Licence `json:"licence"` |
| + Home string `json:"home"` |
| + Source string `json:"source"` |
| + Packages []Package `json:"packages"` |
| +} |
| + |
| +// VersionText is the entry's version, or each package's when they differ. |
| +func (e Entry) VersionText() string { |
| + versions := map[string]bool{} |
| + for _, p := range e.Packages { |
| + versions[p.Version] = true |
| + } |
| + if len(versions) == 1 { |
| + return e.Packages[0].Version |
| + } |
| + var parts []string |
| + for _, p := range e.Packages { |
| + if p.Version != "" { |
| + parts = append(parts, p.Name+" "+p.Version) |
| + } |
| + } |
| + return strings.Join(parts, ", ") |
| +} |
| + |
| +// Section is one heading's entries. ID is one of sectionOrder. |
| +type Section struct { |
| + ID string `json:"id"` |
| + Entries []Entry `json:"entries"` |
| +} |
| + |
| +// Colophon is an app's Colophon, its sections in sectionOrder and their |
| +// entries by name. |
| +type Colophon struct { |
| + Sections []Section `json:"sections"` |
| +} |
| + |
| +// sectionOrder is the order sections are shown in. |
| +var sectionOrder = []string{"typefaces", "go", "javascript", "rust", "swift", "icons", "data", "tools", "services"} |
| + |
| +// Entry finds the entry with id. |
| +func (c Colophon) Entry(id string) (Entry, bool) { |
| + for _, s := range c.Sections { |
| + for _, e := range s.Entries { |
| + if e.ID == id { |
| + return e, true |
| + } |
| + } |
| + } |
| + return Entry{}, false |
| +} |
| + |
| +func (c Colophon) sectionOf(id string) string { |
| + for _, s := range c.Sections { |
| + for _, e := range s.Entries { |
| + if e.ID == id { |
| + return s.ID |
| + } |
| + } |
| + } |
| + return "" |
| +} |
| + |
| +// Count is the number of entries in each section, and "total". |
| +func (c Colophon) Count() map[string]int { |
| + n := map[string]int{} |
| + for _, s := range c.Sections { |
| + n[s.ID] = len(s.Entries) |
| + n["total"] += len(s.Entries) |
| + } |
| + return n |
| +} |
| + |
| +// Build is app's Colophon for what it ships, from the catalog. app is the |
| +// key of the usage notes it reads ("docs", "docs-native"). |
| +func Build(app string, shipped []Package) (Colophon, error) { |
| + return build(projects, app, shipped) |
| +} |
| + |
| +func build(projects []Project, app string, shipped []Package) (Colophon, error) { |
| + var problems []string |
| + owner := map[Ref]int{} |
| + for i, p := range projects { |
| + for _, r := range p.Packages { |
| + owner[r] = i |
| + } |
| + } |
| + // One package per ecosystem, name and version. A package seen as a tool |
| + // in one build and shipped by another ships; a package limited to some |
| + // platforms in one and not in another is on all of them. |
| + merged := map[string]*Package{} |
| + var keys []string |
| + for _, p := range shipped { |
| + if p.Ecosystem == "" || p.Name == "" { |
| + problems = append(problems, "a package without an ecosystem or name") |
| + continue |
| + } |
| + key := p.Ecosystem + ":" + p.Name + "@" + p.Version |
| + if have, ok := merged[key]; ok { |
| + have.Tool = have.Tool && p.Tool |
| + if len(have.Platforms) == 0 || len(p.Platforms) == 0 { |
| + have.Platforms = nil |
| + } else { |
| + have.Platforms = union(have.Platforms, p.Platforms) |
| + } |
| + continue |
| + } |
| + p.Platforms = append([]string(nil), p.Platforms...) |
| + merged[key] = &p |
| + keys = append(keys, key) |
| + } |
| + sort.Strings(keys) |
| + byProject := map[int][]Package{} |
| + for _, key := range keys { |
| + p := *merged[key] |
| + i, known := owner[p.ref()] |
| + if !known { |
| + problems = append(problems, p.ref().String()+" has no catalog entry") |
| + continue |
| + } |
| + if len(p.Notices) == 0 && !p.Tool && projects[i].Licence.SPDX != NoAssertion { |
| + problems = append(problems, fmt.Sprintf("%s %s carries no licence text", p.ref(), p.Version)) |
| + } |
| + byProject[i] = append(byProject[i], p) |
| + } |
| + sections := map[string][]Entry{} |
| + for i, p := range projects { |
| + packages, ships := byProject[i] |
| + own := p.Uses[app] |
| + use := own |
| + if use == "" { |
| + use = p.Uses["*"] |
| + } |
| + switch { |
| + case ships && use == "": |
| + problems = append(problems, p.ID+" has no usage note for "+app) |
| + continue |
| + case !ships && own != "": |
| + problems = append(problems, p.ID+" has a usage note for "+app+" but "+app+" does not ship it") |
| + continue |
| + case !ships: |
| + continue |
| + } |
| + section, err := sectionFor(p, packages) |
| + if err != nil { |
| + problems = append(problems, err.Error()) |
| + continue |
| + } |
| + sections[section] = append(sections[section], Entry{ID: p.ID, Name: p.Name, Blurb: p.Blurb, Usage: use, Author: p.Author, Licence: p.Licence, Home: p.Home, Source: p.Source, Packages: packages}) |
| + } |
| + if len(problems) > 0 { |
| + sort.Strings(problems) |
| + return Colophon{}, errors.New("colophon: " + app + ":\n " + strings.Join(problems, "\n ")) |
| + } |
| + var c Colophon |
| + for _, id := range sectionOrder { |
| + entries := sections[id] |
| + if len(entries) == 0 { |
| + continue |
| + } |
| + sort.SliceStable(entries, func(a, b int) bool { |
| + return strings.ToLower(entries[a].Name) < strings.ToLower(entries[b].Name) |
| + }) |
| + c.Sections = append(c.Sections, Section{ID: id, Entries: entries}) |
| + } |
| + return c, nil |
| +} |
| + |
| +func union(a, b []string) []string { |
| + seen := map[string]bool{} |
| + var out []string |
| + for _, s := range append(append([]string(nil), a...), b...) { |
| + if !seen[s] { |
| + seen[s] = true |
| + out = append(out, s) |
| + } |
| + } |
| + sort.Strings(out) |
| + return out |
| +} |
| + |
| +func sectionFor(p Project, packages []Package) (string, error) { |
| + tool := true |
| + ecosystem := "" |
| + for _, pkg := range packages { |
| + if !pkg.Tool { |
| + tool = false |
| + if ecosystem == "" { |
| + ecosystem = pkg.Ecosystem |
| + } |
| + } |
| + } |
| + if tool { |
| + return "tools", nil |
| + } |
| + switch p.Kind { |
| + case Typeface: |
| + return "typefaces", nil |
| + case Icons: |
| + return "icons", nil |
| + case Data: |
| + return "data", nil |
| + case Tool: |
| + return "tools", nil |
| + case Service: |
| + return "services", nil |
| + } |
| + switch ecosystem { |
| + case Go: |
| + return "go", nil |
| + case NPM: |
| + return "javascript", nil |
| + case Cargo: |
| + return "rust", nil |
| + case Swift: |
| + return "swift", nil |
| + } |
| + return "", fmt.Errorf("%s is a library with no runtime to list it under", p.ID) |
| +} |
| + |
| +// Labels are the page's words, in the caller's locale. Sections is each |
| +// section's heading, keyed by its ID. |
| +type Labels struct { |
| + Contents string |
| + Sections map[string]string |
| + By string |
| + Licence string |
| + Version string |
| + Home string |
| + Source string |
| + HomeAndSource string |
| + // Back is the licence page's link back to the Colophon, Missing what |
| + // it says for a package published without a licence file, and |
| + // NotIncluded what it says for a tool whose text is not copied here. |
| + Back string |
| + Missing string |
| + NotIncluded string |
| +} |
| + |
| +// English is the page's words in English. |
| +var English = Labels{ |
| + Contents: "On this page", |
| + Sections: map[string]string{ |
| + "typefaces": "Typefaces", |
| + "go": "Go libraries", |
| + "javascript": "JavaScript libraries", |
| + "rust": "Rust libraries", |
| + "swift": "Swift libraries", |
| + "icons": "Icons and artwork", |
| + "data": "Data", |
| + "tools": "Tools", |
| + "services": "Services", |
| + }, |
| + By: "By", |
| + Licence: "License", |
| + Version: "Version", |
| + Home: "Home page", |
| + Source: "Source", |
| + HomeAndSource: "Home page and source", |
| + Back: "Back to the colophon", |
| + Missing: "This package is published without a license file, so there is no text to show.", |
| + NotIncluded: "This is a tool the app is built or tested with, not part of what it ships, so its license text is not copied here. It is in the project's source.", |
| +} |
| + |
| +// Page is "estilo/colophon"'s data. Intro is the paragraphs under the |
| +// heading. LicenceBase is the path an entry's licence page is under: the |
| +// entry's ID is appended to it. |
| +type Page struct { |
| + Title string |
| + Intro []string |
| + Labels Labels |
| + LicenceBase string |
| + Colophon Colophon |
| +} |
| + |
| +// LicencePage is "estilo/colophon-licence"'s data: one entry's licence |
| +// texts, every package's own. Back is the Colophon's URL. |
| +type LicencePage struct { |
| + Title string |
| + Back string |
| + Labels Labels |
| + Entry Entry |
| +} |
diff --git a/colophon/colophon_test.go b/colophon/colophon_test.go| new file mode 100644 |
| index 0000000..4f2153f |
| --- /dev/null |
| +++ b/colophon/colophon_test.go |
| @@ -0,0 +1,469 @@ |
| +package colophon |
| + |
| +import ( |
| + "bytes" |
| + "html/template" |
| + "net/url" |
| + "regexp" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/estilo.git/credits" |
| + "amadan.net/oficina/estilo.git/internal/tokencheck" |
| +) |
| + |
| +// The catalog is the one place every app's Colophon reads a project's |
| +// description from, so every entry in it must be whole: a blurb, who made |
| +// it, the licence it is under, and links to its home and its source. |
| +func TestCatalogEntriesAreComplete(t *testing.T) { |
| + projects := Catalog() |
| + if len(projects) < 50 { |
| + t.Fatalf("the catalog has %d projects; the checks below would pass nearly vacuously", len(projects)) |
| + } |
| + if err := Validate(projects); err != nil { |
| + t.Fatal(err) |
| + } |
| +} |
| + |
| +func TestValidateRefusesAnIncompleteEntry(t *testing.T) { |
| + good := Project{ID: "yjs", Name: "Yjs", Kind: Library, Blurb: "A CRDT for shared editing. It merges edits without a server deciding the order.", Author: "Kevin Jahns", Licence: Licence{SPDX: "MIT", Name: "MIT License"}, Home: "https://yjs.dev", Source: "https://github.com/yjs/yjs", Packages: []Ref{{Ecosystem: NPM, Name: "yjs"}}, Uses: map[string]string{"docs": "The editor keeps the document in it."}} |
| + if err := Validate([]Project{good}); err != nil { |
| + t.Fatalf("a complete entry was refused: %v", err) |
| + } |
| + for name, spoil := range map[string]func(*Project){ |
| + "no blurb": func(p *Project) { p.Blurb = "" }, |
| + "blurb in lower case": func(p *Project) { p.Blurb = "a CRDT for shared editing." }, |
| + "three sentences": func(p *Project) { p.Blurb = "One thing. Another thing. A third thing." }, |
| + "no author": func(p *Project) { p.Author = " " }, |
| + "no licence name": func(p *Project) { p.Licence.Name = "" }, |
| + "no licence identifier": func(p *Project) { p.Licence.SPDX = "" }, |
| + "no home": func(p *Project) { p.Home = "" }, |
| + "plain-http source": func(p *Project) { p.Source = "http://github.com/yjs/yjs" }, |
| + "script url": func(p *Project) { p.Home = "javascript:alert(1)" }, |
| + "no packages": func(p *Project) { p.Packages = nil }, |
| + "unknown kind": func(p *Project) { p.Kind = "gadget" }, |
| + "unknown ecosystem": func(p *Project) { p.Packages = []Ref{{Ecosystem: "maven", Name: "x"}} }, |
| + "bad id": func(p *Project) { p.ID = "Yjs Project" }, |
| + "empty usage note": func(p *Project) { p.Uses = map[string]string{"docs": ""} }, |
| + "usage not a sentence": func(p *Project) { p.Uses = map[string]string{"docs": "the editor"} }, |
| + } { |
| + p := good |
| + p.Packages = append([]Ref(nil), good.Packages...) |
| + p.Uses = map[string]string{"docs": good.Uses["docs"]} |
| + spoil(&p) |
| + if err := Validate([]Project{p}); err == nil { |
| + t.Errorf("%s: accepted", name) |
| + } |
| + } |
| + twin := good |
| + twin.ID = "yjs-again" |
| + if err := Validate([]Project{good, twin}); err == nil || !strings.Contains(err.Error(), "npm:yjs") { |
| + t.Errorf("one package claimed by two projects was accepted: %v", err) |
| + } |
| + same := good |
| + if err := Validate([]Project{good, same}); err == nil { |
| + t.Error("a duplicate id was accepted") |
| + } |
| +} |
| + |
| +func notice(text string) []credits.Notice { return []credits.Notice{{Name: "LICENSE", Text: text}} } |
| + |
| +func testCatalog() []Project { |
| + return []Project{ |
| + {ID: "yjs", Name: "Yjs", Kind: Library, Blurb: "A CRDT.", Author: "Kevin Jahns", Licence: Licence{"MIT", "MIT License"}, Home: "https://yjs.dev", Source: "https://github.com/yjs/yjs", Packages: []Ref{{NPM, "yjs"}}, Uses: map[string]string{"docs": "Holds the document."}}, |
| + {ID: "prosemirror", Name: "ProseMirror", Kind: Library, Blurb: "An editor toolkit.", Author: "Marijn Haverbeke", Licence: Licence{"MIT", "MIT License"}, Home: "https://prosemirror.net", Source: "https://github.com/ProseMirror", Packages: []Ref{{NPM, "prosemirror-model"}, {NPM, "prosemirror-view"}}, Uses: map[string]string{"docs": "Draws the editor."}}, |
| + {ID: "chi", Name: "chi", Kind: Library, Blurb: "A router.", Author: "Peter Kieltyka", Licence: Licence{"MIT", "MIT License"}, Home: "https://go-chi.io", Source: "https://github.com/go-chi/chi", Packages: []Ref{{Go, "github.com/go-chi/chi/v5"}}, Uses: map[string]string{"docs": "Routes requests."}}, |
| + {ID: "carlito", Name: "Carlito", Kind: Typeface, Blurb: "A sans serif.", Author: "tyPoland", Licence: Licence{"OFL-1.1", "SIL Open Font License 1.1"}, Home: "https://github.com/googlefonts/carlito", Source: "https://github.com/googlefonts/carlito", Packages: []Ref{{Font, "Carlito"}}, Uses: map[string]string{"docs": "The default font."}}, |
| + {ID: "esbuild", Name: "esbuild", Kind: Tool, Blurb: "A bundler.", Author: "Evan Wallace", Licence: Licence{"MIT", "MIT License"}, Home: "https://esbuild.github.io", Source: "https://github.com/evanw/esbuild", Packages: []Ref{{NPM, "esbuild"}}, Uses: map[string]string{"docs": "Builds the editor."}}, |
| + {ID: "wasmi", Name: "wasmi", Kind: Library, Blurb: "A wasm interpreter.", Author: "Parity", Licence: Licence{"MIT OR Apache-2.0", "MIT or Apache 2.0"}, Home: "https://github.com/wasmi-labs/wasmi", Source: "https://github.com/wasmi-labs/wasmi", Packages: []Ref{{Cargo, "wasmi"}, {Cargo, "wasmi_core"}}, Uses: map[string]string{"docs": "Tests the core.", "docs-native": "Runs the core."}}, |
| + {ID: "signin", Name: "signin", Kind: Library, Blurb: "Sign-in.", Author: "Keymail", Licence: Licence{NoAssertion, "No licence published"}, Home: "https://pkg.go.dev/github.com/keymaildev/signin", Source: "https://github.com/keymaildev/signin", Packages: []Ref{{Go, "github.com/keymaildev/signin"}}, Uses: map[string]string{"docs": "Signs people in."}}, |
| + } |
| +} |
| + |
| +func shippedSet() []Package { |
| + return []Package{ |
| + {Ecosystem: NPM, Name: "yjs", Version: "13.6.27", Notices: notice("yjs")}, |
| + {Ecosystem: NPM, Name: "prosemirror-view", Version: "1.42.3", Notices: notice("pmv")}, |
| + {Ecosystem: NPM, Name: "prosemirror-model", Version: "1.25.11", Notices: notice("pmm")}, |
| + {Ecosystem: Go, Name: "github.com/go-chi/chi/v5", Version: "v5.3.2", Notices: notice("chi")}, |
| + {Ecosystem: Font, Name: "Carlito", Notices: notice("OFL")}, |
| + {Ecosystem: NPM, Name: "esbuild", Version: "0.28.2", Tool: true, Notices: notice("esbuild")}, |
| + {Ecosystem: Cargo, Name: "wasmi", Version: "0.32.3", Tool: true, Notices: notice("wasmi")}, |
| + {Ecosystem: Go, Name: "github.com/keymaildev/signin", Version: "v0.1.1"}, |
| + } |
| +} |
| + |
| +func TestBuildGroupsEveryShippedPackageUnderItsProject(t *testing.T) { |
| + c, err := build(testCatalog(), "docs", shippedSet()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var order []string |
| + for _, s := range c.Sections { |
| + var names []string |
| + for _, e := range s.Entries { |
| + names = append(names, e.ID) |
| + } |
| + order = append(order, s.ID+"="+strings.Join(names, ",")) |
| + } |
| + // Typefaces first, then libraries by runtime, then tools. A library |
| + // that this app only builds or tests with (wasmi, a dev-dependency of |
| + // the web core) is a tool here, whatever it is elsewhere. |
| + if got, want := strings.Join(order, " "), "typefaces=carlito go=chi,signin javascript=prosemirror,yjs tools=esbuild,wasmi"; got != want { |
| + t.Fatalf("sections = %s, want %s", got, want) |
| + } |
| + pm, ok := c.Entry("prosemirror") |
| + if !ok || len(pm.Packages) != 2 || pm.Packages[0].Name != "prosemirror-model" || pm.Usage != "Draws the editor." || pm.Blurb != "An editor toolkit." { |
| + t.Fatalf("ProseMirror's two packages or its words were lost: %+v", pm) |
| + } |
| + if got := pm.VersionText(); got != "prosemirror-model 1.25.11, prosemirror-view 1.42.3" { |
| + t.Errorf("VersionText = %q", got) |
| + } |
| + if y, _ := c.Entry("yjs"); y.VersionText() != "13.6.27" { |
| + t.Errorf("a one-package project's version is %q", y.VersionText()) |
| + } |
| + if n := c.Count(); n["typefaces"] != 1 || n["javascript"] != 2 || n["total"] != 7 { |
| + t.Errorf("Count = %v", n) |
| + } |
| +} |
| + |
| +// The test every app's Colophon leans on: the shipped set and the Colophon |
| +// may not differ. Each way they can is refused, by name. |
| +func TestBuildRefusesMissingStaleAndIncompleteEntries(t *testing.T) { |
| + cases := map[string]struct { |
| + app string |
| + shipped func([]Package) []Package |
| + want string |
| + }{ |
| + "a shipped package with no catalog entry": {"docs", func(p []Package) []Package { |
| + return append(p, Package{Ecosystem: Cargo, Name: "yrs", Version: "0.23.5", Notices: notice("yrs")}) |
| + }, "cargo:yrs has no catalog entry"}, |
| + "a shipped project with no usage note for the app": {"docs-native", func(p []Package) []Package { |
| + return []Package{p[0]} |
| + }, "yjs has no usage note for docs-native"}, |
| + "a usage note for a project the app no longer ships": {"docs", func(p []Package) []Package { |
| + return p[1:] |
| + }, "yjs has a usage note for docs but docs does not ship it"}, |
| + "a package without its licence text": {"docs", func(p []Package) []Package { |
| + p[0].Notices = nil |
| + return p |
| + }, "npm:yjs 13.6.27 carries no licence text"}, |
| + "an unnamed package": {"docs", func(p []Package) []Package { |
| + return append(p, Package{Ecosystem: NPM}) |
| + }, "a package without an ecosystem or name"}, |
| + } |
| + for name, tc := range cases { |
| + t.Run(name, func(t *testing.T) { |
| + _, err := build(testCatalog(), tc.app, tc.shipped(shippedSet())) |
| + if err == nil || !strings.Contains(err.Error(), tc.want) { |
| + t.Fatalf("err = %v, want it to say %q", err, tc.want) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestBuildMergesAPackageSeenTwice(t *testing.T) { |
| + p := shippedSet() |
| + // The same crate from two builds: once shipped, once only as a tool. |
| + p = append(p, Package{Ecosystem: Cargo, Name: "wasmi", Version: "0.32.3", Notices: notice("wasmi")}) |
| + c, err := build(testCatalog(), "docs", p) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + w, _ := c.Entry("wasmi") |
| + if len(w.Packages) != 1 || w.Packages[0].Tool { |
| + t.Fatalf("wasmi = %+v, want one shipped package", w.Packages) |
| + } |
| + if c.sectionOf("wasmi") != "rust" { |
| + t.Errorf("a shipped wasmi is in %q", c.sectionOf("wasmi")) |
| + } |
| +} |
| + |
| +func parse(t *testing.T) *template.Template { |
| + t.Helper() |
| + return template.Must(template.New("").ParseFS(Templates(), "templates/*.html")) |
| +} |
| + |
| +func page(t *testing.T, c Colophon, labels Labels) string { |
| + t.Helper() |
| + var out bytes.Buffer |
| + if err := parse(t).ExecuteTemplate(&out, "estilo/colophon", Page{Title: "Colophon", Intro: []string{"What Docs is made with."}, Labels: labels, LicenceBase: "/help/colophon/", Colophon: c}); err != nil { |
| + t.Fatal(err) |
| + } |
| + return out.String() |
| +} |
| + |
| +func TestPageNamesEachProjectAndLinksItsLicenceHomeAndSource(t *testing.T) { |
| + c, err := build(testCatalog(), "docs", shippedSet()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + html := page(t, c, English) |
| + for _, want := range []string{ |
| + "<h1>Colophon</h1>", "<p>What Docs is made with.</p>", |
| + `<h2 id="colophon-typefaces">Typefaces</h2>`, `<h2 id="colophon-go">Go libraries</h2>`, |
| + `<h2 id="colophon-javascript">JavaScript libraries</h2>`, `<h2 id="colophon-tools">Tools</h2>`, |
| + `<h3><bdi>ProseMirror</bdi></h3>`, "An editor toolkit. Draws the editor.", |
| + "<dt>By</dt>", "<dd>Marijn Haverbeke</dd>", |
| + `<a href="/help/colophon/prosemirror">MIT License</a>`, |
| + `<a href="https://prosemirror.net" rel="noreferrer" referrerpolicy="no-referrer">Home page</a>`, |
| + `<a href="https://github.com/ProseMirror" rel="noreferrer" referrerpolicy="no-referrer">Source</a>`, |
| + // Home and source the same address: one link that says so. |
| + `<a href="https://github.com/googlefonts/carlito" rel="noreferrer" referrerpolicy="no-referrer">Home page and source</a>`, |
| + `<a href="#colophon-javascript">JavaScript libraries</a>`, |
| + } { |
| + if !strings.Contains(html, want) { |
| + t.Errorf("the page lost %q", want) |
| + } |
| + } |
| + if strings.Contains(html, "<script") || strings.Contains(html, " on") && regexp.MustCompile(`\son[a-z]+=`).MatchString(html) { |
| + t.Error("the page carries script; it must work without") |
| + } |
| + if regexp.MustCompile(`<h[4-6]`).MatchString(html) { |
| + t.Error("the page skips heading levels") |
| + } |
| + // Every section is in the contents, and every entry has its own anchor. |
| + if strings.Count(html, `<a href="#colophon-`) != len(c.Sections) { |
| + t.Error("the contents and the sections disagree") |
| + } |
| + for _, s := range c.Sections { |
| + for _, e := range s.Entries { |
| + if !strings.Contains(html, `id="colophon-`+e.ID+`"`) { |
| + t.Errorf("%s has no anchor", e.ID) |
| + } |
| + } |
| + } |
| +} |
| + |
| +func TestPageEscapesCatalogTextAndRefusesUnsafeLinks(t *testing.T) { |
| + cat := testCatalog() |
| + cat[0].Name = "<img src=x onerror=alert(1)>" |
| + cat[0].Blurb = "Fast & <b>small</b>." |
| + cat[0].Home = "javascript:alert(1)" |
| + c, err := build(cat, "docs", shippedSet()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + html := page(t, c, English) |
| + if strings.Contains(html, "<img") || strings.Contains(html, "<b>") || !strings.Contains(html, "Fast & <b>small</b>.") { |
| + t.Fatal("catalog text was interpreted as markup") |
| + } |
| + if strings.Contains(html, `href="javascript:`) { |
| + t.Fatal("an unsafe home URL reached a link") |
| + } |
| +} |
| + |
| +// Every label is the caller's, so a page in any of the twelve locales is |
| +// the caller's translation and the catalog's original words. |
| +func TestLabelsAreTheCallers(t *testing.T) { |
| + c, err := build(testCatalog(), "docs", shippedSet()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + for _, label := range []string{"Foinse oscailte", "Código abierto", "オープンソース", "المصدر المفتوح"} { |
| + l := English |
| + l.By, l.Licence, l.Home, l.Source, l.HomeAndSource, l.Contents = label+"-by", label+"-licence", label+"-home", label+"-source", label+"-both", label+"-contents" |
| + l.Sections = map[string]string{} |
| + for k := range English.Sections { |
| + l.Sections[k] = label + "-" + k |
| + } |
| + html := page(t, c, l) |
| + for _, want := range []string{label + "-by", label + "-licence", label + "-home", label + "-source", label + "-both", label + "-contents", label + "-typefaces", label + "-tools"} { |
| + if !strings.Contains(html, template.HTMLEscapeString(want)) { |
| + t.Errorf("%s lost", want) |
| + } |
| + } |
| + } |
| +} |
| + |
| +func TestLicencePageShowsEveryPackagesOriginalText(t *testing.T) { |
| + c, err := build(testCatalog(), "docs", shippedSet()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + pm, _ := c.Entry("prosemirror") |
| + pm.Packages[0].Notices = []credits.Notice{{Name: "LICENSE", Text: "\nCopyright <Marijn>\nPermission & conditions"}} |
| + var out bytes.Buffer |
| + if err := parse(t).ExecuteTemplate(&out, "estilo/colophon-licence", LicencePage{Title: "ProseMirror: licence", Back: "/help/colophon#colophon-prosemirror", Labels: English, Entry: pm}); err != nil { |
| + t.Fatal(err) |
| + } |
| + html := out.String() |
| + for _, want := range []string{ |
| + "<h1>ProseMirror: licence</h1>", |
| + `<a href="/help/colophon#colophon-prosemirror">Back to the colophon</a>`, |
| + "<h2><bdi>prosemirror-model</bdi> 1.25.11</h2>", "<h2><bdi>prosemirror-view</bdi> 1.42.3</h2>", |
| + // The parser drops a <pre>'s first newline, so the template adds one. |
| + "<pre>\n\nCopyright <Marijn>\nPermission & conditions</pre>", |
| + } { |
| + if !strings.Contains(html, want) { |
| + t.Errorf("the licence page lost %q", want) |
| + } |
| + } |
| + signin, _ := c.Entry("signin") |
| + out.Reset() |
| + if err := parse(t).ExecuteTemplate(&out, "estilo/colophon-licence", LicencePage{Title: "signin", Back: "/help/colophon", Labels: English, Entry: signin}); err != nil { |
| + t.Fatal(err) |
| + } |
| + if !strings.Contains(out.String(), English.Missing) { |
| + t.Error("a package published without a licence file does not say so") |
| + } |
| +} |
| + |
| +// The no-flash rule (AGENTS.md row 9): the Colophon is chrome, set in the |
| +// system UI face it inherits. Its stylesheet declares no face and fetches |
| +// nothing. |
| +func TestStylesheetDeclaresNoFaceAndReadsOnlyDefinedTokens(t *testing.T) { |
| + css := string(CSS()) |
| + for _, banned := range []string{"@font-face", "url(", "@import"} { |
| + if strings.Contains(css, banned) { |
| + t.Errorf("colophon.css contains %s", banned) |
| + } |
| + } |
| + for _, m := range regexp.MustCompile(`font(-family)?\s*:\s*([^;}]+)`).FindAllStringSubmatch(css, -1) { |
| + if strings.TrimSpace(m[2]) != "inherit" { |
| + t.Errorf("colophon.css sets a font: %q", m[0]) |
| + } |
| + } |
| + missing, n := tokencheck.Undefined(CSS()) |
| + if n == 0 || len(missing) > 0 { |
| + t.Fatalf("colophon.css reads %d tokens, undefined: %v", n, missing) |
| + } |
| + // 24px targets for every link (WCAG 2.5.8, without the spacing exception). |
| + if !strings.Contains(css, "min-block-size: 24px") { |
| + t.Error("links lost their 24px target") |
| + } |
| +} |
| + |
| +func TestEnglishLabelsCoverEverySection(t *testing.T) { |
| + for _, id := range sectionOrder { |
| + if English.Sections[id] == "" { |
| + t.Errorf("no English heading for %s", id) |
| + } |
| + } |
| + for _, p := range Catalog() { |
| + for _, u := range []string{p.Home, p.Source} { |
| + if parsed, err := url.Parse(u); err != nil || parsed.Host == "" { |
| + t.Errorf("%s: %q", p.ID, u) |
| + } |
| + } |
| + } |
| +} |
| + |
| +// A tool is not in what the app ships, so its licence text is not |
| +// required; the licence page says why there is none and where it is. |
| +func TestAToolNeedsNoLicenceTextAndSaysWhereItIs(t *testing.T) { |
| + p := shippedSet() |
| + p[5].Notices = nil // esbuild |
| + c, err := build(testCatalog(), "docs", p) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + e, _ := c.Entry("esbuild") |
| + var out bytes.Buffer |
| + if err := parse(t).ExecuteTemplate(&out, "estilo/colophon-licence", LicencePage{Title: "esbuild", Back: "/help/colophon", Labels: English, Entry: e}); err != nil { |
| + t.Fatal(err) |
| + } |
| + html := out.String() |
| + if !strings.Contains(html, template.HTMLEscapeString(English.NotIncluded)) || !strings.Contains(html, `<a href="https://github.com/evanw/esbuild" rel="noreferrer" referrerpolicy="no-referrer">Source</a>`) { |
| + t.Fatalf("a tool's licence page does not say where its licence is:\n%s", html) |
| + } |
| + if strings.Contains(html, English.Missing) { |
| + t.Error("a tool's licence page says it was published without one") |
| + } |
| +} |
| + |
| +// A blurb may open with any capital, not only an ASCII one: Validate runs |
| +// at init, so a byte-wise check would stop every consumer starting. |
| +func TestValidateReadsTheFirstLetterNotTheFirstByte(t *testing.T) { |
| + p := testCatalog()[3] |
| + for blurb, ok := range map[string]bool{ |
| + "Łukasz Dziedzic drew it, after his Lato.": true, |
| + "Égalité is a serif.": true, |
| + "łukasz drew it.": false, |
| + } { |
| + p.Blurb = blurb |
| + if err := Validate([]Project{p}); (err == nil) != ok { |
| + t.Errorf("%q: accepted=%v, want %v (%v)", blurb, err == nil, ok, err) |
| + } |
| + } |
| +} |
| + |
| +// One note for every app (Uses["*"]) saves writing "Yrs uses it." once per |
| +// app; an app's own note wins, and a default is never stale. |
| +func TestADefaultUsageNoteServesEveryAppWithoutItsOwn(t *testing.T) { |
| + cat := testCatalog() |
| + cat[0].Uses = map[string]string{"*": "Holds every document.", "docs-native": "Holds the app's documents."} |
| + cat[1].Uses = map[string]string{"*": "Draws the editor."} |
| + cat[5].Uses = map[string]string{"docs": "Tests the core."} |
| + c, err := build(cat, "docs", shippedSet()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if y, _ := c.Entry("yjs"); y.Usage != "Holds every document." { |
| + t.Errorf("docs reads %q, want the default", y.Usage) |
| + } |
| + native, err := build(cat, "docs-native", []Package{shippedSet()[0]}) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if y, _ := native.Entry("yjs"); y.Usage != "Holds the app's documents." { |
| + t.Errorf("docs-native reads %q, want its own note", y.Usage) |
| + } |
| + // prosemirror's default names no app, so not shipping it is not stale. |
| + if _, err := build(cat, "docs-native", []Package{shippedSet()[0]}); err != nil { |
| + t.Errorf("an unshipped project's default note was called stale: %v", err) |
| + } |
| +} |
| + |
| +// The catalog's words appear on US-English pages (Docs' catalog is en-US), |
| +// so they are written in US English. |
| +func TestCatalogIsInUSEnglish(t *testing.T) { |
| + british := regexp.MustCompile(`(?i)\b(licen[cs]e[ds]? published|licence\w*|\w+isation|\w+ised|\w+ises|normalis\w*|synchronis\w*|maths|colour\w*|centre)\b`) |
| + for _, p := range Catalog() { |
| + texts := []string{p.Blurb, p.Licence.Name} |
| + for _, u := range p.Uses { |
| + texts = append(texts, u) |
| + } |
| + for _, s := range texts { |
| + for _, w := range british.FindAllString(s, -1) { |
| + if strings.EqualFold(w, "license published") || strings.HasPrefix(strings.ToLower(w), "license") { |
| + continue |
| + } |
| + t.Errorf("%s: %q is British English", p.ID, w) |
| + } |
| + } |
| + } |
| +} |
| + |
| +// The entries, blurbs, authors and licence texts are English on a page in |
| +// the request's locale; they say so (WCAG 3.1.2). The caller's labels do not. |
| +func TestTheCatalogsEnglishIsMarkedAsEnglish(t *testing.T) { |
| + c, err := build(testCatalog(), "docs", shippedSet()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + html := page(t, c, English) |
| + if strings.Count(html, `<ul role="list" estilo-colophon-entries lang="en">`) != len(c.Sections) { |
| + t.Error("an entries list is not marked lang=\"en\"") |
| + } |
| + if strings.Contains(html, `<article estilo-colophon lang=`) { |
| + t.Error("the whole page is marked English; the caller's labels are in its locale") |
| + } |
| + pm, _ := c.Entry("prosemirror") |
| + var out bytes.Buffer |
| + if err := parse(t).ExecuteTemplate(&out, "estilo/colophon-licence", LicencePage{Title: "t", Back: "/b", Labels: English, Entry: pm}); err != nil { |
| + t.Fatal(err) |
| + } |
| + if strings.Count(out.String(), `<section estilo-colophon-licence lang="en">`) != len(pm.Packages) { |
| + t.Error("a licence section is not marked lang=\"en\"") |
| + } |
| +} |
| + |
| +// At 320px a label beside a long value must not be squeezed: flex shrinks |
| +// a dt that overflow-wrap lets break anywhere ("Ver/si/on"). Docs' |
| +// browser check measures it; this holds the rule in the stylesheet. |
| +func TestADefinitionLabelNeverShrinks(t *testing.T) { |
| + if !regexp.MustCompile(`\[estilo-colophon-entry\] dt \{[^}]*flex: none`).MatchString(string(CSS())) { |
| + t.Error("colophon.css lets a dt shrink") |
| + } |
| +} |
diff --git a/colophon/inventory.go b/colophon/inventory.go| new file mode 100644 |
| index 0000000..7a74fdd |
| --- /dev/null |
| +++ b/colophon/inventory.go |
| @@ -0,0 +1,296 @@ |
| +package colophon |
| + |
| +// The collectors: each turns one kind of build's own record of what it |
| +// used into Packages, with each package's licence files read from where |
| +// the build read the package. Go modules come from credits/catalog.Collect |
| +// (go list -deps of the production entry point) through FromComponents. |
| + |
| +import ( |
| + "encoding/json" |
| + "errors" |
| + "fmt" |
| + "io" |
| + "os" |
| + "path/filepath" |
| + "sort" |
| + "strings" |
| + "unicode/utf8" |
| + |
| + "amadan.net/oficina/estilo.git/credits" |
| + "amadan.net/oficina/estilo.git/credits/catalog" |
| +) |
| + |
| +// FromComponents is credits components (catalog.Collect's inventory) as |
| +// Packages of ecosystem. |
| +func FromComponents(ecosystem string, components []credits.Component) []Package { |
| + out := make([]Package, 0, len(components)) |
| + for _, c := range components { |
| + out = append(out, Package{Ecosystem: ecosystem, Name: c.Name, Version: c.Version, Notices: append([]credits.Notice{}, c.Notices...)}) |
| + } |
| + return out |
| +} |
| + |
| +var sourceSuffixes = []string{".go", ".rs", ".js", ".mjs", ".cjs", ".ts", ".c", ".h", ".py", ".swift", ".json", ".toml"} |
| + |
| +// DirNotices reads the licence files at the top of dir, the names |
| +// credits/catalog recognises (LICENSE, LICENCE, COPYING, NOTICE, and those |
| +// with a suffix), skipping source files. A symlink, an oversized file, an |
| +// empty one or one that is not UTF-8 is refused rather than skipped. |
| +func DirNotices(dir string) ([]credits.Notice, error) { |
| + entries, err := os.ReadDir(dir) |
| + if err != nil { |
| + return nil, err |
| + } |
| + notices := []credits.Notice{} |
| + for _, entry := range entries { |
| + name := entry.Name() |
| + lower := strings.ToLower(name) |
| + source := false |
| + for _, s := range sourceSuffixes { |
| + source = source || strings.HasSuffix(lower, s) |
| + } |
| + if entry.IsDir() || source || !catalog.NoticeFilename(name) { |
| + continue |
| + } |
| + full := filepath.Join(dir, name) |
| + info, err := os.Lstat(full) |
| + if err != nil { |
| + return nil, err |
| + } |
| + if !info.Mode().IsRegular() || info.Size() > 2<<20 { |
| + return nil, fmt.Errorf("colophon: %s is not a bounded regular file", full) |
| + } |
| + raw, err := os.ReadFile(full) |
| + if err != nil { |
| + return nil, err |
| + } |
| + if !utf8.Valid(raw) || strings.TrimSpace(string(raw)) == "" { |
| + return nil, fmt.Errorf("colophon: %s is empty or not UTF-8", full) |
| + } |
| + notices = append(notices, credits.Notice{Name: name, Text: string(raw)}) |
| + } |
| + sort.Slice(notices, func(i, j int) bool { return notices[i].Name < notices[j].Name }) |
| + return notices, nil |
| +} |
| + |
| +type cargoMetadata struct { |
| + Packages []struct { |
| + ID, Name, Version string |
| + ManifestPath string `json:"manifest_path"` |
| + Targets []struct { |
| + Kind []string |
| + } |
| + } |
| + Resolve *struct { |
| + Root string |
| + Nodes []struct { |
| + ID string |
| + Deps []struct { |
| + Pkg string |
| + DepKinds []struct { |
| + Kind *string |
| + } `json:"dep_kinds"` |
| + } |
| + } |
| + } |
| +} |
| + |
| +func readCargoMetadata(metadata io.Reader) (cargoMetadata, error) { |
| + var m cargoMetadata |
| + if err := json.NewDecoder(metadata).Decode(&m); err != nil { |
| + return m, err |
| + } |
| + if m.Resolve == nil || m.Resolve.Root == "" { |
| + return m, errors.New("colophon: cargo metadata has no resolve graph with a root") |
| + } |
| + return m, nil |
| +} |
| + |
| +func (m cargoMetadata) pkg(id string) (Package, error) { |
| + for _, p := range m.Packages { |
| + if p.ID == id { |
| + notices := []credits.Notice{} |
| + if _, err := os.Stat(filepath.Dir(p.ManifestPath)); err == nil { |
| + var e error |
| + if notices, e = DirNotices(filepath.Dir(p.ManifestPath)); e != nil { |
| + return Package{}, e |
| + } |
| + } |
| + return Package{Ecosystem: Cargo, Name: p.Name, Version: p.Version, Notices: notices}, nil |
| + } |
| + } |
| + return Package{}, fmt.Errorf("colophon: cargo metadata has no package %s", id) |
| +} |
| + |
| +// CollectCargoTools is a crate's direct dev-dependencies, as tools: what |
| +// its tests are built with, unless it ships them anyway. Their own |
| +// dependencies are theirs, not the app's. |
| +func CollectCargoTools(metadata io.Reader) ([]Package, error) { |
| + m, err := readCargoMetadata(metadata) |
| + if err != nil { |
| + return nil, err |
| + } |
| + var out []Package |
| + for _, n := range m.Resolve.Nodes { |
| + if n.ID != m.Resolve.Root { |
| + continue |
| + } |
| + for _, d := range n.Deps { |
| + dev := len(d.DepKinds) > 0 |
| + for _, k := range d.DepKinds { |
| + dev = dev && k.Kind != nil && *k.Kind == "dev" |
| + } |
| + if !dev { |
| + continue |
| + } |
| + p, err := m.pkg(d.Pkg) |
| + if err != nil { |
| + return nil, err |
| + } |
| + p.Tool = true |
| + out = append(out, p) |
| + } |
| + } |
| + sort.Slice(out, func(i, j int) bool { return out[i].Name < out[j].Name }) |
| + return out, nil |
| +} |
| + |
| +// CollectCargo is the crates one build uses, from `cargo metadata --locked |
| +// --format-version 1 --filter-platform <target>` run on its manifest: |
| +// everything the root reaches through normal and build dependencies, never |
| +// through a dev-dependency, and not the root itself. A crate the build only |
| +// runs while compiling (a proc-macro, a build dependency, or anything |
| +// reached only through one) is not linked into what ships, so it is marked |
| +// Tool; one also reached through ordinary dependencies ships. |
| +func CollectCargo(metadata io.Reader) ([]Package, error) { |
| + m, err := readCargoMetadata(metadata) |
| + if err != nil { |
| + return nil, err |
| + } |
| + nodes := map[string]int{} |
| + for i, n := range m.Resolve.Nodes { |
| + nodes[n.ID] = i |
| + } |
| + seen := map[string]bool{} |
| + pending := []string{m.Resolve.Root} |
| + for len(pending) > 0 { |
| + id := pending[len(pending)-1] |
| + pending = pending[:len(pending)-1] |
| + if seen[id] { |
| + continue |
| + } |
| + seen[id] = true |
| + n, ok := nodes[id] |
| + if !ok { |
| + return nil, fmt.Errorf("colophon: cargo metadata has no node for %s", id) |
| + } |
| + for _, d := range m.Resolve.Nodes[n].Deps { |
| + for _, k := range d.DepKinds { |
| + if k.Kind == nil || *k.Kind != "dev" { |
| + pending = append(pending, d.Pkg) |
| + break |
| + } |
| + } |
| + } |
| + } |
| + // linked: reached from the root through normal dependencies only, |
| + // without passing through a proc-macro (which runs in the compiler and |
| + // is not linked, nor is anything only it uses). |
| + macro := map[string]bool{} |
| + for _, p := range m.Packages { |
| + for _, t := range p.Targets { |
| + for _, k := range t.Kind { |
| + macro[p.ID] = macro[p.ID] || k == "proc-macro" |
| + } |
| + } |
| + } |
| + linked := map[string]bool{} |
| + pending = []string{m.Resolve.Root} |
| + for len(pending) > 0 { |
| + id := pending[len(pending)-1] |
| + pending = pending[:len(pending)-1] |
| + if linked[id] || macro[id] { |
| + continue |
| + } |
| + linked[id] = true |
| + for _, d := range m.Resolve.Nodes[nodes[id]].Deps { |
| + for _, k := range d.DepKinds { |
| + if k.Kind == nil { |
| + pending = append(pending, d.Pkg) |
| + break |
| + } |
| + } |
| + } |
| + } |
| + var out []Package |
| + for id := range seen { |
| + if id == m.Resolve.Root { |
| + continue |
| + } |
| + p, err := m.pkg(id) |
| + if err != nil { |
| + return nil, err |
| + } |
| + p.Tool = !linked[id] |
| + out = append(out, p) |
| + } |
| + sort.Slice(out, func(i, j int) bool { |
| + if out[i].Name != out[j].Name { |
| + return out[i].Name < out[j].Name |
| + } |
| + return out[i].Version < out[j].Version |
| + }) |
| + return out, nil |
| +} |
| + |
| +// CollectNPM is the packages a bundle was built from. inputs are the input paths |
| +// of esbuild's metafile, relative to root; those outside node_modules are |
| +// the app's own and are skipped. Each package is the directory after the |
| +// last node_modules in a path, with its own package.json and licence. |
| +func CollectNPM(root string, inputs []string) ([]Package, error) { |
| + dirs := map[string]bool{} |
| + for _, input := range inputs { |
| + clean := filepath.ToSlash(filepath.Clean(input)) |
| + if clean != input || filepath.IsAbs(input) { |
| + return nil, fmt.Errorf("colophon: bundle input %q is not a plain relative path", input) |
| + } |
| + at := strings.LastIndex(clean, "node_modules/") |
| + if at < 0 { |
| + continue // the app's own source |
| + } |
| + if strings.HasPrefix(clean, "../") { |
| + return nil, fmt.Errorf("colophon: bundle input %q is a package outside %s", input, root) |
| + } |
| + rest := strings.Split(clean[at+len("node_modules/"):], "/") |
| + n := 1 |
| + if strings.HasPrefix(rest[0], "@") { |
| + n = 2 |
| + } |
| + if len(rest) <= n { |
| + return nil, fmt.Errorf("colophon: bundle input %q is not inside a package", input) |
| + } |
| + dirs[clean[:at+len("node_modules/")]+strings.Join(rest[:n], "/")] = true |
| + } |
| + var out []Package |
| + for dir := range dirs { |
| + full := filepath.Join(root, filepath.FromSlash(dir)) |
| + raw, err := os.ReadFile(filepath.Join(full, "package.json")) |
| + if err != nil { |
| + return nil, err |
| + } |
| + var manifest struct{ Name, Version string } |
| + if err := json.Unmarshal(raw, &manifest); err != nil { |
| + return nil, fmt.Errorf("colophon: %s/package.json: %w", dir, err) |
| + } |
| + if want := dir[strings.LastIndex(dir, "node_modules/")+len("node_modules/"):]; manifest.Name != want || manifest.Version == "" { |
| + return nil, fmt.Errorf("colophon: %s/package.json names %q %q", dir, manifest.Name, manifest.Version) |
| + } |
| + notices, err := DirNotices(full) |
| + if err != nil { |
| + return nil, err |
| + } |
| + out = append(out, Package{Ecosystem: NPM, Name: manifest.Name, Version: manifest.Version, Notices: notices}) |
| + } |
| + sort.Slice(out, func(i, j int) bool { return out[i].Name < out[j].Name }) |
| + return out, nil |
| +} |
diff --git a/colophon/inventory_test.go b/colophon/inventory_test.go| new file mode 100644 |
| index 0000000..4c5acb9 |
| --- /dev/null |
| +++ b/colophon/inventory_test.go |
| @@ -0,0 +1,194 @@ |
| +package colophon |
| + |
| +import ( |
| + "os" |
| + "path/filepath" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/estilo.git/credits" |
| +) |
| + |
| +func write(t *testing.T, path, text string) { |
| + t.Helper() |
| + if err := os.MkdirAll(filepath.Dir(path), 0o700); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := os.WriteFile(path, []byte(text), 0o600); err != nil { |
| + t.Fatal(err) |
| + } |
| +} |
| + |
| +// cargo metadata's shape, cut to what Cargo reads: the root's normal and |
| +// build dependencies ship (a build dependency's licence travels with |
| +// what it generated), a dev-dependency does not, and nothing reachable |
| +// only through a dev-dependency does either. |
| +func TestCargoWalksNormalAndBuildDependenciesOnly(t *testing.T) { |
| + root := t.TempDir() |
| + for _, crate := range []string{"yrs", "serde_derive", "wasmparser", "only-via-dev"} { |
| + write(t, filepath.Join(root, crate, "Cargo.toml"), "") |
| + write(t, filepath.Join(root, crate, "LICENSE-MIT"), crate+" licence\n") |
| + write(t, filepath.Join(root, crate, "license.rs"), "// source, not a notice") |
| + } |
| + write(t, filepath.Join(root, "bare", "Cargo.toml"), "") |
| + manifest := func(c string) string { return filepath.Join(root, c, "Cargo.toml") } |
| + meta := `{"packages":[ |
| + {"id":"app","name":"docs-core","version":"0.1.0","manifest_path":"` + filepath.Join(root, "app", "Cargo.toml") + `"}, |
| + {"id":"yrs","name":"yrs","version":"0.23.5","manifest_path":"` + manifest("yrs") + `"}, |
| + {"id":"sd","name":"serde_derive","version":"1.0.229","manifest_path":"` + manifest("serde_derive") + `"}, |
| + {"id":"wp","name":"wasmparser","version":"0.258.0","manifest_path":"` + manifest("wasmparser") + `"}, |
| + {"id":"dv","name":"only-via-dev","version":"1.0.0","manifest_path":"` + manifest("only-via-dev") + `"}, |
| + {"id":"bare","name":"bare","version":"2.0.0","manifest_path":"` + manifest("bare") + `"}], |
| + "resolve":{"root":"app","nodes":[ |
| + {"id":"app","deps":[{"pkg":"yrs","dep_kinds":[{"kind":null}]},{"pkg":"sd","dep_kinds":[{"kind":"build"}]},{"pkg":"wp","dep_kinds":[{"kind":"dev"}]}]}, |
| + {"id":"yrs","deps":[{"pkg":"bare","dep_kinds":[{"kind":null}]}]}, |
| + {"id":"sd","deps":[]},{"id":"bare","deps":[]}, |
| + {"id":"wp","deps":[{"pkg":"dv","dep_kinds":[{"kind":null}]}]},{"id":"dv","deps":[]}]}}` |
| + got, err := CollectCargo(strings.NewReader(meta)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var names []string |
| + for _, p := range got { |
| + names = append(names, p.Name+"@"+p.Version) |
| + if p.Ecosystem != Cargo { |
| + t.Errorf("%s is %s", p.Name, p.Ecosystem) |
| + } |
| + } |
| + if strings.Join(names, " ") != "bare@2.0.0 serde_derive@1.0.229 yrs@0.23.5" { |
| + t.Fatalf("crates = %v", names) |
| + } |
| + if len(got[2].Notices) != 1 || got[2].Notices[0].Name != "LICENSE-MIT" || got[2].Notices[0].Text != "yrs licence\n" { |
| + t.Fatalf("yrs notices = %+v (a .rs file is source, not a notice)", got[2].Notices) |
| + } |
| + if len(got[0].Notices) != 0 { |
| + t.Fatal("a crate with no licence file was given one") |
| + } |
| + if _, err := CollectCargo(strings.NewReader(`{"packages":[],"resolve":null}`)); err == nil { |
| + t.Fatal("metadata without a resolve graph was accepted (run without --locked?)") |
| + } |
| +} |
| + |
| +// esbuild's metafile names every input file it bundled; the packages are |
| +// the node_modules directories those files are in, with their own |
| +// package.json and licence. |
| +func TestNPMNamesThePackagesTheBundleRead(t *testing.T) { |
| + root := t.TempDir() |
| + write(t, filepath.Join(root, "node_modules/yjs/package.json"), `{"name":"yjs","version":"13.6.27"}`) |
| + write(t, filepath.Join(root, "node_modules/yjs/LICENSE"), "yjs licence") |
| + write(t, filepath.Join(root, "node_modules/yjs/dist/yjs.mjs"), "") |
| + write(t, filepath.Join(root, "node_modules/@scope/pkg/package.json"), `{"name":"@scope/pkg","version":"1.0.0"}`) |
| + write(t, filepath.Join(root, "node_modules/@scope/pkg/LICENSE.md"), "scoped licence") |
| + write(t, filepath.Join(root, "node_modules/@scope/pkg/lib/a.js"), "") |
| + // A package nested under another's node_modules is its own package. |
| + write(t, filepath.Join(root, "node_modules/yjs/node_modules/lib0/package.json"), `{"name":"lib0","version":"0.2.117"}`) |
| + write(t, filepath.Join(root, "node_modules/yjs/node_modules/lib0/LICENSE"), "lib0 licence") |
| + write(t, filepath.Join(root, "node_modules/yjs/node_modules/lib0/index.js"), "") |
| + inputs := []string{"node_modules/yjs/dist/yjs.mjs", "editor-entry.js", "node_modules/@scope/pkg/lib/a.js", "node_modules/yjs/node_modules/lib0/index.js", "node_modules/yjs/dist/yjs.mjs"} |
| + got, err := CollectNPM(root, inputs) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var names []string |
| + for _, p := range got { |
| + names = append(names, p.Name+"@"+p.Version+":"+p.Notices[0].Text) |
| + } |
| + if strings.Join(names, " ") != "@scope/pkg@1.0.0:scoped licence lib0@0.2.117:lib0 licence yjs@13.6.27:yjs licence" { |
| + t.Fatalf("packages = %v", names) |
| + } |
| + write(t, filepath.Join(root, "node_modules/liar/package.json"), `{"name":"someone-else","version":"1.0.0"}`) |
| + write(t, filepath.Join(root, "node_modules/liar/x.js"), "") |
| + if _, err := CollectNPM(root, []string{"node_modules/liar/x.js"}); err == nil { |
| + t.Fatal("a package.json naming a different package was accepted") |
| + } |
| + if _, err := CollectNPM(root, []string{"node_modules/../../etc/passwd"}); err == nil { |
| + t.Fatal("an input outside node_modules was accepted") |
| + } |
| +} |
| + |
| +func TestFromComponentsKeepsNamesVersionsAndNotices(t *testing.T) { |
| + got := FromComponents(Go, []credits.Component{{Name: "github.com/go-chi/chi/v5", Version: "v5.3.2", Notices: notice("chi")}}) |
| + if len(got) != 1 || got[0].Ecosystem != Go || got[0].Name != "github.com/go-chi/chi/v5" || got[0].Version != "v5.3.2" || got[0].Notices[0].Text != "chi" { |
| + t.Fatalf("%+v", got) |
| + } |
| +} |
| + |
| +func TestDirNoticesRefusesSymlinksAndEmptyFiles(t *testing.T) { |
| + dir := t.TempDir() |
| + write(t, filepath.Join(dir, "COPYING"), " \n") |
| + if _, err := DirNotices(dir); err == nil { |
| + t.Fatal("an empty notice was accepted") |
| + } |
| + dir = t.TempDir() |
| + write(t, filepath.Join(dir, "real"), "text") |
| + if err := os.Symlink(filepath.Join(dir, "real"), filepath.Join(dir, "LICENSE")); err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := DirNotices(dir); err == nil { |
| + t.Fatal("a symlinked notice was accepted") |
| + } |
| +} |
| + |
| +// A crate's tools are its direct dev-dependencies: what its tests run |
| +// on, named once. What they in turn depend on is theirs, not the app's. |
| +func TestCollectCargoToolsIsTheDirectDevDependencies(t *testing.T) { |
| + root := t.TempDir() |
| + write(t, filepath.Join(root, "wp", "LICENSE-APACHE"), "wasmparser licence") |
| + meta := `{"packages":[ |
| + {"id":"app","name":"docs-core","version":"0.1.0","manifest_path":"` + filepath.Join(root, "app", "Cargo.toml") + `"}, |
| + {"id":"yrs","name":"yrs","version":"0.23.5","manifest_path":"` + filepath.Join(root, "yrs", "Cargo.toml") + `"}, |
| + {"id":"wp","name":"wasmparser","version":"0.258.0","manifest_path":"` + filepath.Join(root, "wp", "Cargo.toml") + `"}, |
| + {"id":"both","name":"serde_json","version":"1.0.151","manifest_path":"` + filepath.Join(root, "both", "Cargo.toml") + `"}, |
| + {"id":"dv","name":"only-via-dev","version":"1.0.0","manifest_path":"` + filepath.Join(root, "dv", "Cargo.toml") + `"}], |
| + "resolve":{"root":"app","nodes":[ |
| + {"id":"app","deps":[{"pkg":"yrs","dep_kinds":[{"kind":null}]},{"pkg":"wp","dep_kinds":[{"kind":"dev"}]},{"pkg":"both","dep_kinds":[{"kind":"dev"},{"kind":null}]}]}, |
| + {"id":"yrs","deps":[]},{"id":"both","deps":[]}, |
| + {"id":"wp","deps":[{"pkg":"dv","dep_kinds":[{"kind":null}]}]},{"id":"dv","deps":[]}]}}` |
| + got, err := CollectCargoTools(strings.NewReader(meta)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if len(got) != 1 || got[0].Name != "wasmparser" || !got[0].Tool || got[0].Notices[0].Text != "wasmparser licence" { |
| + t.Fatalf("tools = %+v", got) |
| + } |
| +} |
| + |
| +// Proc-macros and build dependencies run while the crate is compiled and |
| +// are not linked into what ships, nor is anything reached only through |
| +// them; CollectCargo marks them tools. A crate linked as well as used by a |
| +// macro ships. |
| +func TestCollectCargoMarksMacroAndBuildOnlyCratesAsTools(t *testing.T) { |
| + root := t.TempDir() |
| + crates := []string{"yrs", "serde", "serde_derive", "syn", "unicode-ident", "autocfg", "itoa"} |
| + var pkgs []string |
| + for _, c := range crates { |
| + write(t, filepath.Join(root, c, "LICENSE"), c+" licence") |
| + kind := `"lib"` |
| + if c == "serde_derive" { |
| + kind = `"proc-macro"` |
| + } |
| + pkgs = append(pkgs, `{"id":"`+c+`","name":"`+c+`","version":"1.0.0","manifest_path":"`+filepath.Join(root, c, "Cargo.toml")+`","targets":[{"kind":[`+kind+`]}]}`) |
| + } |
| + pkgs = append(pkgs, `{"id":"app","name":"app","version":"0.1.0","manifest_path":"`+filepath.Join(root, "app", "Cargo.toml")+`","targets":[{"kind":["cdylib"]}]}`) |
| + meta := `{"packages":[` + strings.Join(pkgs, ",") + `],"resolve":{"root":"app","nodes":[ |
| + {"id":"app","deps":[{"pkg":"yrs","dep_kinds":[{"kind":null}]},{"pkg":"autocfg","dep_kinds":[{"kind":"build"}]}]}, |
| + {"id":"yrs","deps":[{"pkg":"serde","dep_kinds":[{"kind":null}]},{"pkg":"unicode-ident","dep_kinds":[{"kind":null}]}]}, |
| + {"id":"serde","deps":[{"pkg":"serde_derive","dep_kinds":[{"kind":null}]},{"pkg":"itoa","dep_kinds":[{"kind":null}]}]}, |
| + {"id":"serde_derive","deps":[{"pkg":"syn","dep_kinds":[{"kind":null}]},{"pkg":"unicode-ident","dep_kinds":[{"kind":null}]}]}, |
| + {"id":"syn","deps":[{"pkg":"unicode-ident","dep_kinds":[{"kind":null}]}]}, |
| + {"id":"unicode-ident","deps":[]},{"id":"autocfg","deps":[]},{"id":"itoa","deps":[]}]}}` |
| + got, err := CollectCargo(strings.NewReader(meta)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + tool := map[string]bool{} |
| + for _, p := range got { |
| + tool[p.Name] = p.Tool |
| + } |
| + want := map[string]bool{"yrs": false, "serde": false, "itoa": false, "unicode-ident": false, "serde_derive": true, "syn": true, "autocfg": true} |
| + for name, w := range want { |
| + if v, ok := tool[name]; !ok || v != w { |
| + t.Errorf("%s: tool=%v (present %v), want %v", name, v, ok, w) |
| + } |
| + } |
| +} |
diff --git a/colophon/projects.json b/colophon/projects.json| new file mode 100644 |
| index 0000000..e4996d0 |
| --- /dev/null |
| +++ b/colophon/projects.json |
| @@ -0,0 +1,2495 @@ |
| +{ |
| + "comment": "The suite's Colophon catalog: one entry per open-source project an Oficina app is made with. blurb says what it is, in one or two sentences; uses says what each app uses it for, keyed by the app's colophon key. Apps never list projects by hand: they collect what they ship and colophon.Build matches it here. See colophon/colophon.go.", |
| + "projects": [ |
| + { |
| + "id": "ahash", |
| + "name": "aHash", |
| + "kind": "library", |
| + "blurb": "A fast hash function for hash tables, made to resist deliberately colliding keys.", |
| + "author": "Tom Kaitchuck", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/ahash", |
| + "source": "https://github.com/tkaitchuck/ahash", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "ahash" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Yrs's hash tables use it.", |
| + "docs-native": "Yrs's and wasmi's hash tables use it." |
| + } |
| + }, |
| + { |
| + "id": "arc-swap", |
| + "name": "arc-swap", |
| + "kind": "library", |
| + "blurb": "A shared pointer that can be swapped atomically, for data read often and changed rarely.", |
| + "author": "The arc-swap developers", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/arc-swap", |
| + "source": "https://github.com/vorner/arc-swap", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "arc-swap" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Yrs uses it.", |
| + "docs-native": "The apps' Yrs uses it." |
| + } |
| + }, |
| + { |
| + "id": "arrayvec", |
| + "name": "arrayvec", |
| + "kind": "library", |
| + "blurb": "A vector with a fixed capacity, stored inline.", |
| + "author": "Ulrik Sverdrup (bluss)", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/arrayvec", |
| + "source": "https://github.com/bluss/arrayvec", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "arrayvec" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "wasmi uses it." |
| + } |
| + }, |
| + { |
| + "id": "async-lock", |
| + "name": "async-lock", |
| + "kind": "library", |
| + "blurb": "Locks and other synchronization primitives for asynchronous Rust, from the smol project.", |
| + "author": "Stjepan Glavina and the smol-rs contributors", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/async-lock", |
| + "source": "https://github.com/smol-rs/async-lock", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "async-lock" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Yrs uses it.", |
| + "docs-native": "The apps' Yrs uses it." |
| + } |
| + }, |
| + { |
| + "id": "async-trait", |
| + "name": "async-trait", |
| + "kind": "library", |
| + "blurb": "Lets a Rust trait have asynchronous methods.", |
| + "author": "David Tolnay", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/async-trait", |
| + "source": "https://github.com/dtolnay/async-trait", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "async-trait" |
| + } |
| + ], |
| + "uses": { |
| + "*": "Yrs uses it while it is built." |
| + } |
| + }, |
| + { |
| + "id": "autocfg", |
| + "name": "autocfg", |
| + "kind": "library", |
| + "blurb": "Checks which compiler features are available while a crate is built.", |
| + "author": "Josh Stone", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/autocfg", |
| + "source": "https://github.com/cuviper/autocfg", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "autocfg" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "num-traits uses it while it is built." |
| + } |
| + }, |
| + { |
| + "id": "bigfft", |
| + "name": "bigfft", |
| + "kind": "library", |
| + "blurb": "Multiplies very large integers quickly, using the fast Fourier transform.", |
| + "author": "Rémy Oudompheng and The Go Authors", |
| + "licence": { |
| + "spdx": "BSD-3-Clause", |
| + "name": "BSD 3-Clause License" |
| + }, |
| + "home": "https://github.com/remyoudompheng/bigfft", |
| + "source": "https://github.com/remyoudompheng/bigfft", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "github.com/remyoudompheng/bigfft" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The SQLite driver's math library uses it." |
| + } |
| + }, |
| + { |
| + "id": "brotli", |
| + "name": "Brotli", |
| + "kind": "tool", |
| + "blurb": "Google's compression format, the one inside every WOFF2 font.", |
| + "author": "The Brotli Authors", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://github.com/google/brotli", |
| + "source": "https://github.com/google/brotli", |
| + "packages": [ |
| + { |
| + "ecosystem": "pip", |
| + "name": "brotli" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "fontTools compresses the browser's font files with it." |
| + } |
| + }, |
| + { |
| + "id": "bubblewrap", |
| + "name": "bubblewrap", |
| + "kind": "tool", |
| + "blurb": "Runs a program in a sandbox of its own, without root.", |
| + "author": "The bubblewrap contributors", |
| + "licence": { |
| + "spdx": "LGPL-2.0-or-later", |
| + "name": "GNU Lesser General Public License 2.0 or later" |
| + }, |
| + "home": "https://github.com/containers/bubblewrap", |
| + "source": "https://github.com/containers/bubblewrap", |
| + "packages": [ |
| + { |
| + "ecosystem": "toolchain", |
| + "name": "bwrap" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "On Linux the core's WebAssembly is built inside it instead of Docker, for the same identical bytes." |
| + } |
| + }, |
| + { |
| + "id": "caladea", |
| + "name": "Caladea", |
| + "kind": "typeface", |
| + "blurb": "A serif by Andrés Torresi and Carolina Giovagnoli of Huerta Tipográfica. It is drawn to the same measurements as Microsoft's Cambria, so text set in one takes the same space in the other.", |
| + "author": "The Caladea Project Authors", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://fonts.google.com/specimen/Caladea", |
| + "source": "https://github.com/huertatipografica/Caladea", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "Caladea" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "A font in the font menu that lays text out as Cambria would.", |
| + "docs-native": "A font in the font menu that lays text out as Cambria would." |
| + } |
| + }, |
| + { |
| + "id": "carlito", |
| + "name": "Carlito", |
| + "kind": "typeface", |
| + "blurb": "A sans serif by Łukasz Dziedzic, based on his Lato. It is drawn to the same measurements as Microsoft's Calibri, letter for letter, so text set in one takes the same space in the other.", |
| + "author": "The Carlito Project Authors", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://fonts.google.com/specimen/Carlito", |
| + "source": "https://github.com/googlefonts/carlito", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "Carlito" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Docs' default font, so a document breaks its lines and pages where Word would in Calibri.", |
| + "docs-native": "The app's default font, so a document breaks its lines and pages where Word would in Calibri." |
| + } |
| + }, |
| + { |
| + "id": "caveat", |
| + "name": "Caveat", |
| + "kind": "typeface", |
| + "blurb": "A handwriting face by Pablo Impallari, drawn from quick, casual notes.", |
| + "author": "The Caveat Project Authors", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://fonts.google.com/specimen/Caveat", |
| + "source": "https://github.com/googlefonts/caveat", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "Caveat" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "One of the fonts in the font menu, served to the browser and embedded in PDFs.", |
| + "docs-native": "One of the fonts in the font menu, bundled with the app." |
| + } |
| + }, |
| + { |
| + "id": "cfg-if", |
| + "name": "cfg-if", |
| + "kind": "library", |
| + "blurb": "A macro for writing code that differs by platform without a tangle of conditions.", |
| + "author": "Alex Crichton", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/cfg-if", |
| + "source": "https://github.com/rust-lang/cfg-if", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "cfg-if" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Several of the core's crates use it.", |
| + "docs-native": "Several of the apps' crates use it." |
| + } |
| + }, |
| + { |
| + "id": "chi", |
| + "name": "chi", |
| + "kind": "library", |
| + "blurb": "A small, fast HTTP router for Go, built on the standard library's own handlers.", |
| + "author": "Peter Kieltyka and Google Inc.", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://go-chi.io/", |
| + "source": "https://github.com/go-chi/chi", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "github.com/go-chi/chi/v5" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Every page and request is routed with it." |
| + } |
| + }, |
| + { |
| + "id": "chromedp", |
| + "name": "chromedp", |
| + "kind": "tool", |
| + "blurb": "Drives Chrome from Go through the DevTools protocol.", |
| + "author": "Kenneth Shaw", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://github.com/chromedp/chromedp", |
| + "source": "https://github.com/chromedp/chromedp", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "github.com/chromedp/chromedp" |
| + }, |
| + { |
| + "ecosystem": "go", |
| + "name": "github.com/chromedp/cdproto" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Docs' browser tests drive Chrome with it." |
| + } |
| + }, |
| + { |
| + "id": "crossbeam-utils", |
| + "name": "crossbeam-utils", |
| + "kind": "library", |
| + "blurb": "Utilities for concurrent programming in Rust, from the Crossbeam project.", |
| + "author": "The Crossbeam Project Developers", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://github.com/crossbeam-rs/crossbeam", |
| + "source": "https://github.com/crossbeam-rs/crossbeam", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "crossbeam-utils" |
| + } |
| + ], |
| + "uses": { |
| + "*": "DashMap uses it." |
| + } |
| + }, |
| + { |
| + "id": "dashmap", |
| + "name": "DashMap", |
| + "kind": "library", |
| + "blurb": "A concurrent hash map for Rust.", |
| + "author": "Acrimon", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://crates.io/crates/dashmap", |
| + "source": "https://github.com/xacrimon/dashmap", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "dashmap" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Yrs uses it.", |
| + "docs-native": "The apps' Yrs uses it." |
| + } |
| + }, |
| + { |
| + "id": "docker", |
| + "name": "Docker", |
| + "kind": "tool", |
| + "blurb": "Runs software in containers, from images pinned by digest.", |
| + "author": "Docker, Inc.", |
| + "licence": { |
| + "spdx": "Apache-2.0", |
| + "name": "Apache License 2.0" |
| + }, |
| + "home": "https://www.docker.com/", |
| + "source": "https://github.com/moby/moby", |
| + "packages": [ |
| + { |
| + "ecosystem": "toolchain", |
| + "name": "docker" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The core's WebAssembly is built in a pinned Rust image, so every machine builds the same bytes." |
| + } |
| + }, |
| + { |
| + "id": "downcast-rs", |
| + "name": "downcast-rs", |
| + "kind": "library", |
| + "blurb": "Lets a trait object be turned back into the concrete type it holds.", |
| + "author": "Ashish Myles and contributors", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/downcast-rs", |
| + "source": "https://github.com/marcianx/downcast-rs", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "downcast-rs" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "wasmi uses it." |
| + } |
| + }, |
| + { |
| + "id": "eb-garamond", |
| + "name": "EB Garamond", |
| + "kind": "typeface", |
| + "blurb": "Georg Duffner's revival of Claude Garamont's sixteenth-century types, from the Egenolff-Berner specimen of 1592.", |
| + "author": "The EB Garamond Project Authors", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://fonts.google.com/specimen/EB+Garamond", |
| + "source": "https://github.com/octaviopardo/EBGaramond12", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "EB Garamond" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "One of the fonts in the font menu, served to the browser and embedded in PDFs.", |
| + "docs-native": "One of the fonts in the font menu, bundled with the app." |
| + } |
| + }, |
| + { |
| + "id": "esbuild", |
| + "name": "esbuild", |
| + "kind": "tool", |
| + "blurb": "A JavaScript bundler and minifier, written in Go by Evan Wallace.", |
| + "author": "Evan Wallace", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://esbuild.github.io/", |
| + "source": "https://github.com/evanw/esbuild", |
| + "packages": [ |
| + { |
| + "ecosystem": "npm", |
| + "name": "esbuild" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "It builds the editor's JavaScript into the bundles Docs serves." |
| + } |
| + }, |
| + { |
| + "id": "event-listener", |
| + "name": "event-listener", |
| + "kind": "library", |
| + "blurb": "Lets asynchronous tasks and threads wait to be told something happened.", |
| + "author": "Stjepan Glavina, John Nunley and the smol-rs contributors", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/event-listener", |
| + "source": "https://github.com/smol-rs/event-listener", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "event-listener" |
| + } |
| + ], |
| + "uses": { |
| + "*": "async-lock uses it." |
| + } |
| + }, |
| + { |
| + "id": "event-listener-strategy", |
| + "name": "event-listener-strategy", |
| + "kind": "library", |
| + "blurb": "Waits on an event-listener either by blocking or by polling, from one piece of code.", |
| + "author": "John Nunley and the smol-rs contributors", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/event-listener-strategy", |
| + "source": "https://github.com/smol-rs/event-listener-strategy", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "event-listener-strategy" |
| + } |
| + ], |
| + "uses": { |
| + "*": "async-lock uses it." |
| + } |
| + }, |
| + { |
| + "id": "fastrand", |
| + "name": "fastrand", |
| + "kind": "library", |
| + "blurb": "A small, fast random number generator, not for cryptography.", |
| + "author": "Stjepan Glavina and the smol-rs contributors", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/fastrand", |
| + "source": "https://github.com/smol-rs/fastrand", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "fastrand" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Yrs picks client identifiers with it. Docs carries a copy patched to build for WebAssembly without JavaScript.", |
| + "docs-native": "Yrs picks client identifiers with it, from the same patched copy as the server." |
| + } |
| + }, |
| + { |
| + "id": "fonttools", |
| + "name": "fontTools", |
| + "kind": "tool", |
| + "blurb": "The Python library for reading, changing and writing font files.", |
| + "author": "Just van Rossum and the fontTools contributors", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://fonttools.readthedocs.io/", |
| + "source": "https://github.com/fonttools/fonttools", |
| + "packages": [ |
| + { |
| + "ecosystem": "pip", |
| + "name": "fonttools" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "It cuts each font's styles and builds the browser's copies and the font menu's previews." |
| + } |
| + }, |
| + { |
| + "id": "getrandom", |
| + "name": "getrandom", |
| + "kind": "library", |
| + "blurb": "Reads random bytes from whatever the platform provides.", |
| + "author": "The rust-random Project Developers and The Rust Project Developers", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/getrandom", |
| + "source": "https://github.com/rust-random/getrandom", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "getrandom" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "fastrand would ask the system for randomness through it; the core's own backend refuses every request, because the server hands it identifiers and client ids explicitly.", |
| + "docs-native": "fastrand would ask the system for randomness through it; the core's own backend refuses every request, because the app hands it identifiers and client ids explicitly." |
| + } |
| + }, |
| + { |
| + "id": "go-humanize", |
| + "name": "go-humanize", |
| + "kind": "library", |
| + "blurb": "Formats numbers, sizes and times the way people say them.", |
| + "author": "Dustin Sallings", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://github.com/dustin/go-humanize", |
| + "source": "https://github.com/dustin/go-humanize", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "github.com/dustin/go-humanize" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The SQLite driver's C library uses it." |
| + } |
| + }, |
| + { |
| + "id": "go-json-experiment", |
| + "name": "go-json-experiment", |
| + "kind": "library", |
| + "blurb": "The Go team's work on a second version of Go's JSON package, published ahead of the standard library.", |
| + "author": "The Go Authors", |
| + "licence": { |
| + "spdx": "BSD-3-Clause", |
| + "name": "BSD 3-Clause License" |
| + }, |
| + "home": "https://github.com/go-json-experiment/json", |
| + "source": "https://github.com/go-json-experiment/json", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "github.com/go-json-experiment/json" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Docs reads its team and Home settings with it." |
| + } |
| + }, |
| + { |
| + "id": "go-text-typesetting", |
| + "name": "go-text/typesetting", |
| + "kind": "library", |
| + "blurb": "A pure-Go font reader and text shaper, a port of HarfBuzz's shaping.", |
| + "author": "The go-text authors", |
| + "licence": { |
| + "spdx": "Unlicense OR BSD-3-Clause", |
| + "name": "The Unlicense or BSD 3-Clause License" |
| + }, |
| + "home": "https://github.com/go-text/typesetting", |
| + "source": "https://github.com/go-text/typesetting", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "github.com/go-text/typesetting" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The PDF export shapes text with it, so its lines break where the editor's do." |
| + } |
| + }, |
| + { |
| + "id": "golang", |
| + "name": "Go", |
| + "kind": "tool", |
| + "blurb": "The programming language, compiler and standard library from Google's Go team.", |
| + "author": "The Go Authors", |
| + "licence": { |
| + "spdx": "BSD-3-Clause", |
| + "name": "BSD 3-Clause License" |
| + }, |
| + "home": "https://go.dev/", |
| + "source": "https://go.googlesource.com/go", |
| + "packages": [ |
| + { |
| + "ecosystem": "toolchain", |
| + "name": "go" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The Docs server is written in Go, and its standard library is compiled into it." |
| + } |
| + }, |
| + { |
| + "id": "google-uuid", |
| + "name": "uuid", |
| + "kind": "library", |
| + "blurb": "Google's package for generating and parsing UUIDs.", |
| + "author": "Google Inc.", |
| + "licence": { |
| + "spdx": "BSD-3-Clause", |
| + "name": "BSD 3-Clause License" |
| + }, |
| + "home": "https://pkg.go.dev/github.com/google/uuid", |
| + "source": "https://github.com/google/uuid", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "github.com/google/uuid" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Docs gives documents and their stored content their identifiers with it." |
| + } |
| + }, |
| + { |
| + "id": "gorm", |
| + "name": "GORM", |
| + "kind": "library", |
| + "blurb": "An object-relational mapper for Go.", |
| + "author": "Jinzhu", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://gorm.io/", |
| + "source": "https://github.com/go-gorm/gorm", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "gorm.io/gorm" |
| + }, |
| + { |
| + "ecosystem": "go", |
| + "name": "gorm.io/plugin/dbresolver" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Rastrillo's database layer is built on it." |
| + } |
| + }, |
| + { |
| + "id": "hashbrown", |
| + "name": "hashbrown", |
| + "kind": "library", |
| + "blurb": "A Rust port of Google's SwissTable hash map, the one behind Rust's own HashMap.", |
| + "author": "Amanieu d'Antras", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/hashbrown", |
| + "source": "https://github.com/rust-lang/hashbrown", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "hashbrown" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "DashMap uses it.", |
| + "docs-native": "DashMap and wasmi use it." |
| + } |
| + }, |
| + { |
| + "id": "html-entities", |
| + "name": "HTML named character references", |
| + "kind": "data", |
| + "blurb": "The table of named characters, such as & and é, from the WHATWG's HTML Living Standard.", |
| + "author": "WHATWG (Apple, Google, Mozilla, Microsoft)", |
| + "licence": { |
| + "spdx": "CC-BY-4.0", |
| + "name": "Creative Commons Attribution 4.0" |
| + }, |
| + "home": "https://html.spec.whatwg.org/multipage/named-characters.html", |
| + "source": "https://github.com/whatwg/html", |
| + "packages": [ |
| + { |
| + "ecosystem": "asset", |
| + "name": "html-entities" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "The apps read HTML pasted from other apps with it." |
| + } |
| + }, |
| + { |
| + "id": "indexmap-nostd", |
| + "name": "indexmap-nostd", |
| + "kind": "library", |
| + "blurb": "A hash map that remembers insertion order, for code without the standard library.", |
| + "author": "Robin Freyler", |
| + "licence": { |
| + "spdx": "Apache-2.0", |
| + "name": "Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/indexmap-nostd", |
| + "source": "https://github.com/robbepop/indexmap-nostd", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "indexmap-nostd" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "wasmi's WebAssembly parser uses it." |
| + } |
| + }, |
| + { |
| + "id": "inflection", |
| + "name": "inflection", |
| + "kind": "library", |
| + "blurb": "Turns English nouns into their plurals and back.", |
| + "author": "Jinzhu", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://github.com/jinzhu/inflection", |
| + "source": "https://github.com/jinzhu/inflection", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "github.com/jinzhu/inflection" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "GORM names database tables with it." |
| + } |
| + }, |
| + { |
| + "id": "inter", |
| + "name": "Inter", |
| + "kind": "typeface", |
| + "blurb": "A sans serif by Rasmus Andersson, designed for reading on screens.", |
| + "author": "The Inter Project Authors", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://rsms.me/inter/", |
| + "source": "https://github.com/rsms/inter", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "Inter" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "One of the fonts in the font menu, served to the browser and embedded in PDFs.", |
| + "docs-native": "One of the fonts in the font menu, bundled with the app." |
| + } |
| + }, |
| + { |
| + "id": "itoa", |
| + "name": "itoa", |
| + "kind": "library", |
| + "blurb": "Writes integers as text, fast.", |
| + "author": "David Tolnay", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/itoa", |
| + "source": "https://github.com/dtolnay/itoa", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "itoa" |
| + } |
| + ], |
| + "uses": { |
| + "*": "serde_json uses it." |
| + } |
| + }, |
| + { |
| + "id": "jetbrains-mono", |
| + "name": "JetBrains Mono", |
| + "kind": "typeface", |
| + "blurb": "A monospaced face JetBrains made for reading code, with a tall x-height and clear letters that are easy to tell apart.", |
| + "author": "The JetBrains Mono Project Authors", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://www.jetbrains.com/lp/mono/", |
| + "source": "https://github.com/JetBrains/JetBrainsMono", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "JetBrains Mono" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "One of the fonts in the font menu, served to the browser and embedded in PDFs.", |
| + "docs-native": "One of the fonts in the font menu, bundled with the app." |
| + } |
| + }, |
| + { |
| + "id": "keymail-signin", |
| + "name": "Keymail sign-in", |
| + "kind": "library", |
| + "blurb": "Email-first sign-in that knows about Keymail: a claimed Keymail inbox signs in through Keymail, and any other address gets a magic link.", |
| + "author": "Keymail", |
| + "licence": { |
| + "spdx": "NOASSERTION", |
| + "name": "No license published" |
| + }, |
| + "home": "https://keymail.dev/", |
| + "source": "https://github.com/keymaildev/signin", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "github.com/keymaildev/signin" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Docs signs people in with it." |
| + } |
| + }, |
| + { |
| + "id": "lib0", |
| + "name": "lib0", |
| + "kind": "library", |
| + "blurb": "Kevin Jahns' library of small utilities, including the binary encoding Yjs writes its updates in.", |
| + "author": "Kevin Jahns", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://github.com/dmonad/lib0", |
| + "source": "https://github.com/dmonad/lib0", |
| + "packages": [ |
| + { |
| + "ecosystem": "npm", |
| + "name": "lib0" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Yjs is built on it, and the editor encodes its updates with it." |
| + } |
| + }, |
| + { |
| + "id": "liberation-mono", |
| + "name": "Liberation Mono", |
| + "kind": "typeface", |
| + "blurb": "A monospaced face by Steve Matteson, made for Red Hat to the same measurements as Courier New.", |
| + "author": "Red Hat, Inc., with digitized data from Google", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://github.com/liberationfonts/liberation-fonts", |
| + "source": "https://github.com/liberationfonts/liberation-fonts", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "Liberation Mono" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The font code is set in, and one in the font menu.", |
| + "docs-native": "The font code is set in, and one in the font menu." |
| + } |
| + }, |
| + { |
| + "id": "liberation-sans", |
| + "name": "Liberation Sans", |
| + "kind": "typeface", |
| + "blurb": "A sans serif by Steve Matteson, made for Red Hat to the same measurements as Arial, so text set in one takes the same space in the other.", |
| + "author": "Red Hat, Inc., with digitized data from Google", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://github.com/liberationfonts/liberation-fonts", |
| + "source": "https://github.com/liberationfonts/liberation-fonts", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "Liberation Sans" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "A font in the font menu that lays text out as Arial would.", |
| + "docs-native": "A font in the font menu that lays text out as Arial would." |
| + } |
| + }, |
| + { |
| + "id": "liberation-serif", |
| + "name": "Liberation Serif", |
| + "kind": "typeface", |
| + "blurb": "A serif by Steve Matteson, made for Red Hat to the same measurements as Times New Roman, so text set in one takes the same space in the other.", |
| + "author": "Red Hat, Inc., with digitized data from Google", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://github.com/liberationfonts/liberation-fonts", |
| + "source": "https://github.com/liberationfonts/liberation-fonts", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "Liberation Serif" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "A font in the font menu that lays text out as Times New Roman would.", |
| + "docs-native": "A font in the font menu that lays text out as Times New Roman would." |
| + } |
| + }, |
| + { |
| + "id": "libm", |
| + "name": "libm", |
| + "kind": "library", |
| + "blurb": "The C math library in pure Rust.", |
| + "author": "Jorge Aparicio; Sun Microsystems, Bruce D. Evans, Steven G. Kargl, David Schultz, Rich Felker and others, Stephen L. Moshier and Arm Limited", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://crates.io/crates/libm", |
| + "source": "https://github.com/rust-lang/compiler-builtins", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "libm" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "wasmi does WebAssembly's floating-point math with it." |
| + } |
| + }, |
| + { |
| + "id": "literata", |
| + "name": "Literata", |
| + "kind": "typeface", |
| + "blurb": "A book face by TypeTogether, first made for Google Play Books.", |
| + "author": "The Literata Project Authors", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://fonts.google.com/specimen/Literata", |
| + "source": "https://github.com/googlefonts/literata", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "Literata" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "One of the fonts in the font menu, served to the browser and embedded in PDFs.", |
| + "docs-native": "One of the fonts in the font menu, bundled with the app." |
| + } |
| + }, |
| + { |
| + "id": "lucide", |
| + "name": "Lucide", |
| + "kind": "icons", |
| + "blurb": "An open icon set, grown from Cole Bemis's Feather icons, drawn on one grid with one stroke.", |
| + "author": "Lucide Contributors; Feather icons by Cole Bemis", |
| + "licence": { |
| + "spdx": "ISC AND MIT", |
| + "name": "ISC License, and the MIT License for icons from Feather" |
| + }, |
| + "home": "https://lucide.dev/", |
| + "source": "https://github.com/lucide-icons/lucide", |
| + "packages": [ |
| + { |
| + "ecosystem": "asset", |
| + "name": "lucide" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The chrome's interface icons are Lucide's. The app icons are Oficina's own drawings.", |
| + "docs-native": "The apps carry Lucide's license; their icons are Oficina's own drawings and the system's symbols." |
| + } |
| + }, |
| + { |
| + "id": "memchr", |
| + "name": "memchr", |
| + "kind": "library", |
| + "blurb": "Finds bytes in a string, using the processor's vector instructions where it can.", |
| + "author": "Andrew Gallant", |
| + "licence": { |
| + "spdx": "Unlicense OR MIT", |
| + "name": "The Unlicense or MIT License" |
| + }, |
| + "home": "https://crates.io/crates/memchr", |
| + "source": "https://github.com/BurntSushi/memchr", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "memchr" |
| + } |
| + ], |
| + "uses": { |
| + "*": "serde_json uses it." |
| + } |
| + }, |
| + { |
| + "id": "modernc-libc", |
| + "name": "libc for Go", |
| + "kind": "library", |
| + "blurb": "The C standard library, translated to Go, for C programs that have been translated too.", |
| + "author": "The Libc Authors", |
| + "licence": { |
| + "spdx": "BSD-3-Clause", |
| + "name": "BSD 3-Clause License" |
| + }, |
| + "home": "https://pkg.go.dev/modernc.org/libc", |
| + "source": "https://gitlab.com/cznic/libc", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "modernc.org/libc" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "SQLite runs on it." |
| + } |
| + }, |
| + { |
| + "id": "modernc-mathutil", |
| + "name": "mathutil", |
| + "kind": "library", |
| + "blurb": "Mathematical utilities for Go.", |
| + "author": "The mathutil Authors", |
| + "licence": { |
| + "spdx": "BSD-3-Clause", |
| + "name": "BSD 3-Clause License" |
| + }, |
| + "home": "https://pkg.go.dev/modernc.org/mathutil", |
| + "source": "https://gitlab.com/cznic/mathutil", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "modernc.org/mathutil" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "SQLite's C library uses it." |
| + } |
| + }, |
| + { |
| + "id": "modernc-memory", |
| + "name": "memory", |
| + "kind": "library", |
| + "blurb": "A memory allocator for Go programs that manage memory the way C does.", |
| + "author": "The Memory Authors", |
| + "licence": { |
| + "spdx": "BSD-3-Clause", |
| + "name": "BSD 3-Clause License" |
| + }, |
| + "home": "https://pkg.go.dev/modernc.org/memory", |
| + "source": "https://gitlab.com/cznic/memory", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "modernc.org/memory" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "SQLite's C library allocates with it." |
| + } |
| + }, |
| + { |
| + "id": "modernc-sqlite", |
| + "name": "SQLite for Go", |
| + "kind": "library", |
| + "blurb": "SQLite, the public-domain database engine, translated from C to pure Go by Jan Mercl.", |
| + "author": "The Sqlite Authors; SQLite itself is in the public domain", |
| + "licence": { |
| + "spdx": "BSD-3-Clause", |
| + "name": "BSD 3-Clause License" |
| + }, |
| + "home": "https://pkg.go.dev/modernc.org/sqlite", |
| + "source": "https://gitlab.com/cznic/sqlite", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "modernc.org/sqlite" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Docs keeps its documents in SQLite, with no C compiler needed to build it." |
| + } |
| + }, |
| + { |
| + "id": "multi-stash", |
| + "name": "multi-stash", |
| + "kind": "library", |
| + "blurb": "An arena that reuses the slots of removed items.", |
| + "author": "Robin Freyler", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/multi-stash", |
| + "source": "https://github.com/robbepop/multi-stash", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "multi-stash" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "wasmi uses it." |
| + } |
| + }, |
| + { |
| + "id": "nodejs", |
| + "name": "Node.js", |
| + "kind": "tool", |
| + "blurb": "The JavaScript runtime outside the browser.", |
| + "author": "OpenJS Foundation and Node.js contributors", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://nodejs.org/", |
| + "source": "https://github.com/nodejs/node", |
| + "packages": [ |
| + { |
| + "ecosystem": "toolchain", |
| + "name": "node" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The editor's bundles are built and its logic is tested under Node." |
| + } |
| + }, |
| + { |
| + "id": "noto-sans", |
| + "name": "Noto Sans", |
| + "kind": "typeface", |
| + "blurb": "The Latin, Greek and Cyrillic sans serif of Google's Noto project, which sets out to cover every script in Unicode.", |
| + "author": "The Noto Project Authors", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://notofonts.github.io/", |
| + "source": "https://github.com/notofonts/latin-greek-cyrillic", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "Noto Sans" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "One of the fonts in the font menu, served to the browser and embedded in PDFs.", |
| + "docs-native": "One of the fonts in the font menu, bundled with the app." |
| + } |
| + }, |
| + { |
| + "id": "now", |
| + "name": "now", |
| + "kind": "library", |
| + "blurb": "Time helpers for Go: the start and end of a day, a week or a month.", |
| + "author": "Jinzhu", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://github.com/jinzhu/now", |
| + "source": "https://github.com/jinzhu/now", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "github.com/jinzhu/now" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "GORM uses it." |
| + } |
| + }, |
| + { |
| + "id": "num-derive", |
| + "name": "num-derive", |
| + "kind": "library", |
| + "blurb": "Derives numeric traits for Rust types.", |
| + "author": "The Rust Project Developers", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/num-derive", |
| + "source": "https://github.com/rust-num/num-derive", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "num-derive" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "wasmi uses it while it is built." |
| + } |
| + }, |
| + { |
| + "id": "num-traits", |
| + "name": "num-traits", |
| + "kind": "library", |
| + "blurb": "Traits for writing numeric code that works across Rust's number types.", |
| + "author": "The Rust Project Developers", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/num-traits", |
| + "source": "https://github.com/rust-num/num-traits", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "num-traits" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "wasmi uses it." |
| + } |
| + }, |
| + { |
| + "id": "once-cell", |
| + "name": "once_cell", |
| + "kind": "library", |
| + "blurb": "Values that are set once and then only read, such as lazily built tables.", |
| + "author": "Aleksey Kladov", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/once_cell", |
| + "source": "https://github.com/matklad/once_cell", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "once_cell" |
| + } |
| + ], |
| + "uses": { |
| + "*": "DashMap and aHash use it." |
| + } |
| + }, |
| + { |
| + "id": "onest", |
| + "name": "Onest", |
| + "kind": "typeface", |
| + "blurb": "A sans serif by Dmitri Voloshin of TypeType, released through Google Fonts.", |
| + "author": "The Onest Project Authors", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://fonts.google.com/specimen/Onest", |
| + "source": "https://github.com/googlefonts/onest", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "Onest" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Oficina's interface was set in it until October 2026; Docs still serves its files to pages saved before the change." |
| + } |
| + }, |
| + { |
| + "id": "orderedmap", |
| + "name": "orderedmap", |
| + "kind": "library", |
| + "blurb": "A small persistent map that keeps its keys in order.", |
| + "author": "Marijn Haverbeke and others", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://github.com/marijnh/orderedmap", |
| + "source": "https://github.com/marijnh/orderedmap", |
| + "packages": [ |
| + { |
| + "ecosystem": "npm", |
| + "name": "orderedmap" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "ProseMirror keeps its schema's nodes and marks in it." |
| + } |
| + }, |
| + { |
| + "id": "parking-lot", |
| + "name": "parking_lot", |
| + "kind": "library", |
| + "blurb": "Smaller, faster locks for Rust, and the parts to build more of them.", |
| + "author": "The Rust Project Developers", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/parking_lot", |
| + "source": "https://github.com/Amanieu/parking_lot", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "lock_api" |
| + }, |
| + { |
| + "ecosystem": "cargo", |
| + "name": "parking_lot_core" |
| + } |
| + ], |
| + "uses": { |
| + "*": "DashMap uses it." |
| + } |
| + }, |
| + { |
| + "id": "paste", |
| + "name": "paste", |
| + "kind": "library", |
| + "blurb": "Joins identifiers together inside macros.", |
| + "author": "David Tolnay", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/paste", |
| + "source": "https://github.com/dtolnay/paste", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "paste" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "wasmi uses it while it is built." |
| + } |
| + }, |
| + { |
| + "id": "pin-project-lite", |
| + "name": "pin-project-lite", |
| + "kind": "library", |
| + "blurb": "Safe pin projection for asynchronous Rust, written with plain macros.", |
| + "author": "Taiki Endo", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/pin-project-lite", |
| + "source": "https://github.com/taiki-e/pin-project-lite", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "pin-project-lite" |
| + } |
| + ], |
| + "uses": { |
| + "*": "async-lock uses it." |
| + } |
| + }, |
| + { |
| + "id": "playfair-display", |
| + "name": "Playfair Display", |
| + "kind": "typeface", |
| + "blurb": "A high-contrast display serif by Claus Eggers Sørensen, after the European types of the late eighteenth century.", |
| + "author": "The Playfair Display Project Authors", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://fonts.google.com/specimen/Playfair+Display", |
| + "source": "https://github.com/clauseggers/Playfair-Display", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "Playfair Display" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "One of the fonts in the font menu, served to the browser and embedded in PDFs.", |
| + "docs-native": "One of the fonts in the font menu, bundled with the app." |
| + } |
| + }, |
| + { |
| + "id": "playwright", |
| + "name": "Playwright", |
| + "kind": "tool", |
| + "blurb": "Microsoft's library for driving Chromium, Firefox and WebKit from tests.", |
| + "author": "Microsoft Corporation", |
| + "licence": { |
| + "spdx": "Apache-2.0", |
| + "name": "Apache License 2.0" |
| + }, |
| + "home": "https://playwright.dev/", |
| + "source": "https://github.com/microsoft/playwright", |
| + "packages": [ |
| + { |
| + "ecosystem": "npm", |
| + "name": "playwright" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The font checks run in Safari's engine as well as Chrome's through it." |
| + } |
| + }, |
| + { |
| + "id": "plex-sans", |
| + "name": "IBM Plex Sans", |
| + "kind": "typeface", |
| + "blurb": "IBM's corporate sans serif, designed by Mike Abbink with Bold Monday.", |
| + "author": "IBM Corp.", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://www.ibm.com/plex/", |
| + "source": "https://github.com/IBM/plex", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "IBM Plex Sans" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "One of the fonts in the font menu, served to the browser and embedded in PDFs.", |
| + "docs-native": "One of the fonts in the font menu, bundled with the app." |
| + } |
| + }, |
| + { |
| + "id": "pngjs", |
| + "name": "pngjs", |
| + "kind": "tool", |
| + "blurb": "Reads and writes PNG images in plain JavaScript.", |
| + "author": "Luke Page and the pngjs contributors", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://github.com/pngjs/pngjs", |
| + "source": "https://github.com/pngjs/pngjs", |
| + "packages": [ |
| + { |
| + "ecosystem": "npm", |
| + "name": "pngjs" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The font checks compare screenshots with it." |
| + } |
| + }, |
| + { |
| + "id": "proc-macro2", |
| + "name": "proc-macro2", |
| + "kind": "library", |
| + "blurb": "The compiler's macro interface as an ordinary library, so macros can be written and tested like any other code.", |
| + "author": "David Tolnay and Alex Crichton", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/proc-macro2", |
| + "source": "https://github.com/dtolnay/proc-macro2", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "proc-macro2" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The core's derive macros use it while it is built.", |
| + "docs-native": "The apps' derive macros use it while they are built." |
| + } |
| + }, |
| + { |
| + "id": "prosemirror", |
| + "name": "ProseMirror", |
| + "kind": "library", |
| + "blurb": "A toolkit for building rich-text editors on the web, by Marijn Haverbeke. A document is a structured tree, not a pile of HTML, and every change is a step that can be mapped, undone and shared.", |
| + "author": "Marijn Haverbeke and others", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://prosemirror.net/", |
| + "source": "https://code.haverbeke.berlin/prosemirror", |
| + "packages": [ |
| + { |
| + "ecosystem": "npm", |
| + "name": "prosemirror-commands" |
| + }, |
| + { |
| + "ecosystem": "npm", |
| + "name": "prosemirror-inputrules" |
| + }, |
| + { |
| + "ecosystem": "npm", |
| + "name": "prosemirror-keymap" |
| + }, |
| + { |
| + "ecosystem": "npm", |
| + "name": "prosemirror-model" |
| + }, |
| + { |
| + "ecosystem": "npm", |
| + "name": "prosemirror-schema-basic" |
| + }, |
| + { |
| + "ecosystem": "npm", |
| + "name": "prosemirror-schema-list" |
| + }, |
| + { |
| + "ecosystem": "npm", |
| + "name": "prosemirror-state" |
| + }, |
| + { |
| + "ecosystem": "npm", |
| + "name": "prosemirror-transform" |
| + }, |
| + { |
| + "ecosystem": "npm", |
| + "name": "prosemirror-view" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The editor you type in is ProseMirror." |
| + } |
| + }, |
| + { |
| + "id": "python", |
| + "name": "Python", |
| + "kind": "tool", |
| + "blurb": "The Python programming language and its standard library.", |
| + "author": "Python Software Foundation", |
| + "licence": { |
| + "spdx": "PSF-2.0", |
| + "name": "Python Software Foundation License 2.0" |
| + }, |
| + "home": "https://www.python.org/", |
| + "source": "https://github.com/python/cpython", |
| + "packages": [ |
| + { |
| + "ecosystem": "toolchain", |
| + "name": "python" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The font vendoring, the shaping goldens and the native checks are Python scripts.", |
| + "docs-native": "The Mac bundling and the font check are Python scripts." |
| + } |
| + }, |
| + { |
| + "id": "quote", |
| + "name": "quote", |
| + "kind": "library", |
| + "blurb": "Writes Rust code from inside a macro.", |
| + "author": "David Tolnay", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/quote", |
| + "source": "https://github.com/dtolnay/quote", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "quote" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The core's derive macros use it while it is built.", |
| + "docs-native": "The apps' derive macros use it while they are built." |
| + } |
| + }, |
| + { |
| + "id": "rastrillo", |
| + "name": "Rastrillo", |
| + "kind": "library", |
| + "blurb": "The web framework every Oficina app is built on: routing, sessions and sign-in, the database layer, forms and the page vocabulary.", |
| + "author": "The Rastrillo authors", |
| + "licence": { |
| + "spdx": "MPL-2.0", |
| + "name": "Mozilla Public License 2.0" |
| + }, |
| + "home": "https://rastrillo.org/", |
| + "source": "https://amadan.net/rastrillo/rastrillo", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "amadan.net/rastrillo/rastrillo" |
| + }, |
| + { |
| + "ecosystem": "go", |
| + "name": "amadan.net/rastrillo/rastrillo/money" |
| + }, |
| + { |
| + "ecosystem": "go", |
| + "name": "github.com/carlosframework/rastrillo" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Docs is built on it. The server still links the copy at its old path, github.com/carlosframework/rastrillo, for one bridge to the native apps' server." |
| + } |
| + }, |
| + { |
| + "id": "rastrillo-native", |
| + "name": "Rastrillo Native", |
| + "kind": "library", |
| + "blurb": "The native half of the Rastrillo framework: sign-in, accounts and shared parts for Oficina's Mac and iPhone apps, and the server side they sign in through.", |
| + "author": "The Rastrillo authors", |
| + "licence": { |
| + "spdx": "MPL-2.0", |
| + "name": "Mozilla Public License 2.0" |
| + }, |
| + "home": "https://amadan.net/rastrillo/native", |
| + "source": "https://amadan.net/rastrillo/native", |
| + "packages": [ |
| + { |
| + "ecosystem": "swift", |
| + "name": "native" |
| + }, |
| + { |
| + "ecosystem": "go", |
| + "name": "amadan.net/rastrillo/native/server" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The server signs the Mac and iPhone apps in through its server half, which gives each app its own token.", |
| + "docs-native": "The apps sign in, keep their accounts and check for updates with it." |
| + } |
| + }, |
| + { |
| + "id": "rust-lang", |
| + "name": "Rust", |
| + "kind": "tool", |
| + "blurb": "The Rust programming language, compiler and standard library.", |
| + "author": "The Rust Project Developers", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://www.rust-lang.org/", |
| + "source": "https://github.com/rust-lang/rust", |
| + "packages": [ |
| + { |
| + "ecosystem": "toolchain", |
| + "name": "rust" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Docs' document core is written in Rust, and the parts of its standard library the core uses are compiled into its WebAssembly.", |
| + "docs-native": "The apps' document core and the interpreter that runs it are written in Rust, with its standard library compiled in." |
| + } |
| + }, |
| + { |
| + "id": "rustversion", |
| + "name": "rustversion", |
| + "kind": "library", |
| + "blurb": "Compiles code differently by Rust compiler version.", |
| + "author": "David Tolnay", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/rustversion", |
| + "source": "https://github.com/dtolnay/rustversion", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "rustversion" |
| + } |
| + ], |
| + "uses": { |
| + "*": "arc-swap uses it while it is built." |
| + } |
| + }, |
| + { |
| + "id": "scopeguard", |
| + "name": "scopeguard", |
| + "kind": "library", |
| + "blurb": "Runs clean-up code when a scope ends, however it ends.", |
| + "author": "Ulrik Sverdrup (bluss) and the scopeguard developers", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/scopeguard", |
| + "source": "https://github.com/bluss/scopeguard", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "scopeguard" |
| + } |
| + ], |
| + "uses": { |
| + "*": "parking_lot uses it." |
| + } |
| + }, |
| + { |
| + "id": "serde", |
| + "name": "Serde", |
| + "kind": "library", |
| + "blurb": "Rust's framework for turning data structures into formats such as JSON and back.", |
| + "author": "Erick Tryzelaar and David Tolnay", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://serde.rs/", |
| + "source": "https://github.com/serde-rs/serde", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "serde" |
| + }, |
| + { |
| + "ecosystem": "cargo", |
| + "name": "serde_core" |
| + }, |
| + { |
| + "ecosystem": "cargo", |
| + "name": "serde_derive" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Yrs uses it.", |
| + "docs-native": "Yrs and wasmi use it." |
| + } |
| + }, |
| + { |
| + "id": "serde-json", |
| + "name": "serde_json", |
| + "kind": "library", |
| + "blurb": "JSON for Serde.", |
| + "author": "Erick Tryzelaar and David Tolnay", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/serde_json", |
| + "source": "https://github.com/serde-rs/json", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "serde_json" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Yrs reads and writes JSON values with it, and the core's tests use it.", |
| + "docs-native": "The apps' core passes documents to the app as JSON with it." |
| + } |
| + }, |
| + { |
| + "id": "smallstr", |
| + "name": "smallstr", |
| + "kind": "library", |
| + "blurb": "A string that keeps short text inline instead of on the heap.", |
| + "author": "Murarth", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/smallstr", |
| + "source": "https://github.com/murarth/smallstr", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "smallstr" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Yrs uses it.", |
| + "docs-native": "The apps' Yrs uses it." |
| + } |
| + }, |
| + { |
| + "id": "smallvec", |
| + "name": "smallvec", |
| + "kind": "library", |
| + "blurb": "A vector that keeps its first few items inline instead of on the heap.", |
| + "author": "The Servo Project Developers", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/smallvec", |
| + "source": "https://github.com/servo/rust-smallvec", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "smallvec" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Yrs uses it.", |
| + "docs-native": "Yrs and wasmi use it." |
| + } |
| + }, |
| + { |
| + "id": "source-sans", |
| + "name": "Source Sans 3", |
| + "kind": "typeface", |
| + "blurb": "Adobe's first open-source sans serif, designed by Paul D. Hunt for clear reading in interfaces and long text.", |
| + "author": "Adobe", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://fonts.google.com/specimen/Source+Sans+3", |
| + "source": "https://github.com/adobe-fonts/source-sans", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "Source Sans 3" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "One of the fonts in the font menu, served to the browser and embedded in PDFs.", |
| + "docs-native": "One of the fonts in the font menu, bundled with the app." |
| + } |
| + }, |
| + { |
| + "id": "source-serif", |
| + "name": "Source Serif 4", |
| + "kind": "typeface", |
| + "blurb": "A serif by Frank Grießhammer for Adobe, drawn from the transitional types of Pierre-Simon Fournier and made to sit beside Source Sans.", |
| + "author": "Adobe", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://fonts.google.com/specimen/Source+Serif+4", |
| + "source": "https://github.com/adobe-fonts/source-serif", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "Source Serif 4" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "One of the fonts in the font menu, served to the browser and embedded in PDFs.", |
| + "docs-native": "One of the fonts in the font menu, bundled with the app." |
| + } |
| + }, |
| + { |
| + "id": "sparkle", |
| + "name": "Sparkle", |
| + "kind": "library", |
| + "blurb": "A framework that updates Mac apps distributed outside the App Store: it checks a signed feed and installs new versions in place.", |
| + "author": "Andy Matuschak, Kornel Lesiński, Mayur Pawashe and others", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://sparkle-project.org/", |
| + "source": "https://github.com/sparkle-project/Sparkle", |
| + "packages": [ |
| + { |
| + "ecosystem": "swift", |
| + "name": "sparkle" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "The Mac app updates itself with it." |
| + } |
| + }, |
| + { |
| + "id": "spin", |
| + "name": "spin", |
| + "kind": "library", |
| + "blurb": "Locks that wait by spinning, for code without an operating system's help.", |
| + "author": "Mathijs van de Nes", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://crates.io/crates/spin", |
| + "source": "https://github.com/mvdnes/spin-rs", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "spin" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "wasmi uses it." |
| + } |
| + }, |
| + { |
| + "id": "string-interner", |
| + "name": "string-interner", |
| + "kind": "library", |
| + "blurb": "Stores each distinct string once and hands out small handles to it.", |
| + "author": "Robin Freyler", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/string-interner", |
| + "source": "https://github.com/robbepop/string-interner", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "string-interner" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "wasmi uses it." |
| + } |
| + }, |
| + { |
| + "id": "swift-lang", |
| + "name": "Swift", |
| + "kind": "tool", |
| + "blurb": "Apple's open-source programming language and compiler.", |
| + "author": "Apple Inc. and the Swift project authors", |
| + "licence": { |
| + "spdx": "Apache-2.0 WITH Swift-exception", |
| + "name": "Apache License 2.0 with Runtime Library Exception" |
| + }, |
| + "home": "https://www.swift.org/", |
| + "source": "https://github.com/swiftlang/swift", |
| + "packages": [ |
| + { |
| + "ecosystem": "toolchain", |
| + "name": "swift" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "The apps are written in Swift and built with its package manager." |
| + } |
| + }, |
| + { |
| + "id": "syn", |
| + "name": "syn", |
| + "kind": "library", |
| + "blurb": "A parser for Rust source code, for macros that read the code they are given.", |
| + "author": "David Tolnay", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/syn", |
| + "source": "https://github.com/dtolnay/syn", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "syn" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The core's derive macros use it while it is built.", |
| + "docs-native": "The apps' derive macros use it while they are built." |
| + } |
| + }, |
| + { |
| + "id": "thiserror", |
| + "name": "thiserror", |
| + "kind": "library", |
| + "blurb": "Writes the boilerplate of Rust error types for you.", |
| + "author": "David Tolnay", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/thiserror", |
| + "source": "https://github.com/dtolnay/thiserror", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "thiserror" |
| + }, |
| + { |
| + "ecosystem": "cargo", |
| + "name": "thiserror-impl" |
| + } |
| + ], |
| + "uses": { |
| + "*": "Yrs's errors are written with it." |
| + } |
| + }, |
| + { |
| + "id": "uharfbuzz", |
| + "name": "uharfbuzz", |
| + "kind": "tool", |
| + "blurb": "Python bindings for HarfBuzz, the text shaper in most browsers and operating systems.", |
| + "author": "The uharfbuzz contributors; HarfBuzz by Behdad Esfahbod and others", |
| + "licence": { |
| + "spdx": "Apache-2.0 AND MIT-Modern-Variant", |
| + "name": "Apache License 2.0, with HarfBuzz under its own MIT-style license" |
| + }, |
| + "home": "https://harfbuzz.github.io/", |
| + "source": "https://github.com/harfbuzz/uharfbuzz", |
| + "packages": [ |
| + { |
| + "ecosystem": "pip", |
| + "name": "uharfbuzz" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The PDF export's shaping is tested against HarfBuzz's through it." |
| + } |
| + }, |
| + { |
| + "id": "unicode-ident", |
| + "name": "unicode-ident", |
| + "kind": "library", |
| + "blurb": "Says which characters may start or continue an identifier, from Unicode's own tables.", |
| + "author": "David Tolnay; tables by Unicode, Inc.", |
| + "licence": { |
| + "spdx": "(MIT OR Apache-2.0) AND Unicode-3.0", |
| + "name": "MIT License or Apache License 2.0, and the Unicode License v3" |
| + }, |
| + "home": "https://crates.io/crates/unicode-ident", |
| + "source": "https://github.com/dtolnay/unicode-ident", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "unicode-ident" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "syn uses it while the core is built.", |
| + "docs-native": "syn uses it while the apps are built." |
| + } |
| + }, |
| + { |
| + "id": "version-check", |
| + "name": "version_check", |
| + "kind": "library", |
| + "blurb": "Asks which Rust compiler is building the code.", |
| + "author": "Sergio Benitez", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://crates.io/crates/version_check", |
| + "source": "https://github.com/SergioBenitez/version_check", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "version_check" |
| + } |
| + ], |
| + "uses": { |
| + "*": "aHash uses it while it is built." |
| + } |
| + }, |
| + { |
| + "id": "w3c-keyname", |
| + "name": "w3c-keyname", |
| + "kind": "library", |
| + "blurb": "Reads the name of a pressed key from a keyboard event, the same way in every browser.", |
| + "author": "Marijn Haverbeke and others", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://github.com/marijnh/w3c-keyname", |
| + "source": "https://github.com/marijnh/w3c-keyname", |
| + "packages": [ |
| + { |
| + "ecosystem": "npm", |
| + "name": "w3c-keyname" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The editor's keyboard shortcuts are read with it." |
| + } |
| + }, |
| + { |
| + "id": "wasmi", |
| + "name": "wasmi", |
| + "kind": "library", |
| + "blurb": "A WebAssembly interpreter written in Rust, by Robin Freyler. It runs anywhere Rust does, including where generating machine code at run time is not allowed, as on iOS.", |
| + "author": "Robin Freyler", |
| + "licence": { |
| + "spdx": "MIT OR Apache-2.0", |
| + "name": "MIT License or Apache License 2.0" |
| + }, |
| + "home": "https://github.com/wasmi-labs/wasmi", |
| + "source": "https://github.com/wasmi-labs/wasmi", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "wasmi" |
| + }, |
| + { |
| + "ecosystem": "cargo", |
| + "name": "wasmi_core" |
| + }, |
| + { |
| + "ecosystem": "cargo", |
| + "name": "wasmi_collections" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The core's tests run its WebAssembly in wasmi.", |
| + "docs-native": "The apps run their document core, the same Rust as the server's compiled to WebAssembly, inside wasmi." |
| + } |
| + }, |
| + { |
| + "id": "wasmparser", |
| + "name": "wasmparser", |
| + "kind": "tool", |
| + "blurb": "The Bytecode Alliance's WebAssembly parser, part of wasm-tools.", |
| + "author": "Yury Delendik and the Bytecode Alliance", |
| + "licence": { |
| + "spdx": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", |
| + "name": "Apache License 2.0 with LLVM Exception, Apache 2.0 or MIT" |
| + }, |
| + "home": "https://github.com/bytecodealliance/wasm-tools", |
| + "source": "https://github.com/bytecodealliance/wasm-tools", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "wasmparser" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The core's tests check its WebAssembly imports nothing from its host." |
| + } |
| + }, |
| + { |
| + "id": "wasmparser-nostd", |
| + "name": "wasmparser-nostd", |
| + "kind": "library", |
| + "blurb": "Robin Freyler's copy of the Bytecode Alliance's WebAssembly parser, made to build without the standard library.", |
| + "author": "Yury Delendik, the Bytecode Alliance and Robin Freyler", |
| + "licence": { |
| + "spdx": "Apache-2.0 WITH LLVM-exception", |
| + "name": "Apache License 2.0 with LLVM Exception" |
| + }, |
| + "home": "https://crates.io/crates/wasmparser-nostd", |
| + "source": "https://github.com/robbepop/wasm-tools", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "wasmparser-nostd" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "wasmi reads WebAssembly with it." |
| + } |
| + }, |
| + { |
| + "id": "wazero", |
| + "name": "wazero", |
| + "kind": "library", |
| + "blurb": "A WebAssembly runtime written in Go, with no dependencies outside the standard library.", |
| + "author": "The wazero authors", |
| + "licence": { |
| + "spdx": "Apache-2.0", |
| + "name": "Apache License 2.0" |
| + }, |
| + "home": "https://wazero.io/", |
| + "source": "https://github.com/tetratelabs/wazero", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "github.com/tetratelabs/wazero" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The server runs Docs' document core, Rust compiled to WebAssembly, inside it." |
| + } |
| + }, |
| + { |
| + "id": "x-image", |
| + "name": "golang.org/x/image", |
| + "kind": "library", |
| + "blurb": "The Go project's supplementary image libraries.", |
| + "author": "The Go Authors", |
| + "licence": { |
| + "spdx": "BSD-3-Clause", |
| + "name": "BSD 3-Clause License" |
| + }, |
| + "home": "https://pkg.go.dev/golang.org/x/image", |
| + "source": "https://go.googlesource.com/image", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "golang.org/x/image" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The PDF export measures glyphs in its fixed-point units." |
| + } |
| + }, |
| + { |
| + "id": "x-sys", |
| + "name": "golang.org/x/sys", |
| + "kind": "library", |
| + "blurb": "The Go project's low-level access to the operating system.", |
| + "author": "The Go Authors", |
| + "licence": { |
| + "spdx": "BSD-3-Clause", |
| + "name": "BSD 3-Clause License" |
| + }, |
| + "home": "https://pkg.go.dev/golang.org/x/sys", |
| + "source": "https://go.googlesource.com/sys", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "golang.org/x/sys" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "SQLite and wazero use it." |
| + } |
| + }, |
| + { |
| + "id": "x-text", |
| + "name": "golang.org/x/text", |
| + "kind": "library", |
| + "blurb": "The Go project's text libraries: languages, Unicode normalization and more.", |
| + "author": "The Go Authors", |
| + "licence": { |
| + "spdx": "BSD-3-Clause", |
| + "name": "BSD 3-Clause License" |
| + }, |
| + "home": "https://pkg.go.dev/golang.org/x/text", |
| + "source": "https://go.googlesource.com/text", |
| + "packages": [ |
| + { |
| + "ecosystem": "go", |
| + "name": "golang.org/x/text" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "Docs normalizes titles with it, so a search finds an accented word however it was typed." |
| + } |
| + }, |
| + { |
| + "id": "xcodegen", |
| + "name": "XcodeGen", |
| + "kind": "tool", |
| + "blurb": "Generates Xcode projects from a YAML description.", |
| + "author": "Yonas Kolb", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://github.com/yonaskolb/XcodeGen", |
| + "source": "https://github.com/yonaskolb/XcodeGen", |
| + "packages": [ |
| + { |
| + "ecosystem": "toolchain", |
| + "name": "xcodegen" |
| + } |
| + ], |
| + "uses": { |
| + "docs-native": "The iPhone app's Xcode project is generated from ios/project.yml with it." |
| + } |
| + }, |
| + { |
| + "id": "y-prosemirror", |
| + "name": "y-prosemirror", |
| + "kind": "library", |
| + "blurb": "Binds a ProseMirror editor to a Yjs document, so the editor shows the shared document and edits it.", |
| + "author": "Kevin Jahns", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://github.com/yjs/y-prosemirror", |
| + "source": "https://github.com/yjs/y-prosemirror", |
| + "packages": [ |
| + { |
| + "ecosystem": "npm", |
| + "name": "y-prosemirror" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "It joins the editor to the document, and its undo manager is the editor's undo." |
| + } |
| + }, |
| + { |
| + "id": "y-protocols", |
| + "name": "y-protocols", |
| + "kind": "library", |
| + "blurb": "The messages Yjs clients exchange to sync documents and share who is present.", |
| + "author": "Kevin Jahns", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://github.com/yjs/y-protocols", |
| + "source": "https://github.com/yjs/y-protocols", |
| + "packages": [ |
| + { |
| + "ecosystem": "npm", |
| + "name": "y-protocols" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "y-prosemirror uses it." |
| + } |
| + }, |
| + { |
| + "id": "yjs", |
| + "name": "Yjs", |
| + "kind": "library", |
| + "blurb": "A CRDT by Kevin Jahns: shared data that several people can change at once and that always merges to the same result, with no server deciding the order.", |
| + "author": "Kevin Jahns, and the Chair of Computer Science 5 (Databases and Information Systems), RWTH Aachen University", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://yjs.dev/", |
| + "source": "https://github.com/yjs/yjs", |
| + "packages": [ |
| + { |
| + "ecosystem": "npm", |
| + "name": "yjs" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "In the browser, a document is a Yjs document, so edits from several people merge." |
| + } |
| + }, |
| + { |
| + "id": "yrs", |
| + "name": "Yrs", |
| + "kind": "library", |
| + "blurb": "The Rust port of Yjs, by Kevin Jahns and Bartosz Sypytkowski, which reads and writes the same updates as Yjs itself.", |
| + "author": "Kevin Jahns and Bartosz Sypytkowski", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://github.com/y-crdt/y-crdt", |
| + "source": "https://github.com/y-crdt/y-crdt", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "yrs" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "The server's document core is Yrs, compiled to WebAssembly: it checks, merges and renders every edit. Docs carries a copy with fixes for deletions.", |
| + "docs-native": "The apps keep documents in Yrs, so they edit offline and merge with the web. They carry the same fixed copy as the server." |
| + } |
| + }, |
| + { |
| + "id": "zerocopy", |
| + "name": "zerocopy", |
| + "kind": "library", |
| + "blurb": "Google's library for safely reading and writing raw bytes as typed data, without copying.", |
| + "author": "The Fuchsia Authors", |
| + "licence": { |
| + "spdx": "BSD-2-Clause OR Apache-2.0 OR MIT", |
| + "name": "BSD 2-Clause, Apache 2.0 or MIT License" |
| + }, |
| + "home": "https://crates.io/crates/zerocopy", |
| + "source": "https://github.com/google/zerocopy", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "zerocopy" |
| + } |
| + ], |
| + "uses": { |
| + "*": "aHash uses it." |
| + } |
| + }, |
| + { |
| + "id": "zilla-slab", |
| + "name": "Zilla Slab", |
| + "kind": "typeface", |
| + "blurb": "A slab serif Typotheque made for Mozilla's identity.", |
| + "author": "The Mozilla Foundation", |
| + "licence": { |
| + "spdx": "OFL-1.1", |
| + "name": "SIL Open Font License 1.1" |
| + }, |
| + "home": "https://fonts.google.com/specimen/Zilla+Slab", |
| + "source": "https://github.com/mozilla/zilla-slab", |
| + "packages": [ |
| + { |
| + "ecosystem": "font", |
| + "name": "Zilla Slab" |
| + } |
| + ], |
| + "uses": { |
| + "docs": "One of the fonts in the font menu, served to the browser and embedded in PDFs.", |
| + "docs-native": "One of the fonts in the font menu, bundled with the app." |
| + } |
| + }, |
| + { |
| + "id": "zmij", |
| + "name": "zmij", |
| + "kind": "library", |
| + "blurb": "Writes floating-point numbers as the shortest text that reads back exactly.", |
| + "author": "David Tolnay", |
| + "licence": { |
| + "spdx": "MIT", |
| + "name": "MIT License" |
| + }, |
| + "home": "https://crates.io/crates/zmij", |
| + "source": "https://github.com/dtolnay/zmij", |
| + "packages": [ |
| + { |
| + "ecosystem": "cargo", |
| + "name": "zmij" |
| + } |
| + ], |
| + "uses": { |
| + "*": "serde_json uses it." |
| + } |
| + } |
| + ] |
| +} |
diff --git a/colophon/templates/colophon.html b/colophon/templates/colophon.html| new file mode 100644 |
| index 0000000..8c008c2 |
| --- /dev/null |
| +++ b/colophon/templates/colophon.html |
| @@ -0,0 +1,57 @@ |
| +{{/* estilo/colophon — an app's Colophon (colophon.Page). No script: the |
| + contents are in-page links and each licence is its own page. Every |
| + word not in the catalog is the caller's (Labels), in its locale; the |
| + catalog's own words are English, like the licences they sit beside, |
| + and are marked lang="en" (WCAG 3.1.2): the entries and the licence |
| + texts, never the caller's labels around them. |
| + Names are in <bdi> so a right-to-left page keeps them whole. */}} |
| +{{define "estilo/colophon"}} |
| +<article estilo-colophon> |
| + <h1>{{.Title}}</h1> |
| + {{range .Intro}}<p>{{.}}</p>{{end}} |
| + <nav aria-label="{{.Labels.Contents}}" estilo-colophon-contents> |
| + <ul role="list"> |
| + {{range .Colophon.Sections}}<li><a href="#colophon-{{.ID}}">{{index $.Labels.Sections .ID}}</a> <span estilo-colophon-count>({{len .Entries}})</span></li> |
| + {{end}}</ul> |
| + </nav> |
| + {{range .Colophon.Sections}} |
| + <section aria-labelledby="colophon-{{.ID}}"> |
| + <h2 id="colophon-{{.ID}}">{{index $.Labels.Sections .ID}}</h2> |
| + <ul role="list" estilo-colophon-entries lang="en"> |
| + {{range .Entries}} |
| + <li id="colophon-{{.ID}}" estilo-colophon-entry> |
| + <h3><bdi>{{.Name}}</bdi></h3> |
| + <p>{{.Blurb}} {{.Usage}}</p> |
| + <dl> |
| + <div><dt>{{$.Labels.By}}</dt><dd>{{.Author}}</dd></div> |
| + <div><dt>{{$.Labels.Licence}}</dt><dd><a href="{{$.LicenceBase}}{{.ID}}">{{.Licence.Name}}</a></dd></div> |
| + {{with .VersionText}}<div><dt>{{$.Labels.Version}}</dt><dd><bdi>{{.}}</bdi></dd></div>{{end}} |
| + </dl> |
| + <p estilo-colophon-links>{{if eq .Home .Source}}<a href="{{.Home}}" rel="noreferrer" referrerpolicy="no-referrer">{{$.Labels.HomeAndSource}}</a>{{else}}<a href="{{.Home}}" rel="noreferrer" referrerpolicy="no-referrer">{{$.Labels.Home}}</a> <a href="{{.Source}}" rel="noreferrer" referrerpolicy="no-referrer">{{$.Labels.Source}}</a>{{end}}</p> |
| + </li> |
| + {{end}} |
| + </ul> |
| + </section> |
| + {{end}} |
| +</article> |
| +{{end}} |
| + |
| +{{/* estilo/colophon-licence — one entry's licence texts |
| + (colophon.LicencePage): every package's own files, unaltered. The |
| + newline after <pre> is there because the HTML parser drops a <pre>'s |
| + first newline, and a notice's own must survive. */}} |
| +{{define "estilo/colophon-licence"}} |
| +<article estilo-colophon> |
| + <h1>{{.Title}}</h1> |
| + <p><a href="{{.Back}}">{{.Labels.Back}}</a></p> |
| + {{range .Entry.Packages}} |
| + <section estilo-colophon-licence lang="en"> |
| + <h2><bdi>{{.Name}}</bdi>{{with .Version}} {{.}}{{end}}</h2> |
| + {{range .Notices}}<h3><bdi>{{.Name}}</bdi></h3> |
| + <pre> |
| +{{.Text}}</pre> |
| + {{else}}{{if .Tool}}<p>{{$.Labels.NotIncluded}} <a href="{{$.Entry.Source}}" rel="noreferrer" referrerpolicy="no-referrer">{{$.Labels.Source}}</a></p>{{else}}<p>{{$.Labels.Missing}}</p>{{end}}{{end}} |
| + </section> |
| + {{end}} |
| +</article> |
| +{{end}} |
diff --git a/credits/catalog/catalog.go b/credits/catalog/catalog.go| index ace6336..794ada4 100644 |
| --- a/credits/catalog/catalog.go |
| +++ b/credits/catalog/catalog.go |
| @@ -146,3 +146,9 @@ func moduleURL(m *Module) string { |
| } |
| return "https://pkg.go.dev/" + m.Path + "@" + m.Version |
| } |
| + |
| +// NoticeFilename reports whether name is a licence or notice file's name |
| +// (LICENSE, LICENCE, COPYING or NOTICE, alone or with a suffix), the rule |
| +// Collect reads Go modules by; estilo's colophon collectors read crates and |
| +// npm packages by it too. |
| +func NoticeFilename(name string) bool { return noticeFilename(name) } |
diff --git a/implementation/colophon.json b/implementation/colophon.json| new file mode 100644 |
| index 0000000..f4a1dbf |
| --- /dev/null |
| +++ b/implementation/colophon.json |
| @@ -0,0 +1,10 @@ |
| +{ |
| + "author": "Claude Opus 5.5 (claude-opus-5-5), Claude Code", |
| + "user_request": "Paul, 2026-10-26: \"put that under 'Help' ... and then link out to e.g. 'Colophon' where we list all of the open source stuff we use, attribute it, and link out to attribution. Maybe a little paragraph about each thing too would be nice. I'd be happy if that were exhaustive.\"", |
| + "component": "colophon: the Colophon page (estilo/colophon) and each entry's licence page (estilo/colophon-licence), colophon.css, and projects.json, the suite's one catalog of project descriptions (blurb, author, licence, home, source, packages, per-app usage notes).", |
| + "exhaustive_by_construction": "Apps never list projects. They collect what they ship (credits/catalog.Collect for Go, CollectNPM over esbuild's metafile inputs, CollectCargo over cargo metadata's normal and build dependencies, CollectCargoTools for direct dev-dependencies, plus fonts and vendored files) and colophon.Build refuses: a shipped package with no catalog entry, a project shipped without a usage note for the app, a usage note for a project the app does not ship, and a shipped package without its licence text (tools excepted, NOASSERTION excepted and said so on the page). Validate holds every catalog entry to a one-or-two-sentence blurb, an author, a licence, https home and source, and at least one package claimed by no other project.", |
| + "builds_on": "credits (Notice, Lucide, Onest) and credits/catalog (Collect, and its notice-filename rule, now exported as NoticeFilename). The credits page and oficina-notices are unchanged for the apps that use them.", |
| + "no_flash": "No script and no face: colophon.css sets no font but inherit, fetches nothing (TestStylesheetDeclaresNoFaceAndReadsOnlyDefinedTokens). Docs' browser check confirms zero loaded faces and the system UI face at 320 and 1200px with scripts on and off.", |
| + "first_consumer": "Docs, branch feat/colophon (web Help → Colophon and the Apple apps' native Colophon from the same Build).", |
| + "review": "Claude Fable 5.1 (claude-fable-5-1) on #27 at b674411: needs changes (P1 dt shrink at 320px; P2s capitalised, catalog accuracy and tone, lang=en, default usage note, macro/build crates as tools). All addressed at 22a7cfe and after; re-review pending." |
| +} |