1. schematics-utilities
๐Ÿ› ๏ธ Useful exported utilities for working with Schematics
schematics-utilities
Package: schematics-utilities
Created by: nitayneeman
Last modified: Tue, 17 May 2022 05:40:55 GMT
Version: 2.0.3
License: MIT
Downloads: 99,085
Repository: https://github.com/nitayneeman/schematics-utilities

Install

npm install schematics-utilities
yarn add schematics-utilities

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

 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 for the available utilities.


โš ๏ธ๏ธ Disclaimer

This repository contains code which is directly taken from:

All credits go to the respective developers! ๐Ÿ‘


๐Ÿ’๐Ÿป Contributing

This is an open source project. Any contribution would be greatly appreciated!

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin