iron-tools
v1.0.3
Published
A monorepo of specialized CLI tools for managing course materials by dynamically updating index.yaml files
Readme
Iron Tools
A monorepo of specialized CLI tools for managing course materials by dynamically updating index.yaml files.
Table of Contents
Overview
Iron Tools is a comprehensive monorepo containing specialized CLI tools designed for Ironhack course editors to efficiently manage course schedules. The tools automate the process of updating index.yaml files with synchronized dates and holiday insertions while maintaining proper course structure and numbering.
Features
- Unified CLI Interface: Single command-line tool for all operations
- Calendar Synchronization: Automatically insert dates into course schedules
- Holiday Management: Insert holidays and redistribute content across weeks
- Backup Creation: Automatic backup files to prevent data loss
- Sequential Consistency: Maintains proper week and day numbering
- Detailed Logging: Comprehensive progress tracking and error reporting
- Monorepo Architecture: Organized, maintainable codebase with shared utilities
Packages
| Package | Description | Version | | -------------------- | ------------------------------ | ------- | | @iron-tools/cli | Unified command-line interface | 1.0.0 | | @iron-tools/calendar | Calendar synchronization tool | 1.0.0 | | @iron-tools/holiday | Holiday insertion tool | 1.0.0 |
Installation
Install the unified CLI globally using npm:
npm install -g @iron-tools/cli
iron-tools --versionQuick Start
- Navigate to your course directory containing
index.yaml - Synchronize calendar dates:
iron-tools @calendar -d 7 -m 4 -y 2025 -f index.yaml - Insert a holiday:
iron-tools @holiday -w 2 -d 5 -f index.yaml
Usage
Calendar Synchronization
Insert synchronized dates starting from a specific date:
iron-tools @calendar -d <day> -m <month> -y <year> -f <file>Reset all inserted dates:
iron-tools @calendar --reset -f <file>Holiday Management
Insert a holiday on a specific week and day:
iron-tools @holiday -w <week> -d <day> -f <file>Development
Prerequisites
- Node.js >= 16.0.0
- npm >= 8.0.0
Setup
Clone the repository:
git clone https://github.com/omardieh/iron-tools.git cd iron-toolsInstall dependencies:
npm installBuild all packages:
npm run build
Scripts
| Script | Description |
| -------------------------- | -------------------------------- |
| npm start | Run the CLI tool |
| npm test | Run all tests |
| npm run test:unit | Run unit tests only |
| npm run test:integration | Run integration tests only |
| npm run test:coverage | Run tests with coverage report |
| npm run test:watch | Run tests in watch mode |
| npm run lint | Lint all packages |
| npm run lint:fix | Fix linting issues |
| npm run clean | Clean node_modules and coverage |
| npm run clean:install | Clean and reinstall dependencies |
| npm run build | Lint and test all packages |
| npm run release | Build and publish all packages |
Testing
Run the test suite:
# All tests
npm test
# Unit tests only
npm run test:unit
# Integration tests only
npm run test:integration
# With coverage
npm run test:coverage
# Watch mode
npm run test:watchLinting
Maintain code quality:
# Check for linting issues
npm run lint
# Fix linting issues automatically
npm run lint:fixProject Structure
iron-tools/
├── packages/
│ ├── cli/ # Unified CLI interface
│ ├── calendar/ # Calendar synchronization tool
│ └── holiday/ # Holiday insertion tool
├── .gitignore
├── .npmignore
├── jest.config.js
├── package.json
└── README.mdEach package contains:
lib/- Source code and utilitiesbin/- Executable CLI scripts__tests__/- Test filesREADME.md
Package-specific documentation
package.json
- Package configuration
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes and add tests
- Run the test suite:
npm run build - Commit your changes:
git commit -m "Add your feature description" - Push to your branch:
git push origin feature/your-feature-name - Open a pull request
Development Guidelines
- Follow existing code style and conventions
- Add tests for new functionality
- Update documentation as needed
- Ensure all tests pass before submitting
- Use conventional commit messages
Error Handling
Iron Tools provides comprehensive error handling with detailed messages for common issues:
- Invalid file paths or formats
- Missing required arguments
- File parsing errors
- Invalid date or week/day numbers
- Permission issues when creating backups
All tools create automatic backups before making changes to prevent data loss.
License
This project is licensed under the MIT License. See the LICENSE file for details.
⚠️ This is a private proprietary package. Not intended for public use or redistribution.
