build: single-file bundles build/Rosetta.luau + build/rosetta.lua (tools/bundle.py), terse README with generated format / codec tables
- tools/bundle.py: every module a function in __FILES with a cached __include; requires become __include calls, so only the API and its load-time requires run on require. Rosetta._internal(path) includes any module by its src path. --!native modules get @native on each function (NATIVE re-checked on the bundle); linemaps map bundle lines back to sources (--where). LuaJIT bundle inlines the compat prelude. - tools/build.py: the multi-file trees move to build/_modules (gitignored); each target also writes its bundle. - tools/test.sh: api + docs/example tests also run against both bundles; fails when build/ is stale. - default.project.json mounts build/Rosetta.luau; examples/love loads build/rosetta.lua. - README: one line, install, quick start, doc links, generated format table and codec list (tools/gen_registry.py), licence TODO. DOCS lint checks the generated sections and the links.
This commit is contained in:
1 parent
0bd7b87d2b
commit
bcf6d46fb7
16 files changed
+399611
-210
No files matched your search
@@ -1,4 +1,4 @@
|
||||
-- LÖVE smoke test / example for the LuaJIT build (tools/build.py luajit), run from the repo root:
|
||||
-- LÖVE smoke test / example for the LuaJIT bundle build/rosetta.lua (tools/build.py luajit), run from the repo root:
|
||||
-- love examples/love (a window: images, a voxel model, a tone)
|
||||
-- ROSETTA_SMOKE=1 xvfb-run love examples/love (headless: checks, a screenshot, then quits; exit code 1 on
|
||||
-- failure)
|
||||
@@ -7,7 +7,7 @@
|
||||
-- video (decoded in love.update with a time budget per frame), and shows them with love.graphics / love.audio through
|
||||
-- the host's toImageData / toSoundData. docs/guide/README.md explains the API.
|
||||
local root = (love.filesystem.getSource():gsub("/examples/love/?$", ""))
|
||||
package.path = root .. "/build/luajit/?.lua;" .. root .. "/build/luajit/?/init.lua;" .. package.path
|
||||
package.path = root .. "/build/?.lua;" .. package.path -- build/rosetta.lua (or: local F = dofile(root .. "/build/rosetta.lua"))
|
||||
local F = require("rosetta")
|
||||
require("rosetta._compat").install() -- buffer / bit32 globals for this file (the library itself does not need them)
|
||||
|
||||
@@ -46,7 +46,7 @@ function love.load()
|
||||
if check(png ~= nil and png.width == 32, "png fixture", errstr(e)) then tile("basn6a08.png", png) end
|
||||
|
||||
-- a generated image, saved and reloaded through every image writer
|
||||
local Types = require("rosetta.Types")
|
||||
local Types = F.Types
|
||||
local img = Types.Image.new(96, 64, "rgba8")
|
||||
for y = 0, 63 do
|
||||
for x = 0, 95 do
|
||||
|
||||
Reference in new issue
Block a user