An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          


Puppeteer Logo

Schematics Utilities


npm
Docs
Downloads
License


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!