@svgrid/mcp 3.0.24 → 3.0.25

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/validate.js CHANGED
@@ -281,12 +281,18 @@ function checkImports(ctx) {
281
281
  const ours = names.filter((n) => has(surface.grid, n) || has(surface.enterprise, n));
282
282
  if (ours.length) {
283
283
  const from = ours.every((n) => !has(surface.grid, n)) ? '@svgrid/enterprise' : '@svgrid/grid';
284
+ // Every name is ours, so swapping the specifier is the whole fix and
285
+ // `applyFixes` can make it. A mix keeps the advice only: the other
286
+ // names belong to the package that was imported.
287
+ const exact = ours.length === names.length && (ours.every((n) => has(surface.grid, n)) || from === '@svgrid/enterprise');
284
288
  push(ctx, {
285
289
  rule: 'svgrid/lookalike-package',
286
290
  severity: 'error',
287
- line,
291
+ // The specifier's line: a multi-line import starts several lines up.
292
+ line: exact ? lineAt(raw, specStart) : line,
288
293
  message: `"${spec}" is an unrelated project; \`${ours[0]}\` comes from ${from}.`,
289
294
  fix: `import { ${ours.join(', ')} } from '${from}'`,
295
+ ...(exact ? { rename: { from: spec, to: from } } : {}),
290
296
  });
291
297
  }
292
298
  continue;
@@ -720,7 +726,7 @@ function checkSvelteVersion(ctx) {
720
726
  message: usesRunes
721
727
  ? '`export let` is not allowed in runes mode, and this file uses runes.'
722
728
  : '`export let` is the Svelte 4 way to declare a prop.',
723
- fix: 'let { name } = $props()',
729
+ fix: (m) => `let { ${m[2]} } = $props()`,
724
730
  },
725
731
  {
726
732
  re: /(^|\n)\s*\$:\s/g,
@@ -764,12 +770,16 @@ function checkSvelteVersion(ctx) {
764
770
  if (!isSvelte && (r.rule === 'svelte/legacy-slot' || r.rule === 'svelte/legacy-component-tag'))
765
771
  continue;
766
772
  for (let m; (m = r.re.exec(scan));) {
773
+ // The line of the first non-space character: these patterns start with
774
+ // `(^|\n)\s*`, so m.index sits on the newline (or blank lines) before
775
+ // the code and reported `export let` on line 2 when it was on line 4.
776
+ const at = m.index + (m[0].length - m[0].trimStart().length);
767
777
  push(ctx, {
768
778
  rule: r.rule,
769
779
  severity: r.severity,
770
- line: lineAt(raw, m.index),
780
+ line: lineAt(raw, at),
771
781
  message: r.message,
772
- fix: r.fix,
782
+ fix: typeof r.fix === 'function' ? r.fix(m) : r.fix,
773
783
  });
774
784
  }
775
785
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "commercial",
6
6
  "url": "https://svgrid.com/pricing"
7
7
  },
8
- "version": "3.0.24",
8
+ "version": "3.0.25",
9
9
  "description": "Model Context Protocol server for SvGrid, the Svelte 5 data grid: checks the code your AI writes against the real API surface, plus version-pinned docs, API reference and 373 demo sources.",
10
10
  "license": "MIT",
11
11
  "author": "jQWidgets <sales@jqwidgets.com>",
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "com.svgrid/svgrid",
4
4
  "title": "SvGrid",
5
5
  "description": "Checks AI-written SvGrid code against the real API, plus version-pinned Svelte 5 grid docs.",
6
- "version": "3.0.24",
6
+ "version": "3.0.25",
7
7
  "websiteUrl": "https://svgrid.com/docs/help/mcp-server/",
8
8
  "repository": {
9
9
  "url": "https://github.com/sv-grid/sv-grid",
@@ -15,7 +15,7 @@
15
15
  "registryType": "npm",
16
16
  "registryBaseUrl": "https://registry.npmjs.org",
17
17
  "identifier": "@svgrid/mcp",
18
- "version": "3.0.24",
18
+ "version": "3.0.25",
19
19
  "runtimeHint": "npx",
20
20
  "transport": {
21
21
  "type": "stdio"