split-post: the regex-literal false positive (crackle) also points at index.html in the intermediate steps
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dhu3iHseRewQ2WpBSVLokG
This commit is contained in:
1 parent
7274c21b63
commit
5268620470
1 file changed
+1
-1
+1
-1
@@ -14,7 +14,7 @@ for p in files:
|
||||
j = t.index("\n}\n", t.index("async function veniceFetch")) + 3
|
||||
t = t[:j] + "/* the fetcher is injectable: the harness fragments stub it (render.setFetcher); every call goes through venice() */\nlet fetcher = veniceFetch;\nexport const setFetcher = (fn) => { fetcher = fn || veniceFetch; };\nexport const venice = (...a) => fetcher(...a);\n" + t[j:]
|
||||
t = t.replace("\nasync function makeTone(", "\nexport async function makeTone(").replace("\nasync function makeNoise(", "\nexport async function makeNoise(")
|
||||
t = t.replace('import { crackle } from "./player.js";\n', "") # a regex literal in noiseSpec mentions crackle; not a use
|
||||
t = re.sub(r'import \{ crackle \} from "\./(player\.js|index\.html)";\n', "", t) # a regex literal in noiseSpec mentions crackle; not a use
|
||||
if t != s: p.write_text(t)
|
||||
h = ROOT / "index.html"; s = h.read_text()
|
||||
s = s.replace('<script src="brain.js"></script>', '<script src="brain.js" defer></script>') # after the module, which is deferred too
|
||||
|
||||
Reference in new issue
Block a user