Local Tool Validation

Use the pptb-validate CLI — shipped with @pptb/types — to validate your tool's package.json against the same rules as the official Power Platform ToolBox review process, before you publish to npm.

Overview

When you submit a tool to the ToolBox registry, automated checks run the same validation pipeline that pptb-validate mirrors locally. Running the validator before publishing helps you:

  • Catch configuration problems early, without wasting npm version numbers
  • Reduce failed intake reviews caused by minor setup issues
  • Speed up the overall review process for you and for maintainers

Prerequisites

Install @pptb/types as a dev dependency in your tool project:

npm install --save-dev @pptb/types

The pptb-validate binary is automatically added to node_modules/.bin/ on install.

Quick Start

Option 1 — npm script (recommended)

Add a validate script to your tool's package.json:

{
  "scripts": {
    "validate": "pptb-validate"
  }
}

Then run:

npm run validate

Option 2 — npx (no script entry needed)

Run without adding a script entry, as long as @pptb/types is installed:

npx pptb-validate

Option 3 — point at a specific file

npx pptb-validate path/to/package.json

By default the tool looks for package.json in the current working directory.

CLI Options

OptionDescription
--skip-url-checksSkip URL reachability checks — faster and works offline
--jsonPrint results as a JSON object, suitable for CI pipelines
--help, -hShow help information

Examples:

# Full validation including URL reachability
npm run validate

# Fast / offline run — skip URL checks
npm run validate -- --skip-url-checks

# JSON output for CI pipelines
npx pptb-validate --json

# Validate a specific package.json
npx pptb-validate ./dist/package.json --skip-url-checks

What Is Validated

The validator checks every field that the official review pipeline inspects:

FieldRequiredRules
nameMust be a non-empty string
versionMust be a non-empty string
displayNameMust be a non-empty string
descriptionMust be a non-empty string
licenseMust be one of the approved open-source identifiers
contributorsMust be a non-empty array; each entry must have a name
configurations.repositoryMust be a valid GitHub URL
configurations.readmeUrlMust be a valid raw.githubusercontent.com URL
icon⚠️ optionalIf present: relative POSIX SVG path under dist/; no absolute, Windows, or URL paths
configurations.website⚠️ optionalIf present: must be a valid HTTPS URL
configurations.funding⚠️ optionalIf present: must be a valid URL
cspExceptions⚠️ optionalEach directive must be an array of valid origin strings
features.multiConnection⚠️ optionalIf present: must be "required", "optional", or "none"
features.minAPI⚠️ optionalIf present: must be a valid semantic version string

Approved licenses: MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, GPL-2.0, GPL-3.0, LGPL-3.0, ISC, AGPL-3.0-only

Warnings vs Errors

CategoryBehaviour
Required fields missing or invalid (name, version, displayName, description, license, contributors, configurations.repository, configurations.readmeUrl)Error — validation fails, exit code 1
Optional fields absent (icon, configurations.website, configurations.funding)Warning — validation still passes, you are nudged to add them
Optional fields present but malformed (bad URL, invalid icon path, Windows absolute path, backslash separator, etc.)Warning or ✖ Error as appropriate

A clean run with no errors exits with code 0. Any error exits with code 1. Warnings alone do not cause a non-zero exit.

Sample human-readable output:

✔ Validation passed

  ✖ configurations.readmeUrl is missing
  ⚠ icon is not set (optional but recommended)
  ⚠ configurations.website is not set (optional but recommended)

CI Pipeline Integration

Use --json to get machine-readable output and integrate pptb-validate into your GitHub Actions workflow or other CI pipeline:

# .github/workflows/validate.yml
name: Validate tool package

on: [push, pull_request]

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      - run: npm ci
      - run: npx pptb-validate --skip-url-checks

For structured results (e.g. to post a PR comment), capture the JSON output:

npx pptb-validate --json --skip-url-checks
{
  "valid": true,
  "errors": [],
  "warnings": [
    "icon is not set (optional but recommended)"
  ]
}

Next Steps

Was this page helpful?