Flutter LoomBy ARYAN KUMAR

Documentation

Flutter Loomregistry reference.

How the static canonical component registry validates manifests, enforces semantic version immutability, publishes static /r/ JSON endpoints, and feeds both Next.js and Flutter Web.

1. Registry Architecture

Static-First · Zero Backend

Every component lives exclusively under registry/components/<slug>/. The build pipeline compiles manifests into static JSON endpoints under public/r/ for the website and future Dart CLI while generating flutter_preview/lib/generated/demo_registry.dart for the reusable Flutter Web preview runner.

registry-layoutbash
registry/
  components/
    inbox-screen/
      component.json
      files/
        component.dart
        demo.dart
        preview.png
        assets/
        shaders/
  schemas/
    component.schema.json
  generated/
    registry.json
    components/
      inbox-screen.json
      inbox-screen/1.0.0.json
    files/
      inbox-screen/1.0.0/
        component.dart
        demo.dart
        preview.png
scripts/
  build-registry.ts
  validate-registry.ts
  check-registry.ts
public/r/                  # synced default website output (--out)
flutter_preview/lib/generated/

2. Component Folder Conventions & Metadata Schema

Each component folder matches its kebab-case slug and contains component.json paired with files/component.dart, files/demo.dart, and optional files/assets/ or files/shaders/. All manifests are validated against registry/schemas/component.schema.json.

registry/components/inbox-screen/component.jsonjson
{
  "$schema": "../../schemas/component.schema.json",
  "schemaVersion": "1.0.0",
  "name": "Inbox Screen",
  "slug": "inbox-screen",
  "version": "1.0.0",
  "description": "Standalone Inbox UI screen with gradient hero, search, filters, and conversation list.",
  "author": {
    "name": "Aryan Kumar",
    "github": "aryankumar06"
  },
  "license": "MIT",
  "categories": ["screens"],
  "subcategory": "Inbox UI",
  "tags": ["inbox", "inbox-ui", "screens", "messaging"],
  "requirements": {
    "flutter": ">=3.27.0",
    "dart": ">=3.6.0"
  },
  "platforms": ["android", "ios", "web", "macos", "windows", "linux"],
  "dependencies": {},
  "files": [
    {
      "source": "files/component.dart",
      "target": "lib/screens/inbox_screen/component.dart",
      "type": "dart",
      "installable": true
    },
    {
      "source": "files/demo.dart",
Showing 30 of 48 lines

3. Versioning Policy, Endpoints & Security

Components follow strict semantic versioning. Once public/r/components/<slug>/<version>.json and its raw files are published, they are immutable: modifying any file or field without incrementing version fails build:registry and check:registry. All file targets must stay under lib/, assets/, shaders/, or fonts/, pass SHA-256 verification, and never reference traversal segments or executable extensions.

  • GET /r/registry.json — global index of all components and latest versions
  • GET /r/components/<slug>.json — latest stable manifest pointer
  • GET /r/components/<slug>/<version>.json — immutable snapshot + SHA-256s
  • GET /r/files/<slug>/<version>/component.dart — canonical Dart source

4. File Declarations, Dependencies, Assets & Shaders

Every file in files[] declares source, destination target, type (dart, asset, shader, or font), and boolean installable. Every entry in pubspec.assets, pubspec.shaders, and pubspec.fonts must match a declared target path in files[], and dependencies accepts valid pub package names with semver constraints.

5. Registry Generation & Validation Commands

Run validation, generation, staleness checks, and automated integrity tests from the repository root before committing changes:

package.json scriptsbash
# Validate every component.json, source file, destination path, and pubspec rule
npm run validate:registry

# Build registry into registry/generated/ and sync to default public/r/ (or custom --out)
npm run build:registry
npm run build:registry -- --out registry-output

# Verify manifests + confirm generated artifacts match canonical sources cleanly
npm run check:registry

# Run registry validation, checksum, security, and immutability tests
npm run test:registry

6. Contributing Components

Future contributors submit new widgets by adding a canonical directory under registry/components/<slug>/ and running registry validation, Flutter tests, and a clean static export before opening a GitHub pull request.

Read the contribution guide