arcvision 0.1.2 → 0.1.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.
package/dist/index.js CHANGED
@@ -4220,10 +4220,10 @@ var require_supports_color = __commonJS({
4220
4220
  return 3;
4221
4221
  }
4222
4222
  if ("TERM_PROGRAM" in env) {
4223
- const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
4223
+ const version2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
4224
4224
  switch (env.TERM_PROGRAM) {
4225
4225
  case "iTerm.app":
4226
- return version >= 3 ? 3 : 2;
4226
+ return version2 >= 3 ? 3 : 2;
4227
4227
  case "Apple_Terminal":
4228
4228
  return 2;
4229
4229
  }
@@ -44650,8 +44650,8 @@ var require_trace_mapping_umd = __commonJS({
44650
44650
  if (!isString && map._decodedMemo)
44651
44651
  return map;
44652
44652
  const parsed = parse(map);
44653
- const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
44654
- this.version = version;
44653
+ const { version: version2, file, names, sourceRoot, sources, sourcesContent } = parsed;
44654
+ this.version = version2;
44655
44655
  this.file = file;
44656
44656
  this.names = names || [];
44657
44657
  this.sourceRoot = sourceRoot;
@@ -56287,6 +56287,12 @@ var require_parser = __commonJS({
56287
56287
  });
56288
56288
  },
56289
56289
  ExportNamedDeclaration({ node }) {
56290
+ if (node.source) {
56291
+ metadata.imports.push({
56292
+ source: node.source.value,
56293
+ specifiers: node.specifiers ? node.specifiers.map((s) => s.exported.name || s.exported.value) : []
56294
+ });
56295
+ }
56290
56296
  if (node.declaration) {
56291
56297
  if (node.declaration.type === "FunctionDeclaration") {
56292
56298
  metadata.exports.push(node.declaration.id.name);
@@ -56297,6 +56303,12 @@ var require_parser = __commonJS({
56297
56303
  }
56298
56304
  }
56299
56305
  },
56306
+ ExportAllDeclaration({ node }) {
56307
+ metadata.imports.push({
56308
+ source: node.source.value,
56309
+ specifiers: ["*"]
56310
+ });
56311
+ },
56300
56312
  ExportDefaultDeclaration({ node }) {
56301
56313
  metadata.exports.push("default");
56302
56314
  },
@@ -56401,7 +56413,11 @@ var require_tsconfig_utils = __commonJS({
56401
56413
  for (const tsconfigPath of tsconfigPaths) {
56402
56414
  if (fs2.existsSync(tsconfigPath)) {
56403
56415
  try {
56404
- const raw = JSON.parse(fs2.readFileSync(tsconfigPath, "utf-8"));
56416
+ let content = fs2.readFileSync(tsconfigPath, "utf-8");
56417
+ if (content.charCodeAt(0) === 65279) {
56418
+ content = content.slice(1);
56419
+ }
56420
+ const raw = JSON.parse(content);
56405
56421
  return raw.compilerOptions || {};
56406
56422
  } catch (error) {
56407
56423
  console.warn(`Warning: Could not parse ${tsconfigPath}:`, error.message);
@@ -56463,6 +56479,15 @@ var require_path_resolver = __commonJS({
56463
56479
  const resolved = resolveFile(realPath);
56464
56480
  if (resolved)
56465
56481
  return resolved;
56482
+ const wildcardPath = importPath + "/*";
56483
+ if (tsconfig.paths && tsconfig.paths[wildcardPath]) {
56484
+ const pathMappings = tsconfig.paths[wildcardPath];
56485
+ if (Array.isArray(pathMappings) && pathMappings.length > 0) {
56486
+ const mappedPath = pathMappings[0].replace("*", "");
56487
+ const realPath2 = path2.resolve(projectRoot, tsconfig.baseUrl || ".", mappedPath);
56488
+ return resolveFile(realPath2);
56489
+ }
56490
+ }
56466
56491
  }
56467
56492
  if (importPath.startsWith(".")) {
56468
56493
  const realPath = path2.resolve(path2.dirname(fromFile), importPath);
@@ -56581,6 +56606,9 @@ var path = require("path");
56581
56606
  var fs = require("fs");
56582
56607
  var os = require("os");
56583
56608
  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;
56584
56612
  var CONFIG_FILE = path.join(os.homedir(), ".arcvisionrc");
56585
56613
  var API_URL = process.env.ARCVISION_API_URL || "https://arcvisiondev.vercel.app";
56586
56614
  function saveToken(token) {
@@ -56695,7 +56723,7 @@ Quick Start:
56695
56723
  4. Run: arcvision link <token>
56696
56724
  5. Run: arcvision scan --upload
56697
56725
  6. Open dashboard to see results
56698
- `).version("1.0.0");
56726
+ `).version(version);
56699
56727
  program.command("link <token>").description("Link this CLI to a project via upload token").action((token) => {
56700
56728
  try {
56701
56729
  saveToken(token);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arcvision",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Architecture scanner for modern codebases",
5
5
  "bin": {
6
6
  "arcvision": "./dist/index.js"
@@ -26,6 +26,14 @@ function parseFile(filePath) {
26
26
  });
27
27
  },
28
28
  ExportNamedDeclaration({ node }) {
29
+ // Handle export { X, Y, Z } from './file' statements
30
+ if (node.source) {
31
+ metadata.imports.push({
32
+ source: node.source.value,
33
+ specifiers: node.specifiers ? node.specifiers.map(s => s.exported.name || s.exported.value) : []
34
+ });
35
+ }
36
+ // Handle export declarations without source (local exports)
29
37
  if (node.declaration) {
30
38
  if (node.declaration.type === 'FunctionDeclaration') {
31
39
  metadata.exports.push(node.declaration.id.name);
@@ -36,6 +44,13 @@ function parseFile(filePath) {
36
44
  }
37
45
  }
38
46
  },
47
+ ExportAllDeclaration({ node }) {
48
+ // Handle export * from './file' statements
49
+ metadata.imports.push({
50
+ source: node.source.value,
51
+ specifiers: ['*']
52
+ });
53
+ },
39
54
  ExportDefaultDeclaration({ node }) {
40
55
  metadata.exports.push('default');
41
56
  },
@@ -63,6 +63,18 @@ function resolveImport(importPath, fromFile, projectRoot, tsconfig) {
63
63
  const realPath = path.resolve(projectRoot, tsconfig.baseUrl, relativePath);
64
64
  const resolved = resolveFile(realPath);
65
65
  if (resolved) return resolved;
66
+
67
+ // Also try adding '/*' to see if it matches a path mapping pattern
68
+ // e.g., '@/utils' might match '@/utils/*' -> './src/utils/*'
69
+ const wildcardPath = importPath + '/*';
70
+ if (tsconfig.paths && tsconfig.paths[wildcardPath]) {
71
+ const pathMappings = tsconfig.paths[wildcardPath];
72
+ if (Array.isArray(pathMappings) && pathMappings.length > 0) {
73
+ const mappedPath = pathMappings[0].replace('*', '');
74
+ const realPath = path.resolve(projectRoot, tsconfig.baseUrl || '.', mappedPath);
75
+ return resolveFile(realPath);
76
+ }
77
+ }
66
78
  }
67
79
 
68
80
  // Handle relative paths (e.g., './utils', '../components')
@@ -15,7 +15,12 @@ function loadTSConfig(projectRoot) {
15
15
  for (const tsconfigPath of tsconfigPaths) {
16
16
  if (fs.existsSync(tsconfigPath)) {
17
17
  try {
18
- const raw = JSON.parse(fs.readFileSync(tsconfigPath, 'utf-8'));
18
+ let content = fs.readFileSync(tsconfigPath, 'utf-8');
19
+ // Remove BOM if present (0xFEFF)
20
+ if (content.charCodeAt(0) === 0xFEFF) {
21
+ content = content.slice(1);
22
+ }
23
+ const raw = JSON.parse(content);
19
24
  return raw.compilerOptions || {};
20
25
  } catch (error) {
21
26
  console.warn(`Warning: Could not parse ${tsconfigPath}:`, error.message);
package/src/index.js CHANGED
@@ -7,6 +7,11 @@ const fs = require('fs');
7
7
  const os = require('os');
8
8
  const scanner = require('./core/scanner');
9
9
 
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;
14
+
10
15
  const CONFIG_FILE = path.join(os.homedir(), '.arcvisionrc');
11
16
  const API_URL = process.env.ARCVISION_API_URL || 'https://arcvisiondev.vercel.app';
12
17
 
@@ -140,7 +145,7 @@ Quick Start:
140
145
  5. Run: arcvision scan --upload
141
146
  6. Open dashboard to see results
142
147
  `)
143
- .version('1.0.0');
148
+ .version(version);
144
149
 
145
150
  program
146
151
  .command('link <token>')