@svelte-vitals/core 0.9.0 → 0.10.1

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/dist/index.d.ts CHANGED
@@ -53,7 +53,7 @@ interface Result {
53
53
  line?: number;
54
54
  }
55
55
  type Scope = 'route' | 'project';
56
- type Category = 'seo' | 'performance' | 'a11y' | 'maintainability';
56
+ type Category = 'seo' | 'performance';
57
57
  /** How dynamic (`{data.title}`) values are treated by scoring (design §4, §12). */
58
58
  type TreatDynamicAs = 'pass' | 'warn' | 'fail';
59
59
  /** Per-rule override: disable, or change severity. */
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ var SITEMAP_SOURCE_PATHS = [
28
28
 
29
29
  // src/rule.ts
30
30
  function docsUrlFor(id) {
31
- return `https://svelte-vitals.dev/rules/${id}`;
31
+ return `https://oekazuma.github.io/svelte-vitals/rules/${id.toLowerCase()}`;
32
32
  }
33
33
  function isPenalized(detection, treatDynamicAs) {
34
34
  if (detection.presence === "none") return true;
@@ -521,11 +521,9 @@ var SEVERITY_TITLE = {
521
521
  };
522
522
  var CATEGORY_LABEL = {
523
523
  seo: "SEO",
524
- performance: "Performance",
525
- a11y: "Accessibility",
526
- maintainability: "Maintainability"
524
+ performance: "Performance"
527
525
  };
528
- var CATEGORY_ORDER = ["seo", "performance", "a11y", "maintainability"];
526
+ var CATEGORY_ORDER = ["seo", "performance"];
529
527
  function scoreLine(label, { score, scoreModel }) {
530
528
  const parts = [`route avg ${scoreModel.routeAverage}`];
531
529
  if (scoreModel.sitePenalty > 0) parts.push(`site \u2212${scoreModel.sitePenalty}`);
@@ -681,11 +679,8 @@ function severityToGithubLevel(sev) {
681
679
  function messageText(result) {
682
680
  return result.recommendation ? `${result.message} ${result.recommendation}` : result.message;
683
681
  }
684
- function docsUrlFor2(id) {
685
- return `https://svelte-vitals.dev/rules/${id}`;
686
- }
687
682
  var RULE_META = new Map(
688
- allRules.map((r) => [r.id, { title: r.title, severity: r.severity, docsUrl: docsUrlFor2(r.id) }])
683
+ allRules.map((r) => [r.id, { title: r.title, severity: r.severity, docsUrl: docsUrlFor(r.id) }])
689
684
  );
690
685
  function ruleMetaById(id) {
691
686
  return RULE_META.get(id);
@@ -705,7 +700,7 @@ function formatSarifReport(results, config, meta) {
705
700
  id: r.id,
706
701
  name,
707
702
  shortDescription: { text: name },
708
- helpUri: r.docsUrl ?? m?.docsUrl ?? docsUrlFor2(r.id),
703
+ helpUri: r.docsUrl ?? m?.docsUrl ?? docsUrlFor(r.id),
709
704
  defaultConfiguration: { level: severityToSarifLevel(m?.severity ?? r.severity) }
710
705
  });
711
706
  }
@@ -738,7 +733,7 @@ function formatSarifReport(results, config, meta) {
738
733
  tool: {
739
734
  driver: {
740
735
  name: "svelte-vitals",
741
- informationUri: "https://svelte-vitals.dev",
736
+ informationUri: "https://oekazuma.github.io/svelte-vitals",
742
737
  version: meta.version,
743
738
  rules
744
739
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svelte-vitals/core",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "description": "Shared, runtime-agnostic core for svelte-vitals (types, rule engine, scorer, reporter).",
5
5
  "type": "module",
6
6
  "license": "MIT",