This comparison evaluates tools used to automate project setup, file creation, and code transformation. create-react-app is a zero-config starter for React that is now deprecated for new projects. @angular/cli is the official command-line interface for Angular, providing a complete lifecycle management system. @angular-devkit/schematics is the underlying engine powering Angular's generators, allowing custom logic for tree manipulation. @nrwl/devkit is the API layer for Nx, enabling workspace-aware generators for monorepos. plop is a lightweight, micro-generator focused on creating individual files based on simple templates. yeoman-generator is the mature, ecosystem-rich foundation for building complex, interactive scaffolding tools with extensive prompt handling.
Automating repetitive coding tasks is a hallmark of mature frontend engineering. Whether you are spinning up a new application, adding a feature component, or refactoring a monorepo, the right scaffolding tool saves time and enforces consistency. The landscape ranges from simple file generators to complex workspace engines. Let's break down how these tools actually work under the hood.
Some tools are designed to bootstrap an entire ecosystem, while others focus on generating a single file within an existing codebase.
create-react-app was the gold standard for zero-config React setups. It bundled a build system, development server, and testing environment into one command. However, it operated as a monolithic black box.
# create-react-app: One command to rule them all
npx create-react-app my-app
plop takes the opposite approach. It doesn't care about your build system; it only cares about transforming templates based on user input. It is a "micro-generator."
// plopfile.js: Define a simple generator
module.exports = function (plop) {
plop.setGenerator('component', {
description: 'Create a React component',
prompts: [{ type: 'input', name: 'name', message: 'Component name?' }],
actions: [{
type: 'add',
path: 'src/components/{{name}}/{{name}}.js',
templateFile: 'templates/component.hbs'
}]
});
};
yeoman-generator sits in the middle but leans towards heavy lifting. It allows you to compose multiple generators, handle complex file conflicts, and manage dependencies programmatically.
// yo-generator: A class-based approach
module.exports = class extends Generator {
async prompting() {
this.answers = await this.prompt([{ name: 'projectName', type: 'input' }]);
}
writing() {
this.fs.copyTpl(this.templatePath('index.js'), this.destinationPath('index.js'), this.answers);
}
};
How a tool modifies files defines its complexity and safety. Some tools edit your disk immediately; others simulate changes in memory first.
@angular-devkit/schematics uses a "Virtual Tree." It reads your project into an immutable tree in memory, applies transformations, and only writes to disk at the very end. This allows for safe dry-runs and complex rule chaining.
// @angular-devkit/schematics: Functional tree manipulation
export function addComponent(options: Schema): Rule {
return (tree: Tree, context: SchematicContext) => {
// Read a file from the virtual tree
const config = tree.readJson('angular.json');
// Modify the tree (does not hit disk yet)
tree.create(
`src/app/${options.name}.component.ts`,
`export class ${options.name} {}`
);
return tree;
};
}
yeoman-generator works directly with the real file system but queues operations. It uses a commit mechanism to apply changes, handling merge conflicts intelligently if a file already exists.
// yeoman-generator: Queueing file writes
writing() {
// This queues the write; it happens when this.fs.commit() is called
this.fs.write(
this.destinationPath('config.json'),
JSON.stringify({ name: this.options.name }, null, 2)
);
}
plop bypasses complex tree logic for direct template rendering. It reads a Handlebars template, injects data, and writes the result to a specific path immediately upon execution.
<!-- plop template: templates/component.hbs -->
import React from 'react';
export const {{ name }} = () => {
return <div>{{ name }}</div>;
};
In large repositories, generating a file isn't enough. You often need to update workspace configurations, register new projects, or link dependencies.
@nrwl/devkit is built specifically for this. It understands the nx.json and project.json structure. It provides helpers to safely modify these configuration files without breaking the workspace graph.
// @nrwl/devkit: Workspace-aware generation
import { generateFiles, updateProjectConfiguration } from '@nrwl/devkit';
export async function libraryGenerator(host: Tree, schema: LibrarySchema) {
// Generate files into the project directory
generateFiles(host, path.join(__dirname, 'files'), schema.destination, schema);
// Update the workspace configuration safely
updateProjectConfiguration(host, schema.name, {
root: schema.destination,
targets: { build: { executor: '@nrwl/rollup:rollup' } }
});
}
@angular/cli consumes schematics (often built with @angular-devkit/schematics) to ensure that when you generate a component, it automatically registers it in the nearest NgModule or standalone bootstrap file. It relies on the schematic engine to parse TypeScript ASTs.
// @angular/cli: Consuming a schematic via command
// ng generate component hero --standalone
// Under the hood, this runs a schematic that:
// 1. Creates hero.component.ts
// 2. Parses app.module.ts (or main.ts)
// 3. Inserts the import and declaration automatically
create-react-app had no concept of monorepos or workspace awareness. It treated every project as an isolated island, which became a major limitation as the ecosystem shifted towards monorepo architectures.
# create-react-app: No workspace integration
# You had to manually configure lerna or yarn workspaces around it
npx create-react-app apps/my-app
# Manual step: Edit root package.json to add to workspaces array
When standard templates aren't enough, you need to run custom logic during generation.
yeoman-generator shines here. Because it is a full Node.js class, you can make API calls, install npm packages, or run shell commands seamlessly within the generation lifecycle.
// yeoman-generator: Running custom logic
async installing() {
// Dynamically install dependencies based on user choice
if (this.answers.cssFramework === 'tailwind') {
this.npmInstall(['tailwindcss', 'postcss', 'autoprefixer'], { saveDev: true });
this.spawnCommandSync('npx', ['tailwindcss', 'init']);
}
}
@angular-devkit/schematics allows custom logic through "Rules." You can chain asynchronous operations, but you must stay within the functional paradigm of the Schematic engine.
// @angular-devkit/schematics: Chaining rules
export function main(options: Schema): Rule {
return chain([
addFiles(options),
updateTsConfig(options),
// Custom logic: Run an external task if needed
(tree, context) => {
context.logger.info('Running post-generation script...');
return tree;
}
]);
}
plop is limited in logic. It supports basic "actions" like adding files or modifying existing ones with regex, but complex logic often requires writing custom action functions in JavaScript.
// plop: Custom action function
plop.setActionType('log', function (answers, config, plop) {
console.log(`Generated component: ${answers.name}`);
// Returns a string status or throws an error
return 'logged';
});
It is critical to note the lifecycle status of these tools before adopting them.
create-react-app is deprecated. The React team no longer recommends it. The repository has seen minimal maintenance, and it lacks support for modern features like Server Components or fast build tools like Vite. Do not use this for new projects.
# β Deprecated: Avoid for new development
npx create-react-app my-app
# β
Recommended Alternative (Vite)
npm create vite@latest my-app -- --template react
@angular/cli, @angular-devkit/schematics, and @nrwl/devkit are actively maintained and evolve with their respective frameworks. They are safe bets for Angular and Nx ecosystems.
yeoman-generator and plop are stable and mature. While they may not have the hype of new tools, they are widely used in enterprise environments for internal CLI tools and remain reliable.
| Feature | create-react-app | plop | yeoman-generator | @angular-devkit/schematics | @nrwl/devkit |
|---|---|---|---|---|---|
| Primary Use | App Bootstrap | File Templates | Complex Scaffolding | Angular Generators | Nx Monorepo Tools |
| Status | β Deprecated | β Stable | β Stable | β Active | β Active |
| File System | Static Copy | Direct Write | Queued Commit | Virtual Tree | Virtual Tree + Helpers |
| Logic Power | None | Low | High | High | High (Workspace aware) |
| Learning Curve | None | Low | Medium | High | Medium |
Choosing the right tool depends entirely on the scope of your automation.
If you are starting a React project today, skip create-react-app. Use Vite or a framework like Next.js. If you need to generate consistent components within that project, plop is the fastest way to get started with minimal setup.
If you are building an internal CLI tool for your organization that needs to ask questions, install packages, and configure servers, yeoman-generator provides the robustness and flexibility you need.
For Angular developers, the choice is usually made for you: use @angular/cli for daily tasks. If you need to extend the CLI with custom company-specific generators, you will build them using @angular-devkit/schematics.
Finally, if you are operating in a monorepo managed by Nx, @nrwl/devkit is indispensable. It bridges the gap between simple file generation and complex workspace graph manipulation, ensuring your generators don't just create files, but integrate them correctly into your architecture.
Choose this if you are building custom CLI commands specifically for an Angular workspace and need direct access to the virtual file system tree. It is the right fit when you require deep integration with Angular's build system but do not need the full workspace intelligence provided by Nx. Be aware that it has a steeper learning curve due to its functional, tree-based API.
Select this as the primary tool for any standard Angular application development. It is the default choice for initializing projects, serving, building, and running official generators like components or services. You generally do not choose this to build your own generators from scratch, but rather to consume the schematics it provides out of the box.
Opt for this if you are managing a monorepo with Nx and need to create generators that understand workspace boundaries, project dependencies, and nx.json configurations. It simplifies the complex @angular-devkit/schematics API by providing helper functions tailored for modern monorepo structures. This is essential for teams scaling beyond single-project repositories.
Do not choose this for new projects as it is officially deprecated and no longer maintained. The React team now recommends using framework-based tools like Next.js or Vite-based starters. If you are maintaining a legacy application created with this tool, plan a migration strategy to a more modern build system immediately.
Use this when you need a quick, low-friction way to generate consistent boilerplate files (like components or hooks) within an existing project. It is ideal for small-to-medium teams that want to enforce naming conventions and file structures without the overhead of a full generator framework. It excels at simple 'input-template-output' workflows with minimal configuration.
Choose this if you are building a robust, standalone scaffolding tool that requires complex user interactions, extensive prompting, and integration with a wide variety of external tools. It is the best option for creating comprehensive project starters that go beyond simple file copying, offering a mature ecosystem of helpers and a powerful composition system for large-scale automation.
A scaffolding library for the modern web.
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.
| 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 Actions. |
| 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. |
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:
The tooling API is composed of the following pieces:
The SchematicEngine is responsible for loading and constructing Collections 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 are generators and part of a 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. |
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.
FileOperators apply changes to a single FileEntry and return a new FileEntry. The result follows these rules:
FileEntry returned is null, a DeleteAction will be added to the action list.RenameAction will be added to the action list.OverwriteAction will be added to the action list.It is impossible to create files using a FileOperator.
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) |
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 Rules to a source, and return the resulting Source. |
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 Rules. |
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. |
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)).
| 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). |
| 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. |
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:
Rule, which is a transformation from a Tree to another Tree.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.index.ts and loaded into a Tree.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.Tree, containing the new file, is merged with the existing files of the project which the Schematic is run on.