๐ ๏ธ PortaPack Development Guide โ
๐ Prerequisites โ
- Node.js: v18+ (recommended v20)
- npm: v9+
- Git
Optional Tools โ
bash
# Install Commitizen CLI globally
npm install -g commitizen
๐ Getting Started โ
Clone the repository:
bashgit clone https://github.com/manicinc/portapack.git cd portapack
Install dependencies:
bash# Recommended for clean installs npm ci # or npm install
โ๏ธ Development Workflow โ
Primary Development Command โ
bash
npm run dev
This command simultaneously runs:
- TypeScript rebuild watcher
- Documentation server
- Test runner
Specific Development Scripts โ
Command | Purpose |
---|---|
npm run dev:build | Watch and rebuild TypeScript |
npm run dev:docs | Start documentation server |
npm run dev:test | Run tests in watch mode |
๐งช Testing Strategies โ
Test Runners โ
bash
# Full test suite with coverage
npm test
# Interactive test watch mode
npm run dev:test
# Targeted test debugging
npm run dev:test:debug -- tests/specific/file.test.ts
# Clear Jest cache
npm run test:clear
๐งฐ Code Quality โ
bash
# Lint code
npm run lint
# Format code
npm run format
# Check formatting
npm run format:check
๐ฆ Building โ
bash
# Build project
npm run build
Builds include:
- TypeScript compilation
- API documentation generation
- Documentation site build
๐ Documentation โ
bash
# Start documentation development
npm run docs:dev
# Generate API docs
npm run docs:api
# Build documentation
npm run docs:build
๐ฌ Committing Changes โ
bash
# Stage changes
git add .
# Use commit helper
npm run commit
Follow the Conventional Commits specification guided by Commitizen.
๐ค Contribution Workflow โ
- Fork the repository
- Create a feature branchbash
git checkout -b feature/your-feature
- Make changes
- Run testsbash
npm test npm run lint npm run format
- Commit using
npm run commit
- Push to your fork
- Open a Pull Request
๐ Project Structure โ
portapack/
โโโ .github/ # GitHub Actions
โโโ dist/ # Compiled output
โโโ docs/ # Documentation source
โโโ examples/ # Example scripts
โโโ src/ # Source code
โ โโโ cli/ # CLI logic
โ โโโ core/ # Core bundling logic
โ โโโ utils/ # Utility functions
โโโ tests/ # Test files
โโโ package.json # Project configuration
๐จ Troubleshooting โ
- Clear Jest cache:
npm run test:clear
- Ensure Node.js and npm versions match prerequisites
- Verify dependencies with
npm ci
๐ Community & Support โ
๐ License โ
MIT License - Built by Manic Agency