<?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>Forem: Laxman</title>
    <description>The latest articles on Forem by Laxman (@lmn).</description>
    <link>https://forem.com/lmn</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%2F64141%2F6ef4be7b-0e38-47a9-9979-9887731befc1.jpg</url>
      <title>Forem: Laxman</title>
      <link>https://forem.com/lmn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/lmn"/>
    <language>en</language>
    <item>
      <title>release-with-changelog: A superior GitHub action to manage your releases</title>
      <dc:creator>Laxman</dc:creator>
      <pubDate>Sat, 12 Sep 2020 07:11:27 +0000</pubDate>
      <link>https://forem.com/lmn/release-with-changelog-a-superior-github-action-to-manage-your-releases-17gb</link>
      <guid>https://forem.com/lmn/release-with-changelog-a-superior-github-action-to-manage-your-releases-17gb</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kMb_KUZr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/e50fkv4fmjtqfgs5jxzs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kMb_KUZr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/e50fkv4fmjtqfgs5jxzs.png" alt="An automated release with changelog automatically generated"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What the hell are you talking about?
&lt;/h3&gt;

&lt;p&gt;There are these core actions maintained by GitHub, under the &lt;a href="https://github.com/actions/"&gt;@actions/...&lt;/a&gt; scope, that houses actions which automate common tedious tasks like posting output of a build, creating releases, publishing your npm modules etc.&lt;/p&gt;

&lt;p&gt;But these actions are not that powerful per se, they only provide the most generic ways for going about with performing an action.&lt;/p&gt;

&lt;p&gt;For example, if you wanted to automate creating a release on pushing some tags, which also contains a body of changelog commits, you can not, you are stuck with the default static input that &lt;a href="https://github.com/actions/create-release/issues/64"&gt;@actions/create-release&lt;/a&gt; provides. This was a &lt;a href="https://github.com/fregante/github-url-detection/issues/27#issue-665361939"&gt;real requirement&lt;/a&gt; for us. You have to build on top of it.&lt;/p&gt;

&lt;p&gt;Out of this necessity was born &lt;a href="https://github.com/notlmn/release-with-changelog"&gt;release-with-changelog&lt;/a&gt;, a GitHub action to automate your releases without having to worry about manually generating changelogs for every release you make.&lt;/p&gt;

&lt;p&gt;This action takes a list of commits between the current tag and the last available tag, and uses that as body when creating releases, it's as simple as that. Not quite though, there are a little details I ignored to mention here as they require their own in depth explanation. If you want to dig more into the details, there's no other place than the &lt;a href="https://github.com/notlmn/release-with-changelog/blob/main/index.js"&gt;self explaining code&lt;/a&gt; to look at 😉.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I use this?
&lt;/h3&gt;

&lt;p&gt;You can find a sample workflow snippet in the readme or look at how some other (famous 👏) repository use this action in production &lt;a href="https://github.com/sindresorhus/refined-github/pull/3421"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;Release&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;
      &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;fetch-depth&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;notlmn/release-with-changelog@v2&lt;/span&gt;
      &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;header&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;###&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Changelog'&lt;/span&gt;
        &lt;span class="na"&gt;footer&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Custom&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;footer'&lt;/span&gt;
        &lt;span class="na"&gt;include-hash&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
        &lt;span class="na"&gt;include-range&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
        &lt;span class="na"&gt;token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It's as simple as that!&lt;/p&gt;

&lt;p&gt;You can find what these options are and what they do in a bit more detail &lt;a href="https://github.com/notlmn/release-with-changelog/blob/main/action.yml"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The documentation is a bit rough on the edges, so beware, but please go ahead and see if this helps you in your open-source projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  I see, is anyone using this already?
&lt;/h3&gt;

&lt;p&gt;Yes! See how some existing open-source projects are using this extension:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/sindresorhus/refined-github"&gt;Refined GitHub&lt;/a&gt;: A browser extension with more than 12k stars uses this extension to automate its releases, and helps its users notified on new features.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/notlmn/browser-extension-template/"&gt;browser-extension-template&lt;/a&gt;: A GitHub template to help you get started with building your first browser extension, also including this action to automate releases.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Shameless plug: Read how I ended up creating the later project in my &lt;a href="https://dev.to/lmn/writing-a-template-for-browser-extensions-2alg"&gt;previous post&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Credits where it is due
&lt;/h3&gt;

&lt;p&gt;Kudos to the awesome &lt;a href="https://github.com/fregante"&gt;@fregante&lt;/a&gt; for helping me out crushing bugs and adding features to the action. ❤&lt;/p&gt;

&lt;h3&gt;
  
  
  Help us improve it
&lt;/h3&gt;

&lt;p&gt;We're currently working on adding features like &lt;a href="https://github.com/notlmn/release-with-changelog/issues/9"&gt;template for changelog&lt;/a&gt;, &lt;a href="https://github.com/notlmn/release-with-changelog/issues/9"&gt;excluding commits from changelog&lt;/a&gt;, and more.&lt;/p&gt;

&lt;p&gt;Do you like it? Do you hate it? Please feel free to let us know the same in comments or opening issues on the repository. If you have any ideas, reach out to me using comments, &lt;a href="https://twitter.com/bytemode"&gt;twitter&lt;/a&gt;, or any other creative way you could think of. I promise I won't bite.&lt;/p&gt;

</description>
      <category>actionshackathon</category>
      <category>github</category>
      <category>diydeployments</category>
    </item>
    <item>
      <title>Writing a Template for Browser Extensions</title>
      <dc:creator>Laxman</dc:creator>
      <pubDate>Sat, 23 May 2020 07:30:27 +0000</pubDate>
      <link>https://forem.com/lmn/writing-a-template-for-browser-extensions-2alg</link>
      <guid>https://forem.com/lmn/writing-a-template-for-browser-extensions-2alg</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: This is blog post is on how I ended up writing a GitHub template for creating browser extensions, with experience from other browser extension I've worked on, you can find it at &lt;a href="https://github.com/notlmn/browser-extension-template/"&gt;https://github.com/notlmn/browser-extension-template/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;I started working on open-source software sometime around 2016, watching &lt;a href="https://www.youtube.com/playlist?list=PLNYkxOF6rcICCxAiogddzLoyL9Zedi3s5"&gt;Supercharged&lt;/a&gt; (RIP) on YouTube and making little tweaks on their &lt;a href="https://github.com/GoogleChromeLabs/ui-element-samples/"&gt;repository&lt;/a&gt;, and also making a copy of &lt;a href="https://github.com/ramlmn/ui-element-samples/"&gt;my own&lt;/a&gt;. Man, those fun times.&lt;/p&gt;

&lt;p&gt;And sometime around 2017, I found the now-famous browser extension &lt;a href="https://github.com/sindresorhus/refined-github/"&gt;Refined GitHub&lt;/a&gt; by Sindre Sorhus, which by then was in it's initial stages, and I immediately fell in love with it 😍. So, I started contributing to it, suggesting changes, implementing features suggested by other users, editing documentation, or simply triaging issues. I mean that's how one gets into open-source, even small changes like &lt;a href="https://www.youtube.com/watch?v=_iToM2KC0QE"&gt;styling documentation could go a long way&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Later in 2018 I found out that &lt;a href="https://github.com/sindresorhus/notifier-for-github/issues/67"&gt;Notifier for GitHub&lt;/a&gt; (&lt;em&gt;NfG&lt;/em&gt;), another browser extension by Sindre, is &lt;a href="https://github.com/sindresorhus/notifier-for-github/issues/67"&gt;looking for maintainers&lt;/a&gt;. My prior experience on Refined GitHub (&lt;em&gt;RGH&lt;/em&gt;) helped me become a maintainer on that project, which even though is not as active as Refined GitHub, has seen a lot of changes and features added over the years.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S7A86zJn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://user-images.githubusercontent.com/37769974/82723558-5413fe00-9ced-11ea-878f-f421c020aee5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S7A86zJn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://user-images.githubusercontent.com/37769974/82723558-5413fe00-9ced-11ea-878f-f421c020aee5.png" alt="Sindre looking for maintainers on Notifier for GitHub project"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And again, my contributions to these extensions led me to an invitation to become a collaborator on RGH. Even though my involvement on RGH has been a little hands-off, I was still contributing to it. And I really wanted NfG to be a lot more like RGH, in terms of  directory structure, dependencies, and automatic deployments to extension stores so that we have a structured setup for easily managing them. At this point, most of this was achieved by simple copy-pasting code between them, as they had many shared parts.&lt;/p&gt;

&lt;p&gt;At the same point GitHub released a new feature called &lt;a href="https://github.blog/2019-06-06-generate-new-repositories-with-repository-templates/"&gt;template repositories&lt;/a&gt;, which if you do not yet know is similar to forking a repository but the source and fork are loosely related and removes most of the other annoyances like allowing the clone to be made private.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VcYdWvDt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://github.blog/wp-content/uploads/2019/06/repository-template.gif%3Fw%3D1024%26resize%3D1024%252C512" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VcYdWvDt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://github.blog/wp-content/uploads/2019/06/repository-template.gif%3Fw%3D1024%26resize%3D1024%252C512" alt="Template repositories on GitHub"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anyway, with many people starting to create browser extensions and being made open-source, I really wanted something similar to &lt;a href="https://github.com/h5bp/html5-boilerplate/"&gt;HTML5 Boilerplate&lt;/a&gt; but for creating browser extensions. Even though what I wanted to create was a entirely different, the new GitHub template feature helped spark the idea.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bg88z4Wd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://user-images.githubusercontent.com/37769974/82723929-0220a780-9cf0-11ea-81fa-c46b54379359.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bg88z4Wd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://user-images.githubusercontent.com/37769974/82723929-0220a780-9cf0-11ea-81fa-c46b54379359.png" alt="browser-extension-template on GitHub"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that's how I ended up creating &lt;a href="https://github.com/notlmn/browser-extension-template"&gt;browser-extension-template&lt;/a&gt;. The extension borrows a lot of best-practices, with tools and technologies required for building browser extensions including the following features.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Included polyfill for cross-browser compatibility.&lt;/li&gt;
&lt;li&gt;Auto-syncing setup for syncing user options provided by browsers.&lt;/li&gt;
&lt;li&gt;Auto-publishing to extension stores using CRON jobs and weekly tagged releases.&lt;/li&gt;
&lt;li&gt;Extensive documentation on how to configure it (Webpack, css extraction, and even setting up Typescript).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The project also includes a sample browser extension that makes use of all of the features mentioned above.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“This extension template is heavily inspired by &lt;code&gt;refined-github&lt;/code&gt;, &lt;code&gt;notifier-for-github&lt;/code&gt;, and &lt;code&gt;hide-files-on-github&lt;/code&gt; browser extensions. You can always refer to these browser extensions' source code if you find anything confusing on how to create a new extension.”&lt;/p&gt;

&lt;p&gt;— from &lt;code&gt;browser-extension-template&lt;/code&gt; readme&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As mentioned in the readme, the extension borrows a lot from other browser extensions, and some of these features have also been backported to some of these extensions.&lt;/p&gt;

&lt;p&gt;The project is almost a year old now, released under CC-0. If you are interested in building browser extensions, learning how they work, or even contribute to one, take a look at &lt;a href="https://github.com/notlmn/browser-extension-template"&gt;browser-extension-template&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;If you like using browser extensions, also please take a look at my other project &lt;a href="https://github.com/notlmn/copy-as-markdown/"&gt;copy-as-markdown&lt;/a&gt;, and also the above mentioned projects &lt;a href="https://github.com/sindresorhus/refined-github/"&gt;refined-github&lt;/a&gt;, and &lt;a href="https://github.com/sindresorhus/notifier-for-github/"&gt;notifier-for-github&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>extension</category>
      <category>javascript</category>
      <category>github</category>
      <category>template</category>
    </item>
  </channel>
</rss>
