<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: vimal patel</title>
    <description>The latest articles on DEV Community by vimal patel (@patelvimal).</description>
    <link>https://dev.to/patelvimal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F119645%2F13095662-8f38-4e75-ab3a-5e9e5a901272.jpeg</url>
      <title>DEV Community: vimal patel</title>
      <link>https://dev.to/patelvimal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/patelvimal"/>
    <language>en</language>
    <item>
      <title>Schematic to integrate prettier,commit-lint and husky in angular application</title>
      <dc:creator>vimal patel</dc:creator>
      <pubDate>Sun, 12 Dec 2021 13:06:58 +0000</pubDate>
      <link>https://dev.to/patelvimal/schematic-to-integrate-prettiercommit-lint-and-husky-in-angular-application-4glf</link>
      <guid>https://dev.to/patelvimal/schematic-to-integrate-prettiercommit-lint-and-husky-in-angular-application-4glf</guid>
      <description>&lt;p&gt;Every single developer has his/her own preferences when its come to IDE and everyone has there own set of configuration in it.&lt;/p&gt;

&lt;p&gt;To make sure our code repository is having the same consistenty there are few tools which we can use in our project.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prettier :  This is an opinionated code formatter.&lt;/li&gt;
&lt;li&gt;Commit-lint : This checks if your commit messages meet the conventional commit format.&lt;/li&gt;
&lt;li&gt;Husky : Easy to configure Git Hooks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To configured each of these library in your project there are many steps you need to follow.&lt;/p&gt;

&lt;p&gt;Doing this redudent task for every single project can be a pain.&lt;/p&gt;

&lt;p&gt;For that I have created this package using angular schematics which will do the integration and configuration of these packages in your angular application.&lt;/p&gt;

&lt;p&gt;Open your project workspace folder in your command prompt and run below schematic command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ng add @ng-vim/devtools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all. &lt;br&gt;
All above things are configured in your angular application. You can modify the configuration as per your needs.&lt;/p&gt;

&lt;p&gt;Github source-code:- &lt;a href="https://github.com/patelvimal/ng-vim-devtools"&gt;https://github.com/patelvimal/ng-vim-devtools&lt;/a&gt;&lt;br&gt;
Follow Me on Twitter:- &lt;a href="https://twitter.com/patel_vimal"&gt;https://twitter.com/patel_vimal&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Suggestions are welcome to improve this package.&lt;/p&gt;

</description>
      <category>angular</category>
      <category>schematics</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to use angular library locally with Hot Module Reload</title>
      <dc:creator>vimal patel</dc:creator>
      <pubDate>Wed, 14 Apr 2021 15:04:52 +0000</pubDate>
      <link>https://dev.to/patelvimal/how-to-use-angular-library-locally-with-hot-module-reload-2m35</link>
      <guid>https://dev.to/patelvimal/how-to-use-angular-library-locally-with-hot-module-reload-2m35</guid>
      <description>&lt;p&gt;We can create angular library for reusability and there are many different ways to use it in your angular application.&lt;/p&gt;

&lt;p&gt;One of them is is to use &lt;strong&gt;"npm link"&lt;/strong&gt; command to link your library and application. However there are some drawbacks in that approach.&lt;/p&gt;

&lt;p&gt;The biggest one is if you make any changes in your library you need to build your library again and again we is very not a very productive way. In this article I will explain how to use --watch command with ng build to overcome that drawback.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps to create angular library
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use below Angular CLI commands to generate Angular library project.
```
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ng new ngx-shared-lib --create-application=false&lt;br&gt;
cd my-workspace&lt;br&gt;
ng generate library ngx-shared-lib&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
* Navigate to library workspace and use below commands to build library project.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;ng build --watch&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
We are building the library project in "watch" mode so that any code changes will reflect in target application instantly.

* Use below Angular CLI commands to generate Angular Application.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;ng new ngx-sample-app&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
* Navigate to angular application created above and install the library using below commands.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;npm install file://C://angular-local-lib-example//ngx-shared-lib//dist//ngx-shared-lib"&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
Replace library path with physical path of your local system where library is created.

* Run below commands to serve your application.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;ng serve&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
That's all...

Now **make any code changes in your library and save it.**
It will automatically reflect in your target application as we have run the library in "watch" mode.

You can find the sample code base in this github repository.
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/patelvimal" rel="noopener noreferrer"&gt;
        patelvimal
      &lt;/a&gt; / &lt;a href="https://github.com/patelvimal/angular-local-library-example" rel="noopener noreferrer"&gt;
        angular-local-library-example
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Example on how to use angular library locally with HMR
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>angular</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
