ai-first-cli 1.3.0 → 1.3.5
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/.ai-dev/index.db +0 -0
- package/.github/workflows/publish.yml +4 -1
- package/BETA_EVALUATION_REPORT.md +151 -0
- package/CHANGELOG.md +178 -0
- package/PHASE1_USER_SIMULATION.md +56 -0
- package/PHASE2_USER_SIMULATION.md +81 -0
- package/PHASE3_USER_SIMULATION.md +176 -0
- package/README.es.md +18 -0
- package/README.md +80 -1
- package/ai/graph/knowledge-graph.json +10 -0
- package/ai-context/ai_context.md +130 -0
- package/{test-projects/react-app/.ai-dev → ai-context}/ai_rules.md +10 -5
- package/ai-context/architecture.md +136 -0
- package/ai-context/context/features/src.json +69 -0
- package/ai-context/context/features/test-projects.json +69 -0
- package/ai-context/context/flows/App.json +17 -0
- package/ai-context/context/flows/DashboardPage.json +14 -0
- package/ai-context/context/flows/LoginPage.json +14 -0
- package/ai-context/context/flows/admin.json +10 -0
- package/ai-context/context/flows/ai-first.json +9 -0
- package/ai-context/context/flows/androidresources.json +11 -0
- package/ai-context/context/flows/auth.json +13 -0
- package/ai-context/context/flows/authController.json +14 -0
- package/ai-context/context/flows/doctor.json +9 -0
- package/ai-context/context/flows/entrypoints.json +9 -0
- package/ai-context/context/flows/explore.json +9 -0
- package/ai-context/context/flows/fastapiAdapter.json +14 -0
- package/ai-context/context/flows/fastapiadapter.json +11 -0
- package/ai-context/context/flows/index.json +19 -0
- package/ai-context/context/flows/indexer.json +9 -0
- package/ai-context/context/flows/indexstate.json +9 -0
- package/ai-context/context/flows/init.json +22 -0
- package/ai-context/context/flows/main.json +18 -0
- package/ai-context/context/flows/mainactivity.json +9 -0
- package/ai-context/context/flows/models.json +15 -0
- package/ai-context/context/flows/posts.json +15 -0
- package/ai-context/context/flows/repoMapper.json +20 -0
- package/ai-context/context/flows/repomapper.json +11 -0
- package/ai-context/context/flows/routes.json +15 -0
- package/ai-context/context/flows/serializers.json +10 -0
- package/ai-context/context/flows/user.json +23 -0
- package/ai-context/context/flows/views.json +12 -0
- package/{test-projects/react-app/.ai-dev → ai-context}/conventions.md +3 -2
- package/ai-context/dependencies.json +3360 -0
- package/ai-context/entrypoints.md +45 -0
- package/ai-context/index-state.json +196 -0
- package/ai-context/modules.json +901 -0
- package/ai-context/project.json +33 -0
- package/ai-context/repo_map.json +8857 -0
- package/ai-context/repo_map.md +2002 -0
- package/{test-projects/flask-app/.ai-dev → ai-context}/schema.json +1 -1
- package/ai-context/summary.md +46 -0
- package/ai-context/symbols.json +82467 -0
- package/{test-projects/react-app/.ai-dev → ai-context}/tech_stack.md +15 -7
- package/ai-context-evaluation-report-1774223059505.md +206 -0
- package/dist/analyzers/architecture.d.ts.map +1 -1
- package/dist/analyzers/architecture.js +6 -0
- package/dist/analyzers/architecture.js.map +1 -1
- package/dist/analyzers/entrypoints.d.ts.map +1 -1
- package/dist/analyzers/entrypoints.js +105 -0
- package/dist/analyzers/entrypoints.js.map +1 -1
- package/dist/analyzers/symbols.d.ts.map +1 -1
- package/dist/analyzers/symbols.js +72 -1
- package/dist/analyzers/symbols.js.map +1 -1
- package/dist/analyzers/techStack.d.ts +8 -0
- package/dist/analyzers/techStack.d.ts.map +1 -1
- package/dist/analyzers/techStack.js +75 -0
- package/dist/analyzers/techStack.js.map +1 -1
- package/dist/scripts/ai-context-evaluator.js +367 -0
- package/package.json +1 -1
- package/quick-evaluation-report-1774396002305.md +64 -0
- package/quick-evaluator.ts +200 -0
- package/scripts/ai-context-evaluator.ts +440 -0
- package/src/analyzers/architecture.ts +8 -0
- package/src/analyzers/entrypoints.ts +115 -0
- package/src/analyzers/symbols.ts +77 -1
- package/src/analyzers/techStack.ts +93 -0
- package/test_adapters.mjs +11 -11
- package/tests/apex-parser.test.ts +193 -0
- package/tests/cli-commands-batch1.test.ts +808 -0
- package/tests/cli-commands-batch2.test.ts +1113 -0
- package/tests/cli-commands-batch3.test.ts +1128 -0
- package/tests/cli-index.test.ts +1007 -0
- package/tests/cli-init.test.ts +761 -0
- package/tests/salesforce-apex-classes.test.ts +713 -0
- package/tests/salesforce-apex-triggers.test.ts +871 -0
- package/tests/salesforce-custom-objects.test.ts +918 -0
- package/tests/salesforce-flows.test.ts +710 -0
- package/tests/salesforce-lwc.test.ts +963 -0
- package/tests/salesforce-sfdx-integration.test.ts +1125 -0
- package/CONTRIBUTING.md +0 -89
- package/FLOW.md +0 -129
- package/install.sh +0 -188
- package/run-all-tests.sh +0 -184
- package/test-projects/django-app/.ai-dev/ai_context.md +0 -92
- package/test-projects/django-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/django-app/.ai-dev/architecture.md +0 -57
- package/test-projects/django-app/.ai-dev/cache.json +0 -169
- package/test-projects/django-app/.ai-dev/context/flows/views.json +0 -10
- package/test-projects/django-app/.ai-dev/conventions.md +0 -51
- package/test-projects/django-app/.ai-dev/dependencies.json +0 -312
- package/test-projects/django-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/django-app/.ai-dev/files.json +0 -209
- package/test-projects/django-app/.ai-dev/graph/knowledge-graph.json +0 -36
- package/test-projects/django-app/.ai-dev/graph/module-graph.json +0 -145
- package/test-projects/django-app/.ai-dev/graph/symbol-graph.json +0 -1488
- package/test-projects/django-app/.ai-dev/graph/symbol-references.json +0 -1
- package/test-projects/django-app/.ai-dev/index-state.json +0 -294
- package/test-projects/django-app/.ai-dev/modules.json +0 -35
- package/test-projects/django-app/.ai-dev/project.json +0 -11
- package/test-projects/django-app/.ai-dev/repo_map.json +0 -412
- package/test-projects/django-app/.ai-dev/repo_map.md +0 -105
- package/test-projects/django-app/.ai-dev/schema.json +0 -5
- package/test-projects/django-app/.ai-dev/summary.md +0 -15
- package/test-projects/django-app/.ai-dev/symbols.json +0 -1
- package/test-projects/django-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/django-app/README.md +0 -91
- package/test-projects/django-app/blog/__init__.py +0 -0
- package/test-projects/django-app/blog/admin.py +0 -31
- package/test-projects/django-app/blog/models.py +0 -55
- package/test-projects/django-app/blog/serializers.py +0 -69
- package/test-projects/django-app/blog/urls.py +0 -14
- package/test-projects/django-app/blog/views.py +0 -96
- package/test-projects/django-app/django_app/__init__.py +0 -0
- package/test-projects/django-app/django_app/settings.py +0 -90
- package/test-projects/django-app/django_app/urls.py +0 -11
- package/test-projects/django-app/django_app/wsgi.py +0 -9
- package/test-projects/django-app/manage.py +0 -23
- package/test-projects/django-app/requirements.txt +0 -3
- package/test-projects/django-app/users/__init__.py +0 -0
- package/test-projects/django-app/users/admin.py +0 -42
- package/test-projects/django-app/users/models.py +0 -54
- package/test-projects/django-app/users/serializers.py +0 -113
- package/test-projects/django-app/users/urls.py +0 -13
- package/test-projects/django-app/users/views.py +0 -135
- package/test-projects/express-api/.ai-dev/ai_context.md +0 -112
- package/test-projects/express-api/.ai-dev/ai_rules.md +0 -50
- package/test-projects/express-api/.ai-dev/architecture.md +0 -62
- package/test-projects/express-api/.ai-dev/context/features/controllers.json +0 -13
- package/test-projects/express-api/.ai-dev/context/features/services.json +0 -13
- package/test-projects/express-api/.ai-dev/context/flows/auth.json +0 -12
- package/test-projects/express-api/.ai-dev/context/flows/user.json +0 -13
- package/test-projects/express-api/.ai-dev/conventions.md +0 -51
- package/test-projects/express-api/.ai-dev/dependencies.json +0 -54
- package/test-projects/express-api/.ai-dev/entrypoints.md +0 -17
- package/test-projects/express-api/.ai-dev/modules.json +0 -30
- package/test-projects/express-api/.ai-dev/project.json +0 -15
- package/test-projects/express-api/.ai-dev/repo_map.json +0 -100
- package/test-projects/express-api/.ai-dev/repo_map.md +0 -36
- package/test-projects/express-api/.ai-dev/schema.json +0 -5
- package/test-projects/express-api/.ai-dev/summary.md +0 -14
- package/test-projects/express-api/.ai-dev/symbols.json +0 -7
- package/test-projects/express-api/.ai-dev/tech_stack.md +0 -38
- package/test-projects/express-api/.ai-dev/tools.json +0 -10
- package/test-projects/express-api/controllers/authController.js +0 -32
- package/test-projects/express-api/controllers/userController.js +0 -51
- package/test-projects/express-api/index.js +0 -30
- package/test-projects/express-api/middleware/authMiddleware.js +0 -30
- package/test-projects/express-api/models/userRepository.js +0 -25
- package/test-projects/express-api/package.json +0 -18
- package/test-projects/express-api/services/authService.js +0 -17
- package/test-projects/express-api/services/userService.js +0 -28
- package/test-projects/fastapi-app/.ai-dev/ai_context.md +0 -89
- package/test-projects/fastapi-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/fastapi-app/.ai-dev/architecture.md +0 -39
- package/test-projects/fastapi-app/.ai-dev/cache.json +0 -125
- package/test-projects/fastapi-app/.ai-dev/conventions.md +0 -51
- package/test-projects/fastapi-app/.ai-dev/dependencies.json +0 -244
- package/test-projects/fastapi-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/fastapi-app/.ai-dev/files.json +0 -154
- package/test-projects/fastapi-app/.ai-dev/graph/knowledge-graph.json +0 -15
- package/test-projects/fastapi-app/.ai-dev/graph/module-graph.json +0 -78
- package/test-projects/fastapi-app/.ai-dev/graph/symbol-graph.json +0 -1724
- package/test-projects/fastapi-app/.ai-dev/graph/symbol-references.json +0 -51
- package/test-projects/fastapi-app/.ai-dev/index-state.json +0 -217
- package/test-projects/fastapi-app/.ai-dev/modules.json +0 -16
- package/test-projects/fastapi-app/.ai-dev/project.json +0 -9
- package/test-projects/fastapi-app/.ai-dev/repo_map.json +0 -298
- package/test-projects/fastapi-app/.ai-dev/repo_map.md +0 -74
- package/test-projects/fastapi-app/.ai-dev/schema.json +0 -5
- package/test-projects/fastapi-app/.ai-dev/summary.md +0 -12
- package/test-projects/fastapi-app/.ai-dev/symbols.json +0 -1
- package/test-projects/fastapi-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/fastapi-app/.ai-dev/tools.json +0 -10
- package/test-projects/fastapi-app/README.md +0 -118
- package/test-projects/fastapi-app/app/database.py +0 -21
- package/test-projects/fastapi-app/app/dependencies.py +0 -107
- package/test-projects/fastapi-app/app/main.py +0 -47
- package/test-projects/fastapi-app/app/models.py +0 -149
- package/test-projects/fastapi-app/app/routers/auth.py +0 -117
- package/test-projects/fastapi-app/app/routers/posts.py +0 -272
- package/test-projects/fastapi-app/app/schemas.py +0 -191
- package/test-projects/fastapi-app/requirements.txt +0 -10
- package/test-projects/flask-app/.ai-dev/ai_context.md +0 -94
- package/test-projects/flask-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/flask-app/.ai-dev/architecture.md +0 -49
- package/test-projects/flask-app/.ai-dev/cache.json +0 -157
- package/test-projects/flask-app/.ai-dev/context/features/app.json +0 -25
- package/test-projects/flask-app/.ai-dev/context/flows/routes.json +0 -14
- package/test-projects/flask-app/.ai-dev/conventions.md +0 -51
- package/test-projects/flask-app/.ai-dev/dependencies.json +0 -298
- package/test-projects/flask-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/flask-app/.ai-dev/files.json +0 -194
- package/test-projects/flask-app/.ai-dev/graph/knowledge-graph.json +0 -60
- package/test-projects/flask-app/.ai-dev/graph/module-graph.json +0 -95
- package/test-projects/flask-app/.ai-dev/graph/symbol-graph.json +0 -1448
- package/test-projects/flask-app/.ai-dev/graph/symbol-references.json +0 -45
- package/test-projects/flask-app/.ai-dev/index-state.json +0 -273
- package/test-projects/flask-app/.ai-dev/modules.json +0 -21
- package/test-projects/flask-app/.ai-dev/project.json +0 -13
- package/test-projects/flask-app/.ai-dev/repo_map.json +0 -400
- package/test-projects/flask-app/.ai-dev/repo_map.md +0 -98
- package/test-projects/flask-app/.ai-dev/summary.md +0 -13
- package/test-projects/flask-app/.ai-dev/symbols.json +0 -1
- package/test-projects/flask-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/flask-app/.ai-dev/tools.json +0 -10
- package/test-projects/flask-app/README.md +0 -129
- package/test-projects/flask-app/app/__init__.py +0 -46
- package/test-projects/flask-app/app/api/__init__.py +0 -7
- package/test-projects/flask-app/app/api/routes.py +0 -122
- package/test-projects/flask-app/app/auth/__init__.py +0 -7
- package/test-projects/flask-app/app/auth/forms.py +0 -52
- package/test-projects/flask-app/app/auth/routes.py +0 -68
- package/test-projects/flask-app/app/blog/__init__.py +0 -7
- package/test-projects/flask-app/app/blog/forms.py +0 -35
- package/test-projects/flask-app/app/blog/routes.py +0 -140
- package/test-projects/flask-app/app/main/__init__.py +0 -7
- package/test-projects/flask-app/app/main/routes.py +0 -88
- package/test-projects/flask-app/app/models.py +0 -177
- package/test-projects/flask-app/config.py +0 -64
- package/test-projects/flask-app/requirements.txt +0 -10
- package/test-projects/laravel-app/.ai-dev/ai_context.md +0 -97
- package/test-projects/laravel-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/laravel-app/.ai-dev/architecture.md +0 -60
- package/test-projects/laravel-app/.ai-dev/cache.json +0 -161
- package/test-projects/laravel-app/.ai-dev/context/features/app.json +0 -21
- package/test-projects/laravel-app/.ai-dev/context/flows/.json +0 -9
- package/test-projects/laravel-app/.ai-dev/context/flows/category.json +0 -12
- package/test-projects/laravel-app/.ai-dev/context/flows/comment.json +0 -12
- package/test-projects/laravel-app/.ai-dev/context/flows/post.json +0 -12
- package/test-projects/laravel-app/.ai-dev/context/flows/unnamed.json +0 -9
- package/test-projects/laravel-app/.ai-dev/conventions.md +0 -51
- package/test-projects/laravel-app/.ai-dev/dependencies.json +0 -6
- package/test-projects/laravel-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/laravel-app/.ai-dev/files.json +0 -199
- package/test-projects/laravel-app/.ai-dev/graph/knowledge-graph.json +0 -98
- package/test-projects/laravel-app/.ai-dev/graph/module-graph.json +0 -30
- package/test-projects/laravel-app/.ai-dev/graph/symbol-graph.json +0 -5
- package/test-projects/laravel-app/.ai-dev/graph/symbol-references.json +0 -1
- package/test-projects/laravel-app/.ai-dev/index-state.json +0 -280
- package/test-projects/laravel-app/.ai-dev/modules.json +0 -29
- package/test-projects/laravel-app/.ai-dev/project.json +0 -17
- package/test-projects/laravel-app/.ai-dev/repo_map.json +0 -419
- package/test-projects/laravel-app/.ai-dev/repo_map.md +0 -106
- package/test-projects/laravel-app/.ai-dev/schema.json +0 -5
- package/test-projects/laravel-app/.ai-dev/summary.md +0 -15
- package/test-projects/laravel-app/.ai-dev/symbols.json +0 -1
- package/test-projects/laravel-app/.ai-dev/tech_stack.md +0 -34
- package/test-projects/laravel-app/.ai-dev/tools.json +0 -10
- package/test-projects/laravel-app/README.md +0 -107
- package/test-projects/laravel-app/app/Http/Controllers/Api/CategoryController.php +0 -88
- package/test-projects/laravel-app/app/Http/Controllers/Api/CommentController.php +0 -56
- package/test-projects/laravel-app/app/Http/Controllers/Api/PostController.php +0 -174
- package/test-projects/laravel-app/app/Http/Controllers/Controller.php +0 -12
- package/test-projects/laravel-app/app/Models/Category.php +0 -34
- package/test-projects/laravel-app/app/Models/Comment.php +0 -51
- package/test-projects/laravel-app/app/Models/Post.php +0 -108
- package/test-projects/laravel-app/app/Models/User.php +0 -85
- package/test-projects/laravel-app/bootstrap/app.php +0 -25
- package/test-projects/laravel-app/composer.json +0 -35
- package/test-projects/laravel-app/routes/api.php +0 -40
- package/test-projects/nestjs-backend/.ai-dev/ai_context.md +0 -111
- package/test-projects/nestjs-backend/.ai-dev/ai_rules.md +0 -52
- package/test-projects/nestjs-backend/.ai-dev/architecture.md +0 -49
- package/test-projects/nestjs-backend/.ai-dev/cache.json +0 -169
- package/test-projects/nestjs-backend/.ai-dev/context/features/src.json +0 -23
- package/test-projects/nestjs-backend/.ai-dev/context/flows/auth.controller.json +0 -14
- package/test-projects/nestjs-backend/.ai-dev/context/flows/auth.json +0 -10
- package/test-projects/nestjs-backend/.ai-dev/context/flows/users..json +0 -10
- package/test-projects/nestjs-backend/.ai-dev/context/flows/users.controller.json +0 -14
- package/test-projects/nestjs-backend/.ai-dev/context/flows/users.json +0 -10
- package/test-projects/nestjs-backend/.ai-dev/conventions.md +0 -52
- package/test-projects/nestjs-backend/.ai-dev/dependencies.json +0 -152
- package/test-projects/nestjs-backend/.ai-dev/entrypoints.md +0 -18
- package/test-projects/nestjs-backend/.ai-dev/files.json +0 -209
- package/test-projects/nestjs-backend/.ai-dev/graph/knowledge-graph.json +0 -132
- package/test-projects/nestjs-backend/.ai-dev/graph/module-graph.json +0 -29
- package/test-projects/nestjs-backend/.ai-dev/graph/symbol-graph.json +0 -304
- package/test-projects/nestjs-backend/.ai-dev/graph/symbol-references.json +0 -5
- package/test-projects/nestjs-backend/.ai-dev/index-state.json +0 -294
- package/test-projects/nestjs-backend/.ai-dev/modules.json +0 -19
- package/test-projects/nestjs-backend/.ai-dev/project.json +0 -18
- package/test-projects/nestjs-backend/.ai-dev/repo_map.json +0 -427
- package/test-projects/nestjs-backend/.ai-dev/repo_map.md +0 -104
- package/test-projects/nestjs-backend/.ai-dev/schema.json +0 -5
- package/test-projects/nestjs-backend/.ai-dev/summary.md +0 -13
- package/test-projects/nestjs-backend/.ai-dev/symbols.json +0 -1
- package/test-projects/nestjs-backend/.ai-dev/tech_stack.md +0 -38
- package/test-projects/nestjs-backend/.ai-dev/tools.json +0 -10
- package/test-projects/nestjs-backend/package.json +0 -22
- package/test-projects/nestjs-backend/src/app.module.ts +0 -8
- package/test-projects/nestjs-backend/src/auth/auth.controller.ts +0 -22
- package/test-projects/nestjs-backend/src/auth/auth.module.ts +0 -11
- package/test-projects/nestjs-backend/src/auth/auth.service.ts +0 -28
- package/test-projects/nestjs-backend/src/auth/dto/login.dto.ts +0 -4
- package/test-projects/nestjs-backend/src/auth/strategies/jwt.strategy.ts +0 -18
- package/test-projects/nestjs-backend/src/main.ts +0 -9
- package/test-projects/nestjs-backend/src/users/users.controller.ts +0 -32
- package/test-projects/nestjs-backend/src/users/users.module.ts +0 -10
- package/test-projects/nestjs-backend/src/users/users.service.ts +0 -42
- package/test-projects/nestjs-backend/tsconfig.json +0 -21
- package/test-projects/python-cli/.ai-dev/ai_context.md +0 -95
- package/test-projects/python-cli/.ai-dev/ai_rules.md +0 -47
- package/test-projects/python-cli/.ai-dev/architecture.md +0 -55
- package/test-projects/python-cli/.ai-dev/cache.json +0 -149
- package/test-projects/python-cli/.ai-dev/context/features/cli.json +0 -16
- package/test-projects/python-cli/.ai-dev/context/flows/list_.json +0 -9
- package/test-projects/python-cli/.ai-dev/context/flows/remove_.json +0 -9
- package/test-projects/python-cli/.ai-dev/conventions.md +0 -51
- package/test-projects/python-cli/.ai-dev/dependencies.json +0 -66
- package/test-projects/python-cli/.ai-dev/entrypoints.md +0 -4
- package/test-projects/python-cli/.ai-dev/files.json +0 -184
- package/test-projects/python-cli/.ai-dev/graph/knowledge-graph.json +0 -83
- package/test-projects/python-cli/.ai-dev/graph/module-graph.json +0 -31
- package/test-projects/python-cli/.ai-dev/graph/symbol-graph.json +0 -358
- package/test-projects/python-cli/.ai-dev/graph/symbol-references.json +0 -11
- package/test-projects/python-cli/.ai-dev/index-state.json +0 -259
- package/test-projects/python-cli/.ai-dev/modules.json +0 -21
- package/test-projects/python-cli/.ai-dev/project.json +0 -15
- package/test-projects/python-cli/.ai-dev/repo_map.json +0 -367
- package/test-projects/python-cli/.ai-dev/repo_map.md +0 -93
- package/test-projects/python-cli/.ai-dev/schema.json +0 -5
- package/test-projects/python-cli/.ai-dev/summary.md +0 -14
- package/test-projects/python-cli/.ai-dev/symbols.json +0 -1
- package/test-projects/python-cli/.ai-dev/tech_stack.md +0 -32
- package/test-projects/python-cli/.ai-dev/tools.json +0 -10
- package/test-projects/python-cli/__init__.py +0 -1
- package/test-projects/python-cli/cli/__init__.py +0 -1
- package/test-projects/python-cli/cli/add_command.py +0 -6
- package/test-projects/python-cli/cli/list_command.py +0 -7
- package/test-projects/python-cli/cli/remove_command.py +0 -6
- package/test-projects/python-cli/main.py +0 -34
- package/test-projects/python-cli/models/__init__.py +0 -2
- package/test-projects/python-cli/models/task.py +0 -19
- package/test-projects/python-cli/models/task_repository.py +0 -44
- package/test-projects/rails-app/.ai-dev/ai_context.md +0 -94
- package/test-projects/rails-app/.ai-dev/ai_rules.md +0 -47
- package/test-projects/rails-app/.ai-dev/architecture.md +0 -49
- package/test-projects/rails-app/.ai-dev/cache.json +0 -193
- package/test-projects/rails-app/.ai-dev/context/features/app.json +0 -24
- package/test-projects/rails-app/.ai-dev/context/features/config.json +0 -13
- package/test-projects/rails-app/.ai-dev/context/flows/application.json +0 -9
- package/test-projects/rails-app/.ai-dev/context/flows/application_.json +0 -9
- package/test-projects/rails-app/.ai-dev/context/flows/comments.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/comments_.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/posts.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/posts_.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/routes.json +0 -9
- package/test-projects/rails-app/.ai-dev/context/flows/users.json +0 -11
- package/test-projects/rails-app/.ai-dev/context/flows/users_.json +0 -11
- package/test-projects/rails-app/.ai-dev/conventions.md +0 -51
- package/test-projects/rails-app/.ai-dev/dependencies.json +0 -6
- package/test-projects/rails-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/rails-app/.ai-dev/files.json +0 -239
- package/test-projects/rails-app/.ai-dev/graph/knowledge-graph.json +0 -130
- package/test-projects/rails-app/.ai-dev/graph/module-graph.json +0 -27
- package/test-projects/rails-app/.ai-dev/graph/symbol-graph.json +0 -5
- package/test-projects/rails-app/.ai-dev/graph/symbol-references.json +0 -1
- package/test-projects/rails-app/.ai-dev/index-state.json +0 -336
- package/test-projects/rails-app/.ai-dev/modules.json +0 -26
- package/test-projects/rails-app/.ai-dev/project.json +0 -22
- package/test-projects/rails-app/.ai-dev/repo_map.json +0 -486
- package/test-projects/rails-app/.ai-dev/repo_map.md +0 -117
- package/test-projects/rails-app/.ai-dev/schema.json +0 -5
- package/test-projects/rails-app/.ai-dev/summary.md +0 -13
- package/test-projects/rails-app/.ai-dev/symbols.json +0 -1
- package/test-projects/rails-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/rails-app/.ai-dev/tools.json +0 -10
- package/test-projects/rails-app/Gemfile +0 -38
- package/test-projects/rails-app/README.md +0 -140
- package/test-projects/rails-app/Rakefile +0 -8
- package/test-projects/rails-app/app/controllers/api/comments_controller.rb +0 -75
- package/test-projects/rails-app/app/controllers/api/posts_controller.rb +0 -68
- package/test-projects/rails-app/app/controllers/api/users_controller.rb +0 -54
- package/test-projects/rails-app/app/controllers/application_controller.rb +0 -31
- package/test-projects/rails-app/app/models/comment.rb +0 -34
- package/test-projects/rails-app/app/models/post.rb +0 -36
- package/test-projects/rails-app/app/models/user.rb +0 -28
- package/test-projects/rails-app/app/services/post_service.rb +0 -92
- package/test-projects/rails-app/app/services/user_service.rb +0 -76
- package/test-projects/rails-app/config/application.rb +0 -27
- package/test-projects/rails-app/config/environment.rb +0 -7
- package/test-projects/rails-app/config/routes.rb +0 -15
- package/test-projects/react-app/.ai-dev/ai_context.md +0 -96
- package/test-projects/react-app/.ai-dev/architecture.md +0 -39
- package/test-projects/react-app/.ai-dev/cache.json +0 -153
- package/test-projects/react-app/.ai-dev/context/features/src.json +0 -18
- package/test-projects/react-app/.ai-dev/context/flows/UsersPage.json +0 -14
- package/test-projects/react-app/.ai-dev/context/flows/dashboard.json +0 -9
- package/test-projects/react-app/.ai-dev/context/flows/login.json +0 -9
- package/test-projects/react-app/.ai-dev/context/flows/users.json +0 -9
- package/test-projects/react-app/.ai-dev/dependencies.json +0 -128
- package/test-projects/react-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/react-app/.ai-dev/files.json +0 -189
- package/test-projects/react-app/.ai-dev/graph/knowledge-graph.json +0 -112
- package/test-projects/react-app/.ai-dev/graph/module-graph.json +0 -31
- package/test-projects/react-app/.ai-dev/graph/symbol-graph.json +0 -868
- package/test-projects/react-app/.ai-dev/graph/symbol-references.json +0 -31
- package/test-projects/react-app/.ai-dev/index-state.json +0 -266
- package/test-projects/react-app/.ai-dev/modules.json +0 -17
- package/test-projects/react-app/.ai-dev/project.json +0 -16
- package/test-projects/react-app/.ai-dev/repo_map.json +0 -391
- package/test-projects/react-app/.ai-dev/repo_map.md +0 -94
- package/test-projects/react-app/.ai-dev/schema.json +0 -5
- package/test-projects/react-app/.ai-dev/summary.md +0 -13
- package/test-projects/react-app/.ai-dev/symbols.json +0 -1
- package/test-projects/react-app/.ai-dev/tools.json +0 -10
- package/test-projects/react-app/package.json +0 -16
- package/test-projects/react-app/src/App.tsx +0 -21
- package/test-projects/react-app/src/context/AuthContext.tsx +0 -41
- package/test-projects/react-app/src/hooks/useAuth.ts +0 -10
- package/test-projects/react-app/src/main.tsx +0 -10
- package/test-projects/react-app/src/pages/DashboardPage.tsx +0 -17
- package/test-projects/react-app/src/pages/LoginPage.tsx +0 -41
- package/test-projects/react-app/src/pages/UsersPage.tsx +0 -36
- package/test-projects/react-app/src/services/userService.ts +0 -37
- package/test-projects/salesforce-cli/.ai-dev/ai_context.md +0 -89
- package/test-projects/salesforce-cli/.ai-dev/ai_rules.md +0 -47
- package/test-projects/salesforce-cli/.ai-dev/architecture.md +0 -39
- package/test-projects/salesforce-cli/.ai-dev/cache.json +0 -125
- package/test-projects/salesforce-cli/.ai-dev/context/features/force-app.json +0 -14
- package/test-projects/salesforce-cli/.ai-dev/context/flows/account.json +0 -9
- package/test-projects/salesforce-cli/.ai-dev/context/flows/opportunity.json +0 -9
- package/test-projects/salesforce-cli/.ai-dev/conventions.md +0 -51
- package/test-projects/salesforce-cli/.ai-dev/dependencies.json +0 -6
- package/test-projects/salesforce-cli/.ai-dev/entrypoints.md +0 -4
- package/test-projects/salesforce-cli/.ai-dev/files.json +0 -154
- package/test-projects/salesforce-cli/.ai-dev/graph/knowledge-graph.json +0 -64
- package/test-projects/salesforce-cli/.ai-dev/graph/module-graph.json +0 -13
- package/test-projects/salesforce-cli/.ai-dev/graph/symbol-graph.json +0 -148
- package/test-projects/salesforce-cli/.ai-dev/graph/symbol-references.json +0 -1
- package/test-projects/salesforce-cli/.ai-dev/index-state.json +0 -217
- package/test-projects/salesforce-cli/.ai-dev/modules.json +0 -12
- package/test-projects/salesforce-cli/.ai-dev/project.json +0 -14
- package/test-projects/salesforce-cli/.ai-dev/repo_map.json +0 -328
- package/test-projects/salesforce-cli/.ai-dev/repo_map.md +0 -80
- package/test-projects/salesforce-cli/.ai-dev/schema.json +0 -5
- package/test-projects/salesforce-cli/.ai-dev/summary.md +0 -13
- package/test-projects/salesforce-cli/.ai-dev/symbols.json +0 -1
- package/test-projects/salesforce-cli/.ai-dev/tech_stack.md +0 -31
- package/test-projects/salesforce-cli/.ai-dev/tools.json +0 -10
- package/test-projects/salesforce-cli/.forceignore +0 -27
- package/test-projects/salesforce-cli/force-app/main/default/classes/AccountController.cls +0 -24
- package/test-projects/salesforce-cli/force-app/main/default/classes/OpportunityController.cls +0 -25
- package/test-projects/salesforce-cli/force-app/main/default/objects/Project__c.object.xml +0 -45
- package/test-projects/salesforce-cli/force-app/main/default/triggers/AccountTrigger.trigger +0 -33
- package/test-projects/salesforce-cli/sfdx-project.json +0 -11
- package/test-projects/spring-boot-app/.ai-dev/ai_context.md +0 -91
- package/test-projects/spring-boot-app/.ai-dev/ai_rules.md +0 -48
- package/test-projects/spring-boot-app/.ai-dev/architecture.md +0 -39
- package/test-projects/spring-boot-app/.ai-dev/cache.json +0 -173
- package/test-projects/spring-boot-app/.ai-dev/context/features/src.json +0 -26
- package/test-projects/spring-boot-app/.ai-dev/context/flows/PostController.json +0 -19
- package/test-projects/spring-boot-app/.ai-dev/context/flows/UserController.json +0 -19
- package/test-projects/spring-boot-app/.ai-dev/context/flows/comment.json +0 -11
- package/test-projects/spring-boot-app/.ai-dev/context/flows/post.json +0 -14
- package/test-projects/spring-boot-app/.ai-dev/context/flows/user.json +0 -14
- package/test-projects/spring-boot-app/.ai-dev/conventions.md +0 -52
- package/test-projects/spring-boot-app/.ai-dev/dependencies.json +0 -326
- package/test-projects/spring-boot-app/.ai-dev/entrypoints.md +0 -4
- package/test-projects/spring-boot-app/.ai-dev/files.json +0 -214
- package/test-projects/spring-boot-app/.ai-dev/graph/knowledge-graph.json +0 -231
- package/test-projects/spring-boot-app/.ai-dev/graph/module-graph.json +0 -22
- package/test-projects/spring-boot-app/.ai-dev/graph/symbol-graph.json +0 -794
- package/test-projects/spring-boot-app/.ai-dev/graph/symbol-references.json +0 -70
- package/test-projects/spring-boot-app/.ai-dev/index-state.json +0 -301
- package/test-projects/spring-boot-app/.ai-dev/modules.json +0 -21
- package/test-projects/spring-boot-app/.ai-dev/project.json +0 -17
- package/test-projects/spring-boot-app/.ai-dev/repo_map.json +0 -461
- package/test-projects/spring-boot-app/.ai-dev/repo_map.md +0 -109
- package/test-projects/spring-boot-app/.ai-dev/schema.json +0 -5
- package/test-projects/spring-boot-app/.ai-dev/summary.md +0 -12
- package/test-projects/spring-boot-app/.ai-dev/symbols.json +0 -1
- package/test-projects/spring-boot-app/.ai-dev/tech_stack.md +0 -32
- package/test-projects/spring-boot-app/.ai-dev/tools.json +0 -10
- package/test-projects/spring-boot-app/.classpath +0 -57
- package/test-projects/spring-boot-app/.factorypath +0 -69
- package/test-projects/spring-boot-app/.project +0 -34
- package/test-projects/spring-boot-app/.settings/org.eclipse.core.resources.prefs +0 -4
- package/test-projects/spring-boot-app/.settings/org.eclipse.jdt.apt.core.prefs +0 -4
- package/test-projects/spring-boot-app/.settings/org.eclipse.jdt.core.prefs +0 -10
- package/test-projects/spring-boot-app/.settings/org.eclipse.m2e.core.prefs +0 -4
- package/test-projects/spring-boot-app/README.md +0 -122
- package/test-projects/spring-boot-app/pom.xml +0 -79
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/DemoApplication.java +0 -12
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/CommentController.java +0 -89
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/PostController.java +0 -92
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/controllers/UserController.java +0 -84
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/Comment.java +0 -38
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/Post.java +0 -56
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/models/User.java +0 -44
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/CommentRepository.java +0 -21
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/PostRepository.java +0 -18
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/repositories/UserRepository.java +0 -15
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/services/PostService.java +0 -83
- package/test-projects/spring-boot-app/src/main/java/com/example/demo/services/UserService.java +0 -62
- package/test-projects/spring-boot-app/src/main/resources/application.properties +0 -22
- package/test-projects/spring-boot-app/target/classes/com/example/demo/DemoApplication.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController$CommentCreateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController$CommentUpdateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/CommentController.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController$PostCreateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController$PostUpdateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/PostController.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController$UserCreateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController$UserUpdateRequest.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/controllers/UserController.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/models/Comment.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/models/Post.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/models/User.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/CommentRepository.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/PostRepository.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/repositories/UserRepository.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/services/PostService.class +0 -0
- package/test-projects/spring-boot-app/target/classes/com/example/demo/services/UserService.class +0 -0
- package/tests/e2e/run-e2e.sh +0 -88
- /package/{test-projects/django-app/.ai-dev → ai-context}/tools.json +0 -0
|
@@ -20,6 +20,14 @@ export interface TechStack {
|
|
|
20
20
|
gradleVersion?: string;
|
|
21
21
|
kotlinVersion?: string;
|
|
22
22
|
};
|
|
23
|
+
salesforce?: {
|
|
24
|
+
apiVersion?: string;
|
|
25
|
+
packageDirectories?: string[];
|
|
26
|
+
namespace?: string;
|
|
27
|
+
sObjects?: string[];
|
|
28
|
+
apexClasses?: number;
|
|
29
|
+
triggers?: number;
|
|
30
|
+
};
|
|
23
31
|
}
|
|
24
32
|
|
|
25
33
|
/**
|
|
@@ -43,6 +51,7 @@ export function detectTechStack(files: FileInfo[], rootDir: string): TechStack {
|
|
|
43
51
|
);
|
|
44
52
|
|
|
45
53
|
const android = detectAndroidSDK(files, rootDir);
|
|
54
|
+
const salesforce = detectSalesforceInfo(files, rootDir);
|
|
46
55
|
|
|
47
56
|
return {
|
|
48
57
|
languages,
|
|
@@ -55,6 +64,7 @@ export function detectTechStack(files: FileInfo[], rootDir: string): TechStack {
|
|
|
55
64
|
formatters,
|
|
56
65
|
description,
|
|
57
66
|
android,
|
|
67
|
+
salesforce,
|
|
58
68
|
};
|
|
59
69
|
}
|
|
60
70
|
|
|
@@ -71,6 +81,7 @@ function detectLanguages(extensions: Set<string>): string[] {
|
|
|
71
81
|
yaml: "YAML", yml: "YAML", toml: "TOML", xml: "XML", json: "JSON",
|
|
72
82
|
md: "Markdown", tex: "LaTeX", r: "R", lua: "Lua", pl: "Perl",
|
|
73
83
|
hs: "Haskell", ex: "Elixir", erl: "Erlang", clj: "Clojure", dart: "Dart",
|
|
84
|
+
cls: "Apex", trigger: "Apex Trigger",
|
|
74
85
|
};
|
|
75
86
|
|
|
76
87
|
const detected: string[] = [];
|
|
@@ -142,6 +153,8 @@ function detectFrameworks(files: FileInfo[], fileNames: Set<string>, rootDir: st
|
|
|
142
153
|
"build.gradle.kts": "Android",
|
|
143
154
|
"settings.gradle": "Android",
|
|
144
155
|
"AndroidManifest.xml": "Android",
|
|
156
|
+
"sfdx-project.json": "Salesforce DX",
|
|
157
|
+
"force-app": "Salesforce",
|
|
145
158
|
};
|
|
146
159
|
|
|
147
160
|
for (const [indicator, framework] of Object.entries(frameworkIndicators)) {
|
|
@@ -152,6 +165,23 @@ function detectFrameworks(files: FileInfo[], fileNames: Set<string>, rootDir: st
|
|
|
152
165
|
}
|
|
153
166
|
}
|
|
154
167
|
|
|
168
|
+
// Detect SwiftUI from Swift files
|
|
169
|
+
const swiftFiles = files.filter(f => f.extension === "swift");
|
|
170
|
+
for (const swiftFile of swiftFiles) {
|
|
171
|
+
try {
|
|
172
|
+
const content = readFile(path.join(rootDir, swiftFile.relativePath));
|
|
173
|
+
if (content.includes("import SwiftUI")) {
|
|
174
|
+
if (!frameworks.includes("SwiftUI")) {
|
|
175
|
+
frameworks.push("SwiftUI");
|
|
176
|
+
}
|
|
177
|
+
if (!frameworks.includes("iOS")) {
|
|
178
|
+
frameworks.push("iOS");
|
|
179
|
+
}
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
} catch {}
|
|
183
|
+
}
|
|
184
|
+
|
|
155
185
|
return [...new Set(frameworks)];
|
|
156
186
|
}
|
|
157
187
|
|
|
@@ -586,6 +616,55 @@ function detectLibraries(files: FileInfo[], rootDir: string): string[] {
|
|
|
586
616
|
return [...new Set(libraries)];
|
|
587
617
|
}
|
|
588
618
|
|
|
619
|
+
/**
|
|
620
|
+
* Detect Salesforce project information
|
|
621
|
+
*/
|
|
622
|
+
function detectSalesforceInfo(files: FileInfo[], rootDir: string): TechStack["salesforce"] {
|
|
623
|
+
const sfdxPath = path.join(rootDir, "sfdx-project.json");
|
|
624
|
+
|
|
625
|
+
if (!fs.existsSync(sfdxPath)) {
|
|
626
|
+
return undefined;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
try {
|
|
630
|
+
const sfdxConfig = readJsonFile(sfdxPath) as {
|
|
631
|
+
sourceApiVersion?: string;
|
|
632
|
+
packageDirectories?: Array<{ path: string; default?: boolean }>;
|
|
633
|
+
namespace?: string;
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
// Count Apex files
|
|
637
|
+
const apexFiles = files.filter(f => f.extension === "cls" || f.extension === "trigger");
|
|
638
|
+
const apexClasses = files.filter(f => f.extension === "cls").length;
|
|
639
|
+
const triggers = files.filter(f => f.extension === "trigger").length;
|
|
640
|
+
|
|
641
|
+
// Detect SObjects from trigger files
|
|
642
|
+
const sObjects = new Set<string>();
|
|
643
|
+
for (const file of files) {
|
|
644
|
+
if (file.extension === "trigger") {
|
|
645
|
+
try {
|
|
646
|
+
const content = readFile(file.path);
|
|
647
|
+
const match = content.match(/trigger\s+\w+\s+on\s+(\w+)/i);
|
|
648
|
+
if (match) {
|
|
649
|
+
sObjects.add(match[1]);
|
|
650
|
+
}
|
|
651
|
+
} catch {}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
return {
|
|
656
|
+
apiVersion: sfdxConfig.sourceApiVersion,
|
|
657
|
+
packageDirectories: sfdxConfig.packageDirectories?.map(p => p.path),
|
|
658
|
+
namespace: sfdxConfig.namespace,
|
|
659
|
+
sObjects: Array.from(sObjects),
|
|
660
|
+
apexClasses,
|
|
661
|
+
triggers,
|
|
662
|
+
};
|
|
663
|
+
} catch {
|
|
664
|
+
return undefined;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
|
|
589
668
|
/**
|
|
590
669
|
* Generate tech_stack.md content
|
|
591
670
|
*/
|
|
@@ -601,6 +680,20 @@ export function generateTechStackFile(stack: TechStack): string {
|
|
|
601
680
|
content += "## Testing\n" + (stack.testing.map(t => `- ${t}`).join("\n") || "- None detected") + "\n\n";
|
|
602
681
|
content += "## Linters\n" + (stack.linters.map(l => `- ${l}`).join("\n") || "- None detected") + "\n\n";
|
|
603
682
|
content += "## Formatters\n" + (stack.formatters.map(f => `- ${f}`).join("\n") || "- None detected") + "\n\n";
|
|
683
|
+
|
|
684
|
+
// Add Salesforce section if applicable
|
|
685
|
+
if (stack.salesforce) {
|
|
686
|
+
content += "## Salesforce\n";
|
|
687
|
+
content += `- **API Version**: ${stack.salesforce.apiVersion || "N/A"}\n`;
|
|
688
|
+
content += `- **Apex Classes**: ${stack.salesforce.apexClasses}\n`;
|
|
689
|
+
content += `- **Triggers**: ${stack.salesforce.triggers}\n`;
|
|
690
|
+
content += `- **SObjects**: ${stack.salesforce.sObjects?.join(", ") || "N/A"}\n`;
|
|
691
|
+
if (stack.salesforce.namespace) {
|
|
692
|
+
content += `- **Namespace**: ${stack.salesforce.namespace}\n`;
|
|
693
|
+
}
|
|
694
|
+
content += "\n";
|
|
695
|
+
}
|
|
696
|
+
|
|
604
697
|
content += "---\n*Generated by ai-first*\n";
|
|
605
698
|
|
|
606
699
|
return content;
|
package/test_adapters.mjs
CHANGED
|
@@ -3,17 +3,17 @@ import fs from "fs";
|
|
|
3
3
|
import path from "path";
|
|
4
4
|
|
|
5
5
|
const projects = [
|
|
6
|
-
{ name: "Django", path: "test-projects/django-app", ext: "
|
|
7
|
-
{ name: "Laravel", path: "test-projects/laravel-app", ext: "
|
|
8
|
-
{ name: "FastAPI", path: "test-projects/fastapi-app", ext: "
|
|
9
|
-
{ name: "Flask", path: "test-projects/flask-app", ext: "
|
|
10
|
-
{ name: "Rails", path: "test-projects/rails-app", ext: "
|
|
11
|
-
{ name: "Spring Boot", path: "test-projects/spring-boot-app", ext: "
|
|
12
|
-
{ name: "NestJS", path: "test-projects/nestjs-backend", ext: "
|
|
13
|
-
{ name: "Express", path: "test-projects/express-api", ext: "
|
|
14
|
-
{ name: "React", path: "test-projects/react-app", ext: "
|
|
15
|
-
{ name: "Salesforce", path: "test-projects/salesforce-cli", ext: "
|
|
16
|
-
{ name: "Python CLI", path: "test-projects/python-cli", ext: "
|
|
6
|
+
{ name: "Django", path: "test-projects/django-app", ext: "py", sampleFile: "blog/models.py" },
|
|
7
|
+
{ name: "Laravel", path: "test-projects/laravel-app", ext: "php", sampleFile: "app/Http/Controllers/Controller.php" },
|
|
8
|
+
{ name: "FastAPI", path: "test-projects/fastapi-app", ext: "py", sampleFile: "app/main.py" },
|
|
9
|
+
{ name: "Flask", path: "test-projects/flask-app", ext: "py", sampleFile: "app/models.py" },
|
|
10
|
+
{ name: "Rails", path: "test-projects/rails-app", ext: "rb", sampleFile: "app/models/user.rb" },
|
|
11
|
+
{ name: "Spring Boot", path: "test-projects/spring-boot-app", ext: "java", sampleFile: "src/main/java/com/example/demo/DemoApplication.java" },
|
|
12
|
+
{ name: "NestJS", path: "test-projects/nestjs-backend", ext: "ts", sampleFile: "src/main.ts" },
|
|
13
|
+
{ name: "Express", path: "test-projects/express-api", ext: "js", sampleFile: "index.js" },
|
|
14
|
+
{ name: "React", path: "test-projects/react-app", ext: "tsx", sampleFile: "src/App.tsx" },
|
|
15
|
+
{ name: "Salesforce", path: "test-projects/salesforce-cli", ext: "cls", sampleFile: "force-app/main/default/classes/AccountController.cls" },
|
|
16
|
+
{ name: "Python CLI", path: "test-projects/python-cli", ext: "py", sampleFile: "main.py" },
|
|
17
17
|
];
|
|
18
18
|
|
|
19
19
|
console.log("=== ADAPTER SYMBOL EXTRACTION TESTS ===\n");
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { describe, it, expect, beforeAll, afterAll } from "vitest";
|
|
2
|
+
import { extractSymbols } from "../src/analyzers/symbols";
|
|
3
|
+
import { FileInfo } from "../src/core/repoScanner";
|
|
4
|
+
import fs from "fs";
|
|
5
|
+
import path from "path";
|
|
6
|
+
import os from "os";
|
|
7
|
+
|
|
8
|
+
describe("Apex Parser", () => {
|
|
9
|
+
let tempDir: string;
|
|
10
|
+
|
|
11
|
+
beforeAll(() => {
|
|
12
|
+
tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "apex-test-"));
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
afterAll(() => {
|
|
16
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const createFileInfo = (filePath: string, extension: string, content: string): FileInfo => {
|
|
20
|
+
const fullPath = path.join(tempDir, filePath);
|
|
21
|
+
fs.mkdirSync(path.dirname(fullPath), { recursive: true });
|
|
22
|
+
fs.writeFileSync(fullPath, content);
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
path: fullPath,
|
|
26
|
+
relativePath: filePath,
|
|
27
|
+
extension,
|
|
28
|
+
name: filePath.split("/").pop()?.replace(`.${extension}`, "") || "",
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
describe("Class parsing", () => {
|
|
33
|
+
it("should parse public class", () => {
|
|
34
|
+
const content = `public class AccountController {
|
|
35
|
+
public static List getAccounts() {
|
|
36
|
+
return [SELECT Id, Name FROM Account];
|
|
37
|
+
}
|
|
38
|
+
}`;
|
|
39
|
+
const file = createFileInfo("force-app/main/default/classes/AccountController.cls", "cls", content);
|
|
40
|
+
const result = extractSymbols([file]);
|
|
41
|
+
|
|
42
|
+
expect(result.symbols.length).toBeGreaterThanOrEqual(1);
|
|
43
|
+
const classSymbol = result.symbols.find(s => s.type === "class");
|
|
44
|
+
expect(classSymbol).toBeDefined();
|
|
45
|
+
expect(classSymbol?.name).toBe("AccountController");
|
|
46
|
+
expect(classSymbol?.export).toBe(true);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("should parse class with sharing", () => {
|
|
50
|
+
const content = `public with sharing class ContactService {
|
|
51
|
+
public static void updateContact(Contact c) {
|
|
52
|
+
update c;
|
|
53
|
+
}
|
|
54
|
+
}`;
|
|
55
|
+
const file = createFileInfo("ContactService.cls", "cls", content);
|
|
56
|
+
const result = extractSymbols([file]);
|
|
57
|
+
|
|
58
|
+
expect(result.symbols[0].name).toBe("ContactService");
|
|
59
|
+
expect(result.symbols[0].type).toBe("class");
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("should parse class without sharing", () => {
|
|
63
|
+
const content = `public without sharing class AdminController {
|
|
64
|
+
public static void deleteAll() {
|
|
65
|
+
delete [SELECT Id FROM Account];
|
|
66
|
+
}
|
|
67
|
+
}`;
|
|
68
|
+
const file = createFileInfo("AdminController.cls", "cls", content);
|
|
69
|
+
const result = extractSymbols([file]);
|
|
70
|
+
|
|
71
|
+
expect(result.symbols[0].name).toBe("AdminController");
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("should parse inherited sharing class", () => {
|
|
75
|
+
const content = `public inherited sharing class BaseService {
|
|
76
|
+
public virtual void process() {}
|
|
77
|
+
}`;
|
|
78
|
+
const file = createFileInfo("BaseService.cls", "cls", content);
|
|
79
|
+
const result = extractSymbols([file]);
|
|
80
|
+
|
|
81
|
+
expect(result.symbols[0].name).toBe("BaseService");
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
describe("Interface parsing", () => {
|
|
86
|
+
it("should parse public interface", () => {
|
|
87
|
+
const content = `public interface IAccountService {
|
|
88
|
+
Account getAccountById(Id accountId);
|
|
89
|
+
void updateAccount(Account acc);
|
|
90
|
+
}`;
|
|
91
|
+
const file = createFileInfo("IAccountService.cls", "cls", content);
|
|
92
|
+
const result = extractSymbols([file]);
|
|
93
|
+
|
|
94
|
+
expect(result.symbols[0].name).toBe("IAccountService");
|
|
95
|
+
expect(result.symbols[0].type).toBe("interface");
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
describe("Method parsing", () => {
|
|
100
|
+
it("should parse public static methods", () => {
|
|
101
|
+
const content = `public class Utils {
|
|
102
|
+
public static String formatPhone(String phone) {
|
|
103
|
+
return phone.replaceAll('[^0-9]', '');
|
|
104
|
+
}
|
|
105
|
+
}`;
|
|
106
|
+
const file = createFileInfo("Utils.cls", "cls", content);
|
|
107
|
+
const result = extractSymbols([file]);
|
|
108
|
+
|
|
109
|
+
const method = result.symbols.find(s => s.name === "formatPhone");
|
|
110
|
+
expect(method).toBeDefined();
|
|
111
|
+
expect(method?.type).toBe("function");
|
|
112
|
+
expect(method?.export).toBe(true);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("should parse @AuraEnabled methods", () => {
|
|
116
|
+
const content = `public class AccountController {
|
|
117
|
+
@AuraEnabled
|
|
118
|
+
public static List getAccounts() {
|
|
119
|
+
return [SELECT Id, Name FROM Account];
|
|
120
|
+
}
|
|
121
|
+
}`;
|
|
122
|
+
const file = createFileInfo("AccountController.cls", "cls", content);
|
|
123
|
+
const result = extractSymbols([file]);
|
|
124
|
+
|
|
125
|
+
const method = result.symbols.find(s => s.name === "getAccounts");
|
|
126
|
+
expect(method).toBeDefined();
|
|
127
|
+
expect(method?.export).toBe(true);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it("should parse webservice methods", () => {
|
|
131
|
+
const content = `global class WebServiceAPI {
|
|
132
|
+
public static String createAccount(String name) {
|
|
133
|
+
Account acc = new Account(Name = name);
|
|
134
|
+
insert acc;
|
|
135
|
+
return acc.Id;
|
|
136
|
+
}
|
|
137
|
+
}`;
|
|
138
|
+
const file = createFileInfo("WebServiceAPI.cls", "cls", content);
|
|
139
|
+
const result = extractSymbols([file]);
|
|
140
|
+
|
|
141
|
+
const method = result.symbols.find(s => s.name === "createAccount");
|
|
142
|
+
expect(method).toBeDefined();
|
|
143
|
+
expect(method?.export).toBe(true);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
describe("Trigger parsing", () => {
|
|
148
|
+
it("should parse trigger", () => {
|
|
149
|
+
const content = `trigger AccountTrigger on Account (before insert, before update) {
|
|
150
|
+
for(Account acc : Trigger.new) {
|
|
151
|
+
acc.Name = acc.Name.toUpperCase();
|
|
152
|
+
}
|
|
153
|
+
}`;
|
|
154
|
+
const file = createFileInfo("AccountTrigger.trigger", "trigger", content);
|
|
155
|
+
const result = extractSymbols([file]);
|
|
156
|
+
|
|
157
|
+
expect(result.symbols[0].name).toBe("AccountTrigger");
|
|
158
|
+
expect(result.symbols[0].type).toBe("function");
|
|
159
|
+
expect(result.symbols[0].export).toBe(true);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
it("should parse trigger with multiple events", () => {
|
|
163
|
+
const content = `trigger ContactTrigger on Contact (before insert, before update, after insert, after update, before delete, after delete) {
|
|
164
|
+
ContactTriggerHandler.handle(Trigger.operationType);
|
|
165
|
+
}`;
|
|
166
|
+
const file = createFileInfo("ContactTrigger.trigger", "trigger", content);
|
|
167
|
+
const result = extractSymbols([file]);
|
|
168
|
+
|
|
169
|
+
expect(result.symbols[0].name).toBe("ContactTrigger");
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
describe("Salesforce TechStack Detection", () => {
|
|
174
|
+
it("should detect Apex language", () => {
|
|
175
|
+
const files: FileInfo[] = [
|
|
176
|
+
createFileInfo("AccountController.cls", "cls", ""),
|
|
177
|
+
createFileInfo("ContactService.cls", "cls", ""),
|
|
178
|
+
];
|
|
179
|
+
|
|
180
|
+
// This would be tested via detectTechStack, but we verify the extension mapping
|
|
181
|
+
expect(files[0].extension).toBe("cls");
|
|
182
|
+
expect(files[1].extension).toBe("cls");
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it("should detect trigger files", () => {
|
|
186
|
+
const files: FileInfo[] = [
|
|
187
|
+
createFileInfo("AccountTrigger.trigger", "trigger", ""),
|
|
188
|
+
];
|
|
189
|
+
|
|
190
|
+
expect(files[0].extension).toBe("trigger");
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
});
|