webapp-scaffold/bin
Uwe Schuster b3b2903c75 #3: inject-hashed-filenames.py — tag-aware HTML rewrite
Replace substring `html.replace(old_src, new_src)` with a regex anchored
to <script src="…"> / <link href="…"> attribute values. Inert occurrences
in comments, JSON literals, or unrelated attributes are left alone.

Loud warning (stderr) when zero matches occur — previously the script
silently skipped a typo'd old_src.

Also rewrites <link href> in the same pass so adjacent CSS hashing doesn't
need a follow-up edit.

Tests: tests/test_inject_hashed_filenames.py covers happy path (both quote
styles, extra attributes), inert-substring cases (comment, JSON literal,
data-attr, anchor href), and link-href rewriting.

Closes #3

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 21:38:19 +02:00
..
__pycache__ #3: inject-hashed-filenames.py — tag-aware HTML rewrite 2026-04-25 21:38:19 +02:00
fetch-openapi.sh #2: fetch-openapi.sh — pass $OUT via sys.argv, not f-string in heredoc 2026-04-25 21:34:02 +02:00
inject-hashed-filenames.py #3: inject-hashed-filenames.py — tag-aware HTML rewrite 2026-04-25 21:38:19 +02:00
postprocess-openapi.py v0.1.0: fetch/postprocess/inject scripts + vite config factories 2026-04-21 22:06:58 +02:00