ai-first-cli 1.1.2 → 1.1.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/ANALISIS_MEJORAS.md +327 -0
- package/BUGS.md +455 -0
- package/CHANGELOG.md +100 -225
- package/TEST_RESULTS.md +198 -0
- package/TEST_RESULTS_COMPARATIVE.md +159 -0
- package/TEST_RESULTS_COMPLETE.md +127 -0
- package/TEST_RESULTS_COMPREHENSIVE.md +208 -0
- package/ai/ai_context.md +17 -10
- package/ai/ai_rules.md +5 -3
- package/ai/architecture.md +28 -7
- package/ai/cache.json +832 -52
- package/ai/context/features/commands.json +18 -0
- package/ai/context/features/src.json +61 -0
- package/ai/context/features/test-projects.json +56 -0
- package/ai/context/flows/account.json +9 -0
- package/ai/context/flows/add_.json +9 -0
- package/ai/context/flows/ai-first.json +9 -0
- package/ai/context/flows/auth..json +10 -0
- package/ai/context/flows/auth.json +12 -0
- package/ai/context/flows/dashboard.json +9 -0
- package/ai/context/flows/doctor.json +9 -0
- package/ai/context/flows/explore.json +9 -0
- package/ai/context/flows/list_.json +9 -0
- package/ai/context/flows/login.json +9 -0
- package/ai/context/flows/opportunity.json +9 -0
- package/ai/context/flows/remove_.json +9 -0
- package/ai/context/flows/user.json +14 -0
- package/ai/context/flows/users..json +10 -0
- package/ai/context/flows/users.json +9 -0
- package/ai/conventions.md +3 -2
- package/ai/dependencies.json +429 -251
- package/ai/entrypoints.md +10 -0
- package/ai/files.json +822 -46
- package/ai/git/commit-activity.json +126 -39
- package/ai/git/recent-features.json +3 -1
- package/ai/git/recent-files.json +6 -6
- package/ai/git/recent-flows.json +3 -1
- package/ai/graph/knowledge-graph.json +954 -182
- package/ai/graph/module-graph.json +270 -0
- package/ai/graph/symbol-graph.json +48991 -16523
- package/ai/graph/symbol-references.json +953 -56
- package/ai/hierarchy.json +3 -24
- package/ai/index-state.json +1261 -253
- package/ai/index.db +0 -0
- package/ai/modules.json +226 -0
- package/ai/project.json +29 -0
- package/ai/repo-map.json +2284 -250
- package/ai/repo_map.json +2731 -231
- package/ai/repo_map.md +559 -2
- package/ai/schema.json +5 -0
- package/ai/summary.md +16 -7
- package/ai/tech_stack.md +4 -1
- package/ai/tools.json +10 -0
- package/dist/analyzers/dependencies.d.ts.map +1 -1
- package/dist/analyzers/dependencies.js +8 -16
- package/dist/analyzers/dependencies.js.map +1 -1
- package/dist/analyzers/symbols.d.ts.map +1 -1
- package/dist/analyzers/symbols.js +60 -0
- package/dist/analyzers/symbols.js.map +1 -1
- package/dist/commands/ai-first.d.ts +1 -0
- package/dist/commands/ai-first.d.ts.map +1 -1
- package/dist/commands/ai-first.js +29 -6
- package/dist/commands/ai-first.js.map +1 -1
- package/dist/core/semanticContexts.d.ts.map +1 -1
- package/dist/core/semanticContexts.js +48 -26
- package/dist/core/semanticContexts.js.map +1 -1
- package/dist/core/symbolGraph.d.ts.map +1 -1
- package/dist/core/symbolGraph.js +14 -2
- package/dist/core/symbolGraph.js.map +1 -1
- package/dist/utils/fileUtils.d.ts.map +1 -1
- package/dist/utils/fileUtils.js +5 -0
- package/dist/utils/fileUtils.js.map +1 -1
- package/package.json +2 -2
- package/src/analyzers/dependencies.ts +10 -20
- package/src/analyzers/symbols.ts +64 -0
- package/src/commands/ai-first.ts +32 -8
- package/src/core/semanticContexts.ts +54 -29
- package/src/core/symbolGraph.ts +16 -2
- package/src/utils/fileUtils.ts +5 -0
- package/test-projects/express-api/ai/ai_context.md +112 -0
- package/test-projects/express-api/ai/ai_rules.md +50 -0
- package/test-projects/express-api/ai/architecture.md +62 -0
- package/test-projects/express-api/ai/cache.json +125 -0
- package/test-projects/express-api/ai/context/features/controllers.json +13 -0
- package/test-projects/express-api/ai/context/features/services.json +13 -0
- package/test-projects/express-api/ai/context/flows/auth.json +12 -0
- package/test-projects/express-api/ai/context/flows/user.json +13 -0
- package/test-projects/express-api/ai/conventions.md +51 -0
- package/test-projects/express-api/ai/dependencies.json +54 -0
- package/test-projects/express-api/ai/entrypoints.md +17 -0
- package/test-projects/express-api/ai/files.json +169 -0
- package/test-projects/express-api/ai/graph/knowledge-graph.json +98 -0
- package/test-projects/express-api/ai/graph/module-graph.json +44 -0
- package/test-projects/express-api/ai/graph/symbol-graph.json +882 -0
- package/test-projects/express-api/ai/graph/symbol-references.json +51 -0
- package/test-projects/express-api/ai/index-state.json +238 -0
- package/test-projects/express-api/ai/index.db +0 -0
- package/test-projects/express-api/ai/modules.json +30 -0
- package/test-projects/express-api/ai/project.json +15 -0
- package/test-projects/express-api/ai/repo-map.json +291 -0
- package/test-projects/express-api/ai/repo_map.json +100 -0
- package/test-projects/express-api/ai/repo_map.md +36 -0
- package/test-projects/express-api/ai/schema.json +5 -0
- package/test-projects/express-api/ai/summary.md +14 -0
- package/test-projects/express-api/ai/symbols.json +1174 -0
- package/test-projects/express-api/ai/tech_stack.md +38 -0
- package/test-projects/express-api/ai/tools.json +10 -0
- package/test-projects/express-api/controllers/authController.js +32 -0
- package/test-projects/express-api/controllers/userController.js +51 -0
- package/test-projects/express-api/index.js +21 -0
- package/test-projects/express-api/middleware/authMiddleware.js +30 -0
- package/test-projects/express-api/models/userRepository.js +25 -0
- package/test-projects/express-api/package.json +18 -0
- package/test-projects/express-api/services/authService.js +17 -0
- package/test-projects/express-api/services/userService.js +28 -0
- package/test-projects/nestjs-backend/ai/ai_context.md +110 -0
- package/test-projects/nestjs-backend/ai/ai_rules.md +52 -0
- package/test-projects/nestjs-backend/ai/architecture.md +43 -0
- package/test-projects/nestjs-backend/ai/cache.json +137 -0
- package/test-projects/nestjs-backend/ai/context/features/src.json +23 -0
- package/test-projects/nestjs-backend/ai/context/flows/auth..json +10 -0
- package/test-projects/nestjs-backend/ai/context/flows/users..json +10 -0
- package/test-projects/nestjs-backend/ai/conventions.md +52 -0
- package/test-projects/nestjs-backend/ai/dependencies.json +152 -0
- package/test-projects/nestjs-backend/ai/entrypoints.md +18 -0
- package/test-projects/nestjs-backend/ai/files.json +184 -0
- package/test-projects/nestjs-backend/ai/graph/knowledge-graph.json +74 -0
- package/test-projects/nestjs-backend/ai/graph/module-graph.json +29 -0
- package/test-projects/nestjs-backend/ai/graph/symbol-graph.json +304 -0
- package/test-projects/nestjs-backend/ai/graph/symbol-references.json +5 -0
- package/test-projects/nestjs-backend/ai/index-state.json +259 -0
- package/test-projects/nestjs-backend/ai/index.db +0 -0
- package/test-projects/nestjs-backend/ai/modules.json +19 -0
- package/test-projects/nestjs-backend/ai/project.json +14 -0
- package/test-projects/nestjs-backend/ai/repo-map.json +323 -0
- package/test-projects/nestjs-backend/ai/repo_map.json +141 -0
- package/test-projects/nestjs-backend/ai/repo_map.md +39 -0
- package/test-projects/nestjs-backend/ai/schema.json +5 -0
- package/test-projects/nestjs-backend/ai/summary.md +11 -0
- package/test-projects/nestjs-backend/ai/symbols.json +527 -0
- package/test-projects/nestjs-backend/ai/tech_stack.md +37 -0
- package/test-projects/nestjs-backend/ai/tools.json +10 -0
- package/test-projects/nestjs-backend/package.json +22 -0
- package/test-projects/nestjs-backend/src/app.module.ts +8 -0
- package/test-projects/nestjs-backend/src/auth/auth.controller.ts +22 -0
- package/test-projects/nestjs-backend/src/auth/auth.module.ts +11 -0
- package/test-projects/nestjs-backend/src/auth/auth.service.ts +28 -0
- package/test-projects/nestjs-backend/src/auth/dto/login.dto.ts +4 -0
- package/test-projects/nestjs-backend/src/auth/strategies/jwt.strategy.ts +18 -0
- package/test-projects/nestjs-backend/src/main.ts +9 -0
- package/test-projects/nestjs-backend/src/users/users.controller.ts +32 -0
- package/test-projects/nestjs-backend/src/users/users.module.ts +10 -0
- package/test-projects/nestjs-backend/src/users/users.service.ts +42 -0
- package/test-projects/nestjs-backend/tsconfig.json +21 -0
- package/test-projects/python-cli/__init__.py +1 -0
- package/test-projects/python-cli/ai/ai_context.md +94 -0
- package/test-projects/python-cli/ai/ai_rules.md +47 -0
- package/test-projects/python-cli/ai/architecture.md +49 -0
- package/test-projects/python-cli/ai/cache.json +129 -0
- package/test-projects/python-cli/ai/context/features/cli.json +16 -0
- package/test-projects/python-cli/ai/context/flows/add_.json +9 -0
- package/test-projects/python-cli/ai/context/flows/list_.json +9 -0
- package/test-projects/python-cli/ai/context/flows/remove_.json +9 -0
- package/test-projects/python-cli/ai/conventions.md +51 -0
- package/test-projects/python-cli/ai/dependencies.json +66 -0
- package/test-projects/python-cli/ai/entrypoints.md +4 -0
- package/test-projects/python-cli/ai/files.json +174 -0
- package/test-projects/python-cli/ai/graph/knowledge-graph.json +83 -0
- package/test-projects/python-cli/ai/graph/module-graph.json +31 -0
- package/test-projects/python-cli/ai/graph/symbol-graph.json +358 -0
- package/test-projects/python-cli/ai/graph/symbol-references.json +11 -0
- package/test-projects/python-cli/ai/index-state.json +245 -0
- package/test-projects/python-cli/ai/index.db +0 -0
- package/test-projects/python-cli/ai/modules.json +21 -0
- package/test-projects/python-cli/ai/project.json +15 -0
- package/test-projects/python-cli/ai/repo-map.json +290 -0
- package/test-projects/python-cli/ai/repo_map.json +99 -0
- package/test-projects/python-cli/ai/repo_map.md +32 -0
- package/test-projects/python-cli/ai/schema.json +5 -0
- package/test-projects/python-cli/ai/summary.md +11 -0
- package/test-projects/python-cli/ai/symbols.json +475 -0
- package/test-projects/python-cli/ai/tech_stack.md +30 -0
- package/test-projects/python-cli/ai/tools.json +10 -0
- package/test-projects/python-cli/cli/__init__.py +1 -0
- package/test-projects/python-cli/cli/add_command.py +6 -0
- package/test-projects/python-cli/cli/list_command.py +7 -0
- package/test-projects/python-cli/cli/remove_command.py +6 -0
- package/test-projects/python-cli/main.py +34 -0
- package/test-projects/python-cli/models/__init__.py +2 -0
- package/test-projects/python-cli/models/task.py +19 -0
- package/test-projects/python-cli/models/task_repository.py +44 -0
- package/test-projects/react-app/ai/ai_context.md +95 -0
- package/test-projects/react-app/ai/ai_rules.md +49 -0
- package/test-projects/react-app/ai/architecture.md +33 -0
- package/test-projects/react-app/ai/cache.json +129 -0
- package/test-projects/react-app/ai/context/features/src.json +18 -0
- package/test-projects/react-app/ai/context/flows/dashboard.json +9 -0
- package/test-projects/react-app/ai/context/flows/login.json +9 -0
- package/test-projects/react-app/ai/context/flows/users.json +9 -0
- package/test-projects/react-app/ai/conventions.md +52 -0
- package/test-projects/react-app/ai/dependencies.json +128 -0
- package/test-projects/react-app/ai/entrypoints.md +4 -0
- package/test-projects/react-app/ai/files.json +174 -0
- package/test-projects/react-app/ai/graph/knowledge-graph.json +83 -0
- package/test-projects/react-app/ai/graph/module-graph.json +31 -0
- package/test-projects/react-app/ai/graph/symbol-graph.json +868 -0
- package/test-projects/react-app/ai/graph/symbol-references.json +31 -0
- package/test-projects/react-app/ai/index-state.json +245 -0
- package/test-projects/react-app/ai/index.db +0 -0
- package/test-projects/react-app/ai/modules.json +17 -0
- package/test-projects/react-app/ai/project.json +15 -0
- package/test-projects/react-app/ai/repo-map.json +305 -0
- package/test-projects/react-app/ai/repo_map.json +114 -0
- package/test-projects/react-app/ai/repo_map.md +31 -0
- package/test-projects/react-app/ai/schema.json +5 -0
- package/test-projects/react-app/ai/summary.md +11 -0
- package/test-projects/react-app/ai/symbols.json +985 -0
- package/test-projects/react-app/ai/tech_stack.md +38 -0
- package/test-projects/react-app/ai/tools.json +10 -0
- package/test-projects/react-app/package.json +16 -0
- package/test-projects/react-app/src/App.tsx +21 -0
- package/test-projects/react-app/src/context/AuthContext.tsx +41 -0
- package/test-projects/react-app/src/hooks/useAuth.ts +10 -0
- package/test-projects/react-app/src/main.tsx +10 -0
- package/test-projects/react-app/src/pages/DashboardPage.tsx +17 -0
- package/test-projects/react-app/src/pages/LoginPage.tsx +41 -0
- package/test-projects/react-app/src/pages/UsersPage.tsx +36 -0
- package/test-projects/react-app/src/services/userService.ts +37 -0
- package/test-projects/salesforce-cli/.forceignore +27 -0
- package/test-projects/salesforce-cli/ai/ai_context.md +88 -0
- package/test-projects/salesforce-cli/ai/ai_rules.md +47 -0
- package/test-projects/salesforce-cli/ai/architecture.md +33 -0
- package/test-projects/salesforce-cli/ai/cache.json +105 -0
- package/test-projects/salesforce-cli/ai/context/features/force-app.json +14 -0
- package/test-projects/salesforce-cli/ai/context/flows/account.json +9 -0
- package/test-projects/salesforce-cli/ai/context/flows/opportunity.json +9 -0
- package/test-projects/salesforce-cli/ai/conventions.md +51 -0
- package/test-projects/salesforce-cli/ai/dependencies.json +6 -0
- package/test-projects/salesforce-cli/ai/entrypoints.md +4 -0
- package/test-projects/salesforce-cli/ai/files.json +144 -0
- package/test-projects/salesforce-cli/ai/graph/knowledge-graph.json +64 -0
- package/test-projects/salesforce-cli/ai/graph/module-graph.json +13 -0
- package/test-projects/salesforce-cli/ai/graph/symbol-graph.json +148 -0
- package/test-projects/salesforce-cli/ai/graph/symbol-references.json +1 -0
- package/test-projects/salesforce-cli/ai/index-state.json +203 -0
- package/test-projects/salesforce-cli/ai/index.db +0 -0
- package/test-projects/salesforce-cli/ai/modules.json +12 -0
- package/test-projects/salesforce-cli/ai/project.json +14 -0
- package/test-projects/salesforce-cli/ai/repo-map.json +251 -0
- package/test-projects/salesforce-cli/ai/repo_map.json +69 -0
- package/test-projects/salesforce-cli/ai/repo_map.md +21 -0
- package/test-projects/salesforce-cli/ai/schema.json +5 -0
- package/test-projects/salesforce-cli/ai/summary.md +11 -0
- package/test-projects/salesforce-cli/ai/symbols.json +245 -0
- package/test-projects/salesforce-cli/ai/tech_stack.md +30 -0
- package/test-projects/salesforce-cli/ai/tools.json +10 -0
- package/test-projects/salesforce-cli/force-app/main/default/classes/AccountController.cls +24 -0
- package/test-projects/salesforce-cli/force-app/main/default/classes/OpportunityController.cls +25 -0
- package/test-projects/salesforce-cli/force-app/main/default/objects/Project__c.object.xml +45 -0
- package/test-projects/salesforce-cli/force-app/main/default/triggers/AccountTrigger.trigger +33 -0
- package/test-projects/salesforce-cli/sfdx-project.json +11 -0
- package/tests/e2e/README.md +85 -0
- package/tests/e2e/run-e2e.sh +88 -0
- package/tests/semanticContexts.test.ts +23 -25
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Technology Stack
|
|
2
|
+
|
|
3
|
+
**Languages**: JSON, TypeScript (React), TypeScript
|
|
4
|
+
|
|
5
|
+
**Frameworks**: React, Next.js, Remix
|
|
6
|
+
|
|
7
|
+
**Package Managers**: npm
|
|
8
|
+
|
|
9
|
+
## Languages
|
|
10
|
+
- JSON
|
|
11
|
+
- TypeScript (React)
|
|
12
|
+
- TypeScript
|
|
13
|
+
|
|
14
|
+
## Frameworks
|
|
15
|
+
- React
|
|
16
|
+
- Next.js
|
|
17
|
+
- Remix
|
|
18
|
+
|
|
19
|
+
## Key Libraries
|
|
20
|
+
- None detected
|
|
21
|
+
|
|
22
|
+
## Development Tools
|
|
23
|
+
- None detected
|
|
24
|
+
|
|
25
|
+
## Package Managers
|
|
26
|
+
- npm
|
|
27
|
+
|
|
28
|
+
## Testing
|
|
29
|
+
- None detected
|
|
30
|
+
|
|
31
|
+
## Linters
|
|
32
|
+
- None detected
|
|
33
|
+
|
|
34
|
+
## Formatters
|
|
35
|
+
- None detected
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
*Generated by ai-first*
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-app",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"react": "^18.2.0",
|
|
7
|
+
"react-dom": "^18.2.0",
|
|
8
|
+
"react-router-dom": "^6.20.0"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@types/react": "^18.2.0",
|
|
12
|
+
"@types/react-dom": "^18.2.0",
|
|
13
|
+
"typescript": "^5.0.0",
|
|
14
|
+
"vite": "^5.0.0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
|
2
|
+
import { AuthProvider } from './context/AuthContext';
|
|
3
|
+
import LoginPage from './pages/LoginPage';
|
|
4
|
+
import DashboardPage from './pages/DashboardPage';
|
|
5
|
+
import UsersPage from './pages/UsersPage';
|
|
6
|
+
|
|
7
|
+
function App() {
|
|
8
|
+
return (
|
|
9
|
+
<AuthProvider>
|
|
10
|
+
<BrowserRouter>
|
|
11
|
+
<Routes>
|
|
12
|
+
<Route path="/login" element={<LoginPage />} />
|
|
13
|
+
<Route path="/dashboard" element={<DashboardPage />} />
|
|
14
|
+
<Route path="/users" element={<UsersPage />} />
|
|
15
|
+
</Routes>
|
|
16
|
+
</BrowserRouter>
|
|
17
|
+
</AuthProvider>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default App;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createContext, useState, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface User {
|
|
4
|
+
id: string;
|
|
5
|
+
email: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface AuthContextType {
|
|
10
|
+
user: User | null;
|
|
11
|
+
login: (email: string, password: string) => Promise<void>;
|
|
12
|
+
logout: () => void;
|
|
13
|
+
isAuthenticated: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const AuthContext = createContext<AuthContextType | undefined>(undefined);
|
|
17
|
+
|
|
18
|
+
export function AuthProvider({ children }: { children: ReactNode }) {
|
|
19
|
+
const [user, setUser] = useState<User | null>(null);
|
|
20
|
+
|
|
21
|
+
const login = async (email: string, password: string) => {
|
|
22
|
+
const response = await fetch('/api/auth/login', {
|
|
23
|
+
method: 'POST',
|
|
24
|
+
headers: { 'Content-Type': 'application/json' },
|
|
25
|
+
body: JSON.stringify({ email, password })
|
|
26
|
+
});
|
|
27
|
+
if (!response.ok) throw new Error('Login failed');
|
|
28
|
+
const data = await response.json();
|
|
29
|
+
setUser(data.user);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const logout = () => {
|
|
33
|
+
setUser(null);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<AuthContext.Provider value={{ user, login, logout, isAuthenticated: !!user }}>
|
|
38
|
+
{children}
|
|
39
|
+
</AuthContext.Provider>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { AuthContext } from '../context/AuthContext';
|
|
3
|
+
|
|
4
|
+
export function useAuth() {
|
|
5
|
+
const context = useContext(AuthContext);
|
|
6
|
+
if (!context) {
|
|
7
|
+
throw new Error('useAuth must be used within AuthProvider');
|
|
8
|
+
}
|
|
9
|
+
return context;
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useAuth } from '../hooks/useAuth';
|
|
2
|
+
|
|
3
|
+
export default function DashboardPage() {
|
|
4
|
+
const { user, logout } = useAuth();
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<div className="dashboard">
|
|
8
|
+
<header>
|
|
9
|
+
<h1>Dashboard</h1>
|
|
10
|
+
<button onClick={logout}>Logout</button>
|
|
11
|
+
</header>
|
|
12
|
+
<main>
|
|
13
|
+
<p>Welcome, {user?.name}</p>
|
|
14
|
+
</main>
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useState, FormEvent } from 'react';
|
|
2
|
+
import { useAuth } from '../hooks/useAuth';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
|
|
5
|
+
export default function LoginPage() {
|
|
6
|
+
const [email, setEmail] = useState('');
|
|
7
|
+
const [password, setPassword] = useState('');
|
|
8
|
+
const { login } = useAuth();
|
|
9
|
+
const navigate = useNavigate();
|
|
10
|
+
|
|
11
|
+
const handleSubmit = async (e: FormEvent) => {
|
|
12
|
+
e.preventDefault();
|
|
13
|
+
try {
|
|
14
|
+
await login(email, password);
|
|
15
|
+
navigate('/dashboard');
|
|
16
|
+
} catch (error) {
|
|
17
|
+
console.error('Login failed:', error);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div className="login-page">
|
|
23
|
+
<h1>Login</h1>
|
|
24
|
+
<form onSubmit={handleSubmit}>
|
|
25
|
+
<input
|
|
26
|
+
type="email"
|
|
27
|
+
value={email}
|
|
28
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
29
|
+
placeholder="Email"
|
|
30
|
+
/>
|
|
31
|
+
<input
|
|
32
|
+
type="password"
|
|
33
|
+
value={password}
|
|
34
|
+
onChange={(e) => setPassword(e.target.value)}
|
|
35
|
+
placeholder="Password"
|
|
36
|
+
/>
|
|
37
|
+
<button type="submit">Login</button>
|
|
38
|
+
</form>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { User } from '../services/userService';
|
|
3
|
+
|
|
4
|
+
export default function UsersPage() {
|
|
5
|
+
const [users, setUsers] = useState<User[]>([]);
|
|
6
|
+
const [loading, setLoading] = useState(true);
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
fetchUsers();
|
|
10
|
+
}, []);
|
|
11
|
+
|
|
12
|
+
const fetchUsers = async () => {
|
|
13
|
+
try {
|
|
14
|
+
const response = await fetch('/api/users');
|
|
15
|
+
const data = await response.json();
|
|
16
|
+
setUsers(data);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
console.error('Failed to fetch users:', error);
|
|
19
|
+
} finally {
|
|
20
|
+
setLoading(false);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
if (loading) return <div>Loading...</div>;
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div className="users-page">
|
|
28
|
+
<h1>Users</h1>
|
|
29
|
+
<ul>
|
|
30
|
+
{users.map(user => (
|
|
31
|
+
<li key={user.id}>{user.name} ({user.email})</li>
|
|
32
|
+
))}
|
|
33
|
+
</ul>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface User {
|
|
2
|
+
id: string;
|
|
3
|
+
email: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export async function fetchUsers(): Promise<User[]> {
|
|
8
|
+
const response = await fetch('/api/users');
|
|
9
|
+
return response.json();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export async function fetchUser(id: string): Promise<User> {
|
|
13
|
+
const response = await fetch(`/api/users/${id}`);
|
|
14
|
+
return response.json();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function createUser(data: Partial<User>): Promise<User> {
|
|
18
|
+
const response = await fetch('/api/users', {
|
|
19
|
+
method: 'POST',
|
|
20
|
+
headers: { 'Content-Type': 'application/json' },
|
|
21
|
+
body: JSON.stringify(data)
|
|
22
|
+
});
|
|
23
|
+
return response.json();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function updateUser(id: string, data: Partial<User>): Promise<User> {
|
|
27
|
+
const response = await fetch(`/api/users/${id}`, {
|
|
28
|
+
method: 'PUT',
|
|
29
|
+
headers: { 'Content-Type': 'application/json' },
|
|
30
|
+
body: JSON.stringify(data)
|
|
31
|
+
});
|
|
32
|
+
return response.json();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export async function deleteUser(id: string): Promise<void> {
|
|
36
|
+
await fetch(`/api/users/${id}`, { method: 'DELETE' });
|
|
37
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Force.com ignore file
|
|
2
|
+
# See https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
|
|
3
|
+
|
|
4
|
+
# LWC
|
|
5
|
+
node_modules/
|
|
6
|
+
yarn.lock
|
|
7
|
+
|
|
8
|
+
# Dependencies
|
|
9
|
+
package-lock.json
|
|
10
|
+
|
|
11
|
+
# Build outputs
|
|
12
|
+
dist/
|
|
13
|
+
build/
|
|
14
|
+
|
|
15
|
+
# IDE
|
|
16
|
+
.vscode/
|
|
17
|
+
.idea/
|
|
18
|
+
|
|
19
|
+
# OS
|
|
20
|
+
.DS_Store
|
|
21
|
+
Thumbs.db
|
|
22
|
+
|
|
23
|
+
# Logs
|
|
24
|
+
*.log
|
|
25
|
+
|
|
26
|
+
# Test
|
|
27
|
+
coverage/
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# AI Context
|
|
2
|
+
|
|
3
|
+
> This file provides a comprehensive overview of the repository for AI coding assistants.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Quick Overview
|
|
8
|
+
|
|
9
|
+
- **Pattern**: Flat / Simple Structure
|
|
10
|
+
- **Languages**: JSON
|
|
11
|
+
- **Frameworks**: None
|
|
12
|
+
- **Total Files**: 4
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Table of Contents
|
|
17
|
+
|
|
18
|
+
1. [Tech Stack](#tech-stack)
|
|
19
|
+
2. [Architecture](#architecture)
|
|
20
|
+
3. [Key Entrypoints](#key-entrypoints)
|
|
21
|
+
4. [Code Conventions](#code-conventions)
|
|
22
|
+
5. [AI Rules](#ai-rules)
|
|
23
|
+
6. [Repository Map](#repository-map)
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Tech Stack
|
|
28
|
+
|
|
29
|
+
**Languages**: JSON
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Architecture
|
|
34
|
+
|
|
35
|
+
## Architectural Pattern
|
|
36
|
+
**Primary**: Flat / Simple Structure
|
|
37
|
+
|
|
38
|
+
## Key Modules
|
|
39
|
+
| Module | Responsibility |
|
|
40
|
+
|--------|----------------|
|
|
41
|
+
| `force-app` | Contains 3 files |
|
|
42
|
+
| `sfdx-project.json` | Contains 0 files |
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Key Entrypoints
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Code Conventions
|
|
52
|
+
|
|
53
|
+
## Naming Conventions
|
|
54
|
+
- **Files**: PascalCase
|
|
55
|
+
|
|
56
|
+
## Project Structure
|
|
57
|
+
|
|
58
|
+
## Code Style
|
|
59
|
+
- **Semicolons**: Required
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## AI Rules
|
|
65
|
+
|
|
66
|
+
- Language: Use JSON
|
|
67
|
+
- Architecture: Follow Flat / Simple Structure pattern
|
|
68
|
+
- File naming: PascalCase
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Repository Map
|
|
73
|
+
|
|
74
|
+
See repo_map.md for the full structure.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Notes for AI Assistants
|
|
79
|
+
|
|
80
|
+
1. Follow the established naming conventions (see conventions.md)
|
|
81
|
+
2. Use the detected frameworks and libraries
|
|
82
|
+
3. Target the correct entrypoints for modifications
|
|
83
|
+
4. Maintain the detected architecture patterns
|
|
84
|
+
5. Follow AI rules in ai_rules.md
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
*Generated by ai-first*
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# AI Rules
|
|
2
|
+
|
|
3
|
+
> Guidelines for AI assistants working on this project
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Guidelines
|
|
8
|
+
|
|
9
|
+
- Language: Use JSON
|
|
10
|
+
- Architecture: Follow Flat / Simple Structure pattern
|
|
11
|
+
- File naming: PascalCase
|
|
12
|
+
|
|
13
|
+
## Patterns
|
|
14
|
+
|
|
15
|
+
- Layer structure:
|
|
16
|
+
|
|
17
|
+
## Constraints
|
|
18
|
+
|
|
19
|
+
- Always use semicolons
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Quick Reference
|
|
24
|
+
|
|
25
|
+
| Category | Value |
|
|
26
|
+
|----------|-------|
|
|
27
|
+
| Language | JSON |
|
|
28
|
+
| Framework | N/A |
|
|
29
|
+
| Architecture | Flat / Simple Structure |
|
|
30
|
+
| Naming | PascalCase |
|
|
31
|
+
| Indentation | unknown |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Best Practices
|
|
36
|
+
|
|
37
|
+
1. Follow the established naming conventions
|
|
38
|
+
2. Keep functions small and focused
|
|
39
|
+
3. Write tests for new features
|
|
40
|
+
4. Use descriptive variable names
|
|
41
|
+
5. Keep the architecture consistent
|
|
42
|
+
6. Document complex logic
|
|
43
|
+
7. Review code before committing
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
*Generated by ai-first*
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
## Architectural Pattern
|
|
4
|
+
**Primary**: Flat / Simple Structure
|
|
5
|
+
|
|
6
|
+
## Key Modules
|
|
7
|
+
| Module | Responsibility |
|
|
8
|
+
|--------|----------------|
|
|
9
|
+
| `force-app` | Contains 3 files |
|
|
10
|
+
| `sfdx-project.json` | Contains 0 files |
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Module Details
|
|
14
|
+
|
|
15
|
+
### force-app
|
|
16
|
+
- **Path**: `force-app`
|
|
17
|
+
- **Responsibility**: Contains 3 files
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### sfdx-project.json
|
|
21
|
+
- **Path**: `sfdx-project.json`
|
|
22
|
+
- **Responsibility**: Contains 0 files
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## Recommendations
|
|
27
|
+
|
|
28
|
+
- Keep the architecture consistent as the project grows
|
|
29
|
+
- Follow the established layer structure
|
|
30
|
+
- Use dependency injection to manage module relationships
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
*Generated by ai-first*
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": {
|
|
3
|
+
"ai/ai_context.md": {
|
|
4
|
+
"hash": "f038c6e81ed1afc0b5582c214b42fe69",
|
|
5
|
+
"mtime": 1773796492673.4075
|
|
6
|
+
},
|
|
7
|
+
"ai/ai_rules.md": {
|
|
8
|
+
"hash": "d6864e4c14fb24f5b12fc0dbc5fe50f7",
|
|
9
|
+
"mtime": 1773796492673.4075
|
|
10
|
+
},
|
|
11
|
+
"ai/architecture.md": {
|
|
12
|
+
"hash": "587f3de6d1623a0fc13d924503ab2ad9",
|
|
13
|
+
"mtime": 1773796492669.4075
|
|
14
|
+
},
|
|
15
|
+
"ai/context/features/force-app.json": {
|
|
16
|
+
"hash": "05a59b12f59343ac6550313514d26378",
|
|
17
|
+
"mtime": 1773796492675.4075
|
|
18
|
+
},
|
|
19
|
+
"ai/context/flows/account.json": {
|
|
20
|
+
"hash": "b598b9ea1bc7ba8e8220ce3861cd9a6b",
|
|
21
|
+
"mtime": 1773796492675.4075
|
|
22
|
+
},
|
|
23
|
+
"ai/context/flows/opportunity.json": {
|
|
24
|
+
"hash": "ac8e6a6f053bb84d99784bd2e4556e90",
|
|
25
|
+
"mtime": 1773796492675.4075
|
|
26
|
+
},
|
|
27
|
+
"ai/conventions.md": {
|
|
28
|
+
"hash": "d11ac646a8916e3c6cc376f610368317",
|
|
29
|
+
"mtime": 1773796492671.4075
|
|
30
|
+
},
|
|
31
|
+
"ai/dependencies.json": {
|
|
32
|
+
"hash": "038f80a99cbcc45991786b645398758e",
|
|
33
|
+
"mtime": 1773796492672.4075
|
|
34
|
+
},
|
|
35
|
+
"ai/entrypoints.md": {
|
|
36
|
+
"hash": "34c8965a66697d9f1d428bb0904f5d8d",
|
|
37
|
+
"mtime": 1773796492670.4075
|
|
38
|
+
},
|
|
39
|
+
"ai/files.json": {
|
|
40
|
+
"hash": "d69a645e7a5ac643dfc30df33cd9b267",
|
|
41
|
+
"mtime": 1773796517712.798
|
|
42
|
+
},
|
|
43
|
+
"ai/graph/module-graph.json": {
|
|
44
|
+
"hash": "6848d665199d24a321d36d4e96e9dd90",
|
|
45
|
+
"mtime": 1773796517707.7979
|
|
46
|
+
},
|
|
47
|
+
"ai/modules.json": {
|
|
48
|
+
"hash": "1d0ec72acc3fc6e1c8c1c28b1ad87252",
|
|
49
|
+
"mtime": 1773796517705.7979
|
|
50
|
+
},
|
|
51
|
+
"ai/project.json": {
|
|
52
|
+
"hash": "295b4cc3d9224937904a0270cc234dc2",
|
|
53
|
+
"mtime": 1773796492675.4075
|
|
54
|
+
},
|
|
55
|
+
"ai/repo-map.json": {
|
|
56
|
+
"hash": "4f16721f87196949948475fda1bbb92b",
|
|
57
|
+
"mtime": 1773796517706.8672
|
|
58
|
+
},
|
|
59
|
+
"ai/repo_map.json": {
|
|
60
|
+
"hash": "d2f687f4d05e38731e8b4fa2b4481178",
|
|
61
|
+
"mtime": 1773796492668.4075
|
|
62
|
+
},
|
|
63
|
+
"ai/repo_map.md": {
|
|
64
|
+
"hash": "612c1b7f776ec7f0e02e6a2a80bafe3b",
|
|
65
|
+
"mtime": 1773796492667.4075
|
|
66
|
+
},
|
|
67
|
+
"ai/schema.json": {
|
|
68
|
+
"hash": "972220a7d47c9f782cd74798554d2cc4",
|
|
69
|
+
"mtime": 1773796492675.4075
|
|
70
|
+
},
|
|
71
|
+
"ai/summary.md": {
|
|
72
|
+
"hash": "52c99c74210210438e7bf314915ef872",
|
|
73
|
+
"mtime": 1773796492668.4075
|
|
74
|
+
},
|
|
75
|
+
"ai/symbols.json": {
|
|
76
|
+
"hash": "e3c31bde2bfd56e085f689eb750aa93e",
|
|
77
|
+
"mtime": 1773796492672.4075
|
|
78
|
+
},
|
|
79
|
+
"ai/tech_stack.md": {
|
|
80
|
+
"hash": "4f67b75666a8dab1f2f82196130ab030",
|
|
81
|
+
"mtime": 1773796492670.4075
|
|
82
|
+
},
|
|
83
|
+
"ai/tools.json": {
|
|
84
|
+
"hash": "b1356e52c74e9b3b6a0d397b790a4968",
|
|
85
|
+
"mtime": 1773796492675.4075
|
|
86
|
+
},
|
|
87
|
+
"force-app/main/default/classes/AccountController.cls": {
|
|
88
|
+
"hash": "f42a5c32b2194cf4c6227503ba00f6fe",
|
|
89
|
+
"mtime": 1773777904495.204
|
|
90
|
+
},
|
|
91
|
+
"force-app/main/default/classes/OpportunityController.cls": {
|
|
92
|
+
"hash": "27984b63f77bef40953426e0a6b0c685",
|
|
93
|
+
"mtime": 1773777913625.33
|
|
94
|
+
},
|
|
95
|
+
"force-app/main/default/triggers/AccountTrigger.trigger": {
|
|
96
|
+
"hash": "84c54cb056848e844af710a70c5ef243",
|
|
97
|
+
"mtime": 1773777952108.863
|
|
98
|
+
},
|
|
99
|
+
"sfdx-project.json": {
|
|
100
|
+
"hash": "d2a50cc298ee84931caa1b54ae8b18ed",
|
|
101
|
+
"mtime": 1773777895732.083
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"lastIndexed": "2026-03-18T01:15:17.713Z"
|
|
105
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "force-app",
|
|
3
|
+
"path": "force-app",
|
|
4
|
+
"files": [
|
|
5
|
+
"force-app/main/default/classes/AccountController.cls",
|
|
6
|
+
"force-app/main/default/classes/OpportunityController.cls",
|
|
7
|
+
"force-app/main/default/triggers/AccountTrigger.trigger"
|
|
8
|
+
],
|
|
9
|
+
"entrypoints": [
|
|
10
|
+
"force-app/main/default/classes/AccountController.cls",
|
|
11
|
+
"force-app/main/default/classes/OpportunityController.cls"
|
|
12
|
+
],
|
|
13
|
+
"dependencies": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Code Conventions
|
|
2
|
+
|
|
3
|
+
## Naming Conventions
|
|
4
|
+
- **Files**: PascalCase
|
|
5
|
+
|
|
6
|
+
## Project Structure
|
|
7
|
+
|
|
8
|
+
## Code Style
|
|
9
|
+
- **Semicolons**: Required
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Naming Conventions
|
|
13
|
+
|
|
14
|
+
| Element | Convention |
|
|
15
|
+
|---------|------------|
|
|
16
|
+
| Files | PascalCase |
|
|
17
|
+
| Components | unknown |
|
|
18
|
+
| Test Files | unknown |
|
|
19
|
+
| Directories | unknown |
|
|
20
|
+
|
|
21
|
+
## Project Structure
|
|
22
|
+
|
|
23
|
+
| Directory | Location |
|
|
24
|
+
|-----------|----------|
|
|
25
|
+
| Source | unknown |
|
|
26
|
+
| Tests | unknown |
|
|
27
|
+
| Config | unknown |
|
|
28
|
+
|
|
29
|
+
## Code Style
|
|
30
|
+
|
|
31
|
+
| Style Element | Value |
|
|
32
|
+
|---------------|-------|
|
|
33
|
+
| Indentation | unknown |
|
|
34
|
+
| Semicolons | Required |
|
|
35
|
+
|
|
36
|
+
## Testing
|
|
37
|
+
|
|
38
|
+
| Aspect | Value |
|
|
39
|
+
|--------|-------|
|
|
40
|
+
| Framework | unknown |
|
|
41
|
+
| Test Pattern | unknown |
|
|
42
|
+
|
|
43
|
+
## Git
|
|
44
|
+
|
|
45
|
+
| Aspect | Value |
|
|
46
|
+
|--------|-------|
|
|
47
|
+
| Branch Strategy | Trunk-based (main/master) |
|
|
48
|
+
| Commit Format | unknown |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
*Generated by ai-first*
|