Quickstart
Install Quire, author a `.quire` view, and compile it to StretchPress block output.
Install
npm install @stretchgroup/quire
quire version
quire doctor --json
Author a first view
This minimal page compiles to stretchpress.blocks.v1:
quire HomePage {
model {
collection: Collection
}
route "/"
title collection.title
section hero {
text heading {
value collection.title
variant "display"
}
}
}
quire check examples/home.quire
quire compile examples/home.quire --out tmp/home.blocks.json
Common CLI flow
quire check path/to/file.quire
quire check path/to/file.quire --json
quire compile path/to/file.quire --out dist/page.blocks.json
quire format path/to/file.quire --write
quire extract path/to/file.quire --locale en-US --out messages.json
quire lint path/to/file.quire --json
quire parse path/to/file.quire
quire lsp
checkandcompilesearch forquire.schema.json/stretchpress.schema.jsonby walking up from the source file.--schema path/to/schema.jsontargets one schema extension explicitly.--no-projectdisables project schema loading.
Schema-driven projects and builds
quire generate-schema path/to/live-model.json --out quire.schema.json
quire check views/product.quire --schema path/to/quire.schema.json
quire compile views/product.quire --schema path/to/quire.schema.json --out dist/product.blocks.json
quire build ./views --out ./dist
quire build writes one .blocks.json file per .quire source and a manifest at the output root.
SDK usage
The package exports the compiler facade used by CLI:
import { createQuireCompiler } from "@stretchgroup/quire";
const quire = createQuireCompiler({
file: "views/product.quire",
schema: projectSchema,
schemaPath: "quire.schema.json",
});
const diagnostics = quire.validate(source);
if (diagnostics.length === 0) {
const blocks = quire.compile(source);
const formatted = quire.format(source);
const catalog = quire.extractMessages(source, { locale: "en-US" });
}
Migration entry points (from legacy sources)
quire migrate examples/migration/product.liquid --from liquid --out path/to/product.quire --report path/to/report.json
quire migrate path/to/theme --from shopify --out migrated/dawn --report migrated/dawn.report.json
quire migrate path/to/template.hbs --from handlebars --out path/to/page.quire --report path/to/report.json
quire migrate path/to/export.xml --from wxr --out path/to/post.quire
Planned vs implemented
- Planned changes are listed in
.sources/quire/CHANGELOG.mdunder## Unreleased. - Use the shipped
0.1.0CLI + schema set as your compatibility target, and verify behavior with your installedquire --versionbefore relying on newer capabilities.