@svelte-vitals/vite 0.32.3 → 0.34.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.
- package/dist/index.js +3 -3
- package/package.json +8 -6
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);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svelte-vitals/vite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.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.2",
|
|
46
|
-
"svelte-vitals": "0.51.0"
|
|
44
|
+
"tinyglobby": "^0.2.17"
|
|
47
45
|
},
|
|
48
46
|
"peerDependencies": {
|
|
49
47
|
"@sveltejs/kit": "^2.70.3",
|
|
50
|
-
"vite": "^8.2.2"
|
|
48
|
+
"vite": "^8.2.2",
|
|
49
|
+
"@svelte-vitals/core": "^0.48.0",
|
|
50
|
+
"svelte-vitals": "^0.52.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependenciesMeta": {
|
|
53
53
|
"@sveltejs/kit": {
|
|
@@ -59,7 +59,9 @@
|
|
|
59
59
|
"@types/node": "^24.13.3",
|
|
60
60
|
"happy-dom": "^20.11.6",
|
|
61
61
|
"svelte": "^5.56.10",
|
|
62
|
-
"vite": "^8.2.2"
|
|
62
|
+
"vite": "^8.2.2",
|
|
63
|
+
"@svelte-vitals/core": "0.48.0",
|
|
64
|
+
"svelte-vitals": "0.52.0"
|
|
63
65
|
},
|
|
64
66
|
"scripts": {
|
|
65
67
|
"build": "tsdown",
|