svelte-vitals 0.20.0 → 0.21.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/bin.js CHANGED
@@ -4,9 +4,10 @@ import {
4
4
  findUnknownRuleIds,
5
5
  isReporterName,
6
6
  knownRuleIds,
7
+ readCoreVersion,
7
8
  readPackageVersion,
8
9
  run
9
- } from "./chunk-AAM2A7D7.js";
10
+ } from "./chunk-B3RVLTZY.js";
10
11
 
11
12
  // src/bin.ts
12
13
  import mri3 from "mri";
@@ -496,6 +497,15 @@ function installCommand(pm) {
496
497
  const action = pm === "npm" ? "install" : "add";
497
498
  return { command: pm, args: [action, "-D", "@svelte-vitals/vite"] };
498
499
  }
500
+ function readInstalledViteVersion(io) {
501
+ const raw = io.readFile(join2(io.cwd, "node_modules/@svelte-vitals/vite/package.json"));
502
+ if (raw === void 0) return void 0;
503
+ try {
504
+ return JSON.parse(raw).version;
505
+ } catch {
506
+ return void 0;
507
+ }
508
+ }
499
509
 
500
510
  // src/install/index.ts
501
511
  function planForClient(client, scope, io, force) {
@@ -669,6 +679,11 @@ ${indent(r.snippet ?? "")}`);
669
679
  io.errorLog(
670
680
  `svelte-vitals: failed to install @svelte-vitals/vite (${command} ${args.join(" ")} exited ${code}). Install it manually.`
671
681
  );
682
+ } else {
683
+ const installedVersion = readInstalledViteVersion(io);
684
+ io.log(
685
+ installedVersion ? `svelte-vitals: installed @svelte-vitals/vite@${installedVersion} \u2014 compare against \`svelte-vitals --version\`'s core number if findings ever seem out of sync.` : "svelte-vitals: installed @svelte-vitals/vite (could not read the installed version from node_modules)."
686
+ );
672
687
  }
673
688
  }
674
689
  if (hadFailure) return 2;
@@ -1038,7 +1053,7 @@ async function main() {
1038
1053
  process.exit(0);
1039
1054
  }
1040
1055
  if (argv.version) {
1041
- console.log(VERSION);
1056
+ console.log(`${VERSION} (core ${readCoreVersion()})`);
1042
1057
  process.exit(0);
1043
1058
  }
1044
1059
  const { options, warnings, errors } = resolveArgs(argv);
@@ -678,6 +678,15 @@ function readPackageVersion() {
678
678
  return "0.0.0";
679
679
  }
680
680
  }
681
+ function readCoreVersion() {
682
+ try {
683
+ const entry = import.meta.resolve("@svelte-vitals/core");
684
+ const pkg = JSON.parse(readFileSync(new URL("../package.json", entry), "utf8"));
685
+ return pkg.version ?? "0.0.0";
686
+ } catch {
687
+ return "0.0.0";
688
+ }
689
+ }
681
690
 
682
691
  // src/reporter-resolve.ts
683
692
  var AGENT_ENV_VARS = ["CLAUDECODE", "SVELTE_VITALS_AGENT"];
@@ -1137,7 +1146,7 @@ async function run(opts = {}) {
1137
1146
  const output = formatGithubReport(results, config);
1138
1147
  if (output) log(output);
1139
1148
  } else if (reporter === "html") {
1140
- const html = formatHtmlReport(results, config, { version });
1149
+ const html = formatHtmlReport(results, config, { version, coreVersion: readCoreVersion() });
1141
1150
  if (opts.outFile === "-") {
1142
1151
  log(html);
1143
1152
  } else {
@@ -1174,6 +1183,7 @@ async function run(opts = {}) {
1174
1183
  export {
1175
1184
  ProjectError,
1176
1185
  readPackageVersion,
1186
+ readCoreVersion,
1177
1187
  isReporterName,
1178
1188
  findUnknownRuleIds,
1179
1189
  knownRuleIds,
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  routeMatcher,
10
10
  run,
11
11
  spinnerEnabled
12
- } from "./chunk-AAM2A7D7.js";
12
+ } from "./chunk-B3RVLTZY.js";
13
13
  export {
14
14
  ProjectError,
15
15
  analyzeProject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-vitals",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "A SvelteKit SEO checker — not a runtime Web Vitals reporter. Static analysis of your routes' head metadata.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -45,7 +45,7 @@
45
45
  "smol-toml": "^1.7.0",
46
46
  "svelte": "^5.56.4",
47
47
  "tinyglobby": "^0.2.17",
48
- "@svelte-vitals/core": "0.21.0"
48
+ "@svelte-vitals/core": "0.22.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/node": "^24.13.2"