How omniaintranet/omniaclitemplates works
Main Components
• Template Pack Versions – Represent each version folder (e.g., 2.0.0, 3.0.0, …, 8.0.0) as a major grouping component since they encapsulate the different sets of templates.
• Item Templates – Within each version, the “items” directory includes folders for various templates (adminjourney, gitignore, manifest, store, etc.). These are the building blocks used when a user invokes a template command like “omnia dev new …”.
• Project Templates – Also within each version, the “projects” directory holds subfolders for “web”, “worker” (and extension types) that provide full-solution scaffolding.
• Template Engine / CLI Interaction – Although not directly in the code, conceptually include a component representing the Omnia CLI (or the Template Engine) that reads these templates (using the index.json and other manifest files) and generates user projects or items.
Relationships and Interactions
• The “CLI/Template Engine” sends commands (like “omnia dev new”) and interacts with the Template Pack.
• The Template Engine identifies the appropriate version (by reading index.json) and loads the corresponding items and project templates.
• Within each version, the engine chooses a specific item (or project) type by the user’s command and then processes the related manifest files (e.g., adminjourney.manifest.ts, spfeature.manifest.ts) and source files.
• Components and modules (such as stores or unit test files) are grouped logically under each template type.
• A clear flow exists from the CLI command to selection of a version, then further into item or project extraction, and finally generating the output (i.e., scaffolded project structure).
Architectural Patterns and Design Principles
• Modularity: Each version folder is self-contained, and within each version, items and project templates are modular. This structure promotes versioning and backward compatibility.
• Separation of Concerns: The separation between “items” (for small, reusable building blocks) and “projects” (for complete solutions) is core to the design.
• Consistency: The repeated structure in every version (index.json, items, projects) makes it easier to extend and maintain templates.
• Extensibility: The design supports adding new template types (both at an “item” and “project” level) without affecting the rest of the pack.
Relevant Technologies and Frameworks
• Languages and frameworks represented in the templates include TypeScript, CSS in TS, React/JSX (e.g., *.tsx files), and even C# files for project templates.
• There are configuration and manifest files (e.g., manifest.ts, settings.json) which indicate integration with code-generation technologies.
• Build files like gulpfile.js point to automation in building or processing the templates.
Elements
– Omnia CLI/Template Engine (as an initiating component)
– Each version module (2.0.0 through 8.0.0)
– Inside each version:
▪ Items Container (with sample items like adminjourney, vuewebcomponent, etc.)
▪ Projects Container (with “web” and “worker” sub-components)
▪ Common files (index.json, manifest definitions)
– How a CLI command is processed to determine the correct version.
– How templates are then selected and used to generate a full scaffold.