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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mondrian-framework/cli

v2.0.63

Published

Mondrian CLI is a command line tool to help you detect breaking changes on your GraphQL and OpenAPI schemas.

Downloads

74

Readme

Mondrian CLI

Mondrian CLI is a command line tool to help you detect breaking changes on your GraphQL and OpenAPI schemas.

Some functionality of this CLI is also available on our CI Tools which is a free service to help you detect breaking changes on your GraphQL and OpenAPI schemas.

Installation

Just install it globally using npm:

npm install -g @mondrian-framework/cli

Usage

mondrian -h

GraphQL Diff

Compare two GraphQL schemas and detect any breaking changes between them.

mondrian gql-diff -h

Usage: mondrian gql-diff [options]

Detect any breaking changes between two GraphQL schemas

Options:
  --previous-schema <value>           previous GraphQL schema (endpoint, filename or schema)
  --current-schema <value>            current GraphQL schema (endpoint, filename or schema)
  --previous-schema-headers <value>   headers to use on previous schema download. Example: '{ "auth": "Bearer ..." }'
  --current-schema-headers <value>    headers to use on current schema download. Example: '{ "auth": "Bearer ..." }'
  --fail-on-breaking-changes <value>  'true' or 'false'. if 'true' breaking changes will return 1 as exit code. default is 'true'
  -h, --help                          display help for command

Examples:

mondrian gql-diff \
  --previous-schema http://localhost:4000/graphql \
  --current-schema http://localhost:4001/graphql

{
  "breakingChanges": 1,
  "info": [
    {
      "type": "INPUT_FIELD_ADDED",
      "criticality": {
        "level": "BREAKING",
        "reason": "Adding a required input field to an existing input object type is a breaking change because it will cause existing uses of this input object type to error."
      },
      "message": "Input field 'addedField' of type 'String!' was added to input object type 'LoginInput'",
      "meta": {
        "inputName": "LoginInput",
        "addedInputFieldName": "addedField",
        "isAddedInputFieldTypeNullable": false,
        "addedInputFieldType": "String!"
      },
      "path": "LoginInput.addedField"
    }
  ]
}

or 

{
  "breakingChanges": 0,
  "info": []
}

OAS Diff

mondrian oas-diff -h

Usage: mondrian oas-diff [options]

Detect any breaking changes between two OpenApi specifications

Options:
  --previous-schema <value>           previous OpenAPI schema (endpoint, filename or schema)
  --current-schema <value>            current OpenAPI schema (endpoint, filename or schema)
  --previous-schema-headers <value>   headers to use on previous schema download. Example: '{ "auth": "Bearer ..." }'
  --current-schema-headers <value>    headers to use on current schema download. Example: '{ "auth": "Bearer ..." }'
  --fail-on-breaking-changes <value>  'true' or 'false'. if 'true' breaking changes will return 1 as exit code. default is 'true'
  -h, --help                          display help for command

Examples:

mondrian oas-diff \
  --previous-schema http://localhost:4000/openapi/v1/schema.json \
  --current-schema http://localhost:4001/openapi/v1/schema.json

{
  "breakingChanges": 1,
  "info": {
    "reportSummary": {
      "components": {
        "totalChanges": 2,
        "breakingChanges": 1
      }
    },
    "CreatedAt": "0001-01-01T00:00:00Z",
    "UpdatedAt": "0001-01-01T00:00:00Z",
    "commitDetails": {
      "CreatedAt": "0001-01-01T00:00:00Z",
      "UpdatedAt": "0001-01-01T00:00:00Z",
      "commitHash": "16e079",
      "message": "New: /tmp/09fee2a3-99a0-40f1-943e-21374634fab7.json, Original: /tmp/a7de4c68-d58b-44cf-adab-5a9fe0f23fdd.json",
      "author": "",
      "authorEmail": "",
      "committed": "2024-01-16T10:14:37.642229+01:00",
      "changeReport": {
        "components": {
          "schemas": {
            "LoginInput": {
              "changes": [
                {
                  "context": {
                    "newLine": 1,
                    "newColumn": 18067
                  },
                  "change": 2,
                  "property": "required",
                  "new": "addedField",
                  "breaking": true
                },
                {
                  "context": {
                    "newLine": 1,
                    "newColumn": 18167
                  },
                  "change": 3,
                  "property": "properties",
                  "new": "addedField",
                  "breaking": false
                }
              ]
            }
          }
        }
      }
    }
  }
}

or 

{
  "breakingChanges": 0,
  "info": {
    "message": "No changes found between specifications"
  }
}