Skip to content

feat(artifacts): view templates get the view-template role (#208) - #211

Merged
rahlk merged 2 commits into
mainfrom
feat/issue-208-view-template-roles
Sep 11, 2026
Merged

rahlk merged 2 commits into
mainfrom
feat/issue-208-view-template-roles

Conversation

@rahlk

@rahlk rahlk commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Closes #208.

What

Every view template in a project landed in application.artifacts{} with roles: ["unknown"], so a consumer asking "what are this application's views?" had to re-derive the answer from extensions the analyzer had already inspected.

New rows in src/artifacts/rules.ts:

pattern format roles
*.ejs ejs view-template
*.hbs, *.handlebars handlebars view-template
*.pug pug view-template
*.njk nunjucks view-template
*.liquid liquid view-template
*.vue vue view-template
*.svelte svelte view-template
*.astro astro view-template
**/views/**/*.{html,htm}, **/templates/**/*.{html,htm} html view-template

The name is adopted, not coined

view-template is codeanalyzer-java's, from its JSP/JSPX/JSPF/tag/xhtml/Thymeleaf rows in ArtifactDiscovery.java. Java shipped it first, so under the parity clause this repo adopts the spelling verbatim rather than coining a second one — which is exactly the risk #208's own caveat flagged. Recorded in .claude/SCHEMA_DECISIONS.md.

Java's .html policy is adopted with the name: a bare *.html matches no rule and stays unknown, because a static page and a rendered template are not distinguishable by file name and public/index.html is an asset. There is deliberately no bare *.html catch row — matchRules unions roles across every matching rule, so one would ride unknown along on the convention-directory rows.

.vue/.svelte/.astro carry the role and remain artifacts only. That is what makes this independent of #209: artifacts and modules are disjoint by construction, so a .vue that later also yields a symbol_table module needs no re-decision of its role.

No contract move

roles[] is an existing string[] gaining new values — the same class of change as a new framework value in the entrypoint pass. No new field, node label, edge type or property. bun run gen:schema leaves schema.neo4j.json byte-identical; SCHEMA_VERSION unmoved at 2.1.0.

Gates

  • bun test — 373 pass / 8 skip / 0 fail (4 new)
  • bun run typecheck — clean
  • bun run gen:schemaschema.neo4j.json byte-identical

Propagation verdict

codeanalyzer-pythoncodeanalyzer/artifacts/discovery.py's RULES has no template row, so Jinja/Django templates (templates/**/*.html, *.jinja, *.j2) are unknown there. It adopts view-template too; follow-on issue filed.

Template files landed in `application.artifacts{}` with `roles: ["unknown"]`,
so "what are this application's views?" had to be re-derived by the consumer
from extensions the analyzer had already inspected.

Adds rules rows for `.ejs`, `.hbs`/`.handlebars`, `.pug`, `.njk`, `.liquid`,
`.vue`, `.svelte`, `.astro`, and for `.html`/`.htm` under a `views/` or
`templates/` directory. The role name `view-template` is codeanalyzer-java's,
from its JSP/JSF/Thymeleaf rows, adopted verbatim under the parity clause —
along with its policy that a bare `*.html` stays `unknown`, since a static page
and a rendered template are not distinguishable by name.

No contract move: `roles[]` is an existing string[] gaining new values.
`schema.neo4j.json` byte-identical, SCHEMA_VERSION unmoved.
)

Also bumps package.json and ANALYZER_VERSION to 1.6.2 in lockstep.
@rahlk
rahlk merged commit 900d01c into main Sep 11, 2026
1 check passed
@rahlk
rahlk deleted the feat/issue-208-view-template-roles branch September 11, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

artifacts: view templates get roles: ["unknown"] (.vue, .svelte, .astro, .ejs, .html)

1 participant