arcvision 0.1.4 → 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, "/");
@@ -56606,9 +56611,14 @@ var path = require("path");
56606
56611
  var fs = require("fs");
56607
56612
  var os = require("os");
56608
56613
  var scanner = require_scanner();
56609
- var packageJsonPath = path.join(__dirname, "../../package.json");
56610
- var packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
56611
- var version = packageJson.version;
56614
+ var version = "1.0.0";
56615
+ try {
56616
+ const packageJsonPath = path.join(__dirname, "../package.json");
56617
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
56618
+ version = packageJson.version;
56619
+ } catch (error) {
56620
+ console.warn("Warning: Could not load version from package.json, using default");
56621
+ }
56612
56622
  var CONFIG_FILE = path.join(os.homedir(), ".arcvisionrc");
56613
56623
  var API_URL = process.env.ARCVISION_API_URL || "https://arcvisiondev.vercel.app";
56614
56624
  function saveToken(token) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arcvision",
3
- "version": "0.1.4",
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
 
package/src/index.js CHANGED
@@ -8,9 +8,18 @@ const os = require('os');
8
8
  const scanner = require('./core/scanner');
9
9
 
10
10
  // Get version from package.json
11
- const packageJsonPath = path.join(__dirname, '../../package.json');
12
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
13
- const version = packageJson.version;
11
+ // Use a try-catch to handle bundled environment
12
+ let version = '1.0.0'; // fallback version
13
+ try {
14
+ // Try to get the package.json path relative to the bundled file
15
+ const packageJsonPath = path.join(__dirname, '../package.json');
16
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
17
+ version = packageJson.version;
18
+ } catch (error) {
19
+ // Fallback to 1.0.0 if package.json cannot be found
20
+ // This can happen in bundled environments
21
+ console.warn('Warning: Could not load version from package.json, using default');
22
+ }
14
23
 
15
24
  const CONFIG_FILE = path.join(os.homedir(), '.arcvisionrc');
16
25
  const API_URL = process.env.ARCVISION_API_URL || 'https://arcvisiondev.vercel.app';