@groma/scanner-vue 0.2.3 → 0.2.4

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +30 -12
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -14,7 +14,7 @@ bun plugins/scanners/vue/build.ts
14
14
  In the project being scanned:
15
15
 
16
16
  ```sh
17
- groma scanner add /absolute/path/to/groma/plugins/scanners/vue/dist/package
17
+ groma plugin add /absolute/path/to/groma/plugins/scanners/vue/dist/package
18
18
  groma scan
19
19
  ```
20
20
 
package/dist/index.js CHANGED
@@ -42070,20 +42070,32 @@ function reachedFiles(entry, compiled, imports, packages, units) {
42070
42070
  }
42071
42071
  async function declaredEntries(root, declarations, packages, workspaces) {
42072
42072
  const entries = [];
42073
+ const diagnostics = [];
42073
42074
  for (const file of declarations) {
42074
42075
  const text = await readFile3(path5.join(root, file), "utf8");
42075
42076
  const name = path5.posix.basename(file);
42076
- if (name === "package.json") {
42077
- const manifest = JSON.parse(text);
42078
- entries.push(...declaredBins(file, manifest), ...declaredScripts(file, manifest.scripts));
42079
- } else if (name === "angular.json")
42080
- entries.push(...angularEntries(file, text));
42081
- else if (name === "project.json")
42082
- entries.push(...nxEntries(file, text, workspaces));
42083
- else if (file.endsWith(".html"))
42084
- entries.push(...browserEntries(file, text, packages));
42077
+ try {
42078
+ if (name === "package.json") {
42079
+ const manifest = JSON.parse(text);
42080
+ entries.push(...declaredBins(file, manifest), ...declaredScripts(file, manifest.scripts));
42081
+ } else if (name === "angular.json")
42082
+ entries.push(...angularEntries(file, text));
42083
+ else if (name === "project.json")
42084
+ entries.push(...nxEntries(file, text, workspaces));
42085
+ else if (file.endsWith(".html"))
42086
+ entries.push(...browserEntries(file, text, packages));
42087
+ } catch (error) {
42088
+ if (!(error instanceof SyntaxError))
42089
+ throw error;
42090
+ diagnostics.push({
42091
+ severity: "warning",
42092
+ code: "JAVASCRIPT_MANIFEST_INVALID",
42093
+ file,
42094
+ message: `The file is not valid JSON; the entry points it declares are not read. ${error.message}`
42095
+ });
42096
+ }
42085
42097
  }
42086
- return entries;
42098
+ return { entries, diagnostics };
42087
42099
  }
42088
42100
  function sourced(entry, files, outputs = []) {
42089
42101
  const file = sourceOf(entry.file, outputs, files);
@@ -42097,7 +42109,8 @@ async function withJavaScriptEntries(root, observation, inputs, files) {
42097
42109
  const packages = new Set(inventory.filter((file) => path5.posix.basename(file) === "package.json").map((file) => path5.posix.dirname(file)));
42098
42110
  const active = new Set(observation.files.map((file) => packageFor(file.file, packages)));
42099
42111
  const declarations = inventory.filter((file) => path5.posix.basename(file) !== "nx.json" && active.has(packageFor(file, packages)));
42100
- const entries = [...inputs.entries, ...await declaredEntries(root, declarations, packages, workspaces)];
42112
+ const declared = await declaredEntries(root, declarations, packages, workspaces);
42113
+ const entries = [...inputs.entries, ...declared.entries];
42101
42114
  const inventoryFiles = [...observation.files];
42102
42115
  const visible = new Set(inventoryFiles.map((file) => file.file));
42103
42116
  const readable = new Set(files);
@@ -42114,7 +42127,12 @@ async function withJavaScriptEntries(root, observation, inputs, files) {
42114
42127
  }
42115
42128
  return [{ ...entry, files: [...new Set([entry.file, ...members.map((file) => file.file)])] }];
42116
42129
  });
42117
- return createScanObservation({ ...observation, files: inventoryFiles, entryPoints });
42130
+ return createScanObservation({
42131
+ ...observation,
42132
+ files: inventoryFiles,
42133
+ entryPoints,
42134
+ diagnostics: [...observation.diagnostics, ...declared.diagnostics]
42135
+ });
42118
42136
  }
42119
42137
 
42120
42138
  // plugins/scanners/entry-points/source.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groma/scanner-vue",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Complementary Vue framework evidence; a dependency declaration does not verify runtime use.",
5
5
  "private": false,
6
6
  "type": "module",