devintelligence 0.0.0-stage → 1.0.0
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/.env.example +14 -0
- package/LICENSE +22 -0
- package/README.md +145 -2
- package/bin/devintelligence.js +17 -0
- package/bin/devintelligence.ts +275 -0
- package/fixtures/django-analytics-service/requirements.txt +4 -0
- package/fixtures/django-analytics-service/settings.py +16 -0
- package/fixtures/express-api-gateway/package.json +14 -0
- package/fixtures/express-api-gateway/src/server.ts +16 -0
- package/fixtures/nextjs-saas-portal/package.json +21 -0
- package/fixtures/nextjs-saas-portal/src/app/dashboard/page.tsx +26 -0
- package/fixtures/rn-bare-fitness/android/build.gradle +19 -0
- package/fixtures/rn-bare-fitness/ios/Info.plist +14 -0
- package/fixtures/rn-bare-fitness/package.json +23 -0
- package/fixtures/rn-bare-fitness/src/WorkoutTracker.tsx +31 -0
- package/fixtures/rn-expo-commerce/android/app/build.gradle +20 -0
- package/fixtures/rn-expo-commerce/android/app/src/main/AndroidManifest.xml +21 -0
- package/fixtures/rn-expo-commerce/android/gradle.properties +6 -0
- package/fixtures/rn-expo-commerce/app.json +17 -0
- package/fixtures/rn-expo-commerce/babel.config.js +10 -0
- package/fixtures/rn-expo-commerce/ios/Podfile +13 -0
- package/fixtures/rn-expo-commerce/metro.config.js +7 -0
- package/fixtures/rn-expo-commerce/package.json +31 -0
- package/fixtures/rn-expo-commerce/src/components/LegacyPromoBanner.tsx +11 -0
- package/fixtures/rn-expo-commerce/src/screens/ProductFeedScreen.tsx +48 -0
- package/fixtures/rn-expo-commerce/src/services/api.ts +15 -0
- package/index.html +21 -0
- package/package.json +75 -4
- package/server.ts +275 -0
- package/src/App.tsx +783 -0
- package/src/components/DeepAnalysisViews.tsx +526 -0
- package/src/components/MobileAndPlatformViews.tsx +625 -0
- package/src/components/OverviewAndExplorerViews.tsx +753 -0
- package/src/components/RepairAndGateViews.tsx +814 -0
- package/src/engine/aiEngine.test.ts +86 -0
- package/src/engine/aiEngine.ts +346 -0
- package/src/engine/analyzerEngine.test.ts +110 -0
- package/src/engine/analyzerEngine.ts +1579 -0
- package/src/engine/repairEngine.ts +545 -0
- package/src/index.css +44 -0
- package/src/index.ts +59 -0
- package/src/main.tsx +5 -0
- package/src/types/devintelligence.ts +310 -0
- package/tsconfig.json +28 -0
- package/vite.config.ts +22 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
export type ProjectEcosystem =
|
|
2
|
+
| 'react-native-expo'
|
|
3
|
+
| 'react-native-bare'
|
|
4
|
+
| 'nextjs'
|
|
5
|
+
| 'react-vite'
|
|
6
|
+
| 'node-express'
|
|
7
|
+
| 'python-django'
|
|
8
|
+
| 'typescript-universal';
|
|
9
|
+
|
|
10
|
+
export type CheckStatus =
|
|
11
|
+
| 'working'
|
|
12
|
+
| 'incompatible'
|
|
13
|
+
| 'misconfigured'
|
|
14
|
+
| 'not_installed'
|
|
15
|
+
| 'os_unsupported';
|
|
16
|
+
|
|
17
|
+
export type IssueSeverity = 'critical' | 'high' | 'medium' | 'low';
|
|
18
|
+
|
|
19
|
+
export type RepairTier = 'SAFE' | 'REVIEW_REQUIRED' | 'RISKY';
|
|
20
|
+
|
|
21
|
+
export type IssueDomain =
|
|
22
|
+
| 'react-native'
|
|
23
|
+
| 'android'
|
|
24
|
+
| 'ios'
|
|
25
|
+
| 'code'
|
|
26
|
+
| 'design'
|
|
27
|
+
| 'performance'
|
|
28
|
+
| 'security'
|
|
29
|
+
| 'dependencies';
|
|
30
|
+
|
|
31
|
+
export interface EnvironmentCheckItem {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
category: 'runtime' | 'package-manager' | 'react-native' | 'android' | 'ios' | 'build-tools';
|
|
35
|
+
status: CheckStatus;
|
|
36
|
+
detectedVersion: string;
|
|
37
|
+
requiredVersion: string;
|
|
38
|
+
osPlatform: string;
|
|
39
|
+
explanation: string;
|
|
40
|
+
remediationCommand?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface DiagnosticIssue {
|
|
44
|
+
id: string;
|
|
45
|
+
projectId: string;
|
|
46
|
+
domain: IssueDomain;
|
|
47
|
+
ruleId: string;
|
|
48
|
+
title: string;
|
|
49
|
+
severity: IssueSeverity;
|
|
50
|
+
repairTier: RepairTier;
|
|
51
|
+
confidence: number; // 0-100
|
|
52
|
+
filePath: string;
|
|
53
|
+
line: number;
|
|
54
|
+
rootCause: string;
|
|
55
|
+
explanation: string;
|
|
56
|
+
recommendedRepair: string;
|
|
57
|
+
terminalCommand?: string;
|
|
58
|
+
fixAvailable: boolean;
|
|
59
|
+
beforeSnippet: string;
|
|
60
|
+
afterSnippet: string;
|
|
61
|
+
unifiedDiff: string;
|
|
62
|
+
fixed?: boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface AndroidDiagnosticSummary {
|
|
66
|
+
present: boolean;
|
|
67
|
+
manifestPath: string | null;
|
|
68
|
+
packageName: string | null;
|
|
69
|
+
minSdkVersion: number | null;
|
|
70
|
+
compileSdkVersion: number | null;
|
|
71
|
+
targetSdkVersion: number | null;
|
|
72
|
+
agpVersion: string | null;
|
|
73
|
+
kotlinVersion: string | null;
|
|
74
|
+
ndkVersion: string | null;
|
|
75
|
+
hermesEnabled: boolean;
|
|
76
|
+
newArchEnabled: boolean;
|
|
77
|
+
jetifierEnabled: boolean;
|
|
78
|
+
gradleJvmArgs: string | null;
|
|
79
|
+
permissions: string[];
|
|
80
|
+
cleartextTrafficAllowed: boolean;
|
|
81
|
+
releaseMinifyEnabled: boolean;
|
|
82
|
+
releaseUsesDebugSigning: boolean;
|
|
83
|
+
abis: string[];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface IosDiagnosticSummary {
|
|
87
|
+
present: boolean;
|
|
88
|
+
hostCanVerifyNativeBuild: boolean;
|
|
89
|
+
hostOsNote: string;
|
|
90
|
+
podfilePath: string | null;
|
|
91
|
+
infoPlistPath: string | null;
|
|
92
|
+
deploymentTarget: string | null;
|
|
93
|
+
bundleIdentifier: string | null;
|
|
94
|
+
hermesEnabled: boolean | null;
|
|
95
|
+
flipperEnabled: boolean;
|
|
96
|
+
useFrameworks: string | null;
|
|
97
|
+
declaredPermissions: string[];
|
|
98
|
+
missingRequiredPermissions: string[];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface DependencyRecord {
|
|
102
|
+
name: string;
|
|
103
|
+
currentVersion: string;
|
|
104
|
+
recommendedVersion: string;
|
|
105
|
+
section: 'dependencies' | 'devDependencies' | 'python';
|
|
106
|
+
estimatedSizeKb: number;
|
|
107
|
+
status: 'compatible' | 'conflict' | 'heavy' | 'deprecated';
|
|
108
|
+
note: string;
|
|
109
|
+
replacementSuggestion?: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface DesignSystemReport {
|
|
113
|
+
discoveredTokens: {
|
|
114
|
+
colors: string[];
|
|
115
|
+
radii: string[];
|
|
116
|
+
spacingScale: string[];
|
|
117
|
+
fontFamilies: string[];
|
|
118
|
+
};
|
|
119
|
+
hardcodedColorsCount: number;
|
|
120
|
+
inconsistentSpacingCount: number;
|
|
121
|
+
randomRadiiCount: number;
|
|
122
|
+
emojiIconsCount: number;
|
|
123
|
+
accessibilityGapsCount: number;
|
|
124
|
+
tokenComplianceScore: number;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface PerformanceReport {
|
|
128
|
+
totalSourceFiles: number;
|
|
129
|
+
totalSourceSizeKb: number;
|
|
130
|
+
estimatedBundleWeightKb: number;
|
|
131
|
+
heavyDependencies: { name: string; sizeKb: number; reason: string }[];
|
|
132
|
+
renderBottlenecksCount: number;
|
|
133
|
+
memoryLeakRisksCount: number;
|
|
134
|
+
blockingIoCount: number;
|
|
135
|
+
unoptimizedAssets: string[];
|
|
136
|
+
performanceScore: number;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface LaunchDoctorReport {
|
|
140
|
+
frameworkName: string;
|
|
141
|
+
ecosystem: ProjectEcosystem;
|
|
142
|
+
packageManager: 'npm' | 'yarn' | 'pnpm' | 'bun' | 'pip';
|
|
143
|
+
workflowType: 'Expo Managed' | 'Expo Prebuild (CNG)' | 'Bare React Native' | 'Web / Backend Standard';
|
|
144
|
+
detectedScripts: Record<string, string>;
|
|
145
|
+
recommendedStartCommand: string;
|
|
146
|
+
secondaryCommands: { label: string; command: string }[];
|
|
147
|
+
metroConfigured: boolean;
|
|
148
|
+
babelConfigured: boolean;
|
|
149
|
+
typescriptConfigured: boolean;
|
|
150
|
+
androidLaunchReady: boolean;
|
|
151
|
+
iosLaunchReady: boolean;
|
|
152
|
+
readinessNotes: string[];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface QualityGateConfig {
|
|
156
|
+
minCodeQuality: number;
|
|
157
|
+
minDesignQuality: number;
|
|
158
|
+
minPerformanceScore: number;
|
|
159
|
+
maxCriticalIssues: number;
|
|
160
|
+
maxSecurityIssues: number;
|
|
161
|
+
requireBuildVerification: boolean;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface QualityGateEvaluation {
|
|
165
|
+
passed: boolean;
|
|
166
|
+
exitCode: 0 | 1;
|
|
167
|
+
evaluatedAt: string;
|
|
168
|
+
checks: {
|
|
169
|
+
name: string;
|
|
170
|
+
actual: number | string;
|
|
171
|
+
threshold: number | string;
|
|
172
|
+
passed: boolean;
|
|
173
|
+
}[];
|
|
174
|
+
githubActionsYaml: string;
|
|
175
|
+
preCommitHookScript: string;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface RepairRecord {
|
|
179
|
+
id: string;
|
|
180
|
+
projectId: string;
|
|
181
|
+
issueId: string;
|
|
182
|
+
issueTitle: string;
|
|
183
|
+
filePath: string;
|
|
184
|
+
repairTier: RepairTier;
|
|
185
|
+
appliedAt: string;
|
|
186
|
+
backupPath: string;
|
|
187
|
+
rolledBack: boolean;
|
|
188
|
+
verifiedAfterFix: boolean;
|
|
189
|
+
unifiedDiff: string;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface ScanSnapshot {
|
|
193
|
+
id: string;
|
|
194
|
+
projectId: string;
|
|
195
|
+
scannedAt: string;
|
|
196
|
+
durationMs: number;
|
|
197
|
+
totalIssues: number;
|
|
198
|
+
criticalCount: number;
|
|
199
|
+
safeFixableCount: number;
|
|
200
|
+
scores: {
|
|
201
|
+
overall: number;
|
|
202
|
+
reactNative: number;
|
|
203
|
+
codeQuality: number;
|
|
204
|
+
designQuality: number;
|
|
205
|
+
performance: number;
|
|
206
|
+
security: number;
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface VisualTestingReport {
|
|
211
|
+
projectId: string;
|
|
212
|
+
lastCapturedAt: string;
|
|
213
|
+
engine: string;
|
|
214
|
+
viewportsTested: {
|
|
215
|
+
label: string;
|
|
216
|
+
width: number;
|
|
217
|
+
height: number;
|
|
218
|
+
overflowDetected: boolean;
|
|
219
|
+
brokenImagesCount: number;
|
|
220
|
+
consoleErrorsCount: number;
|
|
221
|
+
networkFailuresCount: number;
|
|
222
|
+
diffPercentage: number;
|
|
223
|
+
status: 'pass' | 'warning' | 'fail';
|
|
224
|
+
}[];
|
|
225
|
+
findings: {
|
|
226
|
+
viewport: string;
|
|
227
|
+
selector: string;
|
|
228
|
+
description: string;
|
|
229
|
+
recommendation: string;
|
|
230
|
+
}[];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export interface ErrorDiagnosisResult {
|
|
234
|
+
id: string;
|
|
235
|
+
category:
|
|
236
|
+
| 'Metro Bundler'
|
|
237
|
+
| 'Babel / Reanimated'
|
|
238
|
+
| 'Android Gradle / Kotlin'
|
|
239
|
+
| 'Android Manifest'
|
|
240
|
+
| 'CocoaPods / iOS'
|
|
241
|
+
| 'Native Module Linking'
|
|
242
|
+
| 'Hermes Runtime'
|
|
243
|
+
| 'React Render / Hook Crash'
|
|
244
|
+
| 'Dependency Conflict';
|
|
245
|
+
severity: IssueSeverity;
|
|
246
|
+
confidence: number;
|
|
247
|
+
summary: string;
|
|
248
|
+
rootCause: string;
|
|
249
|
+
responsibleFile: string;
|
|
250
|
+
line: number | null;
|
|
251
|
+
safeRepairSteps: string[];
|
|
252
|
+
terminalCommands: string[];
|
|
253
|
+
codePatchSuggestion?: string;
|
|
254
|
+
aiPowered?: boolean;
|
|
255
|
+
aiModel?: string;
|
|
256
|
+
fallbackUsed?: boolean;
|
|
257
|
+
fallbackReason?: string;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export interface ProjectIntelligenceReport {
|
|
261
|
+
id: string;
|
|
262
|
+
name: string;
|
|
263
|
+
rootPath: string;
|
|
264
|
+
ecosystem: ProjectEcosystem;
|
|
265
|
+
description: string;
|
|
266
|
+
lastScannedAt: string;
|
|
267
|
+
scanDurationMs: number;
|
|
268
|
+
filesAnalyzed: string[];
|
|
269
|
+
scores: {
|
|
270
|
+
overall: number;
|
|
271
|
+
reactNative: number;
|
|
272
|
+
codeQuality: number;
|
|
273
|
+
designQuality: number;
|
|
274
|
+
performance: number;
|
|
275
|
+
security: number;
|
|
276
|
+
};
|
|
277
|
+
environmentChecks: EnvironmentCheckItem[];
|
|
278
|
+
issues: DiagnosticIssue[];
|
|
279
|
+
android: AndroidDiagnosticSummary;
|
|
280
|
+
ios: IosDiagnosticSummary;
|
|
281
|
+
dependencies: DependencyRecord[];
|
|
282
|
+
designSystem: DesignSystemReport;
|
|
283
|
+
performance: PerformanceReport;
|
|
284
|
+
launchDoctor: LaunchDoctorReport;
|
|
285
|
+
qualityGateConfig: QualityGateConfig;
|
|
286
|
+
qualityGateEvaluation: QualityGateEvaluation;
|
|
287
|
+
visualTesting: VisualTestingReport;
|
|
288
|
+
repairHistory: RepairRecord[];
|
|
289
|
+
scanHistory: ScanSnapshot[];
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export type DashboardModuleId =
|
|
293
|
+
| 'command-center'
|
|
294
|
+
| 'project-explorer'
|
|
295
|
+
| 'project-health'
|
|
296
|
+
| 'rn-doctor'
|
|
297
|
+
| 'android-diagnostics'
|
|
298
|
+
| 'ios-diagnostics'
|
|
299
|
+
| 'code-intelligence'
|
|
300
|
+
| 'design-intelligence'
|
|
301
|
+
| 'performance-lab'
|
|
302
|
+
| 'security-audit'
|
|
303
|
+
| 'dependency-intelligence'
|
|
304
|
+
| 'error-diagnostics'
|
|
305
|
+
| 'auto-repair'
|
|
306
|
+
| 'visual-testing'
|
|
307
|
+
| 'quality-gate'
|
|
308
|
+
| 'project-history'
|
|
309
|
+
| 'environment-manager'
|
|
310
|
+
| 'settings';
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"experimentalDecorators": true,
|
|
5
|
+
"useDefineForClassFields": false,
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"types": ["vite/client", "node"],
|
|
8
|
+
"lib": [
|
|
9
|
+
"ES2022",
|
|
10
|
+
"DOM",
|
|
11
|
+
"DOM.Iterable"
|
|
12
|
+
],
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"moduleResolution": "bundler",
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"moduleDetection": "force",
|
|
17
|
+
"allowJs": true,
|
|
18
|
+
"jsx": "react-jsx",
|
|
19
|
+
"paths": {
|
|
20
|
+
"@/*": [
|
|
21
|
+
"./*"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"allowImportingTsExtensions": true,
|
|
25
|
+
"noEmit": true
|
|
26
|
+
},
|
|
27
|
+
"exclude": ["dist", "fixtures", "node_modules"]
|
|
28
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
2
|
+
import react from '@vitejs/plugin-react';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import {defineConfig} from 'vite';
|
|
5
|
+
|
|
6
|
+
export default defineConfig(() => {
|
|
7
|
+
return {
|
|
8
|
+
plugins: [react(), tailwindcss()],
|
|
9
|
+
resolve: {
|
|
10
|
+
alias: {
|
|
11
|
+
'@': path.resolve(__dirname, '.'),
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
server: {
|
|
15
|
+
// HMR is disabled in AI Studio via DISABLE_HMR env var.
|
|
16
|
+
// Do not modify—file watching is disabled to prevent flickering during agent edits.
|
|
17
|
+
hmr: process.env.DISABLE_HMR !== 'true',
|
|
18
|
+
// Disable file watching when DISABLE_HMR is true to save CPU during agent edits.
|
|
19
|
+
watch: process.env.DISABLE_HMR === 'true' ? null : {},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
});
|