rename: src/Formats -> src/Rosetta, @formats -> @rosetta requires, build/luajit/rosetta + rosetta._compat, build/roblox/Rosetta, ROSETTA_* env/globals, writer vendor strings

This commit is contained in:
4DBug committed 2026-11-01 01:19:16 -05:00
1 parent 2956576d7f
commit 22ddcd78fa
941 files changed
+3364 -3364

No files matched your search

+6 -6
View File
@@ -1,15 +1,15 @@
#!/usr/bin/env python3
# Module moves (python3 -I tools/move.py [--dry] old=new ...): moves src/Formats/<old>(.luau | /) to <new> with
# git mv, then rewrites every reference to the module path in the repo: requires ("@formats/old" and
# "@formats/old/Sub"), contract deps ("old"), header comment lines ("-- old: ..." / "-- old/Sub: ..."), fixture
# INPUTS ("src/Formats/old"), docs and comments ("old" as a whole path token). Paths are module paths
# Module moves (python3 -I tools/move.py [--dry] old=new ...): moves src/Rosetta/<old>(.luau | /) to <new> with
# git mv, then rewrites every reference to the module path in the repo: requires ("@rosetta/old" and
# "@rosetta/old/Sub"), contract deps ("old"), header comment lines ("-- old: ..." / "-- old/Sub: ..."), fixture
# INPUTS ("src/Rosetta/old"), docs and comments ("old" as a whole path token). Paths are module paths
# (codecs/Deflate, core/Huffman). Generated files are not edited: rerun tools/gen_registry.py afterwards.
#
# python3 -I tools/move.py codecs/Deflate=codecs/compress/Deflate core/Huffman=codecs/entropy/Huffman
import os, re, subprocess, sys
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SRC = os.path.join(ROOT, "src", "Formats")
SRC = os.path.join(ROOT, "src", "Rosetta")
SCAN = ["src", "tests", "tools", "docs", "examples", "README.md", "default.project.json"]
SKIP = {os.path.join("tests", "gen"), os.path.join("tools", "move.py"), "build"}
EXTS = (".luau", ".lua", ".py", ".md", ".json", ".sh")
@@ -59,7 +59,7 @@ def main():
# a path token: not preceded by a word char or "."; not followed by a word char
subs = [(re.compile(r"(?<![\w.])" + re.escape(old) + r"(?![\w])"), new) for old, new in pairs]
lua_subs = [(re.compile(r"(?<![\w.])formats\." + re.escape(old.replace("/", ".")) + r"(?![\w])"),
"formats." + new.replace("/", ".")) for old, new in pairs]
"rosetta." + new.replace("/", ".")) for old, new in pairs]
changed = 0
for f in files():
with open(f, encoding="utf-8", errors="surrogateescape") as h: