Add Lua require mode that adheres to the PUC Lua require behavior.#344
Draft
bainchild wants to merge 1 commit intoseaofvoices:mainfrom
Draft
Add Lua require mode that adheres to the PUC Lua require behavior.#344bainchild wants to merge 1 commit intoseaofvoices:mainfrom
bainchild wants to merge 1 commit intoseaofvoices:mainfrom
Conversation
New require mode has no configuration other than the key `lua_path`, followed by the environment variable `LUA_PATH`, defaulting to `./?.luau;./?.lua;./?/init.luau;./?/init.lua`.
Contributor
|
Hi 👋 That is all a good start! To answer your questions:
|
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.
This is a new require mode that follows the lua/luajit interpreter require behavior, excluding the default search string being different and binary libraries not being included.
There is also a design choice I'd like to get counsel on before this is merged:
requires replace.'s in the path with/, before substituting them into the search string, which means you can't have file extensions..luau,.lua,.txt,.json,.toml,.yaml. This could cause problems if not considered, or be considered an intentional override mechanism, given that those resource types are transcoded to lua anyway.LUA_PATHenvironment variable not providing these 4 resource extensions (as they aren't included in the default lua search path).I am also unsure if I should be contributing the documentation to go alongside this, as I couldn't find any general standards for documentation contribution.