Skip to main content

origin_kit/
lib.rs

1//! The `origin` command, as a library.
2//!
3//! Scaffolding is a tool concern, not a maintenance task a product carries: this crate
4//! holds the project template and the code that instantiates it, while `origin-xtask`
5//! keeps the tasks a generated project runs on itself (`validate`, `generate`,
6//! `update`). That split is what lets `origin new` work without a checkout of Origin —
7//! the template is compiled into this binary (ADR-0032).
8
9pub mod scaffold;
10
11mod template {
12    include!(concat!(env!("OUT_DIR"), "/template.rs"));
13}
14
15pub use scaffold::{Options, run};
16
17/// The embedded project template: `(path relative to the project root, contents)`.
18///
19/// A path may carry the `.in` suffix described in [`scaffold`]; it is stripped when the
20/// file is written.
21pub fn template_files() -> &'static [(&'static str, &'static [u8])] {
22    template::FILES
23}