Meta tags:
description= CLI tool for Angular. Contribute to angular/angular-cli development by creating an account on GitHub.;
Headings (most frequently used words):
templating, operators, navigation, provided, readme, md, schematics, sources, and, rules, file, breadcrumbs, footer, glossary, tooling, generators, examples, menu, repository, filesexpand, tree, latest, commit, history, metadata, controls, description, engine, collection, schematic, path, content, simple,
Text of the page (most frequently used words):
the (112), and (41), tree (40), #schematics (31), for (19), that (17), rule (16), from (16), file (15), files (15), options (15), template (13), #source (13), github (12), with (12), cli (12), apply (11), angular (11), create (11), can (10), templating (10), path (10), code (10), collection (10), this (9), are (9), name (9), returns (9), library (9), list (8), description (8), actions (8), action (7), new (7), which (7), schematic (7), tooling (7), content (7), provides (6), example (6), return (6), function (6), creates (6), using (6), see (6), all (6), filesystem (6), reference (6), security (5), url (5), default (5), schema (5), another (5), result (5), will (5), input (5), section (5), rules (5), applied (5), json (5), you (4), not (4), existing (4), object (4), root (4), into (4), import (4), devkit (4), system (4), these (4), following (4), other (4), string (4), fileoperator (4), provided (4), empty (4), added (4), changes (4), generators (4), dependencies (4), packages (4), task (4), raw (4), your (4), support (4), copilot (4), navigation (3), containing (3), functions (3), passed (3), strings (3), option (3), schematiccontext (3), export (3), its (3), entirely (3), given (3), but (3), expression (3), replaced (3), call (3), defined (3), applies (3), entire (3), factories (3), operators (3), fileentry (3), engine (3), how (3), sink (3), should (3), metadata (3), tool (3), repository (3), copy (3), blame (3), readme (3), angular_devkit (3), main (3), history (3), more (3), quality (3), tab (3), window (3), refresh (3), session (3), reload (3), sign (3), developers (3), changelog (3), customer (3), enterprise (3), grade (3), features (3), build (3), perform (2), information (2), community (2), status (2), footer (2), resulting (2), project (2), run (2), fills (2), specified (2), placeholders (2), only (2), about (2), disk (2), same (2), directory (2), loaded (2), index (2), used (2), classify (2), things (2), templatesource (2), mergewith (2), branchandmerge (2), schematicsexception (2), classoptions (2), class (2), determine (2), transformation (2), hello (2), world (2), any (2), simple (2), examples (2), structural (2), javascript (2), above (2), value (2), html (2), when (2), placeholder (2), __variable (2), variable (2), inside (2), paths (2), some (2), pass (2), filepredicate (2), pathtemplate (2), contenttemplate (2), merge (2), move (2), operator (2), multiple (2), sources (2), changed (2), generator (2), one (2), responsible (2), api (2), commit (2), original (2), uses (2), add (2), collections (2), those (2), npm (2), tasks (2), does (2), work (2), itself (2), such (2), created (2), committed (2), descriptive (2), side (2), what (2), 205 (2), lines (2), 146 (2), loc (2), breadcrumbs (2), latest (2), insights (2), 196 (2), signed (2), universe (2), training (2), integrations (2), stories (2), center (2), documentation (2), learn (2), business (2), fixes (2), products (2), secret (2), time, share, personal, manage, cookies, contact, docs, privacy, terms, 2026, inc, finally, merged, then, knows, variables, via, among, others, dasherize, additional, const, required, throw, context, core, __name, dasherize__, simplified, receives, few, myschematic, comment, gets, dropped, text, inserts, structure, allowing, insert, inline, escaped, inserted, replacing, supports, direct, expressions, chained, left, etc, function1, function2__, function__, __variable__, operates, their, values, referenced, based, upon, consists, filter, predicate, boolean, both, templates, moves, subdirectory, every, foreach, concatenation, chain, noop, also, loads, createaction, argument, additionally, cover, basic, use, cases, impossible, overwriteaction, renameaction, returned, null, deleteaction, single, follows, nothing, normally, unused, field, version, type, prop, defines, properties, part, loading, constructing, creating, interface, understands, schematicdescription, collectiondescription, enginehost, schematicengine, composed, pieces, output, logs, propagated, including, debugging, many, sinks, filesystemsink, dryrunsink, represent, initial, state, current, formats, validation, validate, selectors, app, names, please, check, anything, specify, respected, parses, arguments, validates, understand, respect, between, refer, responsibility, honor, loader, available, published, document, explains, usage, implementation, way, execute, external, command, script, installing, running, tests, building, scheduled, before, after, final, destination, atomic, operation, validated, could, read, each, contain, transformations, staging, area, referred, executes, without, effects, term, glossary, distinguishes, yeoman, yarn, purely, actual, until, everything, ready, there, effect, design, transform, they, refactor, around, scaffolding, modern, web, edit, outline, download, preview, controls, top, expand, items, pull, requests, issues, message, dismiss, alert, switched, accounts, out, appearance, settings, search, pricing, event, talks, workshops, next, partners, company, forum, events, webinars, blog, resource, connect, resources, premium, advanced, ons, trust, why, evaluate, industries, government, manufacturing, financial, services, healthcare, industry, nonprofits, startups, team, enterprises, stage, businesses, improvements, across, place, developer, articles, sponsors, trending, repos, explore, customize, certifications, scanning, leak, prevention, protection, vulnerability, detection, remediation, secure, cloud, development, environments, codespaces, analysis, enforcement, automation, ship, coding, agent, projects, automated, hosting, review, collaboration, platform, menu, skip,
Text of the page (random words):
angular cli packages angular_devkit schematics readme md at main angular angular cli github skip to content navigation menu sign in products platform github repository hosting code review and collaboration copilot ai coding agent for tasks projects and automated work build ship actions ci cd and automation code quality quality analysis fixes and enforcement codespaces cloud development environments secure code security vulnerability detection and remediation secret protection secret scanning and leak prevention all features developers learn documentation training certifications build build with copilot customize copilot integrations explore trending repos github sponsors developer articles changelog changelog your source for the latest features improvements and fixes across github products all in one place businesses by stage enterprises team startups nonprofits by industry healthcare financial services manufacturing government see all industries evaluate github why github customer stories business insights trust center add ons github advanced security enterprise grade code security copilot for business enterprise grade ai features premium support enterprise grade 24 7 support resources learn connect documentation resource center blog events webinars community forum customer stories integrations support customer support training github status company about partners changelog github universe github universe the event for developers by developers talks workshops and what s next for github pricing search sign in sign up appearance settings you signed in with another tab or window reload to refresh your session you signed out in another tab or window reload to refresh your session you switched accounts on another tab or window reload to refresh your session dismiss alert message angular angular cli repository navigation code issues 196 196 pull requests 20 20 actions security and quality 8 8 insights more items files expand file tree main breadcrumbs angular cli packages angular_devkit schematics readme md copy path blame more file actions blame more file actions latest commit history history history 205 lines 146 loc 14 4 kb main breadcrumbs angular cli packages angular_devkit schematics readme md copy path top file metadata and controls preview code blame 205 lines 146 loc 14 4 kb raw copy raw file download raw file outline edit and raw actions schematics a scaffolding library for the modern web description schematics are generators that transform an existing filesystem they can create files refactor existing files or move files around what distinguishes schematics from other generators such as yeoman or yarn create is that schematics are purely descriptive no changes are applied to the actual filesystem until everything is ready to be committed there is no side effect by design in schematics glossary term description schematics a generator that executes descriptive code without side effects on an existing file system collection a list of schematics metadata schematics can be referred by name inside a collection tool the code using the schematics library tree a staging area for changes containing the original file system and a list of changes to apply to it rule a function that applies actions to a tree it returns a new tree that will contain all transformations to be applied source a function that creates an entirely new tree from an empty filesystem for example a file source could read files from disk and create a create action for each of those action an atomic operation to be validated and committed to a filesystem or a tree actions are created by schematics sink the final destination of all action s task a task is a way to execute an external command or script in a schematic a task can be used to perform actions such as installing dependencies running tests or building a project a task is created by using the schematiccontext object and can be scheduled to run before or after the schematic tree is applied tooling schematics is a library and does not work by itself a reference cli is available on this repository and is published on npm at angular devkit schematics cli this document explains the library usage and the tooling api but does not go into the tool implementation itself the tooling is responsible for the following tasks create the schematic engine and pass in a collection and schematic loader understand and respect the schematics metadata and dependencies between collections schematics can refer to dependencies and it s the responsibility of the tool to honor those dependencies the reference cli uses npm packages for its collections create the options object options can be anything but the schematics can specify a json schema that should be respected the reference cli for example parses the arguments as a json object and validates it with the schema specified by the collection schematics provides some json schema formats for validation that tooling should add these validate paths html selectors and app names please check the reference cli for how these can be added call the schematics with the original tree the tree should represent the initial state of the filesystem the reference cli uses the current directory for this create a sink and commit the result of the schematics to the sink many sinks are provided by the library filesystemsink and dryrunsink are examples output any logs propagated by the library including debugging information the tooling api is composed of the following pieces engine the schematicengine is responsible for loading and constructing collection s and schematics when creating an engine the tooling provides an enginehost interface that understands how to create a collectiondescription from a name and how to create a schematicdescription schematics generators schematics are generators and part of a collection collection a collection is defined by a collection json file in the reference cli this json defines the following properties prop name type description name string the name of the collection version string unused field schematic operators sources and rules a source is a generator of a tree it creates an entirely new root tree from nothing a rule is a transformation from one tree to another a schematic at the root is a rule that is normally applied on the filesystem operators fileoperator s apply changes to a single fileentry and return a new fileentry the result follows these rules if the fileentry returned is null a deleteaction will be added to the action list if the path changed a renameaction will be added to the action list if the content changed an overwriteaction will be added to the action list it is impossible to create files using a fileoperator provided operators the schematics library provides multiple operator factories by default that cover basic use cases fileoperator description contenttemplate t options t apply a content template see the templating section pathtemplate t options t apply a path template see the templating section provided sources the schematics library additionally provides multiple source factories by default source description empty creates a source that returns an empty tree source tree tree creates a source that returns the tree passed in as argument url url string loads a list of files from the given url and returns a tree with the files as createaction applied to an empty tree apply source source rules rule apply a list of rule s to a source and return the resulting source provided rules the schematics library also provides rule factories by default rule description noop returns the input tree as is chain rules rule returns a rule that s the concatenation of other rule s foreach op fileoperator returns a rule that applies an operator to every file of the input tree move root string moves all the files from the input to a subdirectory merge other tree merge the input tree with the other tree contenttemplate t options t apply a content template see the template section to the entire tree pathtemplate t options t apply a path template see the template section to the entire tree template t options t apply both path and content templates see the template section to the entire tree filter predicate filepredicate boolean returns the input tree with files that do not pass the filepredicate templating as referenced above some functions are based upon a file templating system which consists of path and content templating the system operates on placeholders defined inside files or their paths as loaded in the tree and fills these in as defined in the following using values passed into the rule which applies the templating i e template t options t path templating placeholder description __variable__ replaced with the value of variable __variable function__ replaced with the result of the call function variable can be chained to the left __variable function1 function2__ etc content templating placeholder description expression replaced with the result of the call of the given expression this only supports direct expressions no structural for if javascript expression same as above but the value of the result will be escaped for html when inserted i e replacing with inline code inserts the given code into the template structure allowing to insert structural javascript text a comment which gets entirely dropped examples simple an example of a simple schematics which creates a hello world file using an option to determine its path import tree from angular devkit schematics export default function myschematic options any return tree tree tree create options path hi hello world return tree a few things from this example the function receives the list of options from the tooling it returns a rule which is a transformation from a tree to another tree templating a simplified example of a schematics which creates a file containing a new class using an option to determine its name files __name dasherize__ ts export class classify name index ts import strings from angular devkit core import rule schematiccontext schematicsexception tree apply branchandmerge mergewith template url from angular devkit schematics import schema as classoptions from schema export default function options classoptions rule return tree tree context schematiccontext if options name throw new schematicsexception option name is required const templatesource apply url files template strings options return branchandmerge mergewith templatesource additional things from this example strings provides the used dasherize and classify functions among others the files are on disk in the same root directory as the index ts and loaded into a tree then the template rule fills in the specified templating placeholders for this it only knows about the variables and functions passed to it via the options object finally the resulting tree containing the new file is merged with the existing files of the project which the schematic is run on footer 2026 github inc footer navigation terms privacy security status community docs contact manage cookies do not share my personal information you can t perform that action at this time
|