@groma/scanner-vue 0.2.0 → 0.2.2

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -16
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -39745,13 +39745,13 @@ function compare(...values) {
39745
39745
  }
39746
39746
  function uniqueBy(values, key, label) {
39747
39747
  const seen = new Set;
39748
- for (const value of values) {
39749
- const id = key(value);
39748
+ const keyed = values.map((value) => ({ id: key(value), value }));
39749
+ for (const { id } of keyed) {
39750
39750
  if (seen.has(id))
39751
39751
  throw new Error(`duplicate ${label}: ${id}`);
39752
39752
  seen.add(id);
39753
39753
  }
39754
- return [...values].sort((left, right) => key(left).localeCompare(key(right)));
39754
+ return keyed.sort((left, right) => left.id.localeCompare(right.id)).map((entry) => entry.value);
39755
39755
  }
39756
39756
  function createScanObservation(input) {
39757
39757
  const roots = validateRoots(input.roots);
@@ -39762,9 +39762,7 @@ function createScanObservation(input) {
39762
39762
  symbols: [...new Map(file.symbols.map((symbol) => [
39763
39763
  compare(symbol.id, symbol.kind),
39764
39764
  symbol
39765
- ])).values()].sort((left, right) => {
39766
- return compare(left.id, left.kind).localeCompare(compare(right.id, right.kind));
39767
- })
39765
+ ]))].sort(([left], [right]) => left.localeCompare(right)).map(([, symbol]) => symbol)
39768
39766
  })), (file) => file.file, "file path");
39769
39767
  const filePaths = new Set(files.map((file) => file.file));
39770
39768
  for (const file of files) {
@@ -39775,8 +39773,6 @@ function createScanObservation(input) {
39775
39773
  throw new Error(`file references unknown root: ${root}`);
39776
39774
  }
39777
39775
  }
39778
- for (const diagnostic of input.diagnostics)
39779
- diagnosticLocation(diagnostic);
39780
39776
  return {
39781
39777
  schemaVersion: 1,
39782
39778
  scanner: input.scanner,
@@ -39786,14 +39782,14 @@ function createScanObservation(input) {
39786
39782
  ...entryPoints(input.entryPoints, filePaths),
39787
39783
  ...operationEvidence(input, filePaths),
39788
39784
  ...httpEvidence(input.httpEndpoints, input.httpRequests, input.operations && new Set(input.operations.map((operation) => operation.id))),
39789
- diagnostics: [...new Map(input.diagnostics.map((diagnostic) => [
39790
- diagnosticKey(diagnostic),
39791
- diagnostic
39792
- ])).values()].sort((left, right) => {
39793
- return diagnosticKey(left).localeCompare(diagnosticKey(right));
39794
- })
39785
+ diagnostics: normalizeScanDiagnostics(input.diagnostics)
39795
39786
  };
39796
39787
  }
39788
+ function normalizeScanDiagnostics(diagnostics) {
39789
+ for (const diagnostic of diagnostics)
39790
+ diagnosticLocation(diagnostic);
39791
+ return [...new Map(diagnostics.map((diagnostic) => [diagnosticKey(diagnostic), diagnostic]))].sort(([left], [right]) => left.localeCompare(right)).map(([, diagnostic]) => diagnostic);
39792
+ }
39797
39793
  function entryPoints(input, paths) {
39798
39794
  if (input === undefined)
39799
39795
  return {};
@@ -39902,10 +39898,14 @@ function operationTokens(operation) {
39902
39898
  const endLine = Number(operation.endLine);
39903
39899
  if (endLine < startLine)
39904
39900
  throw new Error("operation.endLine must be at or after startLine");
39901
+ const tokens = array(operation.tokens, "operation.tokens");
39902
+ tokens.forEach((token) => {
39903
+ string(token, "operation.token");
39904
+ });
39905
39905
  return {
39906
39906
  startLine,
39907
39907
  endLine,
39908
- tokens: array(operation.tokens, "operation.tokens").map((token) => string(token, "operation.token"))
39908
+ tokens
39909
39909
  };
39910
39910
  }
39911
39911
  function validateOperationTokens(operation) {
@@ -40096,7 +40096,7 @@ class VueProject {
40096
40096
  this.validateSfc(source.fileName);
40097
40097
  }
40098
40098
  owned(source) {
40099
- return !source.isDeclarationFile && !relative(this.root, source.fileName).startsWith("../") && !source.fileName.includes("/node_modules/");
40099
+ return !source.isDeclarationFile && !relative(this.root, source.fileName).startsWith("../") && !source.fileName.includes("/node_modules/") && this.readable.has(relative(this.root, source.fileName));
40100
40100
  }
40101
40101
  sfc(file) {
40102
40102
  const code = this.language.scripts.get(file)?.generated?.root;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groma/scanner-vue",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Complementary Vue framework evidence; a dependency declaration does not verify runtime use.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "repository": {
61
61
  "type": "git",
62
- "url": "https://github.com/MrLesk/Groma.md.git"
62
+ "url": "https://github.com/MrLesk/groma.md.git"
63
63
  },
64
64
  "publishConfig": {
65
65
  "access": "public"