lpghatguy / baste Goto Github PK
View Code? Open in Web Editor NEWAlternate Lua module system
License: MIT License
Alternate Lua module system
License: MIT License
I used loadfile
because I was concerned about the ability of tools like LuaCov to keep up. I'm pretty sure they use debug chunk naming though, so they'd probably be fine with a loadstring
generated chunk with the proper name.
The other problem with loadfile
is that it's difficult to distinguish different types of errors. By handling the file read and load inside Baste, we get a much more robust way to figure out what went wrong.
Coverage dropped pretty badly when I added LOVE specific code. Need to download LOVE as a sixth build option and run the included spec for it!
Regular Lua modules get a module-ish path in ...
when they're loaded.
Should Baste try to generate paths like that? It'd be awfully convenient to import everything with Baste, but it might be tricky.
The current config for luacheck is lua51
, which isn't correct since the project runs on 5.2 and 5.3.
I need to look into what config cross-version projects should have.
I want Baste to work with MoonScript and native modules and all sorts of things no one has thought of yet.
There should be a way to plug in custom path resolvers and custom module loaders to make these things easy. They can then be distributed using a similar single file mechanism and potentially loaded with Baste itself!
Baste might need the ability to inject itself as a global for use with tools like Busted. Since tests are a case where relative imports are incredibly useful (especially in-tree tests), it would make sense to use Baste there too instead of relying on two module systems.
I'm not normally a fan of littering code licenses around on source files, but Baste is only a single file and intended to be vendored in a convenient place.
The license should probably be at the top of the file!
Right now, the bulk of the path handling is done with a gob of gsub
calls with some pretty terrible patterns. I know there are a lot of edge cases that need tests written.
The path module should be rewritten, exposed for testing, and clearly documented.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.