feat(artifacts): view templates get the view-template role (#208) - #211
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #208.
What
Every view template in a project landed in
application.artifacts{}withroles: ["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:*.ejsejsview-template*.hbs,*.handlebarshandlebarsview-template*.pugpugview-template*.njknunjucksview-template*.liquidliquidview-template*.vuevueview-template*.sveltesvelteview-template*.astroastroview-template**/views/**/*.{html,htm},**/templates/**/*.{html,htm}htmlview-templateThe name is adopted, not coined
view-templateiscodeanalyzer-java's, from its JSP/JSPX/JSPF/tag/xhtml/Thymeleaf rows inArtifactDiscovery.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
.htmlpolicy is adopted with the name: a bare*.htmlmatches no rule and staysunknown, because a static page and a rendered template are not distinguishable by file name andpublic/index.htmlis an asset. There is deliberately no bare*.htmlcatch row —matchRulesunions roles across every matching rule, so one would rideunknownalong on the convention-directory rows..vue/.svelte/.astrocarry the role and remain artifacts only. That is what makes this independent of #209: artifacts and modules are disjoint by construction, so a.vuethat later also yields asymbol_tablemodule needs no re-decision of its role.No contract move
roles[]is an existingstring[]gaining new values — the same class of change as a newframeworkvalue in the entrypoint pass. No new field, node label, edge type or property.bun run gen:schemaleavesschema.neo4j.jsonbyte-identical;SCHEMA_VERSIONunmoved at 2.1.0.Gates
bun test— 373 pass / 8 skip / 0 fail (4 new)bun run typecheck— cleanbun run gen:schema—schema.neo4j.jsonbyte-identicalPropagation verdict
codeanalyzer-python —
codeanalyzer/artifacts/discovery.py'sRULEShas no template row, so Jinja/Django templates (templates/**/*.html,*.jinja,*.j2) areunknownthere. It adoptsview-templatetoo; follow-on issue filed.