<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Pac-Cli on It Must Be Code!</title><link>https://itmustbecode.com/tags/pac-cli/</link><description>Recent content in Pac-Cli on It Must Be Code!</description><generator>Hugo</generator><language>en-CA</language><lastBuildDate>Sun, 04 Jun 2023 19:44:35 +0000</lastBuildDate><atom:link href="https://itmustbecode.com/tags/pac-cli/feed.xml" rel="self" type="application/rss+xml"/><item><title>Calling PAC CLI ModelBuilder from an Azure DevOps Pipeline</title><link>https://itmustbecode.com/calling-pac-cli-modelbuilder-from-an-azure-devops-pipeline/</link><pubDate>Sun, 04 Jun 2023 19:44:35 +0000</pubDate><guid isPermaLink="false">https://itmustbecode.com/calling-pac-cli-modelbuilder-from-an-azure-devops-pipeline/</guid><description>&lt;p&gt;In a previous blog post, I described how to use the new &lt;strong&gt;modelbuilder&lt;/strong&gt; command group of the Microsoft Power Platform CLI ( &lt;strong&gt;PAC CLI&lt;/strong&gt;) to generate &lt;strong&gt;early-bound&lt;/strong&gt; classes for Dataverse code customization projects.&lt;/p&gt;
&lt;p&gt;This time we&amp;rsquo;ll take this a step further and explore how to &lt;strong&gt;automate&lt;/strong&gt; the early-bound class creation process by invoking the PAC CLI modelbuilder within an &lt;strong&gt;Azure DevOps pipeline&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;🔗Link to previous post here :
&lt;a class="link" href="https://itmustbecode.com/how-to-generate-dataverse-early-bound-classes-with-pac-cli-modelbuilder/" target="_blank" rel="noopener"
&gt;How to Generate Dataverse Early-Bound Classes with PAC CLI ModelBuilder&lt;/a&gt;&lt;/p&gt;</description></item><item><title>How to Generate Dataverse Early-Bound Classes with PAC CLI ModelBuilder</title><link>https://itmustbecode.com/how-to-generate-dataverse-early-bound-classes-with-pac-cli-modelbuilder/</link><pubDate>Wed, 12 Apr 2023 03:37:47 +0000</pubDate><guid isPermaLink="false">https://itmustbecode.com/how-to-generate-dataverse-early-bound-classes-with-pac-cli-modelbuilder/</guid><description>&lt;p&gt;As a Power Platform developer, I have always been a strong advocate for the use of &lt;strong&gt;early-bound&lt;/strong&gt; classes in customization projects that targets Dataverse tables and actions. Early-bound classes not only increase code readability and maintainability, they also significantly reduce the risk of errors. I think that being proficient and fast in generating early-bound classes is a must-have skill for any developers who works with the platform.&lt;/p&gt;
&lt;p&gt;Recently, the Microsoft Power Platform CLI ( &lt;strong&gt;PAC CLI&lt;/strong&gt;) introduced the new &lt;strong&gt;modelbuilder&lt;/strong&gt; command group that enables early bound classes generation directly from the CLI. Traditionally the generation of early-bound classes was primarily accomplished through a specialized tool called &lt;strong&gt;CrmSvcUtil&lt;/strong&gt;. Yet, integrating these capabilities into a more versatile and widespread tool like &lt;strong&gt;PAC CLI&lt;/strong&gt; is a logical step forward that will undoubtedly improve user adoption in the long run.&lt;/p&gt;</description></item><item><title>PCF Control compile error : Cannot find module 'ajv/dist/compile/codegen'</title><link>https://itmustbecode.com/pcf-control-compile-error-cannot-find-module-ajv-dist-compile-codegen/</link><pubDate>Tue, 03 Jan 2023 18:09:56 +0000</pubDate><guid isPermaLink="false">https://itmustbecode.com/pcf-control-compile-error-cannot-find-module-ajv-dist-compile-codegen/</guid><description>&lt;p&gt;I was working on a new PCF control project and I encountered an unexpected error when attempting to build the project, even though no custom code had been added yet. (Cannot find module &lt;strong&gt;ajv/dist/compile/codegen&lt;/strong&gt;)&lt;/p&gt;
&lt;figure&gt;&lt;img src="./image.png"loading="lazy"&gt;&lt;/figure&gt;
&lt;p&gt;For reference, I&amp;rsquo;m using the latest version ( &lt;em&gt;at the time of writing&lt;/em&gt;) of the &lt;strong&gt;Microsoft Power Platform CLI&lt;/strong&gt; ( &lt;strong&gt;1.21.4+g4869036&lt;/strong&gt;) and here are the steps to reproduce :&lt;/p&gt;
&lt;figure&gt;&lt;img src="./image-2.png"loading="lazy"&gt;&lt;/figure&gt;
&lt;ol&gt;
&lt;li&gt;Execute the &lt;strong&gt;init&lt;/strong&gt; method of the &lt;strong&gt;pac cli&lt;/strong&gt;. This will scaffold a new PCF control projects with all the basic dependencies.&lt;/li&gt;
&lt;li&gt;Execute &lt;strong&gt;npm install&lt;/strong&gt; to download the dependencies&lt;/li&gt;
&lt;li&gt;Try to build the project : &lt;strong&gt;npm run build&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;❌Fails with error : Cannot find module &amp;ldquo;ajv/dist/compile/codegen&amp;rdquo;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pac pcf init -ns &amp;lt;Namespace&amp;gt; -n &amp;lt;ProjectName&amp;gt; -t field
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;npm install
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;npm run build
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The error message is quite straitforward and points toward a node module that cannot be found : &lt;strong&gt;ajv/dist/compile/codegen&lt;/strong&gt; . Upon checking the &lt;strong&gt;node_modules&lt;/strong&gt; directory, even if the &lt;strong&gt;ajv&lt;/strong&gt; module seems present, the &lt;strong&gt;compile/codegen&lt;/strong&gt; part is nowhere to be found.&lt;/p&gt;</description></item></channel></rss>