npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@adobe/spectrum-component-diff-generator

v1.4.1

Published

Generates diff reports for Spectrum component schema changes with breaking change analysis

Readme

Component Schema Diff Generator

A tool for generating diff reports between Spectrum component schema versions, with intelligent breaking change detection.

Features

  • 🔍 Smart Diff Analysis: Detects component schema changes with semantic understanding
  • ⚠️ Breaking Change Detection: Automatically identifies API-breaking changes vs. safe updates
  • 📊 Multiple Output Formats: CLI, JSON, and Markdown outputs for different use cases
  • 🛠️ Shared Architecture: Built on @adobe/spectrum-diff-core for consistency with token diff generator
  • 🧪 Thoroughly Tested: Comprehensive test suite with 100% coverage

Installation

# Install dependencies
pnpm install

# Run tests
pnpm test

Usage

CLI

# Compare component schemas between versions (GitHub tags)
sdiff report --osv v1.0.0 --nsv v1.1.0 --format markdown --output report.md

# Compare between branches
sdiff report --osb main --nsb feature/new-components

# Compare remote version to local
sdiff report --osv v1.0.0 --local packages/component-schemas

# Show only breaking changes
sdiff report --osv v1.0.0 --nsv v1.1.0 --breaking-only

# Output formats
sdiff report --osv v1.0.0 --nsv v1.1.0 --format json        # JSON output
sdiff report --osv v1.0.0 --nsv v1.1.0 --format markdown    # Markdown output
sdiff report --osv v1.0.0 --nsv v1.1.0 --format cli         # CLI output (default)

CLI Options

  • --osv, --old-schema-version <version> - Old component schema version (GitHub tag)
  • --nsv, --new-schema-version <version> - New component schema version (GitHub tag)
  • --osb, --old-schema-branch <branch> - Old component schema branch
  • --nsb, --new-schema-branch <branch> - New component schema branch
  • --local <dir> - Local component schemas directory (default: packages/component-schemas)
  • --repo <repo> - Repository in owner/repo format
  • --format <format> - Output format: cli, markdown, json (default: cli)
  • --output <file> - Output file path
  • --breaking-only - Show only breaking changes
  • --github-token <token> - GitHub API token for private repos

Programmatic API

import {
  componentDiff,
  ComponentLoader,
} from "@adobe/spectrum-component-diff-generator";

// Load schemas
const loader = new ComponentLoader();
const original = await loader.loadLocalComponents("./schemas-v1");
const updated = await loader.loadLocalComponents("./schemas-v2");

// Generate diff
const result = componentDiff(original, updated);

console.log(result.summary.hasBreakingChanges); // true/false
console.log(result.summary.breakingChanges); // number of breaking changes

Breaking Change Detection

The tool automatically detects breaking changes according to JSON Schema best practices:

❌ Breaking Changes

  • Deleting components: Any removed component schema
  • Removing properties: Deleting any property from a component
  • Adding required fields: New required properties break existing implementations
  • Restricting enums: Removing values from enum fields
  • Type changes: Changing property types
  • Schema metadata changes: Changes to $schema, title, etc.

✅ Non-Breaking Changes

  • Adding components: New component schemas are always safe
  • Adding optional properties: New optional fields don't break existing usage
  • Expanding enums: Adding new enum values is backward compatible
  • Documentation updates: Changes to descriptions, examples, etc.

Output Examples

CLI Output

🚨 BREAKING CHANGES DETECTED

Component Schema Diff Report
Breaking Changes: 2
Non-Breaking Changes: 3

❌ Deleted Components (BREAKING):
  - legacy-button

💥 Breaking Updates:
  - button

📦 Added Components:
  + new-toggle

🔄 Non-Breaking Updates:
  ~ avatar
  ~ badge

JSON Output

{
  "summary": {
    "hasBreakingChanges": true,
    "totalComponents": {
      "added": 1,
      "deleted": 1,
      "updated": 3
    },
    "breakingChanges": 2,
    "nonBreakingChanges": 3
  },
  "changes": {
    "added": { "new-toggle": { "type": "added", "schema": {...} } },
    "deleted": { "legacy-button": { "type": "deleted", "schema": {...} } },
    "updated": {
      "breaking": { "button": { "type": "updated", "changes": {...} } },
      "nonBreaking": { "avatar": { "type": "updated", "changes": {...} } }
    }
  }
}

Architecture

This tool is built on the shared @adobe/spectrum-diff-core library, providing:

  • Consistent APIs: Same patterns as token diff generator
  • Shared utilities: Common diff, file loading, and formatting logic
  • Template system: Reusable Handlebars templates
  • Extensible design: Easy to add new output formats and analysis rules

Future Enhancements

  • Remote schema loading (GitHub API support)
  • Advanced breaking change rules (semantic versioning alignment)
  • Integration with PR workflows
  • Custom rule configuration
  • Detailed change descriptions with migration guidance

Built with ❤️ for the Adobe Spectrum Design System