chore: run format and fix tests

This commit is contained in:
Ralph Khreish
2025-08-02 22:55:58 +03:00
parent 30359e3cea
commit cc8e088e6a
7 changed files with 70 additions and 56 deletions

View File

@@ -18,4 +18,4 @@
"reasoning": "This task has high complexity due to several challenging aspects: 1) AI integration requiring sophisticated prompt engineering, 2) Test generation across multiple frameworks, 3) File system operations with proper error handling, 4) MCP tool integration, 5) Complex configuration requirements, and 6) Framework-specific template generation. The task already has 5 subtasks but could benefit from reorganization based on the updated implementation details in the info blocks, particularly around framework support and configuration."
}
]
}
}

View File

@@ -1,9 +1,9 @@
{
"currentTag": "master",
"lastSwitched": "2025-08-01T14:09:25.838Z",
"branchTagMapping": {
"v017-adds": "v017-adds",
"next": "next"
},
"migrationNoticeShown": true
}
"currentTag": "master",
"lastSwitched": "2025-08-01T14:09:25.838Z",
"branchTagMapping": {
"v017-adds": "v017-adds",
"next": "next"
},
"migrationNoticeShown": true
}

View File

@@ -9,17 +9,9 @@
"engines": {
"vscode": "^1.93.0"
},
"categories": [
"AI",
"Visualization",
"Education",
"Other"
],
"categories": ["AI", "Visualization", "Education", "Other"],
"main": "./dist/extension.js",
"activationEvents": [
"onStartupFinished",
"workspaceContains:.taskmaster/**"
],
"activationEvents": ["onStartupFinished", "workspaceContains:.taskmaster/**"],
"contributes": {
"viewsContainers": {
"activitybar": [
@@ -80,9 +72,7 @@
"items": {
"type": "string"
},
"default": [
"task-master-ai"
],
"default": ["task-master-ai"],
"description": "An array of arguments to pass to the MCP server command."
},
"taskmaster.mcp.cwd": {
@@ -149,11 +139,7 @@
},
"taskmaster.ui.theme": {
"type": "string",
"enum": [
"auto",
"light",
"dark"
],
"enum": ["auto", "light", "dark"],
"default": "auto",
"description": "UI theme preference"
},
@@ -214,12 +200,7 @@
},
"taskmaster.debug.logLevel": {
"type": "string",
"enum": [
"error",
"warn",
"info",
"debug"
],
"enum": ["error", "warn", "info", "debug"],
"default": "info",
"description": "Logging level"
},

View File

@@ -4,7 +4,13 @@ import { Button } from '@/components/ui/button';
import { Label } from '@/components/ui/label';
import { Textarea } from '@/components/ui/textarea';
import { CollapsibleSection } from '@/components/ui/CollapsibleSection';
import { Wand2, Loader2, PlusCircle, TrendingUp, TrendingDown } from 'lucide-react';
import {
Wand2,
Loader2,
PlusCircle,
TrendingUp,
TrendingDown
} from 'lucide-react';
import {
useUpdateTask,
useUpdateSubtask,
@@ -34,10 +40,12 @@ export const AIActionsSection: React.FC<AIActionsSectionProps> = ({
}) => {
const [prompt, setPrompt] = useState('');
const [scopePrompt, setScopePrompt] = useState('');
const [scopeStrength, setScopeStrength] = useState<'light' | 'regular' | 'heavy'>('regular');
const [lastAction, setLastAction] = useState<'regenerate' | 'append' | 'scope-up' | 'scope-down' | null>(
null
);
const [scopeStrength, setScopeStrength] = useState<
'light' | 'regular' | 'heavy'
>('regular');
const [lastAction, setLastAction] = useState<
'regenerate' | 'append' | 'scope-up' | 'scope-down' | null
>(null);
const updateTask = useUpdateTask();
const updateSubtask = useUpdateSubtask();
const scopeUpTask = useScopeUpTask();
@@ -117,8 +125,11 @@ export const AIActionsSection: React.FC<AIActionsSectionProps> = ({
setLastAction('scope-up');
try {
const taskId = isSubtask && parentTask ? `${parentTask.id}.${currentTask.id}` : currentTask.id;
const taskId =
isSubtask && parentTask
? `${parentTask.id}.${currentTask.id}`
: currentTask.id;
await scopeUpTask.mutateAsync({
taskId,
strength: scopeStrength,
@@ -143,8 +154,11 @@ export const AIActionsSection: React.FC<AIActionsSectionProps> = ({
setLastAction('scope-down');
try {
const taskId = isSubtask && parentTask ? `${parentTask.id}.${currentTask.id}` : currentTask.id;
const taskId =
isSubtask && parentTask
? `${parentTask.id}.${currentTask.id}`
: currentTask.id;
await scopeDownTask.mutateAsync({
taskId,
strength: scopeStrength,
@@ -162,7 +176,11 @@ export const AIActionsSection: React.FC<AIActionsSectionProps> = ({
};
// Track loading states based on the last action
const isLoading = updateTask.isPending || updateSubtask.isPending || scopeUpTask.isPending || scopeDownTask.isPending;
const isLoading =
updateTask.isPending ||
updateSubtask.isPending ||
scopeUpTask.isPending ||
scopeDownTask.isPending;
const isRegenerating = isLoading && lastAction === 'regenerate';
const isAppending = isLoading && lastAction === 'append';
const isScopingUp = isLoading && lastAction === 'scope-up';
@@ -251,7 +269,7 @@ export const AIActionsSection: React.FC<AIActionsSectionProps> = ({
<Label className="block text-sm font-medium text-vscode-foreground/80 mb-3">
Task Complexity Adjustment
</Label>
{/* Strength Selection */}
<div className="mb-3">
<Label className="block text-xs text-vscode-foreground/60 mb-2">
@@ -348,10 +366,12 @@ export const AIActionsSection: React.FC<AIActionsSectionProps> = ({
</>
)}
<p>
<strong>Scope Up:</strong> Increases task complexity with more details, requirements, or implementation steps
<strong>Scope Up:</strong> Increases task complexity with more
details, requirements, or implementation steps
</p>
<p>
<strong>Scope Down:</strong> Decreases task complexity by simplifying or removing unnecessary details
<strong>Scope Down:</strong> Decreases task complexity by
simplifying or removing unnecessary details
</p>
</div>
</div>

View File

@@ -268,9 +268,7 @@ export function useScopeUpTask() {
return response;
},
onSuccess: async (data, variables) => {
console.log(
'✅ Task scope up successful, invalidating all task queries'
);
console.log('✅ Task scope up successful, invalidating all task queries');
console.log('Task ID:', variables.taskId);
// Invalidate ALL task-related queries

View File

@@ -9,10 +9,7 @@
"task-master-mcp": "mcp-server/server.js",
"task-master-ai": "mcp-server/server.js"
},
"workspaces": [
"apps/*",
"."
],
"workspaces": ["apps/*", "."],
"scripts": {
"test": "node --experimental-vm-modules node_modules/.bin/jest",
"test:fails": "node --experimental-vm-modules node_modules/.bin/jest --onlyFailures",

View File

@@ -8,13 +8,17 @@ jest.unstable_mockModule('../../../../../scripts/modules/utils.js', () => ({
log: jest.fn(),
readJSON: jest.fn(),
writeJSON: jest.fn(),
getCurrentTag: jest.fn(() => 'master')
getCurrentTag: jest.fn(() => 'master'),
readComplexityReport: jest.fn(),
findTaskInComplexityReport: jest.fn(),
findProjectRoot: jest.fn()
}));
jest.unstable_mockModule(
'../../../../../scripts/modules/ai-services-unified.js',
() => ({
generateObjectService: jest.fn()
generateObjectService: jest.fn(),
generateTextService: jest.fn()
})
);
@@ -26,8 +30,22 @@ jest.unstable_mockModule(
})
);
jest.unstable_mockModule(
'../../../../../scripts/modules/task-manager/analyze-task-complexity.js',
() => ({
default: jest.fn()
})
);
jest.unstable_mockModule(
'../../../../../src/utils/path-utils.js',
() => ({
findComplexityReportPath: jest.fn()
})
);
// Import modules after mocking
const { log, readJSON, writeJSON } = await import(
const { log, readJSON, writeJSON, readComplexityReport, findTaskInComplexityReport } = await import(
'../../../../../scripts/modules/utils.js'
);
const { generateObjectService } = await import(