Overview
An entry is the core content unit in Dex DSL. Each entry represents a single recording/performance with associated metadata, credits, downloads, and a generated HTML page.Entries live in the
entries/ directory, with each entry in its own folder named by slug (e.g., entries/john-doe-piano/).Entry Folder Structure
Each entry folder contains five tracked files:entry.json Schema
Theentry.json file defines the entry’s structure:
Core Fields
URL-safe identifier (lowercase, alphanumeric, hyphens). Must match folder name.
Display title shown in UI and metadata.
Derived canonical metadata for SEO and search:
instrument: Primary instrument nameartistName: Primary artist/performer name
Timestamps managed automatically:
publishedAt: First write timestamp (immutable after creation)updatedAt: Last modification timestamp (auto-updated on every write)
Video configuration:
mode: Either"url"(direct video URL) or"embed"(iframe HTML)dataUrl: Video CDN URL (required if mode isurl)dataHtml: Embed iframe HTML (required if mode isembed)
Sidebar Configuration
ThesidebarPageConfig contains download panel and credits:
Catalog lookup code (e.g.,
"A.Pl S4 01"). Used for asset resolution.Download bucket identifiers. Valid values:
["A", "B", "C", "D", "E", "X"].Credits structure:
Audio file specifications:
bitDepth: Bit depth (e.g.,24)sampleRate: Sample rate in Hz (e.g.,48000)channels:"mono","stereo", or"multichannel"staticSizes: Object mapping buckets to file sizes (e.g.,{"A": "250 MB"})
Recording index references:
recordingIndexPdfRef: Asset token for PDF (e.g.,lookup:A.Pl_S4_01orasset:abc123)recordingIndexBundleRef: Bundle token (e.g.,bundle:stems-package)recordingIndexSourceUrl: Google Sheets URL for recording index datafileTree: Hierarchical download tree structure (see Download Tree section)
manifest.json Schema
Themanifest.json maps download formats to CDN URLs:
Format keys (like
mp3, wav, 1080p, 4K) are extracted from the HTML template and validated during entry creation.Entry Lifecycle
Creation (Init)
When creating an entry withdex init:
The publishedAt timestamp is set on first write and never changes:
Updates (Update)
When updating an entry withdex update:
- Read existing
entry.json - Preserve
publishedAtfrom existing lifecycle - Fall back to oldest file mtime if
publishedAtis missing - Set
updatedAtto current timestamp - Regenerate
index.htmlwith updated data
Health Checks (Doctor)
Thedex doctor command checks for:
- Drift: Differences between
entry.jsonand generated HTML - Missing files: Any of the 5 tracked files absent
- Invalid JSON: Malformed
entry.jsonormanifest.json - Schema violations: Fields not matching Zod schemas
- Broken asset references: Invalid
lookup:,asset:, orbundle:tokens
Canonical Metadata
Canonical fields are derived from credits and sidebar config:Download Tree Structure
ThefileTree in downloads supports hierarchical file organization:
Slugification Rules
Slugs are normalized using:"John Doe Piano"→"john-doe-piano""A.Pl S4 01!!"→"apl-s4-01""test___entry"→"test-entry"
Validation and Schemas
Entries are validated using Zod schemas:See
scripts/lib/entry-schema.mjs for the complete schema definitions including credits, download tree, and manifest validation.Best Practices
Stable Slugs
Never change an entry’s slug after publishing. URLs depend on slug permanence.
Validate Before Commit
Run
dex doctor before committing entry changes to catch drift and schema issues.Use Asset Tokens
Prefer
lookup: and bundle: tokens over hardcoded URLs for maintainability.Track File Size
Keep
staticSizes updated so users know download sizes before clicking.