Skip to content

๐Ÿ› ๏ธ 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 โ€‹

  1. Clone the repository:

    bash
    git clone https://github.com/manicinc/portapack.git
    cd portapack
  2. 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 โ€‹

CommandPurpose
npm run dev:buildWatch and rebuild TypeScript
npm run dev:docsStart documentation server
npm run dev:testRun 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 โ€‹

  1. Fork the repository
  2. Create a feature branch
    bash
    git checkout -b feature/your-feature
  3. Make changes
  4. Run tests
    bash
    npm test
    npm run lint
    npm run format
  5. Commit using npm run commit
  6. Push to your fork
  7. 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

Last updated:

Released under the MIT License