Skip to content

refactor: rename schema module to platform-schema - #57

Merged
mcanouil merged 3 commits into
mainfrom
refactor/platform-schema-module
Aug 26, 2026
Merged

refactor: rename schema module to platform-schema#57
mcanouil merged 3 commits into
mainfrom
refactor/platform-schema-module

Conversation

@mcanouil

Copy link
Copy Markdown
Owner

_modules/schema.lua in this extension validates platform configurations from platforms.yml. That filename is already claimed by the shared schema.lua module, which validates an extension's _schema.yml against the v2 meta-schema. Two files cannot share a name in _modules/, so gitlink could not carry both. The file is now _modules/platform-schema.lua, with its module table renamed to match, and _modules/platforms.lua updated to load it.

Also fixes how _modules/bitbucket.lua loads the shared string module. It used require("_modules/string"), a bare module name. Quarto's patched require rewrites a name to a fully qualified path only when the name starts with ., so this one was cached under that literal key, which is global to the render. Another extension's _modules/string could be returned in its place. It now uses the same load_sibling helper as paths.lua, metadata.lua, html.lua, and widget.lua.

Verified by rendering example.qmd, a Bitbucket document, a document with an invalid custom platform file (the validator still reports the platform name and the missing field), and the docs/ site.

The module validates platform configurations from platforms.yml, but it
held the filename `_modules/schema.lua`. That name belongs to the shared
schema module, which validates an extension's `_schema.yml` against the
v2 meta-schema. Two files cannot share a name in `_modules/`, so gitlink
could not carry both.
`require("_modules/string")` does not start with `.`, so Quarto's patched
require caches it under that literal key rather than a fully qualified
path. The key is global to the render, so another extension's
`_modules/string` could be returned instead. Use the load_sibling helper
that the other local modules already use.
@mcanouil mcanouil added the Type: Refactor 🔥 Issues related to refactoring, restructuring, or cleaning up label Aug 26, 2026
@mcanouil mcanouil self-assigned this Aug 26, 2026
@mcanouil
mcanouil marked this pull request as ready for review August 26, 2026 21:39
@mcanouil
mcanouil merged commit 61a24be into main Aug 26, 2026
4 checks passed
@mcanouil
mcanouil deleted the refactor/platform-schema-module branch August 26, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Refactor 🔥 Issues related to refactoring, restructuring, or cleaning up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant