https://github.com/nitayneeman/schematics-utilities
๐ ๏ธ Useful exported utilities for working with Schematics
https://github.com/nitayneeman/schematics-utilities
angular devkit material schematic schematics util utilities utility utils
Last synced: 12 days ago
JSON representation
๐ ๏ธ Useful exported utilities for working with Schematics
- Host: GitHub
- URL: https://github.com/nitayneeman/schematics-utilities
- Owner: nitayneeman
- License: mit
- Created: 2018-07-13T19:59:26.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T21:08:19.000Z (almost 3 years ago)
- Last Synced: 2024-08-09T05:45:59.495Z (about 1 year ago)
- Topics: angular, devkit, material, schematic, schematics, util, utilities, utility, utils
- Language: TypeScript
- Homepage: https://nitayneeman.github.io/schematics-utilities
- Size: 736 KB
- Stars: 86
- Watchers: 6
- Forks: 9
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
Schematics Utilities
Installation ยท
Usage ยท
Disclaimer## โน๏ธ๏ธ Description
At the moment, none of the utilities from the Angular Schematics package are exported.
This project was created from that purpose - _providing a collection of general and useful utilities for Schematics, based on non-exported existing utilities and further_.
You might use this project as a polyfill until these utilities will be exported officially by the relevant teams (and then just replace the path you import). However, consider sticking with this project for additional and unique utilities which are planned for the future.
## ๐ง How to Install
To Install using npm, simply do:
```
npm install schematics-utilities
```
## ๐จ๐ปโ๐ซ How to Use
```javascript
import { Rule, Tree } from '@angular-devkit/schematics';
// 1. Import the needed utilities
import { addPackageJsonDependency, NodeDependency, NodeDependencyType } from 'schematics-utilities';function addDependencies(host: Tree): Tree {
const dependencies: NodeDependency[] = [{ type: NodeDependencyType.Default, version: '4.17.10', name: 'lodash-es' }];// 2. Just use it whenever you need :)
dependencies.forEach(dependency => addPackageJsonDependency(host, dependency));return host;
}export default function(): Rule {
return (tree: Tree) => {
addDependencies(tree);return tree;
};
}
```Check out the [API docs](https://nitayneeman.github.io/schematics-utilities/) for the available utilities.
## โ ๏ธ๏ธ Disclaimer
This repository contains code which is directly taken from:
- [Angular Schematics package](https://github.com/angular/angular-cli/tree/master/packages/schematics)
- [Angular Material](https://github.com/angular/components/tree/master/src/cdk/schematics/utils)All credits go to the respective developers! ๐
## ๐๐ป Contributing
This is an open source project. Any contribution would be greatly appreciated!