arcvision 0.1.5 → 0.1.7

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 CHANGED
@@ -56268,10 +56268,15 @@ var require_parser = __commonJS({
56268
56268
  var path2 = require("path");
56269
56269
  function parseFile(filePath) {
56270
56270
  const content = fs2.readFileSync(filePath, "utf-8");
56271
- const ast = parser.parse(content, {
56272
- sourceType: "module",
56273
- plugins: ["jsx", "typescript", "classProperties", "dynamicImport"]
56274
- });
56271
+ let ast;
56272
+ try {
56273
+ ast = parser.parse(content, {
56274
+ sourceType: "module",
56275
+ plugins: ["jsx", "typescript", "classProperties", "dynamicImport"]
56276
+ });
56277
+ } catch (error) {
56278
+ throw error;
56279
+ }
56275
56280
  const metadata = {
56276
56281
  id: filePath,
56277
56282
  imports: [],
@@ -56554,15 +56559,16 @@ var require_scanner = __commonJS({
56554
56559
  let metadata = parser.parseFile(file);
56555
56560
  const relativePath = path2.relative(directory, file);
56556
56561
  metadata = await pluginManager.processFile(file, metadata);
56562
+ const normalizedRelativePath = normalize(relativePath);
56557
56563
  const node = {
56558
- id: relativePath,
56564
+ id: normalizedRelativePath,
56559
56565
  type: "file",
56560
56566
  metadata
56561
56567
  };
56562
56568
  architectureMap.nodes.push(node);
56563
- fileMap.set(relativePath, metadata);
56569
+ fileMap.set(normalizedRelativePath, metadata);
56564
56570
  } catch (e) {
56565
- console.warn(`\u26A0\uFE0F Parse warning for ${file}: ${e.message}`);
56571
+ console.warn(`\u26A0\uFE0F Failed to parse ${file} \u2014 file skipped, you should check manually`);
56566
56572
  }
56567
56573
  }
56568
56574
  const normalize = (p) => p.replace(/\\/g, "/");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arcvision",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Architecture scanner for modern codebases",
5
5
  "bin": {
6
6
  "arcvision": "./dist/index.js"
@@ -5,10 +5,17 @@ const path = require('path');
5
5
 
6
6
  function parseFile(filePath) {
7
7
  const content = fs.readFileSync(filePath, 'utf-8');
8
- const ast = parser.parse(content, {
9
- sourceType: 'module',
10
- plugins: ['jsx', 'typescript', 'classProperties', 'dynamicImport']
11
- });
8
+ let ast;
9
+
10
+ try {
11
+ ast = parser.parse(content, {
12
+ sourceType: 'module',
13
+ plugins: ['jsx', 'typescript', 'classProperties', 'dynamicImport']
14
+ });
15
+ } catch (error) {
16
+ // Re-throw the error to be handled by the scanner
17
+ throw error;
18
+ }
12
19
 
13
20
  const metadata = {
14
21
  id: filePath,
@@ -35,17 +35,19 @@ async function scan(directory) {
35
35
  // Process with plugins
36
36
  metadata = await pluginManager.processFile(file, metadata);
37
37
 
38
+ const normalizedRelativePath = normalize(relativePath);
39
+
38
40
  const node = {
39
- id: relativePath,
41
+ id: normalizedRelativePath,
40
42
  type: 'file',
41
43
  metadata: metadata
42
44
  };
43
45
 
44
46
  architectureMap.nodes.push(node);
45
- fileMap.set(relativePath, metadata);
47
+ fileMap.set(normalizedRelativePath, metadata);
46
48
  } catch (e) {
47
- // Non-fatal parse errors (like .d.ts files) are logged but don't stop the scan
48
- console.warn(`⚠️ Parse warning for ${file}: ${e.message}`);
49
+ // Log a clear, user-friendly warning message and continue scanning
50
+ console.warn(`⚠️ Failed to parse ${file} — file skipped, you should check manually`);
49
51
  }
50
52
  }
51
53