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 +10 -5
- package/package.json +1 -1
- package/src/core/parser.js +11 -4
- package/src/core/scanner.js +2 -2
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
|
-
|
|
56272
|
-
|
|
56273
|
-
|
|
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
|
|
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
package/src/core/parser.js
CHANGED
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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,
|
package/src/core/scanner.js
CHANGED
|
@@ -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
|
-
//
|
|
48
|
-
console.warn(`⚠️
|
|
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
|
|