Skip to content

Pin a plugin's dependency version from its registry entry - #2793

Merged
chalin merged 30 commits into
docsy:mainfrom
chalin:chalin-m24-plugin-config-two-spaces-2026-0905
Sep 7, 2026
Merged

chalin merged 30 commits into
docsy:mainfrom
chalin:chalin-m24-plugin-config-two-spaces-2026-0905

Conversation

@chalin

@chalin chalin commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator
  • Contributes to Add a JS plugin loading mechanism #2789
  • Scope:
    • version becomes a registry-entry field: the pin of the third-party dependency a plugin's companion fetches
    • moves the markmap pin from params.markmap.version onto its entry
    • deprecates the legacy key, which wins over the entry's value while present
    • tightens the params.docsy schema contract and aligns its implementation, documentation, and tests
    • defines plugin emission priorities without promising equal-weight order
  • Out of scope:
    • KaTeX, Mermaid, and Redoc retain their top-level version pins until converted to plugins
    • pageGate's shape (separate task)
    • plugin-specific registry fields for third-party plugins (on first real need)
  • Design: For the entry-field and shared-validation rationale, see Registry shape.
  • Review focus:
    • placement of version validation in the plugin loop
    • legacy-wins precedence in the shim
    • the schema contract and its consumers
  • Preview(s):

@chalin chalin added this to the 0.18.0 milestone Sep 6, 2026
@chalin
chalin marked this pull request as ready for review September 6, 2026 10:16
@chalin chalin changed the title Plugins: pin a plugin's dependency version on its registry entry Pin a plugin's dependency version from its registry entry Sep 6, 2026
chalin added a commit to chalin/docsy that referenced this pull request Sep 6, 2026
…entry

The pinned version of the dependency a plugin's companion fetches is now the
entry's `version` field, normalized and validated once by the loop (URL
character guard fails the build; a non-X.Y.Z value warns under the documented
NAME-floating-version id). The markmap companion reads .Plugin.version; its
local checks move to the loop. params.markmap.version is deprecated under the
existing docsy-markmap-legacy id and honored while set.
Pins section, MarkMap version, Plugins reference, implementation security
constraints, maintainer notes, 0.18 post and changelog follow the field;
Renovate's theme-config matcher reads the new path.
…a string

errorf fails the build without leaving the template, so the loop now skips the
entry after the character guard fires, and the fixture asserts no fetch was
attempted. The shim stringifies params.markmap.version before testing it, so a
falsy legacy value is deprecated and honored like any other. The canary also
pins the loop's bare read; the pins section shows MarkMap's entry form below
the params.PACKAGE sample; changelog cites this PR.
… a cast

The shim forwards params.markmap.version whenever the key is set, so an empty
or falsy legacy pin is deprecated and then fails at the companion as before
0.18. The loop stringifies with printf, so a map or slice fails the character
guard instead of crashing the string cast; the two checks are flat under one
with. Docs qualify the guarantee to enabled entries; the one-id test names
shape warnings; assertion messages read affirmatively.
…he loop net

- Names Docsy 0.18 in the three legacy warnings; the version one states that a present legacy pin overrides the entry's
- Points the companion's empty-pin error at the theme-defaults merge, the likely cause
- Pins the entry env override, legacy-over-explicit-entry precedence, a map-valued legacy pin, and the name-derived floating id on a generic entry
- Moves the version ids and outcomes to the guide's Warnings, connects the author security rule to the field, and homes the entry-field rationale on the design page
- Drops the maintainer notes' partialCached caveat (stale since docsy#2787) and the changelog's PR cite (key issue suffices)
… fallback check

- Puts the pin in the resources.Copy target, so each language of a multilingual site gets its own pinned file (the cache is keyed by target); a static tripwire pins the shape
- Restores the canary's rejection of every nonempty fallback, exempting only the loop's nil-normalizing default ""
- Qualifies the guide's version outcomes to nonempty values, distinguishes the legacy keys' fates in the NOTE and the post, and tells upgraders to move only an overridden pin
- Lists the maintainer notes' bump steps and per-package caveats; drops an orphaned link-cache entry and a stale cSpell word
- Keeps legacy major selectors working without locking the loop's normalization syntax
- Bases the no-fetch guarantee on companion reachability instead of missing error text
- Aligns migration guidance with when plugins actually load

Plugins: drop special handling for numeric zero

- Keeps normalization simple for the string-valued version field; quoted major selectors remain supported
- Makes empty-version repair advice account for legacy overrides
- Removes a syntax detector that rejects equivalent vendoring implementations
- Keeps migration conditions readable and comment claims accurate
- Avoids prescribing explicit pins when the theme default should be inherited
- Makes entry shape, required fields, coercion qualifiers, and syntactic patterns explicit in the recursive schema
- Drops the provisional scalar shorthand and requires each effective entry to declare enable
- Drives defaults, required fields, and version syntax from the schema while preserving advisory version warnings
- Aligns user, maintainer, acceptance, fixture, and browser coverage with the contract
@chalin
chalin force-pushed the chalin-m24-plugin-config-two-spaces-2026-0905 branch from 40d7953 to 35f319a Compare September 6, 2026 19:24
- Keeps normalization qualifiers local instead of implying file-wide trimming
- Rejects whitespace rather than silently repairing the supplied value
- Keeps string coercion and verifies both legacy and registry inputs
- Keeps requiredness beside each field and distinguishes map entries from schema metadata
- Checks field-level requiredness and diagnoses an empty effective registry
- Keeps inherited configuration and all-disabled registries valid
- Exercises published bytes instead of relying on companion stubs or filename shape
- Keeps the default-comparison test meaningful as the schema evolves
- Clarifies ordering and corrects stale validation descriptions
- Keeps output reproducible without making equal-weight ordering a dependency contract
- Distinguishes tag ordering from asynchronous readiness
@chalin
chalin merged commit bdee841 into docsy:main Sep 7, 2026
18 checks passed
@chalin
chalin deleted the chalin-m24-plugin-config-two-spaces-2026-0905 branch September 7, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant