Design Token Inspector
Design Token Inspector ouputs a list of changes between two Design Token schemas. Every change is precisely explained and marked as breaking, non-breaking or dangerous.
Features
Major features:
- Compares schemas
- Finds breaking or dangerous changes
- Validates documents against a schema
Design Token Inspector has a CLI and also a programatic API, so you can use it however you want to and even build tools on top of it.
Installation
# CLI
yarn add @design-token/inspector-cli
# Core API for programatic usage
yarn add @design-token/inspector-core
Compare schemas
Compares schemas and finds breaking or dangerous changes.
CLI:
$ design-token-inspector diff OLD_SCHEMA NEW_SCHEMA
API:
import { Change, diff } from '@design-token/inspector-core';
const changes: Change[] = diff(schemaA, schemaB);
CLI in more details
SCHEMA
Pointer to a Git repository
Example:
design-token-inspector diff git:origin/master:schema.graphql
Pattern:
git:ref:path/to/file
Pointer to a GitHub repository
Example:
design-token-inspector digg github:kamilkisiela/design-token-inspector-example#master:schema.graphql
Pattern:
github:owner/name#ref:path/to/file
JSON File
Example:
design-token-inspector coverage introspected-schema.json
DOCUMENTS
Glob pattern
Example:
design-token-inspector validate ./src/**/*.{js,jsx,tsx,graphql} https://localhost:3000/graphql
Supports TypeScript, JavaScript and GraphQL Files (Extensions: ts,tsx,js,jsx,graphql,gql,graphqls).
Help
Find out what the CLI is capable of:
design-token-inspector --help
design-token-inspector diff --help
License
MIT © Mirahi SRL