Refactored the `expandTask` feature (`scripts/modules/task-manager/expand-task.js`) and related components (`commands.js`, `mcp-server/src/tools/expand-task.js`, `mcp-server/src/core/direct-functions/expand-task.js`) to integrate with the unified AI service layer (`ai-services-unified.js`) and configuration management (`config-manager.js`). The refactor involved: - Removing direct AI client calls and configuration fetching from `expand-task.js`. - Attempting to use `generateObjectService` for structured subtask generation. This failed due to provider-specific errors (Perplexity internal errors, Anthropic schema translation issues). - Reverting the core AI interaction to use `generateTextService`, asking the LLM to format its response as JSON containing a "subtasks" array. - Re-implementing manual JSON parsing and Zod validation (`parseSubtasksFromText`) to handle the text response reliably. - Updating prompt generation functions (`generateMainSystemPrompt`, `generateMainUserPrompt`, `generateResearchUserPrompt`) to request the correct JSON object structure within the text response. - Ensuring the `expandTaskDirect` function handles pre-checks (force flag, task status) and correctly passes the `session` context and logger wrapper to the core `expandTask` function. - Correcting duplicate imports in `commands.js`. - Validating the refactored feature works correctly via both CLI (`task-master expand --id <id>`) and MCP (`expand_task` tool) for main and research roles. This aligns the task expansion feature with the new architecture while using the more robust text generation approach due to current limitations with structured output services. Closes subtask 61.37.
102 lines
5.1 KiB
Plaintext
102 lines
5.1 KiB
Plaintext
# Task ID: 63
|
|
# Title: Add pnpm Support for the Taskmaster Package
|
|
# Status: pending
|
|
# Dependencies: None
|
|
# Priority: medium
|
|
# Description: Implement full support for pnpm as an alternative package manager in the Taskmaster application, allowing users to install and manage the package using pnpm alongside the existing npm and yarn options.
|
|
# Details:
|
|
This task involves:
|
|
|
|
1. Update the installation documentation to include pnpm installation commands (e.g., `pnpm add taskmaster`).
|
|
|
|
2. Ensure all package scripts are compatible with pnpm's execution model:
|
|
- Review and modify package.json scripts if necessary
|
|
- Test script execution with pnpm syntax (`pnpm run <script>`)
|
|
- Address any pnpm-specific path or execution differences
|
|
|
|
3. Create a pnpm-lock.yaml file by installing dependencies with pnpm.
|
|
|
|
4. Test the application's installation and operation when installed via pnpm:
|
|
- Global installation (`pnpm add -g taskmaster`)
|
|
- Local project installation
|
|
- Verify CLI commands work correctly when installed with pnpm
|
|
|
|
5. Update CI/CD pipelines to include testing with pnpm:
|
|
- Add a pnpm test matrix to GitHub Actions workflows
|
|
- Ensure tests pass when dependencies are installed with pnpm
|
|
|
|
6. Handle any pnpm-specific dependency resolution issues:
|
|
- Address potential hoisting differences between npm/yarn and pnpm
|
|
- Test with pnpm's strict mode to ensure compatibility
|
|
|
|
7. Document any pnpm-specific considerations or commands in the README and documentation.
|
|
|
|
8. Consider adding a pnpm-specific installation script or helper if needed.
|
|
|
|
This implementation should maintain full feature parity regardless of which package manager is used to install Taskmaster.
|
|
|
|
# Test Strategy:
|
|
1. Manual Testing:
|
|
- Install Taskmaster globally using pnpm: `pnpm add -g taskmaster`
|
|
- Install Taskmaster locally in a test project: `pnpm add taskmaster`
|
|
- Verify all CLI commands function correctly with both installation methods
|
|
- Test all major features to ensure they work identically to npm/yarn installations
|
|
|
|
2. Automated Testing:
|
|
- Create a dedicated test workflow in GitHub Actions that uses pnpm
|
|
- Run the full test suite using pnpm to install dependencies
|
|
- Verify all tests pass with the same results as npm/yarn
|
|
|
|
3. Documentation Testing:
|
|
- Review all documentation to ensure pnpm commands are correctly documented
|
|
- Verify installation instructions work as written
|
|
- Test any pnpm-specific instructions or notes
|
|
|
|
4. Compatibility Testing:
|
|
- Test on different operating systems (Windows, macOS, Linux)
|
|
- Verify compatibility with different pnpm versions (latest stable and LTS)
|
|
- Test in environments with multiple package managers installed
|
|
|
|
5. Edge Case Testing:
|
|
- Test installation in a project that uses pnpm workspaces
|
|
- Verify behavior when upgrading from an npm/yarn installation to pnpm
|
|
- Test with pnpm's various flags and modes (--frozen-lockfile, --strict-peer-dependencies)
|
|
|
|
6. Performance Comparison:
|
|
- Measure and document any performance differences between package managers
|
|
- Compare installation times and disk space usage
|
|
|
|
Success criteria: Taskmaster should install and function identically regardless of whether it was installed via npm, yarn, or pnpm, with no degradation in functionality or performance.
|
|
|
|
# Subtasks:
|
|
## 1. Update Documentation for pnpm Support [pending]
|
|
### Dependencies: None
|
|
### Description: Revise installation and usage documentation to include pnpm commands and instructions for installing and managing Taskmaster with pnpm.
|
|
### Details:
|
|
Add pnpm installation commands (e.g., `pnpm add taskmaster`) and update all relevant sections in the README and official docs to reflect pnpm as a supported package manager.
|
|
|
|
## 2. Ensure Package Scripts Compatibility with pnpm [pending]
|
|
### Dependencies: 63.1
|
|
### Description: Review and update package.json scripts to ensure they work seamlessly with pnpm's execution model.
|
|
### Details:
|
|
Test all scripts using `pnpm run <script>`, address any pnpm-specific path or execution differences, and modify scripts as needed for compatibility.
|
|
|
|
## 3. Generate and Validate pnpm Lockfile [pending]
|
|
### Dependencies: 63.2
|
|
### Description: Install dependencies using pnpm to create a pnpm-lock.yaml file and ensure it accurately reflects the project's dependency tree.
|
|
### Details:
|
|
Run `pnpm install` to generate the lockfile, check it into version control, and verify that dependency resolution is correct and consistent.
|
|
|
|
## 4. Test Taskmaster Installation and Operation with pnpm [pending]
|
|
### Dependencies: 63.3
|
|
### Description: Thoroughly test Taskmaster's installation and CLI operation when installed via pnpm, both globally and locally.
|
|
### Details:
|
|
Perform global (`pnpm add -g taskmaster`) and local installations, verify CLI commands, and check for any pnpm-specific issues or incompatibilities.
|
|
|
|
## 5. Integrate pnpm into CI/CD Pipeline [pending]
|
|
### Dependencies: 63.4
|
|
### Description: Update CI/CD workflows to include pnpm in the test matrix, ensuring all tests pass when dependencies are installed with pnpm.
|
|
### Details:
|
|
Modify GitHub Actions or other CI configurations to use pnpm/action-setup, run tests with pnpm, and cache pnpm dependencies for efficiency.
|
|
|