Modules & Packages
Compile-time imports, package manifests, and starter/package installation flows.
Quire modules are compile-time only. They supply reusable component templates and starter content without changing the output contract.
Module imports
import { ProductCard, PriceBadge as Badge } from "./cards.quire"
quire ProductPage {
model {
product: Product
}
route "/products/{product.slug}"
title product.title
section hero {
include ProductCard featured {
item product
showPrice true
}
}
}
importreads explicit local paths, package names, or package manifests.- Imports expose only
component/partialdefinitions from referenced modules. - Imported modules are type-checked and expanded before block JSON emission.
- Imported view output is not merged into the importing view.
Module resolution behavior
- Resolve order for package imports uses local installs, not Node module resolution.
quire package.jsonmanifests define compile-time component exports.- Bare package names resolve from
quire_packages/<package-name>/. - Import cycles and invalid manifests emit diagnostic errors.
Component package manifests
{
"format": "quire.component-package",
"version": 1,
"name": "@stretchgroup/product-cards",
"exports": {
"ProductCard": "./cards.quire",
"FeaturedProductCard": {
"source": "./cards.quire",
"component": "ProductCard"
}
}
}
String exports map by name. Object exports can alias a differently named component.
Publishing and installing packages
quire publish ./library/product-cards --registry ./quire.registry.json
quire add @stretchgroup/product-cards --registry ./quire.registry.json --project ./site
Installed package state:
quire_packages/<name>/in the consuming projectquire.lock.jsonat the project root- imported components available from package names
Registry contract
The package registry JSON includes format, version, packages, versioned package entries, integrity values, and file lists. Formats use:
quire.component-packagefor code/starter package metadataquire.package-registryfor registry indices
Starter packages
Starter packages include starter.entry and starter.files to copy a scaffolded .quire entry and schema into a target project during install.
{
"starter": {
"entry": "pages/home.quire",
"description": "Editorial blog starter with hero, featured article, latest posts, and newsletter CTA.",
"files": [
{ "source": "./quire.schema.json", "target": "quire.schema.json" },
{ "source": "./starter/pages/home.quire", "target": "pages/home.quire" }
]
}
}
Installed starter behavior
quire add installs files but does not execute package contents. Installed component code stays compile-time only.
Planned and existing restrictions
- Package imports are deterministic and path-limited.
- Package names are not resolved via arbitrary package hooks or network calls at compile time.
- This keeps large installs repeatable and side-effect free.