@svelte-vitals/vite 0.32.2 → 0.33.0

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.
@@ -10,7 +10,7 @@ function findingSignature(results, config) {
10
10
  const warn = (line) => console.warn(terminalSafe(line));
11
11
  async function postIngest(origin, route, results, failedRuleIds) {
12
12
  if (!isLoopbackOrigin(origin)) {
13
- if (globalThis.process?.env?.SVELTE_VITALS_DEBUG) warn(`[svelte-vitals] live UI ingest skipped for non-loopback origin ${origin} — open the dashboard via localhost`);
13
+ if (globalThis.process?.env?.SVELTE_VITALS_DEBUG) warn(`svelte-vitals: live UI ingest skipped for non-loopback origin ${origin} — open the dashboard via localhost`);
14
14
  return;
15
15
  }
16
16
  try {
@@ -82,7 +82,7 @@ async function analyzeAndIngest(html, route, origin, rules, config, lastSignatur
82
82
  lastSignature.set(route, signature);
83
83
  if (globalThis.process?.env?.SVELTE_VITALS_UI) postIngest(origin, route, results, failedRuleIds);
84
84
  } catch (err) {
85
- if (globalThis.process?.env?.SVELTE_VITALS_DEBUG) warn(`[svelte-vitals] dev analysis failed: ${err instanceof Error ? err.message : String(err)}`);
85
+ if (globalThis.process?.env?.SVELTE_VITALS_DEBUG) warn(`svelte-vitals: dev analysis failed: ${err instanceof Error ? err.message : String(err)}`);
86
86
  }
87
87
  }
88
88
  /**
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { access, mkdir, readFile, writeFile } from "node:fs/promises";
4
4
  import { basename, dirname, isAbsolute, join, relative, sep } from "node:path";
5
5
  import { CATEGORIES, defineConfig } from "@svelte-vitals/core";
6
6
  import { ROBOTS_SOURCE_PATHS, SITEMAP_SOURCE_PATHS, SVELTE_CONFIG_FILES, VITE_CONFIG_FILES, allRules, applyInlineDirectives, applyOverrides, applyRuleSeverities, buildJsonReport, collectComponentFacts, collectKitModuleFacts, collectSourceFiles, collectSuppressions, computeScore, defaultConfig, findMinifyDisabled, formatConsoleReport, formatFailedRuleWarning, formatJsonReport, hasFailureAtOrAbove, renderAppShell, resolveKitAliases, resolveKitPathsBase, resolveRuleOptions, runRules, safeHref, selectRules, shouldSkipRangeCheck, skippedFileWarnings, summarize, terminalSafe, unknownDirectiveIds, validateRuleSetting, withFailedRulesOff, withReadLimit } from "@svelte-vitals/core/internal";
7
- import { CONFIG_FILENAMES, analyzeProject, findUnknownRuleIds, knownRuleIds, loadConfigFile, ruleOptionsSpec } from "svelte-vitals";
7
+ import { CONFIG_FILENAMES, analyzeProject, findUnknownRuleIds, knownRuleIds, loadConfigFile, registryTag, ruleOptionsSpec } from "svelte-vitals";
8
8
  import { glob } from "tinyglobby";
9
9
  //#region src/providers/rendered/project.ts
10
10
  async function exists(path) {
@@ -615,7 +615,7 @@ const DEFAULT_PRERENDER_DIR = ".svelte-kit/output/prerendered/pages";
615
615
  function validateRulesOption(rules) {
616
616
  if (!rules) return;
617
617
  const unknown = findUnknownRuleIds(Object.keys(rules));
618
- if (unknown.length > 0) throw new Error(`svelte-vitals: invalid \`rules\` option — unknown rule id(s): ${unknown.join(", ")}. Known rule ids: ${knownRuleIds().join(", ")}`);
618
+ if (unknown.length > 0) throw new Error(`svelte-vitals: invalid \`rules\` option — unknown rule id(s): ${unknown.join(", ")}. Known rule ids (${registryTag()}): ${knownRuleIds().join(", ")}`);
619
619
  const errors = [];
620
620
  for (const [id, setting] of Object.entries(rules)) errors.push(...validateRuleSetting(`rules.${id}`, id, setting, ruleOptionsSpec(id), { allowOptions: true }));
621
621
  if (errors.length > 0) throw new Error(`svelte-vitals: invalid \`rules\` option — ${errors.join(" ")}`);
@@ -657,7 +657,7 @@ function validateOverridesOption(overrides, rules) {
657
657
  const entryRules = entry.rules ?? {};
658
658
  const nonCategoryKeys = Object.keys(entryRules).filter((k) => !CATEGORIES.includes(k));
659
659
  const unknown = findUnknownRuleIds(nonCategoryKeys);
660
- if (unknown.length > 0) throw new Error(`svelte-vitals: invalid \`overrides\` option — overrides[${i}]: unknown rule id(s) or categories: ${unknown.join(", ")}. Known categories: ${CATEGORIES.join(", ")}. Known rule ids: ${knownRuleIds().join(", ")}`);
660
+ if (unknown.length > 0) throw new Error(`svelte-vitals: invalid \`overrides\` option — overrides[${i}]: unknown rule id(s) or categories: ${unknown.join(", ")}. Known categories: ${CATEGORIES.join(", ")}. Known rule ids (${registryTag()}): ${knownRuleIds().join(", ")}`);
661
661
  for (const [key, setting] of Object.entries(entryRules)) {
662
662
  const isCategory = CATEGORIES.includes(key);
663
663
  const baseline = isCategory ? void 0 : resolveRuleOptions(key, ruleOptionsSpec(key), baseConfig);
@@ -744,7 +744,7 @@ function svelteVitals(options = {}) {
744
744
  store.setStatic(results);
745
745
  staticFailedRuleIds = failedRuleIds ?? [];
746
746
  },
747
- onError: (err) => warn(`[svelte-vitals] dev analysis failed: ${err instanceof Error ? err.message : String(err)}`),
747
+ onError: (err) => warn(`svelte-vitals: dev analysis failed: ${err instanceof Error ? err.message : String(err)}`),
748
748
  onStatusChange: (analyzing) => store.setAnalyzing(analyzing)
749
749
  });
750
750
  runner.start();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svelte-vitals/vite",
3
- "version": "0.32.2",
3
+ "version": "0.33.0",
4
4
  "description": "Vite/SvelteKit plugin for svelte-vitals — analyzes prerendered HTML during vite build, plus a live dev dashboard.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -41,13 +41,13 @@
41
41
  "dependencies": {
42
42
  "esm-env": "^1.2.2",
43
43
  "node-html-parser": "^9.0.1",
44
- "tinyglobby": "^0.2.17",
45
- "@svelte-vitals/core": "0.47.1",
46
- "svelte-vitals": "0.50.1"
44
+ "tinyglobby": "^0.2.17"
47
45
  },
48
46
  "peerDependencies": {
49
47
  "@sveltejs/kit": "^2.70.3",
50
- "vite": "^8.2.1"
48
+ "vite": "^8.2.2",
49
+ "@svelte-vitals/core": "^0.47.2",
50
+ "svelte-vitals": "^0.51.1"
51
51
  },
52
52
  "peerDependenciesMeta": {
53
53
  "@sveltejs/kit": {
@@ -57,9 +57,11 @@
57
57
  "devDependencies": {
58
58
  "@sveltejs/kit": "^2.70.3",
59
59
  "@types/node": "^24.13.3",
60
- "happy-dom": "^20.11.2",
61
- "svelte": "^5.56.9",
62
- "vite": "^8.2.1"
60
+ "happy-dom": "^20.11.6",
61
+ "svelte": "^5.56.10",
62
+ "vite": "^8.2.2",
63
+ "@svelte-vitals/core": "0.47.2",
64
+ "svelte-vitals": "0.51.1"
63
65
  },
64
66
  "scripts": {
65
67
  "build": "tsdown",