JSPM

  • Created
  • Published
  • Downloads 1980
  • Score
    100M100P100Q112522F
  • License MIT

ESLint for API contracts — detect breaking changes, enforce semver, and generate migration guides for OpenAPI specs

Package Exports

    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 (delimit-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    delimit-cli

    ESLint for API contracts — detect breaking changes, enforce semver, and generate migration guides for OpenAPI specs.

    npm License: MIT

    Install

    npm install -g delimit-cli

    This installs the delimit command globally.

    Quick Start

    # Initialize a policy file in your repo
    delimit init
    
    # Detect breaking changes between two specs
    delimit lint api/openapi-old.yaml api/openapi-new.yaml
    
    # See raw diff output
    delimit diff api/openapi-old.yaml api/openapi-new.yaml
    
    # Generate a human-readable explanation
    delimit explain api/openapi-old.yaml api/openapi-new.yaml

    Commands

    Command Description
    delimit init Create .delimit/policies.yml with default rules
    delimit lint <old> <new> Diff + policy check with semver badge and violations
    delimit diff <old> <new> Raw diff with [BREAKING]/[safe] tags
    delimit explain <old> <new> Human-readable change explanation

    Options

    # Specify explainer template (default: developer)
    delimit explain old.yaml new.yaml -t migration
    delimit explain old.yaml new.yaml -t pr_comment
    delimit explain old.yaml new.yaml -t changelog
    
    # Include semver classification
    delimit lint old.yaml new.yaml --current-version 1.0.0
    
    # Use custom policy file
    delimit lint old.yaml new.yaml -p .delimit/policies.yml

    Explainer Templates

    Template Audience
    developer Technical details for engineers
    team_lead Summary for engineering managers
    product Non-technical overview for PMs
    migration Step-by-step migration guide
    changelog Ready-to-paste changelog entry
    pr_comment GitHub PR comment format
    slack Slack message format

    CI/CD Integration

    For automated PR checks, use the GitHub Action:

    - uses: delimit-ai/delimit-action@v1
      with:
        old_spec: base/api/openapi.yaml
        new_spec: api/openapi.yaml

    See Delimit API Governance on the GitHub Marketplace.

    Custom Policies

    Create .delimit/policies.yml:

    rules:
      - id: no_endpoint_removal
        change_types: [endpoint_removed]
        severity: error
        action: forbid
        message: "Endpoints cannot be removed without deprecation"
    
      - id: warn_type_change
        change_types: [type_changed]
        severity: warning
        action: warn
        message: "Type change may break clients"

    Supported Specs

    • OpenAPI 3.0.x and 3.1.x
    • Swagger 2.0
    • YAML and JSON formats

    License

    MIT