@svelte-vitals/core 0.55.3 → 0.55.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal.d.ts +1 -251
- package/dist/internal.js +36 -41
- package/dist/{json-DmLgFEwV.d.ts → json-CWGGrAda.d.ts} +3 -33
- package/dist/{markdown-CsQNXeWj.js → markdown-YuU0EwLR.js} +150 -296
- package/package.json +6 -6
package/dist/internal.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { $ as performanceLoadWaterfall, $n as shouldSkipRangeCheck, $t as securityJavascriptUrl, A as a11yPatternTitle, An as splitTokens, Ar as seoTitlePresence, At as parseModuleProgram, B as a11yPlaceholderLabelOption, Bn as seoJsonLdDateFormat, Bt as attrTextOf, C as a11yPermittedContents, Cn as IDREF_ATTRS, Cr as seoCanonicalUrl, Ct as collectBrowserGuardImports, D as a11yDeprecatedAttr, Dn as foldOccurrences, Dr as layoutNeverRenders, Dt as collectSuppressions, E as a11yDisallowedAriaProps, En as decodeFragmentId, Er as seoDescriptionPresence, Et as collectProgramBindings, F as a11yPositiveTabindex, Fn as seoCharset, Fr as docsUrlFor, Ft as walkEstree, G as a11yInteractiveNesting, Gn as seoViewport, Gt as parseSvelte, H as a11yLabelHasControl, Hn as seoJsonLdDeprecatedType, Ht as attrValueOf, I as isInteractiveContainer, In as seoDescriptionLength, Ir as isPenalized, It as walkEvalScope, J as a11yUnknownAriaAttribute, Jn as seoTwitterCard, Jt as architecturePropCount, K as a11yInvalidAriaValue, Kn as seoOgUrl, Kt as textFromNodes, L as isInteractiveElement, Ln as seoTitleLength, Lt as walkScoped, M as a11yNoDuplicateDt, Mn as resolveRole, Mr as effectiveSeverity, Mt as scopeIntroducedNames, N as a11yNoAutofocus, Nn as seoHreflang, Nr as hasFailureAtOrAbove, Nt as unwrapExport, O as a11yDeprecatedElement, On as isTopFragment, Or as pageRendersOnlyWhenBuilding, Ot as collectSvelteLifecycleImports, P as a11yNoAccesskey, Pn as seoImageAlt, Pr as summarize, Pt as unwrapTs, Q as performanceSequentialAwaits, Qn as resolveRuleOptions, Qt as securityHandlerStateWrite, R as literalTabindexValue, Rn as seoJsonLdRequiredProps, Rr as defaultConfig, Rt as CHILD_NODE_KEYS, S as a11yRequiredElement, Sn as ASIDE_DEMOTING_TAGS, Sr as seoOgImage, St as collectBrowserGlobalRefs, T as a11yDeprecatedAria, Tn as SECTIONING_TAGS, Tr as isClassicScriptType, Tt as collectNamedImportAliases, U as a11yAccessibleName, Un as seoJsonLdValidity, Ut as findAttr, V as a11yUseList, Vn as seoJsonLdRelativeUrl, Vt as attrValue, W as a11yAriaHiddenFocus, Wn as seoSitemapInRobots, Wt as lineOf, X as performanceIframeLoading, Xn as performancePreconnect, Xt as securitySharedStateImport, Y as a11yInvalidRole, Yn as seoIndexability, Yt as architectureComponentSize, Z as performanceStateRaw, Zn as isPlainObject, Zt as securityServerModuleState, _ as a11yNoMissingIdRef, _n as seoHeadingLevelSkip, _r as seoHtmlLang, _t as parseKitModuleFacts, a as formatJsonReport, an as correctnessOrphanEffect, ar as formatFailedRuleWarning, at as architectureReservedNamePlacement, b as a11yDuplicateLandmark, bn as seoSingleH1, br as seoJsonLd, bt as WALK_IGNORED_KEYS, c as computeScore, cn as correctnessNonreactiveBuiltinState, cr as withFailedRulesOff, ct as architectureUnitEntryFile, d as messageText, dn as correctnessUnmutatedState, dr as performanceLcpImage, dt as collectFalseExports, en as securityRawHtml, er as validateRuleSetting, et as performanceMinifyDisabled, f as ruleMetaById, fn as correctnessEffectAsOnMount, fr as performanceFontPreloadCrossorigin, ft as collectTopLevelBindings, g as a11yUnverifiedIdRef, gn as seoSsrDisabled, gr as performanceImageDimensions, gt as parseInMemoryExports, h as explainRule, hn as correctnessEachKey, hr as performanceImageLoadingHint, ht as parseFalseExports, i as buildJsonReport, in as correctnessOrphanLifecycle, ir as compileOverrides, it as architectureRouteComponentImport, j as a11yAbbrTitle, jn as stripTextDirective, jr as classify, jt as rootObjectName, k as HTML_SPEC, kn as resolveLandmark, kr as routeNeverSsr, kt as matchLifecycleCall, l as formatGithubReport, ln as correctnessStalePropDerivation, lr as withIndexableOff, lt as architecturePrivateScopeImport, m as allRules, mn as correctnessEachIndexKey, mr as performanceResponsiveImage, mt as parseExitFactoryExports, n as mdEscape, nn as correctnessServerBrowserGlobal, nr as applyOverrides, nt as performanceHeavyImport, o as formatJsonReportChunks, on as correctnessAutoplayMuted, or as selectRules, ot as architectureReservedDirectoryNames, p as severityToSarifLevel, pn as correctnessEffectAsDerived, pr as performancePreloadMissingAs, pt as parseClientExports, q as a11yRequiredAriaProps, qn as seoOgDescription, qt as valueFromNodes, r as terminalSafe, rn as correctnessBasePathNavigation, rr as applyRuleSeverities, rt as architectureDocLinkTarget, s as computeHealth, sn as correctnessCheckableBindValue, sr as settingSeverity, st as architectureDirectoryNaming, t as formatMarkdownReport, tn as correctnessInstanceBrowserGlobal, tr as SEARCH_RESULT_RULES, tt as performanceNamespaceImport, u as SEVERITY_RANK, un as correctnessPropMutation, ur as performanceRenderBlockingScript, ut as DEFAULT_KIT_ALIASES, v as a11yIdDuplication, vn as seoDuplicateDescription, vr as seoSitemapXml, vt as resolveRepoLocalPath, w as a11yDisallowedElement, wn as NAMING_ATTRS, wr as hasRel, wt as collectDerivedGuardBindings, x as a11yDoctype, xn as ANCESTRY_DEPENDENT_TAGS, xr as seoOgTitle, xt as addBoundNames, y as a11yTopLevelLandmark, yn as seoDuplicateTitle, yr as seoRobotsTxt, yt as isRootRelativePath, z as a11yRequireDatetime, zn as seoJsonLdPlaceholder, zr as defaultProject, zt as attrText } from "./markdown-
|
|
2
|
-
|
|
1
|
+
import { $ as performanceLoadWaterfall, $n as shouldSkipRangeCheck, $t as securityJavascriptUrl, A as a11yPatternTitle, An as splitTokens, Ar as seoTitlePresence, At as parseModuleProgram, B as a11yPlaceholderLabelOption, Bn as seoJsonLdDateFormat, Bt as attrTextOf, C as a11yPermittedContents, Cn as IDREF_ATTRS, Cr as seoCanonicalUrl, Ct as collectBrowserGuardImports, D as a11yDeprecatedAttr, Dn as foldOccurrences, Dr as layoutNeverRenders, Dt as collectSuppressions, E as a11yDisallowedAriaProps, En as decodeFragmentId, Er as seoDescriptionPresence, Et as collectProgramBindings, F as a11yPositiveTabindex, Fn as seoCharset, Fr as docsUrlFor, Ft as walkEstree, G as a11yInteractiveNesting, Gn as seoViewport, Gt as parseSvelte, H as a11yLabelHasControl, Hn as seoJsonLdDeprecatedType, Ht as attrValueOf, I as isInteractiveContainer, In as seoDescriptionLength, Ir as isPenalized, It as walkEvalScope, J as a11yUnknownAriaAttribute, Jn as seoTwitterCard, Jt as architecturePropCount, K as a11yInvalidAriaValue, Kn as seoOgUrl, Kt as textFromNodes, L as isInteractiveElement, Ln as seoTitleLength, Lt as walkScoped, M as a11yNoDuplicateDt, Mn as resolveRole, Mr as effectiveSeverity, Mt as scopeIntroducedNames, N as a11yNoAutofocus, Nn as seoHreflang, Nr as hasFailureAtOrAbove, Nt as unwrapExport, O as a11yDeprecatedElement, On as isTopFragment, Or as pageRendersOnlyWhenBuilding, Ot as collectSvelteLifecycleImports, P as a11yNoAccesskey, Pn as seoImageAlt, Pr as summarize, Pt as unwrapTs, Q as performanceSequentialAwaits, Qn as resolveRuleOptions, Qt as securityHandlerStateWrite, R as literalTabindexValue, Rn as seoJsonLdRequiredProps, Rr as defaultConfig, Rt as CHILD_NODE_KEYS, S as a11yRequiredElement, Sn as ASIDE_DEMOTING_TAGS, Sr as seoOgImage, St as collectBrowserGlobalRefs, T as a11yDeprecatedAria, Tn as SECTIONING_TAGS, Tr as isClassicScriptType, Tt as collectNamedImportAliases, U as a11yAccessibleName, Un as seoJsonLdValidity, Ut as findAttr, V as a11yUseList, Vn as seoJsonLdRelativeUrl, Vt as attrValue, W as a11yAriaHiddenFocus, Wn as seoSitemapInRobots, Wt as lineOf, X as performanceIframeLoading, Xn as performancePreconnect, Xt as securitySharedStateImport, Y as a11yInvalidRole, Yn as seoIndexability, Yt as architectureComponentSize, Z as performanceStateRaw, Zn as isPlainObject, Zt as securityServerModuleState, _ as a11yNoMissingIdRef, _n as seoHeadingLevelSkip, _r as seoHtmlLang, _t as parseKitModuleFacts, a as formatJsonReport, an as correctnessOrphanEffect, ar as formatFailedRuleWarning, at as architectureReservedNamePlacement, b as a11yDuplicateLandmark, bn as seoSingleH1, br as seoJsonLd, bt as WALK_IGNORED_KEYS, c as computeScore, cn as correctnessNonreactiveBuiltinState, cr as withFailedRulesOff, ct as architectureUnitEntryFile, d as messageText, dn as correctnessUnmutatedState, dr as performanceLcpImage, dt as collectFalseExports, en as securityRawHtml, er as validateRuleSetting, et as performanceMinifyDisabled, f as ruleMetaById, fn as correctnessEffectAsOnMount, fr as performanceFontPreloadCrossorigin, ft as collectTopLevelBindings, g as a11yUnverifiedIdRef, gn as seoSsrDisabled, gr as performanceImageDimensions, gt as parseInMemoryExports, h as explainRule, hn as correctnessEachKey, hr as performanceImageLoadingHint, ht as parseFalseExports, i as buildJsonReport, in as correctnessOrphanLifecycle, ir as compileOverrides, it as architectureRouteComponentImport, j as a11yAbbrTitle, jn as stripTextDirective, jr as classify, jt as rootObjectName, k as HTML_SPEC, kn as resolveLandmark, kr as routeNeverSsr, kt as matchLifecycleCall, l as formatGithubReport, ln as correctnessStalePropDerivation, lr as withIndexableOff, lt as architecturePrivateScopeImport, m as allRules, mn as correctnessEachIndexKey, mr as performanceResponsiveImage, mt as parseExitFactoryExports, n as mdEscape, nn as correctnessServerBrowserGlobal, nr as applyOverrides, nt as performanceHeavyImport, o as formatJsonReportChunks, on as correctnessAutoplayMuted, or as selectRules, ot as architectureReservedDirectoryNames, p as severityToSarifLevel, pn as correctnessEffectAsDerived, pr as performancePreloadMissingAs, pt as parseClientExports, q as a11yRequiredAriaProps, qn as seoOgDescription, qt as valueFromNodes, r as terminalSafe, rn as correctnessBasePathNavigation, rr as applyRuleSeverities, rt as architectureDocLinkTarget, s as computeHealth, sn as correctnessCheckableBindValue, sr as settingSeverity, st as architectureDirectoryNaming, t as formatMarkdownReport, tn as correctnessInstanceBrowserGlobal, tr as SEARCH_RESULT_RULES, tt as performanceNamespaceImport, u as SEVERITY_RANK, un as correctnessPropMutation, ur as performanceRenderBlockingScript, ut as DEFAULT_KIT_ALIASES, v as a11yIdDuplication, vn as seoDuplicateDescription, vr as seoSitemapXml, vt as resolveRepoLocalPath, w as a11yDisallowedElement, wn as NAMING_ATTRS, wr as hasRel, wt as collectDerivedGuardBindings, x as a11yDoctype, xn as ANCESTRY_DEPENDENT_TAGS, xr as seoOgTitle, xt as addBoundNames, y as a11yTopLevelLandmark, yn as seoDuplicateTitle, yr as seoRobotsTxt, yt as isRootRelativePath, z as a11yRequireDatetime, zn as seoJsonLdPlaceholder, zr as defaultProject, zt as attrText } from "./markdown-YuU0EwLR.js";
|
|
2
|
+
// src/images.ts
|
|
3
3
|
/** A `.svg` path (query and fragment ignored) or an inline `data:image/svg+xml` URI. */
|
|
4
4
|
function isSvgSrc(src) {
|
|
5
5
|
return /^data:image\/svg\+xml[;,]/i.test(src) || /\.svg$/i.test(src.split(/[?#]/, 1)[0]);
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
//#region src/component-parse.ts
|
|
7
|
+
// src/component-parse.ts
|
|
9
8
|
const KNOWN_TAGS = new Set(Object.keys(HTML_SPEC.elements).map((k) => k.replace(/^svg:/, "").toLowerCase()));
|
|
10
9
|
/**
|
|
11
10
|
* Whether `expr` is a length-only list constructor: `Array(n)` / `new Array(n)` (single argument =
|
|
@@ -1116,12 +1115,25 @@ function selectNativeRole(attributes) {
|
|
|
1116
1115
|
if (attrValueOf(size) !== "static") return void 0;
|
|
1117
1116
|
return Number(attrTextOf(size)) > 1 ? "listbox" : "combobox";
|
|
1118
1117
|
}
|
|
1119
|
-
|
|
1118
|
+
/** svelte-dnd-action's zone actions, which set `role="listitem"` on each child element at runtime. */
|
|
1119
|
+
const DND_ZONE_ACTIONS = /* @__PURE__ */ new Set(["dndzone", "dragHandleZone"]);
|
|
1120
|
+
/** A zone action unless its options' final say on `autoAriaDisabled` is a literal `true`, which turns the item roles off. */
|
|
1121
|
+
function isDndZone(a) {
|
|
1122
|
+
if (a?.type !== "UseDirective" || !DND_ZONE_ACTIONS.has(a.name)) return false;
|
|
1123
|
+
const opts = unwrapTs(a.expression);
|
|
1124
|
+
if (opts?.type !== "ObjectExpression") return true;
|
|
1125
|
+
const keyOf = (p) => p.computed ? p.key?.type === "Literal" ? String(p.key.value) : void 0 : String(p.key?.name ?? p.key?.value);
|
|
1126
|
+
const last = opts.properties.filter((p) => p.type === "SpreadElement" || p.type === "Property" && (keyOf(p) === void 0 || keyOf(p) === "autoAriaDisabled")).at(-1);
|
|
1127
|
+
return !(last?.type === "Property" && keyOf(last) === "autoAriaDisabled" && last.value?.type === "Literal" && last.value.value === true);
|
|
1128
|
+
}
|
|
1129
|
+
function collectAriaElements(node, source, acc, parentIsDndZone = false) {
|
|
1120
1130
|
if (Array.isArray(node)) {
|
|
1121
|
-
for (const child of node) collectAriaElements(child, source, acc);
|
|
1131
|
+
for (const child of node) collectAriaElements(child, source, acc, parentIsDndZone);
|
|
1122
1132
|
return;
|
|
1123
1133
|
}
|
|
1124
1134
|
if (!node || typeof node !== "object") return;
|
|
1135
|
+
let inDndZone = parentIsDndZone;
|
|
1136
|
+
if (typeof node.type === "string" && (node.type.endsWith("Element") || node.type === "Component" || node.type.startsWith("Svelte")) && node.type !== "SvelteBoundary") inDndZone = Array.isArray(node.attributes) && node.attributes.some(isDndZone);
|
|
1125
1137
|
if (node.type === "RegularElement" && Array.isArray(node.attributes)) {
|
|
1126
1138
|
const roleAttr = findAttr(node.attributes, "role");
|
|
1127
1139
|
const ariaAttrs = node.attributes.filter((a) => a?.type === "Attribute" && typeof a.name === "string" && a.name.toLowerCase().startsWith("aria-"));
|
|
@@ -1131,7 +1143,7 @@ function collectAriaElements(node, source, acc) {
|
|
|
1131
1143
|
const hasList = tag === "input" && findAttr(node.attributes, "list") !== void 0;
|
|
1132
1144
|
const selectKind = tag === "select" ? selectNativeRole(node.attributes) : void 0;
|
|
1133
1145
|
const hasSpread = node.attributes.some((a) => a?.type === "SpreadAttribute");
|
|
1134
|
-
const hasAction = node.attributes.some((a) => a?.type === "UseDirective");
|
|
1146
|
+
const hasAction = parentIsDndZone || node.attributes.some((a) => a?.type === "UseDirective");
|
|
1135
1147
|
acc.push({
|
|
1136
1148
|
tag,
|
|
1137
1149
|
line: lineOf(source, node.start),
|
|
@@ -1149,7 +1161,7 @@ function collectAriaElements(node, source, acc) {
|
|
|
1149
1161
|
});
|
|
1150
1162
|
}
|
|
1151
1163
|
}
|
|
1152
|
-
for (const key of CHILD_NODE_KEYS) if (key in node) collectAriaElements(node[key], source, acc);
|
|
1164
|
+
for (const key of CHILD_NODE_KEYS) if (key in node) collectAriaElements(node[key], source, acc, inDndZone);
|
|
1153
1165
|
}
|
|
1154
1166
|
/** This element's `Attribute` nodes (directives/spreads excluded) as `isInteractiveElement`'s
|
|
1155
1167
|
* input shape. */
|
|
@@ -2690,8 +2702,7 @@ function parseComponentFacts(source, filename) {
|
|
|
2690
2702
|
duplicateDts
|
|
2691
2703
|
};
|
|
2692
2704
|
}
|
|
2693
|
-
|
|
2694
|
-
//#region src/inline-directives.ts
|
|
2705
|
+
// src/inline-directives.ts
|
|
2695
2706
|
/**
|
|
2696
2707
|
* Enter every fact-carrying file into a directive index — components, Kit modules, and the Vite
|
|
2697
2708
|
* config when its minify flag was read. The one home for the union both pipelines apply, so a new
|
|
@@ -2774,8 +2785,7 @@ function unknownDirectiveIds(index, rules) {
|
|
|
2774
2785
|
for (const [file, directives] of index) for (const d of directives) for (const id of d.ruleIds ?? []) if (!known.has(id)) seen.add(`${file}:${d.line - 1} disables unknown rule "${id}" — run \`svelte-vitals explain --list\` for the ids.`);
|
|
2775
2786
|
return [...seen].sort();
|
|
2776
2787
|
}
|
|
2777
|
-
|
|
2778
|
-
//#region src/component.ts
|
|
2788
|
+
// src/component.ts
|
|
2779
2789
|
/**
|
|
2780
2790
|
* Component-body facts for the Correctness category — the source-analysis boundary
|
|
2781
2791
|
* (mirrors images.ts / headings.ts). Collected by the static (CLI) provider only;
|
|
@@ -2868,8 +2878,7 @@ async function collectComponentFacts(rt, cwd) {
|
|
|
2868
2878
|
}
|
|
2869
2879
|
}));
|
|
2870
2880
|
}
|
|
2871
|
-
|
|
2872
|
-
//#region src/source-files.ts
|
|
2881
|
+
// src/source-files.ts
|
|
2873
2882
|
/**
|
|
2874
2883
|
* Every file under `src/`, as project-relative paths, sorted. Paths only — nothing is
|
|
2875
2884
|
* read, so this is the cheaper of the two passes over `src/` (the component collector
|
|
@@ -2886,8 +2895,7 @@ async function collectComponentFacts(rt, cwd) {
|
|
|
2886
2895
|
async function collectSourceFiles(rt, cwd) {
|
|
2887
2896
|
return (await rt.glob("src/**/*", cwd)).slice().sort();
|
|
2888
2897
|
}
|
|
2889
|
-
|
|
2890
|
-
//#region src/kit-module-collect.ts
|
|
2898
|
+
// src/kit-module-collect.ts
|
|
2891
2899
|
/** Fallback facts for a Kit file that fails to read or parse (dev tooling must never throw). */
|
|
2892
2900
|
function emptyKitModuleFacts(file, kind) {
|
|
2893
2901
|
return {
|
|
@@ -3044,8 +3052,7 @@ async function arbitrateServerStoreWrites(rt, cwd, facts) {
|
|
|
3044
3052
|
};
|
|
3045
3053
|
});
|
|
3046
3054
|
}
|
|
3047
|
-
|
|
3048
|
-
//#region src/config-object.ts
|
|
3055
|
+
// src/config-object.ts
|
|
3049
3056
|
/**
|
|
3050
3057
|
* Non-computed property of an object literal, by key name (`build` or `'build'`).
|
|
3051
3058
|
* Returns the LAST matching property, honoring JavaScript object semantics where
|
|
@@ -3132,8 +3139,7 @@ function resolveConfigObject(program) {
|
|
|
3132
3139
|
if (!exported) return void 0;
|
|
3133
3140
|
return unwrapToObjectExpression(exported, collectTopLevelBindings(program));
|
|
3134
3141
|
}
|
|
3135
|
-
|
|
3136
|
-
//#region src/vite-config-parse.ts
|
|
3142
|
+
// src/vite-config-parse.ts
|
|
3137
3143
|
/**
|
|
3138
3144
|
* The `build: { minify: false }` override, when present as a literal: returns the
|
|
3139
3145
|
* `minify` property's 1-based line in the ORIGINAL source. Undefined for clean,
|
|
@@ -3158,8 +3164,7 @@ function findMinifyDisabled(source) {
|
|
|
3158
3164
|
if (!minify || minifyValue?.type !== "Literal" || minifyValue.value !== false) return void 0;
|
|
3159
3165
|
return { line: Math.max(0, lineOf(wrapped, minify.start) - 1) };
|
|
3160
3166
|
}
|
|
3161
|
-
|
|
3162
|
-
//#region src/svelte-config-parse.ts
|
|
3167
|
+
// src/svelte-config-parse.ts
|
|
3163
3168
|
function isServedBase(value) {
|
|
3164
3169
|
return typeof value === "string" && value.startsWith("/") && !value.endsWith("/");
|
|
3165
3170
|
}
|
|
@@ -3518,8 +3523,7 @@ function resolveKitPathsBase(viteConfig, svelteConfig) {
|
|
|
3518
3523
|
file: svelteConfig.file
|
|
3519
3524
|
} : void 0;
|
|
3520
3525
|
}
|
|
3521
|
-
|
|
3522
|
-
//#region src/workspace-packages.ts
|
|
3526
|
+
// src/workspace-packages.ts
|
|
3523
3527
|
const DEPENDENCY_FIELDS = [
|
|
3524
3528
|
"dependencies",
|
|
3525
3529
|
"devDependencies",
|
|
@@ -3731,8 +3735,7 @@ function withInstalledPackages(aliases, packages) {
|
|
|
3731
3735
|
const svelte = packages.filter((p) => isSveltePackage(p.manifest));
|
|
3732
3736
|
return svelte.length === 0 ? aliases : [...aliases ?? DEFAULT_KIT_ALIASES, ...svelte.flatMap(entriesOf)];
|
|
3733
3737
|
}
|
|
3734
|
-
|
|
3735
|
-
//#region src/project-paths.ts
|
|
3738
|
+
// src/project-paths.ts
|
|
3736
3739
|
/**
|
|
3737
3740
|
* Source-file locations that satisfy the project-scope rules, shared by every
|
|
3738
3741
|
* mode so the static (CLI) and rendered (plugin) collectors never drift. This
|
|
@@ -3774,8 +3777,7 @@ const VITE_CONFIG_FILES = [
|
|
|
3774
3777
|
];
|
|
3775
3778
|
/** SvelteKit's config resolution order (`@sveltejs/kit` checks js before ts). */
|
|
3776
3779
|
const SVELTE_CONFIG_FILES = ["svelte.config.js", "svelte.config.ts"];
|
|
3777
|
-
|
|
3778
|
-
//#region src/runtime.ts
|
|
3780
|
+
// src/runtime.ts
|
|
3779
3781
|
/**
|
|
3780
3782
|
* How many file reads may be in flight at once. Analysis reads every `.svelte` file in a project
|
|
3781
3783
|
* in parallel, which on a large project opens more descriptors than the process is allowed: at
|
|
@@ -3808,8 +3810,7 @@ function withReadLimit(readFile, limit = READ_CONCURRENCY) {
|
|
|
3808
3810
|
}
|
|
3809
3811
|
};
|
|
3810
3812
|
}
|
|
3811
|
-
|
|
3812
|
-
//#region src/engine.ts
|
|
3813
|
+
// src/engine.ts
|
|
3813
3814
|
/**
|
|
3814
3815
|
* Run a set of rules against a shared context and collect their findings.
|
|
3815
3816
|
* Rules are independent, so they run concurrently; results are flattened in
|
|
@@ -3862,8 +3863,7 @@ async function runAnalysis(rules, ctx, directives) {
|
|
|
3862
3863
|
scoringConfig: withFailedRulesOff(ctx.config, failedRuleIds)
|
|
3863
3864
|
};
|
|
3864
3865
|
}
|
|
3865
|
-
|
|
3866
|
-
//#region src/reporter/palette.ts
|
|
3866
|
+
// src/reporter/palette.ts
|
|
3867
3867
|
/** Default: no decoration (identity) — output is byte-identical to plain text. */
|
|
3868
3868
|
const noColorPalette = {
|
|
3869
3869
|
bold: (s) => s,
|
|
@@ -3879,8 +3879,7 @@ function scoreColor(p, score) {
|
|
|
3879
3879
|
if (score >= 70) return p.yellow;
|
|
3880
3880
|
return p.red;
|
|
3881
3881
|
}
|
|
3882
|
-
|
|
3883
|
-
//#region src/reporter/console.ts
|
|
3882
|
+
// src/reporter/console.ts
|
|
3884
3883
|
const RULE = "────────────────────────";
|
|
3885
3884
|
const SEVERITY_TITLE = {
|
|
3886
3885
|
critical: "Critical",
|
|
@@ -4010,8 +4009,7 @@ function formatConsoleReport(results, config, options = {}) {
|
|
|
4010
4009
|
if (options.verbose && summary.dynamic > 0) lines.push(p.dim("↯ = set dynamically (verified at runtime)."));
|
|
4011
4010
|
return lines.join("\n").replace(/\n+$/, "\n");
|
|
4012
4011
|
}
|
|
4013
|
-
|
|
4014
|
-
//#region src/reporter/agent.ts
|
|
4012
|
+
// src/reporter/agent.ts
|
|
4015
4013
|
/** Render failing findings as an agent-actionable Markdown remediation document (issue #18). */
|
|
4016
4014
|
function formatAgentReport(results, config) {
|
|
4017
4015
|
const failing = results.filter((r) => classify(r, config) === "fail");
|
|
@@ -4052,8 +4050,7 @@ function formatAgentReport(results, config) {
|
|
|
4052
4050
|
}
|
|
4053
4051
|
return lines.join("\n").replace(/\n+$/, "\n");
|
|
4054
4052
|
}
|
|
4055
|
-
|
|
4056
|
-
//#region src/reporter/sarif.ts
|
|
4053
|
+
// src/reporter/sarif.ts
|
|
4057
4054
|
/**
|
|
4058
4055
|
* SARIF `artifactLocation.uri` is a URI reference: `#`, `?`, `%`, spaces and non-ASCII in a raw
|
|
4059
4056
|
* path would be read as fragment/query/escape/invalid and mis-attribute (or drop) the alert in
|
|
@@ -4109,8 +4106,7 @@ function formatSarifReport(results, config, meta) {
|
|
|
4109
4106
|
};
|
|
4110
4107
|
return JSON.stringify(log, null, 2);
|
|
4111
4108
|
}
|
|
4112
|
-
|
|
4113
|
-
//#region src/reporter/app-shell.ts
|
|
4109
|
+
// src/reporter/app-shell.ts
|
|
4114
4110
|
function escapeHtml(s) {
|
|
4115
4111
|
return s.replace(/[&<>"']/g, (c) => c === "&" ? "&" : c === "<" ? "<" : c === ">" ? ">" : c === "\"" ? """ : "'");
|
|
4116
4112
|
}
|
|
@@ -4868,5 +4864,4 @@ function buildHtmlDocument(report, meta) {
|
|
|
4868
4864
|
function formatHtmlReport(results, config, meta) {
|
|
4869
4865
|
return buildHtmlDocument(buildJsonReport(results, config, meta), meta);
|
|
4870
4866
|
}
|
|
4871
|
-
//#endregion
|
|
4872
4867
|
export { ANCESTRY_DEPENDENT_TAGS, APP_SCRIPT, ASIDE_DEMOTING_TAGS, CHILD_NODE_KEYS, IDREF_ATTRS, NAMING_ATTRS, ROBOTS_SOURCE_PATHS, ROOT_FILE_ENDPOINT_GLOB, SEARCH_RESULT_RULES, SECTIONING_TAGS, SITEMAP_SOURCE_PATHS, SVELTE_CONFIG_FILES, VITE_CONFIG_FILES, a11yAbbrTitle, a11yAccessibleName, a11yAriaHiddenFocus, a11yDeprecatedAria, a11yDeprecatedAttr, a11yDeprecatedElement, a11yDisallowedAriaProps, a11yDisallowedElement, a11yDoctype, a11yDuplicateLandmark, a11yIdDuplication, a11yInteractiveNesting, a11yInvalidAriaValue, a11yInvalidRole, a11yLabelHasControl, a11yNoAccesskey, a11yNoAutofocus, a11yNoDuplicateDt, a11yNoMissingIdRef, a11yPatternTitle, a11yPermittedContents, a11yPlaceholderLabelOption, a11yPositiveTabindex, a11yRequireDatetime, a11yRequiredAriaProps, a11yRequiredElement, a11yTopLevelLandmark, a11yUnknownAriaAttribute, a11yUnverifiedIdRef, a11yUseList, addFactsDirectives, allRules, architectureComponentSize, architectureDirectoryNaming, architectureDocLinkTarget, architecturePrivateScopeImport, architecturePropCount, architectureReservedDirectoryNames, architectureReservedNamePlacement, architectureRouteComponentImport, architectureUnitEntryFile, attrText, attrTextOf, attrValue, attrValueOf, buildHtmlDocument, buildJsonReport, classify, collectComponentConstantLists, collectComponentFacts, collectConstantListExports, collectFalseExports, collectKitModuleFacts, collectSourceFiles, collectSuppressions, compileOverrides, computeHealth, computeScore, correctnessAutoplayMuted, correctnessBasePathNavigation, correctnessCheckableBindValue, correctnessEachIndexKey, correctnessEachKey, correctnessEffectAsDerived, correctnessEffectAsOnMount, correctnessInstanceBrowserGlobal, correctnessNonreactiveBuiltinState, correctnessOrphanEffect, correctnessOrphanLifecycle, correctnessPropMutation, correctnessServerBrowserGlobal, correctnessStalePropDerivation, correctnessUnmutatedState, declaredInstalledPackages, declaredLocalPackages, decodeFragmentId, defaultConfig, defaultProject, docsUrlFor, effectiveSeverity, emptyComponentFacts, escapeHtml, explainRule, findAttr, findKitHashRouterInSvelteConfig, findMinifyDisabled, foldOccurrences, formatAgentReport, formatConsoleReport, formatFailedRuleWarning, formatGithubReport, formatHtmlReport, formatJsonReport, formatJsonReportChunks, formatMarkdownReport, formatSarifReport, hasFailureAtOrAbove, hasRel, isClassicScriptType, isPenalized, isPlainObject, isSvgSrc, isTopFragment, layoutNeverRenders, lineOf, noColorPalette, packageJsonWorkspaceGlobs, pageRendersOnlyWhenBuilding, parseComponentFacts, parseModuleProgram, parseSvelte, performanceFontPreloadCrossorigin, performanceHeavyImport, performanceIframeLoading, performanceImageDimensions, performanceImageLoadingHint, performanceLcpImage, performanceLoadWaterfall, performanceMinifyDisabled, performanceNamespaceImport, performancePreconnect, performancePreloadMissingAs, performanceRenderBlockingScript, performanceResponsiveImage, performanceSequentialAwaits, performanceStateRaw, pnpmWorkspaceGlobs, renderAppShell, resolveKitAliases, resolveKitPathsBase, resolveLandmark, resolveRepoLocalPath, resolveRuleOptions, routeNeverSsr, runAnalysis, runRules, safeHref, scoreColor, securityHandlerStateWrite, securityJavascriptUrl, securityRawHtml, securityServerModuleState, securitySharedStateImport, selectRules, seoCanonicalUrl, seoCharset, seoDescriptionLength, seoDescriptionPresence, seoDuplicateDescription, seoDuplicateTitle, seoHeadingLevelSkip, seoHreflang, seoHtmlLang, seoImageAlt, seoIndexability, seoJsonLd, seoJsonLdDateFormat, seoJsonLdDeprecatedType, seoJsonLdPlaceholder, seoJsonLdRelativeUrl, seoJsonLdRequiredProps, seoJsonLdValidity, seoOgDescription, seoOgImage, seoOgTitle, seoOgUrl, seoRobotsTxt, seoSingleH1, seoSitemapInRobots, seoSitemapXml, seoSsrDisabled, seoTitleLength, seoTitlePresence, seoTwitterCard, seoViewport, servesRootFile, settingSeverity, shouldSkipRangeCheck, skippedFileWarnings, splitTokens, stripTextDirective, summarize, terminalSafe, textFromNodes, unknownDirectiveIds, unwrapTs, validateRuleSetting, valueFromNodes, walkEstree, withFailedRulesOff, withIndexableOff, withInstalledPackages, withPackageImports, withReadLimit, withWorkspacePackages };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/runtime.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Runtime abstraction (design §8). Core defines only the interface; concrete
|
|
4
3
|
* adapters (Node / Deno / Bun) live in the CLI package and are the only place
|
|
@@ -36,8 +35,6 @@ interface Runtime {
|
|
|
36
35
|
* deliberately not a dependency, and pure enough to live in core.
|
|
37
36
|
*/
|
|
38
37
|
declare function withReadLimit(readFile: (path: string) => Promise<string>, limit?: number): (path: string) => Promise<string>;
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region src/component.d.ts
|
|
41
38
|
/** An `{#each}` block in a component template. */
|
|
42
39
|
interface EachBlockFact {
|
|
43
40
|
/** True when the block has a key, e.g. `{#each items as item (item.id)}`. */
|
|
@@ -181,7 +178,7 @@ interface AriaElementFact {
|
|
|
181
178
|
/** Set when the element also carries a spread attribute — its full attribute set is
|
|
182
179
|
* unknowable, so required-prop presence checks must treat it as satisfied (a11y/required-aria-props). */
|
|
183
180
|
hasSpread?: true;
|
|
184
|
-
/** Set when the element carries a `use:` action
|
|
181
|
+
/** Set when the element carries a `use:` action or is an item of a svelte-dnd-action zone — either may set `role` at runtime. */
|
|
185
182
|
hasAction?: true;
|
|
186
183
|
}
|
|
187
184
|
/**
|
|
@@ -387,8 +384,6 @@ declare function emptyComponentFacts(file: string): ComponentFacts;
|
|
|
387
384
|
* must never throw).
|
|
388
385
|
*/
|
|
389
386
|
declare function collectComponentFacts(rt: Runtime, cwd: string): Promise<ComponentFacts[]>;
|
|
390
|
-
//#endregion
|
|
391
|
-
//#region src/head.d.ts
|
|
392
387
|
/**
|
|
393
388
|
* A normalized head tag. The mode-independent boundary (design §8): the static
|
|
394
389
|
* SourceHeadProvider (CLI, via the runtime-abstracted `HeadProvider` below) and
|
|
@@ -452,8 +447,6 @@ interface ResolvedHead {
|
|
|
452
447
|
* so a whitespace-only `type` is a data block, not a classic script.
|
|
453
448
|
*/
|
|
454
449
|
declare function isClassicScriptType(type: string | undefined): boolean;
|
|
455
|
-
//#endregion
|
|
456
|
-
//#region src/types.d.ts
|
|
457
450
|
type Severity = 'critical' | 'warning' | 'info';
|
|
458
451
|
/** Where a head tag is set, relative to the route being evaluated (design §4). */
|
|
459
452
|
type Presence = 'own' | 'inherited' | 'none';
|
|
@@ -670,8 +663,6 @@ interface Config {
|
|
|
670
663
|
declare const defaultConfig: Config;
|
|
671
664
|
/** Merge user config over defaults. Identity helper for config files (design §6). */
|
|
672
665
|
declare function defineConfig(config?: Partial<Config>): Config;
|
|
673
|
-
//#endregion
|
|
674
|
-
//#region src/summary.d.ts
|
|
675
666
|
interface Summary {
|
|
676
667
|
critical: number;
|
|
677
668
|
warning: number;
|
|
@@ -689,15 +680,11 @@ declare function effectiveSeverity(result: Result, config: Config): Severity;
|
|
|
689
680
|
declare function summarize(results: Result[], config: Config): Summary;
|
|
690
681
|
/** Whether the run should fail the build/CI per the minimum failing severity. */
|
|
691
682
|
declare function hasFailureAtOrAbove(summary: Summary, min: Severity): boolean;
|
|
692
|
-
//#endregion
|
|
693
|
-
//#region src/reporter/github.d.ts
|
|
694
683
|
/**
|
|
695
684
|
* Render penalized findings as GitHub Actions workflow commands (issue #18, design slice 5).
|
|
696
685
|
* GitHub turns these into inline PR annotations and run-annotation entries. Returns '' when clean.
|
|
697
686
|
*/
|
|
698
687
|
declare function formatGithubReport(results: Result[], config: Config): string;
|
|
699
|
-
//#endregion
|
|
700
|
-
//#region src/reporter/markdown.d.ts
|
|
701
688
|
/**
|
|
702
689
|
* Render a compact Markdown summary — Health score, per-category table, severity counts, and
|
|
703
690
|
* a findings table — suitable for a GitHub Actions job summary or a sticky PR comment
|
|
@@ -707,8 +694,6 @@ declare function formatGithubReport(results: Result[], config: Config): string;
|
|
|
707
694
|
declare function formatMarkdownReport(results: Result[], config: Config, meta: {
|
|
708
695
|
version: string;
|
|
709
696
|
}): string;
|
|
710
|
-
//#endregion
|
|
711
|
-
//#region src/images.d.ts
|
|
712
697
|
/**
|
|
713
698
|
* A normalized <img> occurrence — the mode-independent boundary for Performance
|
|
714
699
|
* rules (mirrors head.ts). Attribute presence only: a dynamically-bound attribute
|
|
@@ -726,6 +711,8 @@ interface ImageInfo {
|
|
|
726
711
|
hasSrcset: boolean;
|
|
727
712
|
/** True when the <img>'s src is known to be an SVG (`isSvgSrc`; performance/responsive-image). */
|
|
728
713
|
svg?: boolean;
|
|
714
|
+
/** True when the <img>'s src is a binding named for a QR code (`qrDataUrl`, `setup.qrCode`): drawn at one fixed size (performance/responsive-image). */
|
|
715
|
+
qr?: boolean;
|
|
729
716
|
/** 1-based source line, or 0 if unknown. */
|
|
730
717
|
line: number;
|
|
731
718
|
/** Source file the <img> came from. */
|
|
@@ -738,8 +725,6 @@ interface ResolvedImages {
|
|
|
738
725
|
route: string;
|
|
739
726
|
images: ImageInfo[];
|
|
740
727
|
}
|
|
741
|
-
//#endregion
|
|
742
|
-
//#region src/a11y.d.ts
|
|
743
728
|
/** One step of a template branch address: which exclusive block, and which arm of it. */
|
|
744
729
|
interface BranchStep {
|
|
745
730
|
/** index of the {#if}/{#await} block among its file's blocks (document order) */
|
|
@@ -893,8 +878,6 @@ declare function isTopFragment(id: string): boolean;
|
|
|
893
878
|
* nothing. Returns an empty string when the fragment is a directive and nothing else.
|
|
894
879
|
*/
|
|
895
880
|
declare function stripTextDirective(fragment: string): string;
|
|
896
|
-
//#endregion
|
|
897
|
-
//#region src/headings.d.ts
|
|
898
881
|
/**
|
|
899
882
|
* A normalized page-body heading occurrence — the mode-independent boundary for
|
|
900
883
|
* the heading-hierarchy rule (mirrors images.ts). Both providers collect these
|
|
@@ -943,8 +926,6 @@ interface ResolvedHeadings {
|
|
|
943
926
|
/** `dynamicHeading`, but from a component loaded with `import()` — source-mode collection folds it in only on routes never server-rendered. */
|
|
944
927
|
clientOnlyHeading?: boolean;
|
|
945
928
|
}
|
|
946
|
-
//#endregion
|
|
947
|
-
//#region src/kit-module.d.ts
|
|
948
929
|
/**
|
|
949
930
|
* Facts parsed from one SvelteKit route/hooks file for the SSR shared-state rules
|
|
950
931
|
* (the security kit-module rules). Collected by `collectKitModuleFacts` (static/CLI + vite build mode).
|
|
@@ -1084,8 +1065,6 @@ declare function layoutNeverRenders(file: string, scope: SsrScope): boolean;
|
|
|
1084
1065
|
declare function pageRendersOnlyWhenBuilding(file: string, scope: SsrScope): boolean;
|
|
1085
1066
|
/** Whether a `+page`/`+layout` file (module or component) belongs to a route that is never server-rendered. */
|
|
1086
1067
|
declare function routeNeverSsr(file: string, scope: SsrScope): boolean;
|
|
1087
|
-
//#endregion
|
|
1088
|
-
//#region src/config-apply.d.ts
|
|
1089
1068
|
/** The severity a setting selects: `'off'`, an explicit severity, or undefined (leave the built-in). */
|
|
1090
1069
|
declare function settingSeverity(setting: RuleSetting | undefined): Severity | 'off' | undefined;
|
|
1091
1070
|
/** Drop rules disabled via config (design §6), including a `defaultOff` rule with no entry. */
|
|
@@ -1129,8 +1108,6 @@ interface CompiledOverride {
|
|
|
1129
1108
|
* targets (every component, every route) must hoist this out of their loop.
|
|
1130
1109
|
*/
|
|
1131
1110
|
declare function compileOverrides(config: Config): CompiledOverride[];
|
|
1132
|
-
//#endregion
|
|
1133
|
-
//#region src/rule-options.d.ts
|
|
1134
1111
|
/**
|
|
1135
1112
|
* One configurable option. `kind` decides the merge semantics, so no rule
|
|
1136
1113
|
* writes merge code of its own: `integer` replaces, and the two collection
|
|
@@ -1208,8 +1185,6 @@ declare function validateRuleSetting(label: string, ruleId: string, setting: unk
|
|
|
1208
1185
|
baseline?: RuleOptions;
|
|
1209
1186
|
skipRangeCheck?: boolean;
|
|
1210
1187
|
}): string[];
|
|
1211
|
-
//#endregion
|
|
1212
|
-
//#region src/rule.d.ts
|
|
1213
1188
|
/** Input given to every rule. Mode-independent: rules see only ResolvedHead[] (design §8, §10). */
|
|
1214
1189
|
interface RuleContext {
|
|
1215
1190
|
heads: ResolvedHead[];
|
|
@@ -1287,8 +1262,6 @@ declare function docsUrlFor(id: string): string;
|
|
|
1287
1262
|
* otherwise (static/inherited) → not penalized
|
|
1288
1263
|
*/
|
|
1289
1264
|
declare function isPenalized(detection: Detection, treatDynamicAs: TreatDynamicAs): boolean;
|
|
1290
|
-
//#endregion
|
|
1291
|
-
//#region src/scoring/score.d.ts
|
|
1292
1265
|
interface ScoreModel {
|
|
1293
1266
|
routeAverage: number;
|
|
1294
1267
|
sitePenalty: number;
|
|
@@ -1331,8 +1304,6 @@ interface HealthResult {
|
|
|
1331
1304
|
}
|
|
1332
1305
|
/** Combined weighted Health score over the categories present in `results` (#10). */
|
|
1333
1306
|
declare function computeHealth(results: Result[], config: Config): HealthResult;
|
|
1334
|
-
//#endregion
|
|
1335
|
-
//#region src/reporter/json.d.ts
|
|
1336
1307
|
declare function issueOf(result: Result): {
|
|
1337
1308
|
fix?: Fix | undefined;
|
|
1338
1309
|
docsUrl?: string | undefined;
|
|
@@ -1421,5 +1392,4 @@ declare function formatJsonReport(...args: Parameters<typeof formatJsonReportChu
|
|
|
1421
1392
|
declare function formatJsonReportChunks(results: Result[], config: Config, meta: {
|
|
1422
1393
|
version: string;
|
|
1423
1394
|
}, ruleIds?: readonly string[], examined?: Record<string, Record<string, number>>, skipped?: JsonReport['skipped']): Generator<string>;
|
|
1424
|
-
//#endregion
|
|
1425
1395
|
export { ResolvedImages as $, KitModuleFacts as A, ResolvedHead as At, BranchStep as B, emptyComponentFacts as Bt, SEARCH_RESULT_RULES as C, Severity as Ct, settingSeverity as D, defaultProject as Dt, selectRules as E, defaultConfig as Et, ResolvedHeadings as F, EffectFact as Ft, SECTIONING_TAGS as G, LandmarkInput as H, Runtime as Ht, A11yOccurrenceInfo as I, OrphanEffectFact as It, isTopFragment as J, decodeFragmentId as K, A11ySkipCause as L, SourceSpan as Lt, pageRendersOnlyWhenBuilding as M, isClassicScriptType as Mt, routeNeverSsr as N, ComponentFacts as Nt, withFailedRulesOff as O, defineConfig as Ot, HeadingInfo as P, EachBlockFact as Pt, ImageInfo as Q, ANCESTRY_DEPENDENT_TAGS as R, SuppressionDirective as Rt, CompiledOverride as S, Scope as St, formatFailedRuleWarning as T, Value as Tt, NAMING_ATTRS as U, withReadLimit as Ut, IDREF_ATTRS as V, skippedFileWarnings as Vt, ResolvedA11y as W, splitTokens as X, resolveLandmark as Y, stripTextDirective as Z, RuleOptionsSpec as _, Result as _t, formatJsonReportChunks as a, classify as at, shouldSkipRangeCheck as b, RuleSetting as bt, ScoreOptions as c, summarize as ct, computeScore as d, Config as dt, isSvgSrc as et, Rule as f, Detection as ft, RuleOptionSpec as g, Project as gt, isPenalized as h, Presence as ht, formatJsonReport as i, Summary as it, layoutNeverRenders as j, hasRel as jt, withIndexableOff as k, HeadTag as kt, ScoreResult as l, CATEGORIES as lt, docsUrlFor as m, KitAlias as mt, RuleEvidence as n, formatGithubReport as nt, HealthResult as o, effectiveSeverity as ot, RuleContext as p, Fix as pt, foldOccurrences as q, buildJsonReport as r, Classification as rt, ScoreModel as s, hasFailureAtOrAbove as st, JsonReport as t, formatMarkdownReport as tt, computeHealth as u, Category as ut, isPlainObject as v, RuleOptions as vt, compileOverrides as w, TreatDynamicAs as wt, validateRuleSetting as x, RuleSettingObject as xt, resolveRuleOptions as y, RuleOverride as yt, ASIDE_DEMOTING_TAGS as z, collectComponentFacts as zt };
|