refactor: rename schema module to platform-schema - #57
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_modules/schema.luain this extension validates platform configurations fromplatforms.yml. That filename is already claimed by the sharedschema.luamodule, which validates an extension's_schema.ymlagainst 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.luaupdated to load it.Also fixes how
_modules/bitbucket.lualoads the sharedstringmodule. It usedrequire("_modules/string"), a bare module name. Quarto's patchedrequirerewrites 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/stringcould be returned in its place. It now uses the sameload_siblinghelper aspaths.lua,metadata.lua,html.lua, andwidget.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 thedocs/site.