arcvision 0.1.5 → 0.1.6

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: [],
@@ -56562,7 +56567,7 @@ var require_scanner = __commonJS({
56562
56567
  architectureMap.nodes.push(node);
56563
56568
  fileMap.set(relativePath, metadata);
56564
56569
  } catch (e) {
56565
- console.warn(`\u26A0\uFE0F Parse warning for ${file}: ${e.message}`);
56570
+ console.warn(`\u26A0\uFE0F Failed to parse ${file} \u2014 file skipped, you should check manually`);
56566
56571
  }
56567
56572
  }
56568
56573
  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.6",
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,
@@ -44,8 +44,8 @@ async function scan(directory) {
44
44
  architectureMap.nodes.push(node);
45
45
  fileMap.set(relativePath, metadata);
46
46
  } 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}`);
47
+ // Log a clear, user-friendly warning message and continue scanning
48
+ console.warn(`⚠️ Failed to parse ${file} — file skipped, you should check manually`);
49
49
  }
50
50
  }
51
51