https://github.com/inigomarquinez/howto-schematics-insert-code
How to update and insert custom code to existing Typescript files using Angular schematics
https://github.com/inigomarquinez/howto-schematics-insert-code
Last synced: about 1 month ago
JSON representation
How to update and insert custom code to existing Typescript files using Angular schematics
- Host: GitHub
- URL: https://github.com/inigomarquinez/howto-schematics-insert-code
- Owner: inigomarquinez
- Created: 2023-09-05T16:43:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-13T15:26:08.000Z (over 1 year ago)
- Last Synced: 2024-10-06T14:41:01.631Z (7 months ago)
- Language: TypeScript
- Size: 31.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Getting Started With Schematics
This repository is a basic Schematic implementation that serves as a starting point to create and publish Schematics to NPM.
### Run locally
If you did changes to the schematic, first you need to build it:
```bash
npm run build
```And then you can tun it locally:
```bash
npm run run:insert-code -- --name=Iñigo --sex=male
```### Testing
To test locally, install `@angular-devkit/schematics-cli` globally and use the `schematics` command line tool. That tool acts the same as the `generate` command of the Angular CLI, but also has a debug mode.
Check the documentation with
```bash
schematics --help
```### Unit Testing
`npm run test` will run the unit tests, using Jasmine as a runner and test framework.
### Publishing
To publish, simply do:
```bash
npm run build
npm publish
```That's it!
### 🔗 Useful links
- [Schematics official documentation](https://angular.io/guide/schematics)
- [Update and insert auto-generated code to existing Typescript, HTML and JSON files with Angular schematics Pt.1](https://medium.com/humanitec-developers/update-and-insert-auto-generated-code-to-existing-typescript-html-and-json-files-with-angular-f0b00f22fb52)