PACKAGE-UPDATE-2025.md•4.39 kB
# Package Update - January 2025
## Summary
All npm packages have been updated to their latest versions and comprehensive code quality tools have been added.
## Updated Packages
### Dependencies
- `@modelcontextprotocol/sdk`: `^0.5.0` → `^1.0.4` (major version bump!)
- `axios`: `^1.6.0` → `^1.7.9`
### DevDependencies
- `@types/node`: `^20.10.0` → `^22.10.5`
- `typescript`: `^5.3.0` → `^5.7.2`
### New DevDependencies (Code Quality Tools)
- `@eslint/js`: `^9.17.0` (NEW)
- `eslint`: `^9.17.0` (NEW)
- `eslint-config-prettier`: `^9.1.0` (NEW)
- `prettier`: `^3.4.2` (NEW)
- `typescript-eslint`: `^8.19.1` (NEW)
## New NPM Scripts
```json
{
"lint": "eslint src --ext .ts",
"lint:fix": "eslint src --ext .ts --fix",
"format": "prettier --write \"src/**/*.ts\"",
"format:check": "prettier --check \"src/**/*.ts\"",
"type-check": "tsc --noEmit",
"validate": "npm run type-check && npm run lint && npm run format:check",
"precommit": "npm run validate && npm run build"
}
```
## New Configuration Files
### eslint.config.js
- Modern ESLint 9 flat config
- TypeScript-ESLint integration
- Prettier integration
- Relaxed rules for MCP server use case:
- `no-console`: off (MCP uses stderr for progress)
- `@typescript-eslint/no-explicit-any`: off (MCP flexibility)
### .prettierrc.json
- Consistent code formatting
- 2 space indentation
- Single quotes
- Semicolons enabled
- 100 character line width
### .prettierignore
- Excludes dist/, node_modules/, generated files
## Updated GitHub Actions CI
### New Jobs
1. **lint** - ESLint code quality check
2. **type-check** - TypeScript type validation
3. **build** - Build and test (now depends on lint + type-check)
4. **root-hygiene** - Repository structure enforcement
### Updated Workflow
- Runs on push to main and pull requests
- Parallel execution of lint and type-check
- Build only runs after quality checks pass
- Integration tests with Sitecore (if secrets configured)
## New README Badges
- ✅ CI Status
- ✅ Root Hygiene
- ✅ TypeScript 5.7
- ✅ Code Style: Prettier
- ✅ MIT License
- ✅ Node.js ≥18
## Validation Results
### ✅ Type Check
```bash
npm run type-check
# ✅ No TypeScript errors
```
### ✅ Build
```bash
npm run build
# ✅ Builds successfully
```
### ✅ Linting
```bash
npm run lint
# ✅ 0 errors, 30 warnings (acceptable for MCP server)
```
### ✅ Formatting
```bash
npm run format:check
# ✅ All matched files use Prettier code style!
```
### ✅ Full Validation
```bash
npm run validate
# ✅ All checks pass
```
## Integration Tests
All MCP tools continue to work correctly with updated packages:
- ✅ 17/17 tests passed (100% success rate)
- ✅ Total duration: ~10-11 seconds
- ✅ All test groups passing
## Breaking Changes
### MCP SDK v1.0.4
The `@modelcontextprotocol/sdk` was upgraded from `^0.5.0` to `^1.0.4`. This is a major version bump, but the API remained compatible with our implementation. No code changes were required.
## Migration Notes
### Clean Install Required
```bash
rm -Recurse -Force node_modules
rm package-lock.json
npm install
```
### ESLint Configuration
The project now uses ESLint 9 with flat config (`eslint.config.js`) instead of the legacy `.eslintrc.json`. The old config file has been removed.
### Linting Warnings
The codebase has 30 linting warnings which are acceptable for this project:
- Unused parameters (preserved for API compatibility)
- Unnecessary escape characters in GraphQL queries
- Console statements (required for MCP stderr output)
These warnings do not affect functionality and are documented as acceptable.
## Next Steps
1. **Optional**: Address linting warnings by refactoring unused parameters with `_` prefix
2. **Recommended**: Set up GitHub repository secrets for CI integration tests:
- `SITECORE_HOST`
- `SITECORE_API_KEY`
3. **Future**: Consider adding unit tests with Jest or Vitest
## Verification Commands
```bash
# Install dependencies
npm install
# Run all quality checks
npm run validate
# Build project
npm run build
# Run integration tests (requires .env)
npm run test
# Format code
npm run format
# Fix auto-fixable linting issues
npm run lint:fix
```
## Status
✅ **All packages updated successfully**
✅ **Code quality tools configured**
✅ **CI/CD pipeline updated**
✅ **All tests passing**
✅ **README badges added**
✅ **Project ready for use**