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

@miragon/value-chain-schema-model

v0.7.1

Published

The value chain data model with types, validation, migrations and stable JSON serialization.

Readme

@miragon/value-chain-schema-model

npm License: MIT

The DOM-free core of the Value Chain Modeler: types, Zod validation, migrations and deterministic JSON serialization for value chain diagrams (ARIS-style Wertschöpfungskettendiagramme, *.vc / *.vc.json).

Plain TypeScript with no diagram-js and no DOM, so it runs in the browser, in Node and in CLIs. The browser renderer @miragon/value-chain-renderer, the web app and the VS Code extension all build on it.

Install

npm install @miragon/value-chain-schema-model

Ships ESM and CommonJS builds with type declarations. zod (^4.6.0) is a peer dependency, so the package validates with your app's copy of Zod instead of bringing a second one.

Usage

import { readFile } from 'node:fs/promises';
import {
  createEmptyDocument,
  parseDocumentJSON,
  serializeDocument,
} from '@miragon/value-chain-schema-model';

const doc = parseDocumentJSON(await readFile('landscape.vc.json', 'utf8')); // migrate + validate
const json = serializeDocument(doc); // stable output for clean Git diffs

const empty = createEmptyDocument('My value chain');

| Export | Purpose | | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | loadDocument(data) / parseDocumentJSON(s) | Migrate older documents to CURRENT_SCHEMA_VERSION, then validate. Use these for any external input. | | validateDocument(data) | Zod schema plus invariants: unique ids, reserved ids, resolvable endpoints, the relation/element-type matrix. | | documentIssues(data) | The same checks as a list of findings, each with its JSON path, for editors that point at the broken spot. | | connectionAllowed(type, source, target) | The relation matrix: sequence/hierarchy link steps, assignment links an org unit with a step. | | serializeDocument(doc) | Deterministic JSON: elements and connections sorted by id, keys deep-sorted, numbers rounded to 3 decimals. | | createEmptyDocument(name?) | A valid, empty document. | | documentExtensions(doc) and its siblings | The fields a document, its meta, an element or a connection carries beyond the schema (kept, see below). | | valueChainDocumentSchema & element schemas | The raw Zod schemas. | | ValueChainDocument, DiagramElement, … | TypeScript types of the persisted format. |

Document format

{
  "schemaVersion": 1,
  "meta": { "name": "Porter Value Chain" },
  "elements": [
    {
      "id": "step-operations",
      "elementType": "step", // chevron
      "name": "Operations",
      "bounds": { "x": 280, "y": 124, "width": 160, "height": 60 },
    },
    {
      "id": "org-production",
      "elementType": "orgUnit", // ellipse
      "name": "Production",
      "bounds": { "x": 295, "y": 230, "width": 130, "height": 60 },
    },
  ],
  "connections": [
    {
      "id": "assign-1",
      "connectionType": "assignment", // or "sequence" | "hierarchy"
      "source": "step-operations",
      "target": "org-production",
      "waypoints": [
        { "x": 360, "y": 184 },
        { "x": 360, "y": 230 },
      ],
    },
  ],
}

Unknown keys on the document, meta, elements and connections are kept through load and serialization (sorted, values unrounded), so vendor extensions survive an edit in the tools. bounds and waypoints reject unknown keys, an unknown elementType or connectionType is invalid, the ids vc-root, __implicitroot… and the names of built-in JavaScript object properties (constructor, toString, …) are reserved, coordinates and sizes stay within ±1e9 (COORDINATE_LIMIT), and objects and arrays nest at most 100 levels (MAX_NESTING_DEPTH).

A complete example lives in example/porter.vc.json.

License

MIT