On this page

Pack anatomy

A pack is a folder:

text
my-pack/
├── dryv.pack.yaml        # the manifest: selections, templates, inputs, composition, actions
├── README.md             # shown by `dryv pack describe` and on the website
├── CHANGELOG.md
├── templates/            # resources: templates and static files (the manifest's `source`)
└── tests/                # a fixture project and a check script

A real manifest

This is the TypeScript API client pack, trimmed. Read it top to bottom.

yaml
version: dryv.pack/v1alpha1
key: unit.clients.ts-api-client
layout: unit # inject | unit
package: # unit packs describe the package they generate
  name: { $ref: "#/inputs/package_name" }
  import_root: src
source: templates # where resources live

info: # catalogue metadata (what `pack search` shows)
  title: TypeScript API Client
  version: 0.1.0
  purpose: clients
  summary: A framework-free TypeScript API client over fetch.
  languages: [typescript]
  frameworks: [fetch]
  tags: [client, sdk, typescript]

plugins: # renderers this pack needs
  - name: jinja
    extensions: [.j2]

inputs: # typed, bounded values a project may set
  package_name: { type: string, default: admin-console-api }

selections: # WHICH subjects
  models:
    subject: schema
    scope: each
  operations:
    subject: operation
    filter:
      all: { facet: http } # only operations that have an HTTP facet
    scope: each

templates: # WHAT each selection produces
  model:
    $ref: "#/selections/models"
    output:
      name: $(subject.name.kebab)
      symbol: $(subject.name.pascal)
  operation:
    $ref: "#/selections/operations"
    output:
      name: $(subject.name.kebab)
      path: [$(group.name.kebab)]
      symbol: $(subject.name.camel)
    imports: # generated-symbol dependencies between templates
      - $ref: "#/templates/model"

provides: # capabilities other packs can bind to
  operation.client: { $ref: "#/templates/operation" }
  schema.types: { $ref: "#/templates/model" }

actions:
  final:
    install:
      commands:
        - run: [(pnpm|npm|bun|yarn), install]

Section by section

KeyPurposeDetails
version, keyContract version and the pack's stable identity (<layout>.<purpose>.<name>)Core model
layoutinject adds files to an existing destination; unit generates a self-contained package or applicationLayouts and units
sourceFolder holding templates and static resourcesTemplate filesystem
infoHuman and catalogue metadata. purpose, summary and languages are required to publishTest and publish
pluginsRenderer name, version constraint and owned file extensionsTemplate servers
inputsTyped values a project can set; exposed to templates as the pack contextpack context
selectionssubject, scope (each or all), optional filterContext overview
templatesBind templates to selections; name outputs, declare symbols, imports and exportsArtifact graph
provides / needsCapability slots between packsComposition and bindings
chooseOptions a project must pick (for example the JS package manager)Project configuration
actionsFile and final commands for the client to runActions and commands

Subjects you can select

schema, operation, event, failure, policy, expression, workflow, view, view.part, surface, and the property kinds property.primitive, property.enum, property.composite, property.literal, property.union, property.record, property.tuple, property.generic, property.temporal. Each has a context page under Context: subjects in the sidebar.

Scope: each versus all

ScopeYou getUse it for
eachOne render per subject, with a singular root (schema)One file per schema
allOne render with a plural root (schemas[])An index, a module, a router that lists everything

Collection scopes such as group and feature add group or feature roots when ownership is provable.

Ownership: managed or scaffold

A resource whose name has .sf immediately before the renderer extension (main.ts.sf.hbs) is a scaffold: Dryv creates it once and never overwrites your later edits. Everything else is managed: Dryv rewrites it, and reports a conflict if you changed it by hand. See Starters, recipes and ownership.

Search in