https://github.com/dills122/schematics-demo
Testing out Angular Schematics
https://github.com/dills122/schematics-demo
angular angular-schematics schematics
Last synced: about 1 month ago
JSON representation
Testing out Angular Schematics
- Host: GitHub
- URL: https://github.com/dills122/schematics-demo
- Owner: dills122
- Created: 2025-10-16T01:23:01.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-10-17T00:53:01.000Z (8 months ago)
- Last Synced: 2025-10-17T04:50:32.255Z (8 months ago)
- Topics: angular, angular-schematics, schematics
- Language: TypeScript
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Schematics Demo
This repository hosts a custom Angular schematic that bootstraps a zoneless, standalone Angular workspace with sensible defaults. Use it as a base for experimentation or publishing to npm.
## Prerequisites
- Node.js ≥ 20 is required to satisfy the Angular devkit toolchain.
- (Optional) Install the Schematics CLI globally if you want to invoke the schematic directly:
```bash
npm install -g @angular-devkit/schematics-cli
```
## Local Development
- Install dependencies: `npm install`
- Compile the TypeScript sources: `npm run build`
- Run unit tests (Jasmine): `npm run test`
- Exercise the schematic end-to-end: `npm run scaffold`
- The script builds the package and generates an Angular app named `dev-app` under `.schematics/dev-app`
- Override the name (and output directory) with `npm run scaffold -- --name my-app`
- Quick iteration helpers:
- `npm run clean:workspaces` removes the `.schematics/` playground directory.
- `npm run generate:dry` runs the schematic in dry-run mode.
- `npm run generate:test` runs the schematic and writes files (identical to the final step of `npm run scaffold`).
The `.schematics/` folder is Git-ignored, so repeated runs stay out of version control.
## Consuming the Package
1. Install the schematic in the target workspace:
```bash
npm install --save-dev schematics-demo
```
2. Generate a project using the Angular CLI:
```bash
ng g schematics-demo:schematics-demo --name my-app
```
All options mirror `ng new`; SCSS, zoneless mode, no SSR, and no AI config are preselected.
## Manual CLI Invocation
If you prefer the raw CLI, you can run the compiled collection directly:
```bash
schematics ./dist/src/collection.json:schematics-demo --name my-app --skip-install --debug=false
```
All options match the Angular `ng new` schematic, but defaults are prefilled for SCSS, zoneless runtime, no SSR, and no AI config.
## Publishing
Before publishing, inspect the packaged tarball:
```bash
npm run build
npm run pack
```
When ready, push the release to npm:
```bash
npm publish
```