<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Yuval Vardi on Medium]]></title>
        <description><![CDATA[Stories by Yuval Vardi on Medium]]></description>
        <link>https://medium.com/@vyuvalv?source=rss-615d7633a18e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*ie_17gKEQWn_Y-tPnpsM1w.png</url>
            <title>Stories by Yuval Vardi on Medium</title>
            <link>https://medium.com/@vyuvalv?source=rss-615d7633a18e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 23:05:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vyuvalv/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Streaming Salesforce Platform Events using gRPC and NodeJS]]></title>
            <link>https://vyuvalv.medium.com/streaming-salesforce-platform-events-using-grpc-and-nodejs-6fa0206dca0?source=rss-615d7633a18e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fa0206dca0</guid>
            <category><![CDATA[grpc]]></category>
            <category><![CDATA[lightning-web-component]]></category>
            <category><![CDATA[salesforce-development]]></category>
            <dc:creator><![CDATA[Yuval Vardi]]></dc:creator>
            <pubDate>Mon, 30 Aug 2021 17:53:45 GMT</pubDate>
            <atom:updated>2021-08-30T17:55:34.160Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*LXX97xQP0hqKoGnOr_o4lw.png" /><figcaption>Delivering real time notifications</figcaption></figure><p>Salesforce has announced a pilot program, where they introduced a new way to communicate with their new <strong>Event Bus</strong> using the new “<strong>Pub/Sub API</strong>”.</p><p>As you may notice, there’s a lot of <strong>“new”</strong> in the sentence above, which means we will need to wait patiently, until this service is generally available to enjoy its full potential…</p><p>In the mean time, I’ve managed to gather the below details, that are publicly available <strong>today </strong>and have added a demo app with some thoughts based on my understanding.</p><p>I thought it would be a good time to play around with the underlying technology for this service (<strong>gRPC) </strong>and get a grasp of how this could potentially be leveraged. I’ve also built a small chat app using Lightning Web Components (<a href="https://lwc.dev/"><strong>LWC</strong></a>) to use as quick demo app (<a href="https://github.com/vyuvalv/lwc-grpc-pubsub">Instructions and links below</a>).</p><p><strong>TLDR;</strong></p><p>I found out that <strong>gRPC</strong> can help to deliver a powerful real-time communication <strong>From</strong> and <strong>To</strong> a Salesforce org (EventBus).</p><p>Read more, if you are interested in <strong>real time</strong> communication between apps, event driven architecture with Salesforce and some cool server streaming capabilities.</p><h3>The New Salesforce Event Bus</h3><p>Let’s start first with the current publications around this new service.</p><p>As this <a href="https://medium.com/salesforce-architects/the-new-salesforce-event-bus-f82165cb0585">article</a> details, Salesforce decided to place and host their new Event Bus <strong>outside</strong> of the servers that are powering Sales Cloud and Service Cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZJJJUxHpcxOfJzGtysokCw.png" /><figcaption>The New Salesforce Event Bus</figcaption></figure><p><strong>This change should bring us a few benefits:</strong></p><ul><li>Allows to easily scale the service.</li><li>It adopts micro-services architecture.</li><li>It will be a Key part of how we’ll deliver new <strong>cross-cloud customer experiences</strong>.</li></ul><p>The Pub/Sub API, will sit on top or basically acts as an interaction layer for the Event Bus (as a runtime engine).</p><ul><li>It’s based on <strong>gRPC</strong>, that allows us, to combine the power of a runtime engine with publish and subscribe in <strong>one</strong> simple interface.</li><li>It will also provide a <strong>powerful client-driven flow</strong> control for event delivery.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*n_l80MSU3UDnm4q3YHgr7g.png" /><figcaption><a href="https://trailhead.salesforce.com/en/content/learn/modules/platform_events_basics/platform_events_architecture">Event-Driven Software Architecture</a></figcaption></figure><h3>What can it help us do better ?</h3><p>The Pub/Sub API, as already alluded to above, will allow users to publish events, subscribe to events, request schema, request topic information and more<strong>…</strong></p><ul><li>Basically, it eradicates the need for building out a custom <strong>CometD</strong> Streaming API client and also the need to use different API Interfaces or Protocols for various common tasks we need to do today.</li></ul><p>The table below, shows the way we approach some tasks today using the range of API interfaces available. Where with the new Pub/Sub API, it’s all available within<strong> One simple and unified API Interface.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*BgNA-YsRuCzxRj4arGxp8Q.png" /><figcaption><a href="https://developer.salesforce.com/blogs/2021/07/pub-sub-api-building-event-driven-integrations-just-got-even-easier">Pub/Sub API: Building Event-Driven Integrations Just Got Even Easier</a></figcaption></figure><p><strong>Some potential use cases:</strong></p><ul><li>Subscribing to Event Monitoring events and publishing a Platform Event back into Salesforce to restrict a user’s profile when they log into Salesforce after working hours.</li><li>Subscribing to Change Data Capture events and replicating order data in an external inventory system.</li><li>Subscribing to a standard Platform Event like <a href="https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/sforce_api_objects_appointmentschedulingevent.htm">AppointmentSchedulingEvent</a> and integrating with Google Calendar to update users’ calendars.</li></ul><h3>So <strong>what’s gRPC ?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dlXg1WplXaNGHc-dMr8Rdw.png" /></figure><p><strong>Where did “gRPC” come from ?</strong></p><ul><li>“RPC” — stands for <em>“</em><strong><em>Remote processing calls</em>”. </strong>The concept was introduced already back in the 90’s and has evolved since then.</li><li>The “g” in “gRPC”, it’s kind of a secret…no one wants to shout it out, but it was originally pioneered by a team at Google (old project aka “stubby”).</li><li>Today it’s an Open Source project with complete open specs and contributors. (Though development is still primarily executed by Google devs).</li></ul><p><strong>Overview of some of the API Patterns over time…</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*jb97cNPnR2XZEwUdMOCUmg.png" /><figcaption><a href="https://www.youtube.com/watch?v=l_P6m3JTyp0">API patterns evolution</a></figcaption></figure><p>Over the years, we have seen a huge increase in volumes and a wide variety of client types (devices) that consume our API’s. This and obviously some ambition to tackle big problems from key players like Facebook and Google has led us to find all sorts of new and different approaches to handle the integration tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*jzYM7LUYj7rsthJkC2cQjg.png" /><figcaption><a href="https://www.youtube.com/watch?v=l_P6m3JTyp0">GraphQL, gRPC or REST? Resolving the API Developer’s Dilemma — Rob Crowley</a></figcaption></figure><p>Good old early adapters, love to watch a new player trying to come up with a new API approach and some are fast to declare, that the old way is dead and long live the new one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KNWPLv19AV4FqVfol0OQFQ.png" /></figure><p>The fact is really, that the API eco-system is still relatively small.</p><p>We need to be flexible and innovative in order to allow things to connect and talk easily.</p><p>The below link, shows some nice Pro’s and Con’s for each approach per use case.</p><ul><li><a href="https://www.redhat.com/architect/apis-soap-rest-graphql-grpc">An Architect’s guide to APIs: SOAP, REST, GraphQL, and gRPC</a></li></ul><p><strong>In Short</strong> — We need to admit that it’s a journey, to provide a really fast and modern network communication which is fully optimised, scalable and easy to maintain.</p><p>Furthermore, there are also valid and interesting use cases where you would actually want to combine the techniques and use them altogether.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*a6o52HNFL1GXZIJpTQJuxg.png" /><figcaption><a href="https://medium.com/@svengau/when-graphql-meets-grpc-3e9729d32e05">When GraphQL meets gRPC… 😍</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*b0DZQt8YZHcTspu5-1dTPA.png" /><figcaption>Providing support for multiple Languages and Platforms Architecture (cc cloudcraft.co)</figcaption></figure><p><strong>Main issues I could see that gRPC aims to solve:</strong></p><ul><li>Strongly typed schema for request and response — our contract is well defined, kind of like SOAP/WSDL, but much easier to read, scale and maintain with advanced inteli-sense features in IDE.</li><li>Language definition and Code generator to support different languages.</li><li>HTTP/2 and gRPC allows a compressed and secured transaction of messages over the wire —<strong> its great for IOT and small devices with limited battery life.</strong></li><li>Bi-directional streaming in my opinion, would be one of the biggest features included in gRPC.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kVmSDjm9GD1NodT9spiSrw.png" /><figcaption><a href="https://www.redhat.com/architect/apis-soap-rest-graphql-grpc">An Architect’s guide to APIs: SOAP, REST, GraphQL, and gRPC</a></figcaption></figure><h3>ProtoBuff</h3><ul><li><em>“Protocol buffers are Google’s </em><strong><em>language-neutral</em></strong><em>, </em><strong><em>platform-neutral</em></strong><em>, extensible mechanism for serializing structured data — think XML, but smaller, faster, and simpler. ”</em></li><li>It’s an Interface <strong>Definition Language</strong> (IDL) — You define how you want your data to be structured once. You can use special generated source code to easily write and read the structured data. Use it on a <strong>variety of data streams</strong> and compile it in a <strong>variety of languages</strong>.</li><li>Can be used with more than 11 different coding languages.</li></ul><p>The <strong>.proto</strong> file, provides us the “dictionary” by which the data is encoded and decoded to and from the Protocol Buffers <strong>binary</strong> format.</p><p>We will use it, as our <strong>schema definition</strong> for our request and response payloads from Salesforce.</p><p>The `<strong>proto</strong>` file will structure the data based on the schema definition, our gRPC <strong>server </strong>can<strong> </strong>then<strong> </strong>decode and encode our payload so data will be compact and easy to transmit.</p><p>On the side of our server file we have our gRPC <strong>client,</strong> which will read and push the data to our <strong>client</strong> <strong>apps,</strong> so it can render and visualise it as we wish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*kzZ6ua3vQsePriJ0zKDpWw.png" /><figcaption>Connection via gRPC</figcaption></figure><h3>Streaming a response to our client app</h3><p>There are also several approaches for how to communicate notifications between our server to the client App.</p><p>While gRPC allows to stream the data on the server, in order to push those notifications to the client we will need to use one of the following:</p><p><strong>Long Pole request/response</strong></p><p>We could open a connection and pole for the results coming in using setTimeout() which will keep fetching data on a certain time interval.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/0*n2_PLTgofG8g64Ml.jpg" /><figcaption>Long polling is quite expensive…</figcaption></figure><p><strong>Web-sockets</strong></p><p>Web-Sockets offer bi-directional communication in real-time.</p><ul><li>Connections can both send and receive data from the client browser.</li><li>Can transmit both binary data and UTF-8.</li><li>When connections are terminated, Web-Sockets won’t automatically recover.</li><li>Some enterprise firewalls with packet inspection have trouble dealing with Web-Sockets.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*-Caj-fHCUzTesR8x7pOkkA.png" /><figcaption><a href="https://ably.com/blog/websockets-vs-sse">Websockets</a></figcaption></figure><p><strong>SSE/HTTP2</strong></p><p>Through this interface, a client requests a particular URL to receive an event stream.</p><ul><li><strong>Server-Sent Events (SSE)</strong> — Updates are pushed (rather than pulled, or requested) from a server to a browser.</li><li>The connection is kept open (until it receives an instruction to be closed) by calling <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventSource/close">EventSource.close()</a>.</li><li>Designed to use the JavaScript <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventSource">EventSource</a> API to subscribe to a stream of data in any popular browser.</li><li>Built-in support for re-connection and event-id and Transported over simple HTTP instead of a custom protocol.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*iKdHxRymFwzj1l9eyPYYRA.png" /><figcaption>Server Sent Events</figcaption></figure><h3>Let’s Demo this in Action</h3><p>This <a href="https://github.com/vyuvalv/lwc-grpc-pubsub">repository</a> stores the full code.</p><p>The project holds 2 similar LWC apps, one in Salesforce org and the other is leveraging more or less the same code using LWC OSS running on localhost.</p><ul><li>Been trying to reuse the same code for both apps as much as possible here. <em>gotta love re-usability</em>.</li><li>You’ll find that the main difference is only the one component that controls the Subscribe and Publish methods.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*8-q69RCT0TXubXdfTrUYUQ.gif" /><figcaption>Salesforce to Localhost and back in real-time</figcaption></figure><p>The Salesforce App, will use the <em>`</em><a href="https://developer.salesforce.com/docs/component-library/bundle/lightning:empApi/documentation"><em>lightning/empApi</em></a><em>` </em>to Subscribe to the channel given by the user on the client and Apex to Publish events.</p><ul><li>The app is built like a messenger chat between 2 users (Salesforce app vs. localhost app). Each user will be able to send a message, that will Publish a Platform Event with some fields to describe the source of the message.</li></ul><p>The OSS app will use <a href="https://nodejs.org/en/">Node JS</a> and <a href="https://expressjs.com/">Express JS</a> server setup, which we will add a <a href="https://grpc.io/">gRPC</a> server to run in parallel on a separate port.</p><p>The gRPC portion, at the moment (<em>Till the Pub/Sub Api will be GA</em>), will allow us to use <a href="https://jsforce.github.io/">JSForce</a> connection to <strong>Subscribe</strong> and <strong>Publish</strong> Platform Events <strong>To</strong> and <strong>From</strong> Salesforce and display them in the form of a Chat.</p><ul><li>All operations will happen within <strong>One</strong> unified gRPC interface.</li><li>Events will be pushed to the client app using Server Sent Events (<a href="https://www.npmjs.com/package/express-sse">SSE</a>).</li></ul><p>JSForce as of writing this article, is using <a href="https://cometd.org/"><strong>cometD</strong></a> under the hood to subscribe and listen to the Streaming API.</p><p>Based on the details above, that’s exactly what should potentially change in the future and will allow a more streamlined way of consuming those events and probably more things to come…</p><p>Small Safe Harbor statement — The above article is only based on my understanding and interpretation of the technology. It’s not here to replace any official documentation and linked resources I found whilst researching on the web (Credit mentioned next to each link).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fa0206dca0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing the Game of life in Lightning Web Components]]></title>
            <link>https://vyuvalv.medium.com/writing-the-game-of-life-in-lightning-web-components-ccf2206bc50b?source=rss-615d7633a18e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ccf2206bc50b</guid>
            <category><![CDATA[lightning-web-component]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Yuval Vardi]]></dc:creator>
            <pubDate>Sun, 22 Nov 2020 20:45:37 GMT</pubDate>
            <atom:updated>2020-11-23T10:33:41.814Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*KUsKof19YYtwNqngbWLxlw.png" /></figure><p>I’ve seen many implementations of this <strong>Algorithm</strong> or “<strong>Game</strong>” in almost any language or platform out there. I have not seen yet, someone implementing this on Salesforce LWC. I’m pretty sure someone might have tried that before me, But I thought to myself.. “Self..maybe you should write one and see what you can learn from this…”</p><p>While this won’t have much business logic baked into it, like most of the stuff we typically build in Salesforce, it definitely shows a few interesting Javascript techniques and has helped me grasp more of an understanding in how to deal with 2 dimensional Grids (Array of arrays) and pick up some html5 canvas drawings skills along the way.</p><p>It shouldn’t be too different than any other <strong>JavaScript </strong>implementation, but it does always makes me happy when I manage to translate something from the open web and make it work inside my day to day platform or stack and in same time it really satisfy me, when I can simplify a complex concept into words or in this case a game.</p><p>In addition, I’ve recently heard that <a href="https://en.wikipedia.org/wiki/John_Horton_Conway">John Horton Conway</a>, the inventor of this amazing algorithm, has recently passed away from COVID-19, so I thought this can be a nice tribute for him as well.</p><p>In the 1970&#39;s, he explored or even helped create the field of <a href="https://en.wikipedia.org/wiki/Cellular_automaton">Cellular automaton</a>. In short, this is where scientists were literally observing a grid of cells in any <strong>finite</strong> number of dimensions.</p><ul><li>For each cell, There is a set of cells called its <strong>neighbourhood</strong> — Those are the cells surrounding a certain cell.</li><li>Time starts when the Grid is set to a certain initial state – Zero or One on each cell.</li><li>Then, we can observe the evolution of the grid, certain cells and/or their neighbourhoods.</li></ul><p>The “<strong>Rules of life</strong>” will determine the next generation state for each cell – <strong>Alive</strong> or <strong>Dead</strong> / <strong>Zero</strong> or <strong>One</strong>.</p><p>This concept resembles and even illustrates the rise and fall of any living organisms or society based on population.</p><blockquote>Evolution is determined by its initial state…</blockquote><p>Quite deep. But the Game of Life logic can have infinite implementation and implications.</p><p>It runs on this basic, but quite a clever algorithm or if you wish, a “Set of Rules”:</p><ul><li><strong>Any live cell with fewer than two live neighbours dies, as if by underpopulation.</strong></li><li><strong>Any live cell with two or three live neighbours lives on to the next generation.</strong></li><li><strong>Any live cell with more than three live neighbours dies, as if by overpopulation.</strong></li><li><strong>Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.</strong></li></ul><p>Basically when implementing those rules in an infinite loop over a 2 dimensional array – Some shapes literally get a “Life” of their own..</p><p>Many different types of patterns were discovered that can occur in the Game of Life. They even gave them names :</p><ul><li><a href="https://en.wikipedia.org/wiki/Still_life_(cellular_automaton)"><em>still life</em></a><em> : do not change between generations.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/66/0*xg6L0cGmY1qf5eam.png" /><figcaption>Block</figcaption></figure><ul><li><a href="https://en.wikipedia.org/wiki/Oscillator_(cellular_automaton)"><em>oscillators</em></a><em> : which returns to their initial state after a few generations.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/82/0*iW3sOYhFxw5MtXTz.gif" /><figcaption>Blinker</figcaption></figure><ul><li><a href="https://en.wikipedia.org/wiki/Spaceship_(cellular_automaton)"><em>spaceships</em></a><em> : translate themselves across the grid.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/84/0*qqa7xud7kTuE1VG4.gif" /><figcaption>Glider</figcaption></figure><p>Theoretically, the Game of Life has the power of a <a href="https://en.wikipedia.org/wiki/Turing_completeness"><strong>universal Turing machine</strong></a> – anything that can be computed algorithmically can be computed within the Game of Life.</p><p>I was quite intrigued by this concept...</p><p>But enough background stories, everything you need or want to learn more about, a quick google search will lead your path to many more genius discoveries.</p><p>Let’s get cracking and try to build this algorithm in LWC and see this thing in action.</p><p>Find here the full playground code for this project.</p><ul><li>Code Playground – Full Working Example</li></ul><p><a href="https://webcomponents.dev/preview/PAaEWqfGbV7IkwwlxW6F">WebComponents.dev</a></p><p>But if you wish to see the breakdown step by step — keep on reading.</p><h3><strong>Step 1 : Create the Universe</strong></h3><p>Our first step here, would be to render a 2 dimensional data array that holds the initial state of our “universe”.</p><ul><li>We can set the number of the columns and rows as parameters for our grid dimensions.</li><li>We will set the height and width of the cell dynamically based on component screen size – just because, I like responsive things :)</li></ul><p>Our initial state will be a random number of Zero or One for each Cell in the grid.</p><ul><li>Zero represents a “Dead” cell. One will be our “Alive” cell.</li><li>We can also, set colour inputs for each state.</li><li>I’ll skip the html parts in this post that shows the color and button inputs — but feel free to look in the actual example code for those.</li></ul><p>We will use <a href="https://www.w3schools.com/html/html5_canvas.asp">html5 canvas</a> to draw our grid. I will be able to draw pretty easily on it and animate it. Plus… I wanted to play with <strong>canvas</strong> for quite some time so this can be a good use case.</p><p>Canvas Element on the HTML</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/25c123f4ecfbc9526e88c1fc28d91eed/href">https://medium.com/media/25c123f4ecfbc9526e88c1fc28d91eed/href</a></iframe><p>A bit of CSS just to set the initial size of our canvas container — the rest will be handled in our JS file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/909eb81a42379f87d4d9a255d3e85e20/href">https://medium.com/media/909eb81a42379f87d4d9a255d3e85e20/href</a></iframe><p>Our Initial JS File — Create a Random World</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d32edda426f7f8b08655e0894c61823/href">https://medium.com/media/6d32edda426f7f8b08655e0894c61823/href</a></iframe><ul><li>When our component has rendered — renderedCallback will be fired. This is where we will have access to our DOM elements. We need it, in order to get our <strong>canvas</strong> <strong>context</strong> and draw on it.</li><li>We only want to call it <strong>once</strong> after render.</li><li>We also need it, so we can set the <strong>width</strong> and <strong>height</strong> dynamically based on the DOM container size.</li></ul><p><strong>Cool trick for debugging </strong>— If we wish to evaluate our grid values generations :</p><ul><li>Un-comment the console.table(universe) log statement and check in your browser console — we can actually display our grid quickly this way and check our values.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YXvKNUq6jInZ0RLRLJK4PA.png" /><figcaption>2 Dimensional Random Array</figcaption></figure><p>Step by step methods inside our JS code - Render the grid on the canvas.</p><ul><li>Getting the canvas context as parameter allows us to re-use and reset our context when we need.</li><li>clientWidth / clientHeight — will provide us the component current dimensions and will allow us to set the cell width and height dynamically.</li><li>Iteration over the columns and X axis and rows as Y axis</li><li>Setting each width and height</li><li>Setting the colour based on the given state value. (Alive/Dead colours)</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/50b5358899cfd1327b2192b76876b0df/href">https://medium.com/media/50b5358899cfd1327b2192b76876b0df/href</a></iframe><ul><li>I’ve separated those methods so we can re-use them for the different functionality later on and tried to keep it readable.</li></ul><p>Let’s test where we are on the UI… It should give us an initial dynamic scaled state canvas based on those columns and rows .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*sZDH9ryXbT5689UCr0IFEA.png" /><figcaption>Canvas display of initial Random state</figcaption></figure><p>Voila! The grid holds a 2 dimensional array with random values of 0 or 1 as the cells state that are also painted with our set of colours.</p><h3>Step 2 : Creating the World’s next Generations</h3><ul><li>This is where we first need to identify the Neighbourhoods for each cell, then count all living cells.</li><li>Secondly, implement the <strong>Rules of life</strong> and Generate the Next Generation of the grid.</li></ul><p>So, based on the current state of each cell and how many neighbours are alive, we can define the new state of each cell and assign it into the Next Generation grid.</p><ul><li>The below nextGeneration method will be broken down into steps.</li><li>It will allow us to both countNeighbours and set the new state for each cell based on the rulesOfLife.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e8e0044f53753bf3991abfb0260a0494/href">https://medium.com/media/e8e0044f53753bf3991abfb0260a0494/href</a></iframe><p>countNeighbours method will sum up the values in each neighbourhood.</p><p>Respectively it will also implement the <strong>Edges</strong> and <strong>Corners</strong> rules which we will discuss a bit further below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b382447f0dd154582f8c2cc0b8cea935/href">https://medium.com/media/b382447f0dd154582f8c2cc0b8cea935/href</a></iframe><p>This is a good point to stop for a second and understand, how can we identify the neighbourhood of a given cell ?</p><p>When checking for neighbours we basically need to run on the surrounding “<strong>neighbourhood</strong>” of the cells as an array by itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*xywFiFNIV0UnLr-AeyM13Q.png" /><figcaption>In this case, we have 8 Dead (Grey) Neighbours surrounding a live(Red) cell.</figcaption></figure><p>We are iterating over columns and then again over rows— 2 nested iterations.</p><p>In the above case, We can shift one column to the left and one to right, same goes for top to bottom on the rows.</p><p>This will give us the neighbours of the middle cell (<strong>Red</strong>).</p><p>We can build another iteration here to cover this with this setting :</p><ul><li>xStart : indexStart, // -1</li><li>xEnd : indexEnd, // 2</li><li>yStart :indexStart, // -1</li><li>yEnd : indexEnd // 2</li></ul><p>Our columns represent our X axis and rows represent our Y axis. By running between <strong>-1</strong> up to <strong>1</strong> in each iteration, we are covering the cells to the :</p><ul><li>Top Left, Left, Bottom Left =&gt; Column 0, Rows 0 up 2.</li><li>Top, Bottom =&gt; Column 1, Only Row 0 and 2</li><li>Top Right, Right, Bottom Right =&gt; Column 2, Rows 0 up 2.</li><li>We need to skip the middle cell :<strong> 1 : 1 =&gt; that’s the one we are evaluating.</strong></li></ul><p>I must admit that when I started developing this thing, I didn’t fully realise, what kind of a complex <strong>“mind ** procedure”</strong> it is, when you keep iterating over those columns and rows and trying to understand how to calculate those in your brain.</p><p>Did you get this headache already ? Which cell are we iterating now ? go left then right ah ?? It helps to <strong>visualise</strong> this as much as possible.</p><h3>Handling the Grid Edges and Corners</h3><p>When using for example a 3X3 grid (like above) we can see a different size of a neighbourhood when it comes to any cell, <strong>BUT</strong> the middle <strong>Red</strong> cell.</p><ul><li>For the algorithm to work — we basically need <strong>8 cells</strong> as a neighbourhood.</li><li>So we can either just ignore any other case and only handle the cells that has 8 neighbours.</li><li>This will leave the edges and corners in their initial state.</li></ul><p>But, I’ve seen a few ways of handling the edges and corners, which can also give us dynamic edges.</p><p><strong>The problem here is that :</strong></p><ul><li><strong>Corners</strong> — will have only <strong>3 neighbours.</strong></li><li><strong>Edges</strong> — will have only <strong>5 neighbours.</strong></li></ul><p>In those cases, we can extend the array with Dead Zero cells , Or maybe simpler to say, Only count the available cells for each case.</p><ul><li>This seems to be more interesting and will also make the entire grid dynamic.</li></ul><p>So I’ve built this getNeighbourhoodCells method to handle the iteration for each neighbourhood relative to its position on the grid.</p><ul><li>It seems a bit long… but hey you kept on reading this far :)</li><li>For each corner or edge — it will run relatively on the available cells</li><li>Otherwise it will give us the <strong>8 neighbours</strong> scenario as default.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/575477cee78a2ff96d9f41239cffa100/href">https://medium.com/media/575477cee78a2ff96d9f41239cffa100/href</a></iframe><p>Personally, Not a big fan of the many if/else if statements but I hope it makes it easy to read.</p><p>Once we have the total number of neighbours and we know the current cell state, we can finally run the<strong> Rules of life </strong>on this cell and calculate the next generation grid.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c019ecf648b6eb5ef7cd43dc00f803dd/href">https://medium.com/media/c019ecf648b6eb5ef7cd43dc00f803dd/href</a></iframe><h3><strong>Step 3 : Lets Animate the Universe and see the future generations !</strong></h3><p>Now, this step is <strong>optional</strong>. We can just leave it with a <strong>next button</strong> that shows us the next Generation each click.</p><p>But, we have a few options to perform this kind of an infinite loop or animate the canvas.</p><ul><li><strong>SetInterval</strong> — Will run in an infinite loop and allow you to control the speed in a pretty straight forward way.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/db12099f272da972d0d8139accd2f852/href">https://medium.com/media/db12099f272da972d0d8139accd2f852/href</a></iframe><ul><li><strong>window.requestAnimationFrame</strong> — This should be more efficient as it calls the next animation frame only once ready.</li><li>But, to control the speed of the animation I had to do some <strong>math</strong>.</li><li>This does not seem to work for me in the web components playground. But works great inside Salesforce.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b9b1c60dc3ba16bcdb4a011acf16888/href">https://medium.com/media/2b9b1c60dc3ba16bcdb4a011acf16888/href</a></iframe><ul><li>Those are the currently <a href="https://developer.salesforce.com/docs/component-library/tools/locker-service-viewer">supported</a> window methods in LWC.</li><li>Above code is how I have achieved it, though as always there are better and more optimised ways to code this challenge.</li><li>Many wise people, have actually found ways and written complete theories on how to optimised this algorithm and shorten up the code to achieve it — I just tried to see if it would work and I that I can play with my example.</li></ul><p>So from now on it’s mainly which UI buttons we wish to have in order to interact with the grid.</p><p>I’ve added some slds <a href="https://developer.salesforce.com/docs/component-library/bundle/lightning-input/example">base input component</a> to get the colour and sliders inputs along with some buttons on the html template — that’s easy.</p><p>But thats it.. Challenge accepted and completed successfully.</p><p>We are ready to observe our animated <strong>Game of life.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*D8suMAfd_CGDdvexRSYAlQ.gif" /></figure><p>While its probably a complete useless app to have this inside a Salesforce Record Page, it might help pass some time for curious users in our org :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o1o-v-s3SY7btkP6ZSpJ_Q.png" /><figcaption>Example App on a Salesforce Record Page Layout</figcaption></figure><p>Full Working example can be found here :</p><p><a href="https://webcomponents.dev/edit/PAaEWqfGbV7IkwwlxW6F?sv=1&amp;pm=1">lwc-conways-game-of-life-example by vyuvalv</a></p><p>I went on to add some more functionality into this project to allow me to draw the different shapes as I please and examine their behaviour.</p><p>Feel free to fork it and extend it as you wish.</p><p>There are some pretty cool examples online for different implementation.</p><p>I’ve even heard about a Game of Life written in the Game of life.. Embedding audio and sounds and all sorts of crazy stuff.</p><p>I hope this article shows my small contribution to the community and my greatest appreciation to Conway’s Game of life. RIP John Conway.</p><p>Worth recognising and noting that he made much larger contributions to mankind other than just <strong>the</strong> “Game of life”, he in fact didn’t really like it! He thought it stole some attention from other great inventions. But for me, this is the something that just caught my eye and made me think. So thanks for that !</p><p>Hope you enjoyed reading… I enjoyed figuring this one out and sharing the story of a great man.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ccf2206bc50b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SFDX and some cool ways of automating your Developer workflows]]></title>
            <link>https://vyuvalv.medium.com/sfdx-and-some-cool-ways-of-automating-your-developer-workflows-154f5947775d?source=rss-615d7633a18e------2</link>
            <guid isPermaLink="false">https://medium.com/p/154f5947775d</guid>
            <category><![CDATA[sfdx]]></category>
            <category><![CDATA[salesforce-productivity]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[yeoman]]></category>
            <category><![CDATA[cli-tool]]></category>
            <dc:creator><![CDATA[Yuval Vardi]]></dc:creator>
            <pubDate>Tue, 19 Nov 2019 23:01:02 GMT</pubDate>
            <atom:updated>2021-08-30T06:59:01.227Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently started playing with a tool called <a href="https://yeoman.io/">Yeoman</a> — it excited me to see that I can automate certain tasks on my file system, but also integrate with other common CLI (Command Line Interface) web tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/0*W0Qa4LsswXV3VCyT.png" /></figure><p>Being a fan of <a href="https://developer.salesforce.com/tools/sfdxcli">SFDX</a> — <strong>Salesforce Developer Experience CLI</strong> tool for managing your salesforce project, I decided to automate a few of my repetitive tasks for any custom feature I would develop on the Salesforce Lightning platform.</p><p><strong>My Goals </strong>were mainly to reduce some manual repetitive tasks between the different projects I’m working on. In addition, I wanted to have some extra configuration steps that would allow me to leverage the SFDX commands more than I was doing before and to add some more flavour to the process.</p><p>Maybe some readers are like me, but every time I needed to use an SFDX command, I found myself either typing —-help as part of my command or going first to the <a href="https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force.htm">commands docs</a> site.</p><blockquote><em>sfdx --help</em> : will show an example command usage, all available options, commands and related topics.</blockquote><blockquote>sfdx force:doc:commands:display : will show all sfdx commands</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0jd2NfW5ianJdb1R0e8lMQ.png" /><figcaption>sfdx — help flag with <strong>force</strong> commands</figcaption></figure><p>Once there, spending some time looking for the right command path and then starting to type flag by flag (options) based on my needs for every step and for every given project… it takes some time and some mistakes are made on this journey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*q4Hs0IHXa3MFznlObwYQWQ.gif" /><figcaption>Configuring SFDX commands with optional flags</figcaption></figure><p>Ahhhh..🤦‍♂️ 🤧 … quickly ctrl c to abort !!</p><p>So later on.. I started to remember some of the basic commands with some pre-defined flags, but still some commands are pretty long and my memory kept on failing me.</p><p>I guess some creativity also comes from being a bit of a lazy developer and a freak of automation, but making things more efficient is also part of my day to day job so I was trying to find a better way.</p><p>This led me to explore a bit more of what I can achieve with some old school terminal tricks and maybe doing it in a much simpler and shorter routine or essentially to make this workflow a bit more efficient.</p><p><strong>Source a Bash file:</strong></p><p>Cool trick I find really useful is that I can create a <strong>.bash_profile</strong> file in my project and source it — Inside I will write a few scripts and aliases for my commands for this specific project or may store a few common generic aliases across all my projects in ~.bash_profile. (will store the file in ~/Users/&lt;username&gt;/.bash_profile and not in the specific project folder)</p><ul><li>touch .bash_profile : This will create your bash file inside your current folder so you can add your alias and functions.</li><li>source .bash_profile : This command will use this file as a source for your bash scripts <strong>instead</strong> of the ~root bash file.</li></ul><p>This will allow to make the commands shorter and much easier for me to use or remember.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae2b9e52db12817c6b82eba85b14f61c/href">https://medium.com/media/ae2b9e52db12817c6b82eba85b14f61c/href</a></iframe><p>Those aliases can also be joined by using &amp;&amp; or written as a function.</p><blockquote>Bash scripts are powerful and really helpful if you really want to automate the whole process into a single liner command.</blockquote><p>Shell/Bash syntax was a bit weird for me at first, but after a few plays you kinda get the hang of it.</p><p>The only thing is that when I was trying to achieve a bit more complex logic and a bit more friendly interface I found myself looking further for other solutions.</p><p>That’s where <a href="https://yeoman.io/"><strong>Yeoman</strong></a> came to the rescue…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/235/0*lwcUd-A1yJBfUC39" /><figcaption>yo welcome</figcaption></figure><blockquote>Yeoman helps you to kickstart new projects, prescribing best practices and tools to help you stay productive.</blockquote><p>Without going into the documentation too deeply, Yeoman brings together 3 powerful concepts :</p><ul><li><a href="https://github.com/yeoman/yo">yo</a> <strong>scaffolding tool </strong>— Scaffolds out a new application, writing your build configuration files etc.</li><li>A <strong>build system</strong> — Common node.js plugins like <a href="https://gruntjs.com/">grunt</a> or <a href="https://gulpjs.com/">gulp</a> are in use and they can help you build, preview and test your code.</li><li>node <strong>package manager</strong> (npm) — which helps you install common code dependencies.</li></ul><p>This is done using yeoman generators — which are available and <a href="https://yeoman.io/generators/">published</a> as npm packages themselves and provide a wizard like process that runs in your Terminal.</p><p>I quickly figured out that in order to build your own tailored workflow, you need to create your own generator. You can do so by using the <a href="https://github.com/yeoman/generator-generator">Generator for generator</a> .</p><blockquote>Generators are yeoman ‘plugins’ that act as the building blocks to create your workflow.</blockquote><p>TL;DR</p><ol><li>Assuming you have <a href="https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm#sfdx_setup_install_cli">SFDX</a> but if not — npm install sfdx-cli --global</li><li>Install yeoman : npm install -g yo</li><li>Install Generator : npm install -g yo generator-generator</li><li>Run your first yo command : yo generator</li></ol><p>Once done answering all questions, your new custom generator will be created and ready to be configured to your needs.</p><p>The initial skeleton generator holds multiple dependencies, that honestly I did not invest too much time to understand them all.</p><p>Step into your <strong>package.json</strong> file and review what you wish to leave or change. In order to make this example simple I removed and changed a few of the dependencies to what I will use in my examples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*MMIPdAutdcIQmOlQxgT5Xg.png" /><figcaption>package.json <strong>dependencies</strong></figcaption></figure><p>My chosen dependencies (third party npm libraries), will give a bit more spark to your generator :</p><ul><li><a href="https://github.com/chalk/chalk"><strong>chalk</strong></a><strong> </strong>— Adds colourful text for input/output on the screen.</li><li><a href="https://github.com/shelljs/shelljs"><strong>shelljs</strong></a><strong> </strong>— Unix shell commands on top of the Node.js API…</li><li><a href="https://github.com/sindresorhus/ora"><strong>ora</strong></a> — Provides an elegant terminal spinner.</li><li><a href="https://github.com/yeoman/yosay"><strong>yosay</strong></a><strong> </strong>— Ascii image to give some credit to yeoman this one is <em>“Like cowsay, but less cow”.</em></li></ul><p>Worth mentioning on this note, a few of those already available inside Yeoman :</p><ul><li><a href="https://github.com/SBoudrias/Inquirer.js"><strong>Inquirer</strong></a><strong>.js </strong>— Provides the command line interface and allows you to validate and conditionally prompt questions this.prompt.</li><li><a href="https://github.com/sboudrias/mem-fs-editor"><strong>mem-fs </strong></a>— Simple way of accessing your file-system this.fs.</li></ul><p>After setting your dependencies and project description — you are ready to start configuring your workflow. Step inside generators/app/index.js file.</p><p>I would suggest at this point to read a bit about the <a href="https://yeoman.io/authoring/running-context.html">running context</a>, which is described with the run loop — ‘ <em>a queue system with priority support ‘</em> — a fancy way for saying that when yo is invoked, the methods will run one after the other by their name and in their designed sequence.</p><p>The gist is that — those are the available priorities (in running order) — I included some of my notes beside them as I was reading through the official yeoman <a href="https://yeoman.io/authoring/running-context.html">documentation</a>:</p><ol><li>initializing - This is where the process starts (after your constructor builds the app). This step can be useful to check for project status and for example to get your SFDX org list or use certain schema definition commands to extract as defaults for your follow up questions or tasks.</li><li>prompting - Where you prompt users for options (where you’d call this.prompt()) — Try to add some dynamic options to complement the standard SFDX commands, validate user inputs and conditionally display questions that will drive your workflow.</li><li>configuring - Saving configurations and configure the project — That’s where we can also set or create any SFDX configuration settings, User definitions etc.</li><li>default - If the method name doesn’t match a priority, it will be pushed to this group.</li><li>writing - This is where we write files. We can use ES6 templates to copy and populate them with User inputs. This can be really helpful for any project, org, metadata or data definition file we wish to work with.</li><li>conflicts - Where conflicts are handled (used internally).</li><li>install - Where installations are run — We can use this step to install any app-exchange packages as dependencies or to clone Git repositories.</li><li>end - Called last, cleanup, <strong>say</strong> <em>good bye</em>, etc…</li></ol><p>Ok makes sense… In my basic examples I don’t really use the entire sequence, it’s optional, but it’s really useful to master this priority and use it wisely while you start configuring the different steps of your workflow.</p><p>Once you start connecting sub-generators to each other — when invoked, each sub-generator will start its own run loop inside the parent priority context. It can get confusing at times, but you can always control your function call order using the composeWith method.</p><h3>Let’s see some examples</h3><p><strong>Initializing your </strong><strong>hello world generator with </strong><strong>yo:</strong></p><blockquote>Tell <em>yo</em> to say ‘Hello world’ , use chalk to give some colour and utilize shelljs to invoke SFDX command.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/59b70313275d1bf5837a567093a0428c/href">https://medium.com/media/59b70313275d1bf5837a567093a0428c/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*cf_NG_J4ECHiDgV1_zswKg.png" /><figcaption>Terminal output of Hello World Simple Example</figcaption></figure><p><strong>Same </strong><strong>hello world example, but now let’s make it smarter :</strong></p><blockquote>When <strong>initializing</strong> with <strong>SFDX org list </strong>with the <em>--json</em> parameter, we can do some smart stuff in background like <strong>Write</strong> and <strong>Read</strong> all connected orgs on your dev hub, which allows us to assign them as defaults to our workflow or simply show/hide some questions.</blockquote><p>The below example will also add a spinner animation — Useful trick when starting to invoke commands and performing some operations in file system — ora add some <a href="https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json">nice frames to spinners</a> and allow messages to show the current stage of the process.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/57e28c9c91a716aa55e7aaf8a1298e92/href">https://medium.com/media/57e28c9c91a716aa55e7aaf8a1298e92/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*OtIplMuKW0PQ6cCcsYCF1Q.png" /><figcaption>Show Default Orgs</figcaption></figure><h4>Prompt the user for questions:</h4><blockquote>Start to look at the optional flags of the commands as questions and have visibility logic around <strong>when</strong> to display or how to <strong>validate</strong> each question.</blockquote><blockquote><strong>Implement visibility logic into your workflow questions:</strong></blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2caf630e206cafdaa6e4894f397d95a1/href">https://medium.com/media/2caf630e206cafdaa6e4894f397d95a1/href</a></iframe><p><strong>Possible Input type values: </strong><br>input, number, confirm, list, rawlist, expand, checkbox, password , editor.</p><h4>Copy Template and write files with user inputs:</h4><blockquote>This example shows a workflow where we generate a new scratch org, but we use a new definition file that was created out of a template which is populated with the User answers as input parameters.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/14e0395bf68559549728660c2c2faf2d/href">https://medium.com/media/14e0395bf68559549728660c2c2faf2d/href</a></iframe><h4>Template of a scratch org definition:</h4><blockquote>This will allow you to add some extra functionality on top of the Standard SFDX command by adding the ability to specify the Features and Settings that should be available in your scratch org, while you are still running a single command.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/be374e8a3bf76fa78d5dfb689b7a4a19/href">https://medium.com/media/be374e8a3bf76fa78d5dfb689b7a4a19/href</a></iframe><h4>Running SFDX Commands with shelljs</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eae14f62091893e9c4b82e8862799ad2/href">https://medium.com/media/eae14f62091893e9c4b82e8862799ad2/href</a></iframe><h4><a href="https://yeoman.io/authoring/composability.html">Composing </a>a workflow with sub-generators:</h4><blockquote>This is where the magic begins… Orchestrate and connect your sub-generators together to support a stream lined workflow.</blockquote><blockquote><em>composeWith</em> accepts a generator path and an optional object for input parameters.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c0dc34b6db5b852b1c655fc3252065c/href">https://medium.com/media/3c0dc34b6db5b852b1c655fc3252065c/href</a></iframe><p>These snippets should give you a quick overview of how to configure your generator methods and integrate with SFDX commands to do the work for you on the different parts of the generator lifecycle.</p><p>The objectives here were to find a way to automate my day to day workflows — This tool definitely proved itself worthy for many of the tasks I would perform as a developer.</p><p>I hope to follow up in the future with a few more articles that will show some more real examples of how to leverage Yeoman to build more automation into the day to day developer workflows.</p><p>For now, you can check out my sample repository which will help you create your SFDX project and manage your org using a Yeoman generator.</p><p><a href="https://github.com/vyuvalv/yo-sfdx-commands-generator/tree/master">vyuvalv/yo-sfdx-commands-generator</a></p><p>This Generator is stored locally — so simply clone the repository follow the instruction on github and type one word :</p><ul><li>yo dx — Main menu</li><li>yo dx:project —Create new project</li><li>yo dx:org —Create new scratch org</li><li>yo dx:manage — Few more org commands</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Agihj27M_52hapfU3r4eFg.png" /></figure><p><strong>Yo </strong>u are ready to Start yo your workflows !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/0*YTtMNriEjUIzkp2D" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=154f5947775d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>