arcvision 0.2.21 → 0.2.24
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/bin/arcvision.js +1 -1
- package/package.json +10 -3
- package/src/core/change-evaluator.js +38 -9
- package/src/index.js +208 -97
- package/.arcvision/logs/errors.log +0 -7
- package/arcvision_context/architecture.authority.ledger.json +0 -26
- package/dist/index.js +0 -68468
- package/schema/arcvision_context_schema_v1.json +0 -356
- package/test-block-functionality.js +0 -40
- package/test-dev-project/.arcvision/invariants.json +0 -19
- package/test-dev-project/arcvision_context/README.md +0 -93
- package/test-dev-project/arcvision_context/architecture.authority.ledger.json +0 -45
- package/test-dev-project/arcvision_context/arcvision.context.json +0 -1023
- package/test-dev-project/src/core/data-service.js +0 -0
- package/test-dev-project/src/ui/user-profile.js +0 -0
- package/test-dev-project/src/utils/helpers.js +0 -0
- package/test_repos/allowed-clean-architecture/.arcvision/invariants.json +0 -57
- package/test_repos/allowed-clean-architecture/adapters/controllers/UserController.js +0 -95
- package/test_repos/allowed-clean-architecture/adapters/http/HttpServer.js +0 -78
- package/test_repos/allowed-clean-architecture/application/dtos/CreateUserRequest.js +0 -37
- package/test_repos/allowed-clean-architecture/application/services/UserService.js +0 -61
- package/test_repos/allowed-clean-architecture/arcvision_context/README.md +0 -93
- package/test_repos/allowed-clean-architecture/arcvision_context/arcvision.context.json +0 -2796
- package/test_repos/allowed-clean-architecture/domain/interfaces/UserRepository.js +0 -25
- package/test_repos/allowed-clean-architecture/domain/models/User.js +0 -39
- package/test_repos/allowed-clean-architecture/index.js +0 -45
- package/test_repos/allowed-clean-architecture/infrastructure/database/DatabaseConnection.js +0 -56
- package/test_repos/allowed-clean-architecture/infrastructure/repositories/InMemoryUserRepository.js +0 -61
- package/test_repos/allowed-clean-architecture/package.json +0 -15
- package/test_repos/blocked-legacy-monolith/.arcvision/invariants.json +0 -78
- package/test_repos/blocked-legacy-monolith/arcvision_context/README.md +0 -93
- package/test_repos/blocked-legacy-monolith/arcvision_context/arcvision.context.json +0 -2882
- package/test_repos/blocked-legacy-monolith/database/dbConnection.js +0 -35
- package/test_repos/blocked-legacy-monolith/index.js +0 -38
- package/test_repos/blocked-legacy-monolith/modules/emailService.js +0 -31
- package/test_repos/blocked-legacy-monolith/modules/paymentProcessor.js +0 -37
- package/test_repos/blocked-legacy-monolith/package.json +0 -15
- package/test_repos/blocked-legacy-monolith/shared/utils.js +0 -19
- package/test_repos/blocked-legacy-monolith/utils/helpers.js +0 -23
- package/test_repos/risky-microservices-concerns/.arcvision/invariants.json +0 -69
- package/test_repos/risky-microservices-concerns/arcvision_context/README.md +0 -93
- package/test_repos/risky-microservices-concerns/arcvision_context/arcvision.context.json +0 -3070
- package/test_repos/risky-microservices-concerns/common/utils.js +0 -77
- package/test_repos/risky-microservices-concerns/gateways/apiGateway.js +0 -84
- package/test_repos/risky-microservices-concerns/index.js +0 -20
- package/test_repos/risky-microservices-concerns/libs/deprecatedHelper.js +0 -36
- package/test_repos/risky-microservices-concerns/package.json +0 -15
- package/test_repos/risky-microservices-concerns/services/orderService.js +0 -42
- package/test_repos/risky-microservices-concerns/services/userService.js +0 -48
package/bin/arcvision.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arcvision",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.24",
|
|
4
4
|
"description": "ArcVision CLI - Architectural Governance and Invariant Detection Tool",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -10,8 +10,15 @@
|
|
|
10
10
|
"start": "node src/index.js",
|
|
11
11
|
"test": "jest",
|
|
12
12
|
"lint": "eslint src/",
|
|
13
|
-
"build": "pkg src/index.js --target node16-linux,node16-macos,node16-win --output dist/arcvision"
|
|
13
|
+
"build": "pkg src/index.js --target node16-linux,node16-macos,node16-win --output dist/arcvision",
|
|
14
|
+
"publish": "npm publish --access public"
|
|
14
15
|
},
|
|
16
|
+
"files": [
|
|
17
|
+
"bin/",
|
|
18
|
+
"src/",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
15
22
|
"keywords": [
|
|
16
23
|
"architecture",
|
|
17
24
|
"governance",
|
|
@@ -62,4 +69,4 @@
|
|
|
62
69
|
"test": "tests"
|
|
63
70
|
},
|
|
64
71
|
"type": "commonjs"
|
|
65
|
-
}
|
|
72
|
+
}
|
|
@@ -331,8 +331,23 @@ function checkPatternRule(invariant, dependencyGraph, changedFiles) {
|
|
|
331
331
|
if (invariant.rule.condition && invariant.rule.condition.pattern) {
|
|
332
332
|
const pattern = invariant.rule.condition.pattern;
|
|
333
333
|
const { patternMatcher } = require('./pattern-matcher');
|
|
334
|
+
const fs = require('fs');
|
|
335
|
+
const path = require('path');
|
|
334
336
|
|
|
335
|
-
//
|
|
337
|
+
// Convert pattern to regex for proper matching
|
|
338
|
+
let regexPattern;
|
|
339
|
+
try {
|
|
340
|
+
// Handle the pipe (OR) operator and other regex constructs
|
|
341
|
+
const escapedPattern = pattern.replace(/\./g, '\\.')
|
|
342
|
+
.replace(/\*/g, '.*')
|
|
343
|
+
.replace(/\+/g, '\\+');
|
|
344
|
+
regexPattern = new RegExp(escapedPattern, 'gi');
|
|
345
|
+
} catch (regexError) {
|
|
346
|
+
console.warn(`Warning: Could not create regex from pattern "${pattern}": ${regexError.message}`);
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Check if any node content matches the pattern by reading actual files
|
|
336
351
|
if (dependencyGraph.nodes && Array.isArray(dependencyGraph.nodes)) {
|
|
337
352
|
return dependencyGraph.nodes.some(node => {
|
|
338
353
|
if (node.path && typeof node.path === 'string') {
|
|
@@ -341,14 +356,28 @@ function checkPatternRule(invariant, dependencyGraph, changedFiles) {
|
|
|
341
356
|
console.log(`🚨 Pattern violation detected in ${node.path}: matches pattern "${pattern}"`);
|
|
342
357
|
return true;
|
|
343
358
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
359
|
+
|
|
360
|
+
// Read actual file content to check for pattern violations
|
|
361
|
+
try {
|
|
362
|
+
// Resolve the full file path
|
|
363
|
+
const fullPath = path.resolve(node.path);
|
|
364
|
+
if (fs.existsSync(fullPath)) {
|
|
365
|
+
const fileContent = fs.readFileSync(fullPath, 'utf8');
|
|
366
|
+
|
|
367
|
+
// Check if file content matches the regex pattern
|
|
368
|
+
if (regexPattern.test(fileContent)) {
|
|
369
|
+
console.log(`🚨 Pattern violation detected in ${node.path}: content matches pattern "${pattern}"`);
|
|
370
|
+
return true;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// Also check with pattern matcher for glob patterns
|
|
374
|
+
if (patternMatcher.match(fileContent, `*${pattern}*`, { matchBase: false })) {
|
|
375
|
+
console.log(`🚨 Pattern violation detected in ${node.path}: content matches pattern "${pattern}"`);
|
|
376
|
+
return true;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
} catch (fileError) {
|
|
380
|
+
// Silently continue if file can't be read
|
|
352
381
|
}
|
|
353
382
|
}
|
|
354
383
|
|