From 2150e2c7d1522d250fea0c8d913c28926d965ec4 Mon Sep 17 00:00:00 2001 From: swapnil <78632212+swapnilpaliwal-sd@users.noreply.github.com> Date: Mon, 28 Sep 2026 20:00:16 -0700 Subject: [PATCH] freshness: watch .vue, .svelte and .astro components in the file table An edit to a single-file component was invisible to the file table, so index said 'graph up to date' and queries answered from the old text. Both web front ends now watch the component extensions; SOURCE still decides which languages a repository has. Closes #1744 Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com> Co-Authored-By: Claude --- .../skills/axiomcode/scripts/ax_fresh.py | 10 +++++-- tests/freshness.py | 27 +++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/plugins/axiomcode/skills/axiomcode/scripts/ax_fresh.py b/plugins/axiomcode/skills/axiomcode/scripts/ax_fresh.py index 896f104bd..808b4a3cb 100644 --- a/plugins/axiomcode/skills/axiomcode/scripts/ax_fresh.py +++ b/plugins/axiomcode/skills/axiomcode/scripts/ax_fresh.py @@ -42,10 +42,16 @@ # what each language's parser reads: extensions, and file names read whatever their extension. Mirrors # parser/src/extract.ts: Java also reads .properties / XML / YAML / Gradle / lombok.config and # META-INF/services; TypeScript reads JavaScript beside it and resolves through tsconfig and package.json. +# SINGLE-FILE COMPONENTS (#1744): the web front ends read the \n" + "\n"), + ('src/List.svelte', '\n'), ('src/pages/index.astro', '---\n---\n'), + ('src/index.html', '
\n'), ('src/app.css', 'a {}\n'), ('README.md', '# x\n')): + write(root, f, body) + got = {os.path.relpath(p, root) for p in ax_fresh.watched(root, lang)} + check(f"prune: {lang} watches .vue, .svelte and .astro components, not the .html, .css or .md beside them", + got == {'src/lib.js', 'src/views/Home.vue', 'src/List.svelte', 'src/pages/index.astro'}, sorted(got)) + table = dict(lang=lang, lang_auto=True, src='', files=ax_fresh.snapshot(root, lang, root)) + with open(os.path.join(root, 'src/views/Home.vue'), 'w') as fh: + fh.write("\n" + "\n") + write(root, 'src/views/About.vue', '\n') + write(root, 'src/index.html', '
changed
\n') + c = ax_fresh.changes(root, table) + check(f"prune: {lang}: an edited .vue makes the graph stale and a new one is added; an edited .html does neither", + c == (['src/views/Home.vue'], ['src/views/About.vue'], []), c) + only = os.path.join(work, 'sfc-only') + write(only, 'src/App.vue', '\n') + n = {l: sum(1 for p in ax_fresh.watched(only, l) if p.endswith(ax_fresh.SOURCE[l])) for l in ('javascript', 'typescript')} + check("prune: a repository of .vue files alone counts no JavaScript or TypeScript source", n == {'javascript': 0, 'typescript': 0}, n) finally: shutil.rmtree(work, ignore_errors=True)