Repository navigation
feat: add Vue 2/3 and Svelte SFC support with calibrated Vue Reference ranges - #162
Merged
Merged
Conversation
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.
Summary
Extend the built-in
typescript-javascriptLanguage plugin to extract and measurescriptblocks from.vue(Vue 2 and Vue 3) and.svelteSingle-File Components, preserving original 1-based line numbers and cross-file.ts/.js/.vue/.svelteImport cycles.Calibrate separate 20-repository pre-2023 Reference range panels for Vue 2 (
ADR 0014) and Vue 3 (ADR 0015) — 40 repositories total — and automatically select the matching Reference range when.vuefiles are measured andpackage.jsondeclaresvuemajor version2or3.Closes #159
Tier
Tier 3 from the tier check:
plugins/languages/ts/tests/conformance.rsupdates the declared extensions assertion to includesvelteandvue.Task
Spec #159:
script,script setup,script context="module", andscript moduleblocks from.vueand.sveltefiles (respectinglang="ts",lang="tsx", andlang="jsx", skipping HTML templates and CSS styles, preserving exact 1-based line numbers)..ts/.jsand.vue/.svelteinsidetypescript-javascript.docs/adr/0014-vue2-reference-ranges.md) and 20 pre-2023 Vue 3 repositories (docs/adr/0015-vue3-reference-ranges.md) — 40 repositories total.package.jsonwhen.vuefiles are measured.plugins/languages/ts/HOW-TO.md,README.md,docs/guide/languages.md, andllms.txt.Fail-first test
plugins/languages/ts/tests/sfc.rs::sfc_without_script_is_empty_and_unclosed_script_is_unparsable(Unicode<中文>tag case).vuetemplates during the 40-repository panel run.starts_with_tagandstarts_with_close_tagoperate on byte slices).Checks
cargo clippy --workspace --all-targets -- -D warningscargo test --workspace --lockedtests/sfc.rstests and 88tests/conformance.rstests)cargo run --package xtask -- merged-resultcargo run --package codeint-cli -- diff origin/mainsecrets,links,duplicates,format,repository,markdown,message)Safety proof
plugins/languages/ts/src/sfc.rscompiles with#![forbid(unsafe_code)], performs all tag matching on ASCII byte slices without UTF-8 boundary slicing panics, and leaves existing.ts/.tsx/.js/.jsx/.mts/.cts/.mjs/.cjslowering unchanged.cargo test --workspace --lockedpassed and the release binary measured 40 real pre-2023 Vue repositories (20 Vue 2 + 20 Vue 3) with 0 unparsable files and 0 panics.interrogate: verified against Vue 2 Options API, Vue 3 dual-scriptscript+script setup, Svelte module + instance scripts, empty/template-only SFCs, unclosedscripttags, and non-ASCII Unicode template tags.Runtime evidence
84ff5fb(release build on Apple Silicon)ADR 0014, 0.010s to 1.375s per repo, 0 unparsable) and 20 pre-2023 Vue 3 repositories (ADR 0015, 0.008s to 0.490s per repo, 0 unparsable).Gaps