v2
Marketplace Documentation
Overview

V2 Marketplace Documentation

V2 marketplaces provide recipe books, path keys, and adapters that transform V2Genome to StandardizedGenome.

Overview

V2 marketplaces:

  • Transform genomes: V2Genome β†’ StandardizedGenome
  • Provide recipe books: Package β†’ Module mapping
  • Define path keys: Semantic path definitions
  • Implement adapters: Marketplace-specific logic

Core Concepts

Marketplace Structure

marketplace/
β”œβ”€β”€ adapter/
β”‚   └── index.js          # Marketplace adapter
β”œβ”€β”€ capabilities/          # Infrastructure modules
β”œβ”€β”€ features/              # Complete features
β”œβ”€β”€ manifest.json          # Module registry (generated)
β”œβ”€β”€ recipe-book.json       # Package β†’ Module mapping (generated)
└── path-keys.json         # Path key definitions

Key Responsibilities

1. Transform Genomes

Marketplaces transform V2Genome to StandardizedGenome:

async transformGenome(genome: V2Genome, options, context) {
  // Use CompositionEngine to resolve
  const handler = new context.V2GenomeHandler(...);
  const lockFile = await handler.resolveGenome(genome);
  return handler.convertLockFileToResolvedGenome(lockFile, genome);
}

2. Provide Recipe Books

Recipe books map business packages to technical modules:

{
  "packages": {
    "auth": {
      "providers": {
        "default": {
          "modules": [
            { "id": "capabilities/auth", "targetPackage": "auth" }
          ]
        }
      }
    }
  }
}

3. Define Path Keys

Path keys define semantic paths:

{
  "pathKeys": [
    {
      "key": "apps.web.root",
      "description": "Web app root directory",
      "computed": true
    }
  ]
}

Creating a Marketplace

Use the CLI command:

architech marketplace generate <name> --type opinionated

This creates:

  • Directory structure
  • Adapter with all required methods
  • Build scripts
  • Path keys structure

Related