<?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: Riina Korpela</title>
    <description>The latest articles on Forem by Riina Korpela (@riimako).</description>
    <link>https://forem.com/riimako</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%2F614240%2F38004c7f-9a15-48e1-a4bb-5dd56487c974.jpg</url>
      <title>Forem: Riina Korpela</title>
      <link>https://forem.com/riimako</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/riimako"/>
    <language>en</language>
    <item>
      <title>Different approaches to testing your own packages locally: npm yalc</title>
      <dc:creator>Riina Korpela</dc:creator>
      <pubDate>Thu, 12 Jan 2023 08:47:37 +0000</pubDate>
      <link>https://forem.com/one-beyond/different-approaches-to-testing-your-own-packages-locally-npm-yalc-3l97</link>
      <guid>https://forem.com/one-beyond/different-approaches-to-testing-your-own-packages-locally-npm-yalc-3l97</guid>
      <description>&lt;p&gt;This is part of a series of articles:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/one-beyond/different-approaches-to-testing-your-own-packages-1kdg"&gt;Linking local files&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/one-beyond/different-approaches-to-testing-your-own-packages-locally-npm-link-4hoj"&gt;npm link&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;npm yalc&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/one-beyond/different-approaches-to-testing-your-own-packages-locally-verdaccio-5hd8"&gt;Verdaccio&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/one-beyond/different-approaches-to-testing-your-own-packages-locally-relative-deps-2c17"&gt;Relative deps&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this article we'll be looking at &lt;em&gt;npm yalc&lt;/em&gt;, and how it can be used to test your packages with examples based on the next structure.&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%2Fycumd9jq2vzi12dkotru.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%2Fycumd9jq2vzi12dkotru.png" alt="Project structure" width="332" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, we will talk about why to choose yalc instead of npm link.&lt;/p&gt;

&lt;h2&gt;
  
  
  npm yalc
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/yalc" rel="noopener noreferrer"&gt;Yalc&lt;/a&gt; acts as simple local repository to share your local developed packages in your local environment. When you publish a package with yalc, the files that should be published to NPM are stored in a special global store.&lt;/p&gt;

&lt;p&gt;Then if you add the package in another project, this project will pull the package content from this special global store, and injects a file:/link: dependency into package.json, and creates a local &lt;em&gt;yalc.lock&lt;/em&gt; file to ensure consistency in the internal routines.&lt;/p&gt;

&lt;p&gt;The usage of yalc is quite simple following next steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You need to install yalc globally on your machine:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  npm i yalc -g
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You need to publish your fancy dependency library:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  cd my-fancy-library 
  yalc publish
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This will copy all the files that should be published                   in a remote NPM registry. This means if your package has some lifecycle scripts, they will run with the publish.&lt;br&gt;&lt;br&gt;
  To avoid the scripts, run:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  cd my-fancy-library 
  yalc publish --no-scripts
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To add this new locally published package to your awesome project:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  cd my-awesome-project 
  yalc add @ks/my-fancy-library  
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To update the dependency library, you can do it with an update:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  yalc update @ks/my-fancy-library 
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;But if you have the same dependency on several dependent packages, you can push the changes to all of them in one command:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  yalc publish --push  
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To finally remove the dependency from yalc in the dependent project:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  yalc remove @ks/my-fancy-library 
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;or you can use &lt;em&gt;--all&lt;/em&gt; flag to remove all the yalc packages from the project.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can unpublish the library published on the second step with:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  yalc installations clean @ks/my-fancy-library 
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Use yalc instead of npm link
&lt;/h2&gt;

&lt;p&gt;You might be wondering, why I use yalc instead of the npm link if they are very similar. I will give you some context about my projects first.&lt;br&gt;&lt;br&gt;
In my actual project, we have several UI-component libraries depending on others, working a little bit as a micro-frontend would work, but with more pyramidal hierarchy. They are typescript projects with storybook, babel, jest for testing... All of them are shared between several teams, with different node versions.&lt;/p&gt;

&lt;p&gt;When the npm link is used, the project’s specific version of node will be used to create the link, and only the projects using the same version will be able to access the local version. Npm link doesn’t throw any errors when this happens.&lt;br&gt;&lt;br&gt;
Some of our projects have references to peerDependencies, and it’s very easy to stumble into issues with symlinks, as the projects' peerDependencies are not always resolved when needed.&lt;br&gt;&lt;br&gt;
Also, there are some documented errors like &lt;a href="https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react" rel="noopener noreferrer"&gt;duplicated react&lt;/a&gt; when using npm link.  &lt;/p&gt;

&lt;p&gt;All of these issues are relatively easy to fix, but after running into them several times, we started to use yalc, and since then, there have not been any similar issues. &lt;/p&gt;

&lt;p&gt;I hope you find this useful, please leave a comment in case of any question or feedback.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>python</category>
      <category>php</category>
    </item>
    <item>
      <title>My experience with ADHD and remote work</title>
      <dc:creator>Riina Korpela</dc:creator>
      <pubDate>Mon, 22 Nov 2021 11:32:33 +0000</pubDate>
      <link>https://forem.com/one-beyond/my-experience-with-adhd-and-remote-work-26ck</link>
      <guid>https://forem.com/one-beyond/my-experience-with-adhd-and-remote-work-26ck</guid>
      <description>&lt;p&gt;I got my very first remote job in the middle of the global pandemic. I finished my maternity leave after having my baby, and I had to start working with a five-month-old baby, with all the nurseries in Spain closed. Furthermore, I had a great opportunity to grow as a developer, and I had to take advantage of it, but the first days working from home and taking care of my "intensita" were a scary experience.&lt;/p&gt;

&lt;p&gt;I have always thought that I am not disciplined enough to keep focus by myself, maybe I have always had a little bit of impostor syndrome. I know I am not lazy, but I have always struggled to keep focus. Once I started to get used to remote working, I started to compare myself with my teammates and I always had the feeling that I wasn’t able to do the same things. My teammates were able to be in a meeting for hours, or finish the work very fast, and some minor tasks could take me hours to finish.&lt;/p&gt;

&lt;p&gt;Something was wrong. I love my work, and usually I don’t have this kind of problem. I started to be more demotivated with my work, and my personal life wasn’t going great either. I decided to look for some professional help, and that is how I got diagnosed with ADHD.&lt;/p&gt;

&lt;p&gt;Having a baby limited my own and professional time, making every second more important, so I had to make more decisions than ever. These decisions and the stress with the pandemic were too much for me to handle, and even though I have always had ADHD, my symptoms got much worse.&lt;br&gt;
But that diagnosis made me very happy indeed. Finally, I had a name for a lot of the things that were going on in my brain but nobody understood.&lt;/p&gt;

&lt;p&gt;The only hobby that I have always loved is software development. I think it is because every programmer knows that we do things, we learn by executing new tasks, and we never stop learning and being active. We don’t get bored! &lt;br&gt;
But even with my passion for new technologies, I needed some time to organize myself and my brain to be able to work well by myself, so I want to share some of my tricks to make my days better and more focused.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do not mask!
&lt;/h3&gt;

&lt;p&gt;My first advice is "do not mask". If you have to mask while you are in your own home, you won't ever be comfortable and secure working in your environment. &lt;strong&gt;If you hide it doesn’t go away.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;People with neurodiversity try to present themselves as neurotypical people and follow the rules of the neurotypical world. For example, we buy a cool ergonomic chair or standing desk like we see our teammates do, but that doesn’t always work for us. We have to accept that our brain doesn't work the same way as most people's brains, and it’s going to be there forever, and we have to listen to our body.&lt;/p&gt;

&lt;p&gt;Many times, I have found myself working on the floor, just sitting with my laptop on my knees, or in not ergonomic postures in my expensive ergonomic chair. So now I bought a small coffee table to place my laptop and I do my meetings sitting on the floor. At my work desk, I don’t have anything but my headphones and my iPad. I use my iPad in the meeting to take notes to avoid interruptions (ADHD people can have the urgency to interrupt to not forget what we are thinking), and music is my favorite tool to program to. Music helps me to get in the flow of code and a good mood, so it allows me to concentrate more on my work.&lt;/p&gt;

&lt;p&gt;I have tried to use a Pomodoro timer, and I have tried many focus applications, but they don’t work for me, but every person is different, so it may work for you. Usually, I reserve some time in "Do not disturb" mode, especially after the daily/weekly meetings. I installed a Quitter app that allows me to set up rules to close my apps when they've been inactive for a while. What worked for me too to avoid the anxiety of having the apps open was to delete the open tick for the apps in the mac’s dock.&lt;/p&gt;

&lt;h3&gt;
  
  
  Focus on now.
&lt;/h3&gt;

&lt;p&gt;To me, it’s important to organize the day with priorities and focus first on the things I can do now. I prefer to send that pending email to my boss before starting to code or clean all the old tickets on the Github board before picking my next task. &lt;/p&gt;

&lt;p&gt;I have realized that my procrastination is very productive, but not for work. Maybe I am cleaning my desk, forgetting about that very important meeting. That is why the shared notifications between my mac, my iPad, and my mobile are the key to being able to remember all the meetings and all the pending tasks.&lt;/p&gt;

&lt;p&gt;My first hour before my daily meetings, I spend with easy, minor tasks, so the rest of the day I can focus on my actual coding tasks. That allows me to reduce the anxiety and closing tasks is always a good start for a new day!&lt;/p&gt;

&lt;h3&gt;
  
  
  It’s okay to ask for help
&lt;/h3&gt;

&lt;p&gt;I work with an awesome team. They love coding, learning new things and most of them participate actively in open source projects, or they have several side projects. Some of them write on blogs or are content creators on platforms like Youtube or Twitch.&lt;/p&gt;

&lt;p&gt;I am not that kind of person, I have never been. I love my work, but it’s only work, and since my baby is here, I don’t spend time outside of my 8 daily hours of work to code or read articles about the new features of the technologies we work on.&lt;/p&gt;

&lt;p&gt;That is why I have learned that it is okay to ask for help, being surrounded by such awesome coders and not learning from them is such a waste of time! Asking them even “silly questions” makes me a better developer, and that is to me the definition of success.&lt;/p&gt;

&lt;p&gt;In my team, we have several ways of communication to allow us to have fluid conversations. Sometimes it is hard to maintain relationships, especially when we all are remote workers, so we try to connect. We have a lot of pair-programming sessions, we spend time debating the best solutions, and that makes us a better team, and makes our code much better quality. And the most important thing to remember is that you work in a team, everybody makes mistakes and we must learn to accept criticism.&lt;/p&gt;

</description>
      <category>adhd</category>
      <category>mentalhealth</category>
      <category>webdev</category>
      <category>remote</category>
    </item>
  </channel>
</rss>
