<?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: tsevdos</title>
    <description>The latest articles on DEV Community by tsevdos (@tsevdos).</description>
    <link>https://dev.to/tsevdos</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%2F104541%2Fe63ce8fa-5c57-4598-98c7-db10cdfe2171.jpg</url>
      <title>DEV Community: tsevdos</title>
      <link>https://dev.to/tsevdos</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tsevdos"/>
    <language>en</language>
    <item>
      <title>Publish your npm package using Changesets and GitHub actions</title>
      <dc:creator>tsevdos</dc:creator>
      <pubDate>Tue, 28 Apr 2026 21:00:00 +0000</pubDate>
      <link>https://dev.to/tsevdos/publish-your-npm-package-using-changesets-and-github-actions-1mb0</link>
      <guid>https://dev.to/tsevdos/publish-your-npm-package-using-changesets-and-github-actions-1mb0</guid>
      <description>&lt;p&gt;This article is a follow-up to my previous article, "&lt;a href="https://dev.to/getting-started-with-changesets"&gt;&lt;strong&gt;Getting started with Changesets&lt;/strong&gt;&lt;/a&gt;". If you haven't read it yet, I highly recommend doing so first, as it will give you a better understanding of what &lt;strong&gt;Changesets&lt;/strong&gt; are and how they work. In this article, I'll show you how to publish your npm package using &lt;a href="https://github.com/changesets/changesets" rel="noopener noreferrer"&gt;&lt;strong&gt;Changesets&lt;/strong&gt;&lt;/a&gt; and &lt;a href="https://github.com/features/actions" rel="noopener noreferrer"&gt;&lt;strong&gt;GitHub actions&lt;/strong&gt;&lt;/a&gt; — this way, you don't have to worry about manually running the publish command and can focus on writing code and creating new features instead. Keep in mind that you &lt;strong&gt;must&lt;/strong&gt; have initialized your repository with Changesets, so make sure you have already set it up (more details in the "&lt;a href="https://dev.to/getting-started-with-changesets"&gt;Getting started with Changesets&lt;/a&gt;" article) before proceeding with this one.&lt;/p&gt;

&lt;p&gt;For the record, at the end of 2025, and after many security issues on the &lt;a href="https://www.npmjs.com" rel="noopener noreferrer"&gt;&lt;strong&gt;npm registry&lt;/strong&gt;&lt;/a&gt;, the npm team decided to &lt;a href="https://github.blog/changelog/2025-12-09-npm-classic-tokens-revoked-session-based-auth-and-cli-token-management-now-available/" rel="noopener noreferrer"&gt;&lt;strong&gt;revoke all personal npm tokens&lt;/strong&gt;&lt;/a&gt; to increase security. This, of course, led to many broken pipelines, especially those used for publishing &lt;strong&gt;npm packages&lt;/strong&gt;. This affected my own &lt;a href="https://www.npmjs.com/~tsevdos" rel="noopener noreferrer"&gt;&lt;strong&gt;npm packages&lt;/strong&gt;&lt;/a&gt;, and that's the reason I wrote this guide. In this guide, I'll show you how to automate the publishing of your &lt;strong&gt;npm packages&lt;/strong&gt; using &lt;a href="https://github.com/features/actions" rel="noopener noreferrer"&gt;&lt;strong&gt;GitHub actions&lt;/strong&gt;&lt;/a&gt;! Let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring trusted publishing on GitHub actions
&lt;/h2&gt;

&lt;p&gt;Before starting, please make sure you read and understand the &lt;a href="https://docs.npmjs.com/trusted-publishers" rel="noopener noreferrer"&gt;"Trusted publishing for npm packages"&lt;/a&gt; and the &lt;a href="https://github.blog/changelog/2025-12-09-npm-classic-tokens-revoked-session-based-auth-and-cli-token-management-now-available/" rel="noopener noreferrer"&gt;"Npm classic tokens revoked, session-based auth and CLI token management now available"&lt;/a&gt; documentation from the &lt;strong&gt;NPM&lt;/strong&gt; and &lt;strong&gt;GitHub&lt;/strong&gt; sites. Now, let's start with the configuration:&lt;/p&gt;

&lt;p&gt;The first step is to &lt;a href="https://docs.npmjs.com/trusted-publishers#configuring-trusted-publishing" rel="noopener noreferrer"&gt;&lt;strong&gt;configure trusted publishing&lt;/strong&gt;&lt;/a&gt; on &lt;a href="https://github.com/features/actions" rel="noopener noreferrer"&gt;Github actions&lt;/a&gt; (or GitLab CI/CD Pipelines). Visit your npm package page at the &lt;a href="https://www.npmjs.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;npm registry&lt;/strong&gt;&lt;/a&gt;, and click on the &lt;strong&gt;"Settings" tab&lt;/strong&gt;. Then click on &lt;strong&gt;"Add a trusted publisher"&lt;/strong&gt;, GitHub Actions in our case, and fill in the following fields:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Organization or user (required)&lt;/strong&gt;: Your GitHub username or organization name&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repository (required)&lt;/strong&gt;: Your repository name&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workflow filename (required)&lt;/strong&gt;: The filename of your workflow (e.g., &lt;code&gt;publish.yml&lt;/code&gt;)

&lt;ul&gt;
&lt;li&gt;Enter only the filename, not the full path&lt;/li&gt;
&lt;li&gt;Must include the &lt;code&gt;.yml&lt;/code&gt; or &lt;code&gt;.yaml&lt;/code&gt; extension&lt;/li&gt;
&lt;li&gt;The workflow file must exist in &lt;code&gt;.github/workflows/&lt;/code&gt; in your repository&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment name (optional)&lt;/strong&gt;: If using GitHub environments for deployment protection&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Check out my settings:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn7av3ui8rbw8epkgoduv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn7av3ui8rbw8epkgoduv.png" alt=" " width="800" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create the GitHub workflow
&lt;/h2&gt;

&lt;p&gt;Once you complete the above configuration, you can create a file at &lt;code&gt;.github/workflows/publish.yml&lt;/code&gt; with the following content.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Publish&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;

&lt;span class="na"&gt;concurrency&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.workflow }}-${{ github.ref }}&lt;/span&gt;

&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;contents&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
  &lt;span class="na"&gt;pull-requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
  &lt;span class="na"&gt;id-token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;publish&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Release&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;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Checkout Repo&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@v6&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Setup Node.js &lt;/span&gt;&lt;span class="m"&gt;24&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/setup-node@v6&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;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;24&lt;/span&gt;
          &lt;span class="na"&gt;registry-url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://registry.npmjs.org"&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install Dependencies&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm i&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Create Release Pull Request or Publish to npm&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;changesets&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;changesets/action@v1&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="c1"&gt;# This expects you to have a script called release which does a build for your packages and calls changeset publish&lt;/span&gt;
          &lt;span class="na"&gt;publish&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm run release&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;
          &lt;span class="na"&gt;NPM_TOKEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt; &lt;span class="c1"&gt;# https://github.com/changesets/changesets/issues/1152#issuecomment-3190884868&lt;/span&gt;
          &lt;span class="na"&gt;NPM_CONFIG_PROVENANCE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For some reason, the &lt;strong&gt;Changesets action&lt;/strong&gt; requires the &lt;code&gt;NPM_TOKEN&lt;/code&gt; environment variable to be set, even if it's not used (see the &lt;a href="https://github.com/changesets/changesets/issues/1152#issuecomment-3190884868" rel="noopener noreferrer"&gt;Github issue #1152&lt;/a&gt;)! Feel free to modify the above workflow to fit your needs. If you need any inspiration, have a look at &lt;a href="https://github.com/tsevdos/elUtils/blob/main/.github/workflows/publish.yml" rel="noopener noreferrer"&gt;&lt;strong&gt;my workflow&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now whenever you push to main, &lt;strong&gt;Changesets&lt;/strong&gt; will open a new pull request with the changeset, and once you merge that pull request, the package will be automatically published to npm registry! You can also modify the workflow to publish directly to npm without creating a pull request, but I prefer this approach because it gives us more control over what gets published. You can view an example &lt;a href="https://github.com/tsevdos/elUtils/pull/132" rel="noopener noreferrer"&gt;PR opened from Changesets here&lt;/a&gt;. When you merge the PR, the package will be published to npm registry!&lt;/p&gt;

&lt;h2&gt;
  
  
  Install the Changeset-bot on your Github repository
&lt;/h2&gt;

&lt;p&gt;As a bonus / optional but very convenient step, is to install the &lt;a href="https://github.com/apps/changeset-bot" rel="noopener noreferrer"&gt;&lt;strong&gt;Changeset bot&lt;/strong&gt;&lt;/a&gt; from the &lt;a href="https://github.com/marketplace.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Github marketplace&lt;/strong&gt;&lt;/a&gt;. This bot will automatically prompt any contributor (even yourself) to create changesets without having to run the &lt;code&gt;npx changeset&lt;/code&gt; command locally, letting you do it directly from the GitHub site instead.&lt;/p&gt;

&lt;p&gt;That's all! You can finally focus on writing code and creating new features for your package, and let the workflow take care of the publishing process. I hope you found this guide useful and that it will help you automate the publishing of your npm packages using Changesets and GitHub Actions. If you have any questions or suggestions, feel free to leave a comment below or reach out to me on Twitter &lt;a href="https://twitter.com/tsevdos" rel="noopener noreferrer"&gt;@tsevdos&lt;/a&gt;. Happy coding!&lt;/p&gt;

</description>
      <category>npm</category>
      <category>package</category>
      <category>changesets</category>
      <category>github</category>
    </item>
    <item>
      <title>Getting started with Changesets</title>
      <dc:creator>tsevdos</dc:creator>
      <pubDate>Mon, 06 Apr 2026 21:00:00 +0000</pubDate>
      <link>https://dev.to/tsevdos/getting-started-with-changesets-9i4</link>
      <guid>https://dev.to/tsevdos/getting-started-with-changesets-9i4</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/changesets/changesets" rel="noopener noreferrer"&gt;&lt;strong&gt;Changesets&lt;/strong&gt;&lt;/a&gt; is the best way to manage, version, and publish your packages. It works great both on standard repositories and monorepos, it integrates easily with your workflows (more on that in a future post), and most importantly, it makes sense! Below is a quick tutorial on how to set up &lt;a href="https://github.com/changesets/changesets" rel="noopener noreferrer"&gt;&lt;strong&gt;Changesets&lt;/strong&gt;&lt;/a&gt; and how it works. I'm also planning to write a follow up post on how to automate the publishing process using &lt;a href="https://docs.github.com/en/actions" rel="noopener noreferrer"&gt;&lt;strong&gt;GitHub actions&lt;/strong&gt;&lt;/a&gt;, so stay tuned for that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;First things first, you must definitely have a look at the official &lt;a href="https://github.com/changesets/changesets/blob/main/docs/intro-to-using-changesets.md" rel="noopener noreferrer"&gt;changesets documentation&lt;/a&gt;. Below, I'll show you how to install and use the basics of &lt;strong&gt;Changesets&lt;/strong&gt;. First of all, we need to set up and initialize &lt;strong&gt;Changesets&lt;/strong&gt; in our project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @changesets/cli init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will create a &lt;code&gt;.changeset&lt;/code&gt; directory in the root of your project, with the following two files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;README.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;config.json&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In most cases the defaults are fine, but my &lt;code&gt;config.json&lt;/code&gt; file has the following configuration (I'm using &lt;strong&gt;GitHub's changelog generator&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/@changesets/changelog-github" rel="noopener noreferrer"&gt;@changesets/changelog-github&lt;/a&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"$schema"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://unpkg.com/@changesets/config@3.0.0/schema.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"changelog"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"@changesets/changelog-github"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"repo"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"tsevdos/elUtils"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"commit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fixed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"linked"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"access"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"public"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"baseBranch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"main"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"updateInternalDependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"patch"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"ignore"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating a Changeset
&lt;/h2&gt;

&lt;p&gt;The next step is to actually create a changeset. Again, have a look at the &lt;a href="https://github.com/changesets/changesets/blob/main/packages/cli/README.md" rel="noopener noreferrer"&gt;&lt;strong&gt;Changesets official CLI&lt;/strong&gt;&lt;/a&gt;. The core idea of Changesets is that you can create a "changeset file" at any point that describes your changes, such as the addition of a new feature, a bug fix, etc. After &lt;strong&gt;committing&lt;/strong&gt; the changeset, Changesets will handle the &lt;strong&gt;versioning&lt;/strong&gt; and the &lt;strong&gt;changelog&lt;/strong&gt; of your project. Keep in mind that you can create multiple changesets before committing (they stack on top of each other), and you can also create changesets for multiple packages if you are working on a monorepo. Here is how you can create a changeset:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx changeset
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll be prompted to describe your changes using the &lt;a href="https://semver.org" rel="noopener noreferrer"&gt;semantic versioning specification (semver)&lt;/a&gt; and a description of your change. The output looks like something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;🦋  What kind of change is this &lt;span class="k"&gt;for &lt;/span&gt;repo?
❯ major &lt;span class="o"&gt;(&lt;/span&gt;breaking change&lt;span class="o"&gt;)&lt;/span&gt;
  minor &lt;span class="o"&gt;(&lt;/span&gt;new feature&lt;span class="o"&gt;)&lt;/span&gt;
  patch &lt;span class="o"&gt;(&lt;/span&gt;bug fix&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a random file in the &lt;code&gt;.changeset&lt;/code&gt; directory (ex. &lt;code&gt;.changeset/brave-garlics-pump.md&lt;/code&gt;) with the description and the semver type you chose.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;@tsevdos/el-utils"&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="s"&gt;minor&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;

new feature added
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Versioning and publishing
&lt;/h2&gt;

&lt;p&gt;When you're ready to release a new version of your package and apply the changeset(s) you've created, simply run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @changesets/cli version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above command will take care two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Update the version of the &lt;code&gt;package.json&lt;/code&gt; file (ex. &lt;code&gt;"version": "1.12.3"&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Update the &lt;code&gt;CHANGELOG.md&lt;/code&gt; file to reflect your changes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After that, you can &lt;strong&gt;commit&lt;/strong&gt; and &lt;strong&gt;push&lt;/strong&gt; the changes to your repository and finally &lt;strong&gt;publish the package to the npm registry&lt;/strong&gt; using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @changesets/cli publish
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Personally, I prefer to have all these commands available in the &lt;code&gt;scripts&lt;/code&gt; section of the &lt;code&gt;package.json&lt;/code&gt; file for easier access:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"changeset"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx changeset"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx @changesets/cli version"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"publish"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx @changesets/cli publish"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that’s it for the basics of &lt;a href="https://github.com/changesets/changesets" rel="noopener noreferrer"&gt;&lt;strong&gt;Changesets&lt;/strong&gt;&lt;/a&gt;! You should now have a solid foundation for managing versioning and releases in your projects. In the next post, we’ll take things a step further and automate the entire process using &lt;a href="https://docs.github.com/en/actions" rel="noopener noreferrer"&gt;&lt;strong&gt;GitHub actions&lt;/strong&gt;&lt;/a&gt;, so stay tuned.&lt;/p&gt;

</description>
      <category>npm</category>
      <category>package</category>
      <category>changesets</category>
    </item>
  </channel>
</rss>
