# ashmeetsehgal/json-deep-compare architecture

> Architecture diagram of the GitHub repository ashmeetsehgal/json-deep-compare, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ashmeetsehgal/json-deep-compare
- Repository: https://github.com/ashmeetsehgal/json-deep-compare

## Overview

##### Main Components
A. Library Core (Left Side)
1. Source Modules (src/)
- Comparator.js
- JSONCompare.js
- Options.js
- PathUtils.js
- RegexValidator.js
- Result.js
- index.js (entry-point)
2. Type Definitions (types/)
- index.d.ts
- test.ts
3. Examples (examples/)
- Various usage scenario scripts (basic-usage.js, type-checking.js, etc.)
4. Tests (test/)
- api-validation.test.js, esm-test.mjs, module-import.test.js, etc.
B. Build & Publish Pipeline (Right Side)
1. Build Configuration
- Babel configuration (babel.esm.config.js)
- TypeScript config (tsconfig.json)
- build-index.js (bundler entry)
2. Scripts
- scripts/publish-package.js
- scripts/publish-packages.js
3. CI/CD Workflows (.github/workflows/)
- Test, coverage, codeql-analysis, npm-publish, renovate, pr-validation, etc.
4. Package Metadata
- package.json / package-lock.json / .npmrc / .npmignore
5. Publishing Targets
- npm registry
- GitHub Packages (optional)

##### Architectural Patterns & Design Principles
- **Separation of Concerns**: Core library vs. build/publish logic kept in separate directories.
- **Extensibility**: Examples folder and plugin-like regexChecks / options data flow—show options flowing into JSONCompare.

##### Technologies, Frameworks & External Services
- Jest – label near Tests.
- Renovate / Dependabot – small labels under CI/CD representing dependency management.

## Diagram (Mermaid)

```mermaid
flowchart LR
    T["Made by AshmeetSehgal.com"]

    subgraph "Library Core"
        direction TB
        SRC["Source Modules (src/)"]:::core
        CMPL["Comparator.js"]:::core
        JSCOMP["JSONCompare.js"]:::core
        OPTS["Options.js"]:::core
        PATHU["PathUtils.js"]:::core
        REGX["RegexValidator.js"]:::core
        RSLT["Result.js"]:::core
        ENTRY["index.js"]:::core
        TYPES["Type Definitions (types/)"]:::core
        TIDX["index.d.ts"]:::core
        TTST["test.ts"]:::core
        EXS["Examples (examples/)"]:::core
        TSTS["Tests (test/)"]:::core
        NODE["Node.js"]:::ext
        SRC --> CMPL
        SRC --> JSCOMP
        SRC --> OPTS
        SRC --> PATHU
        SRC --> REGX
        SRC --> RSLT
        SRC --> ENTRY
        TYPES --> TIDX
        TYPES --> TTST
    end

    subgraph "Build & Publish Pipeline"
        direction TB
        BC["Build Configuration"]:::pipeline
        BABEL["babel.esm.config.js"]:::pipeline
        TS["tsconfig.json"]:::pipeline
        BUNDLER["build-index.js"]:::pipeline
        SCRIPTS["Publish Scripts (scripts/)"]:::pipeline
        SPKG["publish-package.js"]:::pipeline
        SMPKG["publish-packages.js"]:::pipeline
        CI["CI/CD Workflows"]:::pipeline
        WFDIR[".github/workflows/"]:::pipeline
        WF1["codeql-analysis.yml"]:::pipeline
        WF2["coverage.yml"]:::pipeline
        WF3["npm-publish-on-merge.yml"]:::pipeline
        WF4["npm-publish.yml"]:::pipeline
        WF5["pr-description-check.yml"]:::pipeline
        WF6["pr-validation.yml"]:::pipeline
        WF7["publish-package.yml"]:::pipeline
        WF8["renovate.yml"]:::pipeline
        WF9["test.yml"]:::pipeline
        META["Package Metadata"]:::pipeline
        PJN["package.json"]:::pipeline
        LOCK["package-lock.json"]:::pipeline
        NPMIG[".npmignore"]:::pipeline
        NPMRC[".npmrc"]:::pipeline
        NPMR["npm registry"]:::ext
        GHACT["GitHub Actions"]:::ext
        BABEL --> BC
        TS --> BC
        BC --> BUNDLER
        SCRIPTS --> SPKG
        SCRIPTS --> SMPKG
        CI --> WFDIR
        WFDIR --> WF1 & WF2 & WF3 & WF4 & WF5 & WF6 & WF7 & WF8 & WF9
    end

    EXS -->|"consumer usage"| SRC
    TSTS -->|"validate behavior"| SRC
    SRC -->|"input to bundler"| BUNDLER
    BUNDLER -->|"published artifacts"| NPMR
    TTST --> TS
    TYPES --> BUNDLER
    CI -->|"runs"| TSTS
    CI -->|"runs"| WF2
    CI -->|"runs"| WF4

    T --> SRC
    T --> BC

    click SRC "https://github.com/ashmeetsehgal/json-deep-compare/tree/main/src/"
    click CMPL "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/src/Comparator.js"
    click JSCOMP "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/src/JSONCompare.js"
    click OPTS "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/src/Options.js"
    click PATHU "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/src/PathUtils.js"
    click REGX "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/src/RegexValidator.js"
    click RSLT "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/src/Result.js"
    click ENTRY "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/src/index.js"
    click TYPES "https://github.com/ashmeetsehgal/json-deep-compare/tree/main/types/"
    click TIDX "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/types/index.d.ts"
    click TTST "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/types/test.ts"
    click EXS "https://github.com/ashmeetsehgal/json-deep-compare/tree/main/examples/"
    click EXS "https://github.com/ashmeetsehgal/json-deep-compare/tree/main/examples/"
    click TSTS "https://github.com/ashmeetsehgal/json-deep-compare/tree/main/test/"
    click BABEL "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/babel.esm.config.js"
    click TS "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/tsconfig.json"
    click BUNDLER "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/build-index.js"
    click SCRIPTS "https://github.com/ashmeetsehgal/json-deep-compare/tree/main/scripts/"
    click SPKG "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/scripts/publish-package.js"
    click SMPKG "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/scripts/publish-packages.js"
    click WFDIR "https://github.com/ashmeetsehgal/json-deep-compare/tree/main/.github/workflows/"
    click WF1 "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/.github/workflows/codeql-analysis.yml"
    click WF2 "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/.github/workflows/coverage.yml"
    click WF3 "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/.github/workflows/npm-publish-on-merge.yml"
    click WF4 "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/.github/workflows/npm-publish.yml"
    click WF5 "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/.github/workflows/pr-description-check.yml"
    click WF6 "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/.github/workflows/pr-validation.yml"
    click WF7 "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/.github/workflows/publish-package.yml"
    click WF8 "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/.github/workflows/renovate.yml"
    click WF9 "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/.github/workflows/test.yml"
    click PJN "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/package.json"
    click LOCK "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/package-lock.json"
    click NPMIG "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/.npmignore"
    click NPMRC "https://github.com/ashmeetsehgal/json-deep-compare/blob/main/.npmrc"

    classDef core fill:#e0f7fa,stroke:#0288d1,color:#000
    classDef pipeline fill:#e8f5e9,stroke:#2e7d32,color:#000
    classDef ext fill:#fff3e0,stroke:#fb8c00,color:#000
```
