JSPM

  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q69499F
  • License MIT

CLI tool to scaffold GitHub Actions workflows and code quality setup with Husky

Package Exports

  • @netanelh2/create-workflows-package
  • @netanelh2/create-workflows-package/dist/src/cli.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@netanelh2/create-workflows-package) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@netanelh2/create-workflows-package

🚀 CLI tool to add GitHub Actions workflows and code quality setup with Husky to your existing project.

Quick Start

Add workflows and code quality to your project using npx (recommended):

npx @netanelh2/create-workflows-package

Or install globally and use:

npm install -g @netanelh2/create-workflows-package
create-workflows-package

Usage

Interactive Mode (Default)

Run to be prompted for which workflows and features to include:

npx @netanelh2/create-workflows-package

Non-Interactive Mode

Skip all prompts and include everything:

npx @netanelh2/create-workflows-package --yes

Command Options

  • -y, --yes - Skip prompts and include all features
  • --no-install - Skip automatic dependency installation

Examples

# Interactive setup
npx @netanelh2/create-workflows-package

# Include everything without prompts
npx @netanelh2/create-workflows-package --yes

# Setup without installing dependencies
npx @netanelh2/create-workflows-package --no-install

What Gets Added

The CLI adds to your existing project:

  • GitHub Actions workflows for CI/CD automation
  • Code quality tools: ESLint, Prettier with TypeScript support
  • Husky git hooks for pre-commit quality checks
  • lint-staged for efficient pre-commit linting
  • Updated package.json with quality scripts

Available Workflows

Choose from these GitHub Actions workflows:

  • Sanity Tests - Run quick sanity checks on pull requests
  • Regression Tests - Full test suite for releases
  • Code Quality - Linting, formatting, and type checking
  • Cleanup Artifacts - Automatic cleanup of old workflow artifacts
  • Deploy Reports - Deploy test reports to GitHub Pages
  • Slack Notifications - Send notifications to Slack channels
  • Nightly Regression - Run full regression tests nightly

GitHub Actions Setup Guide

After running the CLI, follow these steps to enable GitHub Actions:

  1. Repository Permissions:

    • Go to your repository on GitHub
    • Navigate to Settings > Actions > General
    • Under "Workflow permissions", select "Read and write permissions"
  2. Required Secrets (if using Slack notifications):

    • Go to Settings > Secrets and variables > Actions
    • Add SLACK_WEBHOOK_URL with your Slack webhook URL
  3. Branch Protection (recommended):

    • Go to Settings > Branches
    • Add rules for main branch requiring status checks

Scripts Added to package.json

{
  "scripts": {
    "lint:check": "eslint src/**/*.ts --max-warnings 0 --no-warn-ignored",
    "format:check": "prettier --check src/**/*.ts",
    "check": "npm run lint:check && npm run format:check && npx tsc",
    "fix": "prettier --write src/**/*.ts && eslint src/**/*.ts --fix --no-warn-ignored",
    "pre-commit": "lint-staged",
    "prepare": "husky"
  }
}

After Setup

Once setup is complete, you can use these commands:

# Code Quality
npm run check            # Run all quality checks
npm run lint:check       # Check linting
npm run format:check     # Check formatting
npm run fix              # Auto-fix issues

# Git Hooks
npm run prepare          # Setup Husky (run once)

Requirements

  • Node.js 18.0.0 or higher
  • npm or yarn
  • Existing Git repository (recommended)

Dependencies Added

Dev Dependencies:

  • @typescript-eslint/eslint-plugin
  • @typescript-eslint/parser
  • eslint
  • eslint-config-prettier
  • eslint-plugin-prettier
  • prettier
  • husky
  • lint-staged

License

MIT

Support