<?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: Agustín</title>
    <description>The latest articles on Forem by Agustín (@agustinl).</description>
    <link>https://forem.com/agustinl</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%2F167506%2Fd319e234-3e0c-47cf-931e-799575409087.jpg</url>
      <title>Forem: Agustín</title>
      <link>https://forem.com/agustinl</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/agustinl"/>
    <language>en</language>
    <item>
      <title>Create your perfect space to focus on your daily tasks</title>
      <dc:creator>Agustín</dc:creator>
      <pubDate>Sun, 09 Nov 2025 20:50:59 +0000</pubDate>
      <link>https://forem.com/agustinl/create-your-perfect-space-to-focus-on-your-daily-tasks-16an</link>
      <guid>https://forem.com/agustinl/create-your-perfect-space-to-focus-on-your-daily-tasks-16an</guid>
      <description>&lt;p&gt;I built &lt;strong&gt;&lt;a href="https://www.daily.place/" rel="noopener noreferrer"&gt;daily.place&lt;/a&gt;&lt;/strong&gt; – a small browser app to focus, plan, and breathe 🌿&lt;/p&gt;

&lt;p&gt;Hey everyone 👋&lt;br&gt;
I’m Agustín, a developer from Argentina. I created a side project called &lt;a href="https://www.daily.place/" rel="noopener noreferrer"&gt;daily.place&lt;/a&gt;&lt;br&gt;
 — a simple, browser-based workspace where you can focus, organize your day, and maybe relax a bit too.&lt;/p&gt;

&lt;p&gt;It’s free, works right in your browser, and doesn’t ask you to sign up or create an account.&lt;/p&gt;

&lt;p&gt;🧠 The idea&lt;/p&gt;

&lt;p&gt;I was constantly opening 3 or 4 different tabs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one for a Pomodoro timer,&lt;/li&gt;
&lt;li&gt;another for to-do lists,&lt;/li&gt;
&lt;li&gt;another for background sounds,&lt;/li&gt;
&lt;li&gt;and somehow I’d still end up checking Twitter 🙃&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I thought — what if I could put all those small things in one clean page? Nothing fancy, just a quiet place to focus. That’s how &lt;a href="https://www.daily.place/" rel="noopener noreferrer"&gt;daily.place &lt;/a&gt; started.&lt;/p&gt;

&lt;p&gt;⚙️ What it does&lt;/p&gt;

&lt;p&gt;Here’s what’s inside:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🕐 Pomodoro timer with short &amp;amp; long breaks (customizable).&lt;/li&gt;
&lt;li&gt;✅ To-do list — super simple, all stored locally.&lt;/li&gt;
&lt;li&gt;🎧 Ambient sound mixer — you can blend rain, café, waves, white noise, etc.&lt;/li&gt;
&lt;li&gt;⌨️ Keyboard shortcuts for quick actions.&lt;/li&gt;
&lt;li&gt;🌙 Dark mode for night sessions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything is saved locally in your browser — no servers, no accounts, no tracking. You just open it and start.&lt;/p&gt;

&lt;p&gt;💡 Why I built it&lt;/p&gt;

&lt;p&gt;Honestly, I built it for myself first. I wanted a place that felt calm, like sitting down with a coffee and saying “okay, let’s do this.”&lt;/p&gt;

&lt;p&gt;I didn’t want another app full of analytics, logins, and subscriptions. I just wanted something that loads fast and stays out of my way.&lt;/p&gt;

&lt;p&gt;Now it’s become my go-to tab whenever I start working.&lt;/p&gt;

&lt;p&gt;🚀 Try it out&lt;/p&gt;

&lt;p&gt;Go to &lt;a href="https://www.daily.place/" rel="noopener noreferrer"&gt;daily.place&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pick a “place name” (like Work, Study, FocusZone — whatever you want).&lt;br&gt;
That name saves your layout and settings locally.&lt;/p&gt;

&lt;p&gt;Then just… start working. Add tasks, set the timer, mix a few sounds.&lt;/p&gt;

&lt;p&gt;🧭 What’s next&lt;/p&gt;

&lt;p&gt;I’m planning to add:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;cloud sync so you can use it on multiple devices,&lt;/li&gt;
&lt;li&gt;more ambient sounds,&lt;/li&gt;
&lt;li&gt;maybe some small customization for themes and layouts.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But I’m keeping it simple — that’s kind of the point.&lt;/p&gt;

&lt;p&gt;💬 Final thoughts&lt;/p&gt;

&lt;p&gt;I know it’s not the next Notion or anything like that — and that’s okay. I just wanted a small place that helps me stay focused without noise.&lt;/p&gt;

&lt;p&gt;If that sounds useful to you too, I’d love you to try it: &lt;a href="https://www.daily.place/" rel="noopener noreferrer"&gt;daily.place&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And if you have feedback or find bugs, you can reach me from the site — I’d love to hear from you.&lt;/p&gt;

&lt;p&gt;Thanks for reading ❤️&lt;br&gt;
— Agustín&lt;/p&gt;

</description>
      <category>tooling</category>
      <category>webdev</category>
      <category>sideprojects</category>
    </item>
    <item>
      <title>Create your perfect space to focus on your daily tasks</title>
      <dc:creator>Agustín</dc:creator>
      <pubDate>Wed, 01 Mar 2023 00:37:39 +0000</pubDate>
      <link>https://forem.com/agustinl/create-your-perfect-space-to-focus-on-your-daily-tasks-3oi3</link>
      <guid>https://forem.com/agustinl/create-your-perfect-space-to-focus-on-your-daily-tasks-3oi3</guid>
      <description>&lt;p&gt;Hi everyone!, I want to share my lastest project: &lt;a href="http://daily.place/"&gt;daily.place&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The objective of &lt;a href="http://daily.place/"&gt;daily.place&lt;/a&gt; is to have within reach of a single page the necessary tools to be able to have a space for concentration. Thats include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Music list with different ambient modes (rain, forest, lo-fi, coffee shop, etc.)&lt;/li&gt;
&lt;li&gt;Pomodoro timer with short and long pause, fully configurable.&lt;/li&gt;
&lt;li&gt;To-do list with progress ring.&lt;/li&gt;
&lt;li&gt;☀️ Light and 🌑 dark mode.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything is saved and available in your browser under a name of your choosing.&lt;/p&gt;

&lt;p&gt;Some updates in the last changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔃 Support to re-order tasks.&lt;/li&gt;
&lt;li&gt;Added button to restart daily pomodoro's.&lt;/li&gt;
&lt;li&gt;Vaporwave/Lofi/Synthwave sound added.&lt;/li&gt;
&lt;li&gt;▶️⏸️ Play/pause controls added.&lt;/li&gt;
&lt;li&gt;Transform .gif to .webm to reduce size and load times.&lt;/li&gt;
&lt;li&gt;Add move done tasks down icon in To-Do.&lt;/li&gt;
&lt;li&gt;Add scroll support in To-Do to prevent a long list of tasks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Any feedback is welcome! enjoy it!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.daily.place/"&gt;https://www.daily.place/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>productivity</category>
      <category>nextjs</category>
      <category>react</category>
    </item>
    <item>
      <title>Get information and preview of your site meta tags</title>
      <dc:creator>Agustín</dc:creator>
      <pubDate>Tue, 21 Sep 2021 21:48:10 +0000</pubDate>
      <link>https://forem.com/agustinl/get-information-and-preview-of-your-site-meta-tags-3n9i</link>
      <guid>https://forem.com/agustinl/get-information-and-preview-of-your-site-meta-tags-3n9i</guid>
      <description>&lt;p&gt;Hello everyone, 👋&lt;/p&gt;

&lt;p&gt;I am the creator of &lt;a href="https://www.metazord.io/" rel="noopener noreferrer"&gt;metazord.io&lt;/a&gt;, a web app to get information about the meta tags from your site and also a live preview of social networks when you shared your site link.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Foktnf502alrxbj1yngqi.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Foktnf502alrxbj1yngqi.jpg" alt="Metazord.io preview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I built metazord.io? 💡
&lt;/h2&gt;

&lt;p&gt;I wanted to get a site where I could simply paste a URL and get a complete information of my site meta's to check if I missed some thing or how the site will goes look when someone share it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;metazord&lt;/strong&gt; has a Meta List with a clear description of the most common metas and what your site has or missed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fr8xsi0vcecs1zfisw0ru.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fr8xsi0vcecs1zfisw0ru.jpg" alt="Metazord.io preview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Dark Mode
&lt;/h2&gt;

&lt;p&gt;I added a Dark Mode 🌘 because most common social networks on this days has a Dark mode integrated both on web and mobile.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fo2pw68mhafapuh5ahhnm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fo2pw68mhafapuh5ahhnm.jpg" alt="Metazord.io preview"&gt;&lt;/a&gt;&lt;a href="https://media.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%2Fr6nfxvrlabnsandkorbe.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fr6nfxvrlabnsandkorbe.jpg" alt="Metazord.io preview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How do it work? 🛠
&lt;/h2&gt;

&lt;p&gt;Pase your site link + ENTER ✨&lt;/p&gt;

&lt;h3&gt;
  
  
  Live Preview:
&lt;/h3&gt;

&lt;p&gt;✔ Google Search Result&lt;br&gt;
✔ Facebook Card&lt;br&gt;
✔ Twitter Card&lt;br&gt;
✔ LinkedIn Card&lt;br&gt;
✔ Slack Card&lt;br&gt;
🔜 WhatsApp Card&lt;br&gt;
🔜 Teams Card&lt;br&gt;
🔜 Other Search Engines&lt;/p&gt;

&lt;p&gt;I would love to hear your opinions about this product!&lt;/p&gt;

&lt;p&gt;Hope you all have a great week!&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>webdev</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Deploy Sapper PWA on GitHub Pages</title>
      <dc:creator>Agustín</dc:creator>
      <pubDate>Sat, 06 Jun 2020 00:23:19 +0000</pubDate>
      <link>https://forem.com/agustinl/deploy-sapper-pwa-on-github-pages-2ih1</link>
      <guid>https://forem.com/agustinl/deploy-sapper-pwa-on-github-pages-2ih1</guid>
      <description>&lt;p&gt;This a little tutorial to create a &lt;strong&gt;PWA App with Sapper&lt;/strong&gt;, and deploy with &lt;strong&gt;GitHub Pages&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;First, &lt;a href="https://web.dev/what-are-pwas/" rel="noopener noreferrer"&gt;what is a PWA App?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To understand what this mean, I created a simple web app to divide the count of a dinner (for eg.) between friends or family. Is in Spanish but is easy to understand.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://agustinl.github.io/la-cuenta/?ref=devto" rel="noopener noreferrer"&gt;La Cuenta&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This &lt;strong&gt;PWA&lt;/strong&gt; is available to "install" in you mobile OS to acces directly like anyone other app installed with Play Store (for Android eg.)&lt;/p&gt;

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

&lt;p&gt;Before continuing with this tutorial, can your app be deployed with &lt;strong&gt;GitHub pages&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;GitHub pages only accepts static content, so your Sapper application must be exported to static files before being deployed, so read the &lt;a href="https://sapper.svelte.dev/docs/#Exporting" rel="noopener noreferrer"&gt;Sapper exporting documentation&lt;/a&gt; to find out if your app can be exported and hosted on &lt;strong&gt;GitHub Pages&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So, after this, we can start!&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1
&lt;/h2&gt;

&lt;p&gt;First of all, basic, install &lt;a href="https://sapper.svelte.dev/" rel="noopener noreferrer"&gt;Sapper&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After this, you can start to create the logic and UI for you proyect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2
&lt;/h2&gt;

&lt;p&gt;Assuming your project is ready and functional, or at least ready to be tested live, you have to create a new &lt;strong&gt;GitHub Repo&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3
&lt;/h2&gt;

&lt;p&gt;Instal via &lt;strong&gt;npm&lt;/strong&gt; or your favorite package manager &lt;strong&gt;gh-pages&lt;/strong&gt; package.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm i gh-pages&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After installed, create a folder named &lt;strong&gt;script&lt;/strong&gt; in your app root structure.&lt;/p&gt;

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

&lt;p&gt;And then, into this folder, create a .js file, I named it &lt;strong&gt;gh-pages&lt;/strong&gt;.&lt;br&gt;
Into this js file, copy the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ghpages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;gh-pages&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;ghpages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;publish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;__sapper__/export/&amp;lt;your-app-name&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;branch&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;master&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://github.com/&amp;lt;your-github-username&amp;gt;/&amp;lt;your-repo-name&amp;gt;.git&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;your-github-username&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;your-github-email&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Deploy Complete!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that in the &lt;code&gt;branch&lt;/code&gt; option the &lt;code&gt;master&lt;/code&gt; branch is placed.&lt;br&gt;
Read on to find out why :D&lt;/p&gt;
&lt;h1&gt;
  
  
  Step 4
&lt;/h1&gt;

&lt;p&gt;Go to your Sapper &lt;code&gt;server.js&lt;/code&gt; file.&lt;br&gt;
Add the following lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;sirv&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sirv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;polka&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;polka&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;compression&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;compression&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;sapper&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@sapper/server&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;NODE_ENV&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;development&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;your-app-name&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// &amp;lt;&amp;lt;-&lt;/span&gt;

&lt;span class="nf"&gt;polka&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// &amp;lt;&amp;lt;-&lt;/span&gt;
        &lt;span class="nf"&gt;compression&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;threshold&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
        &lt;span class="nf"&gt;sirv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;static&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
        &lt;span class="nx"&gt;sapper&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;middleware&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means that while we develop and test our app on localhost, the app uses the root directory.&lt;br&gt;
But when it's deployed, use &lt;strong&gt;/ &lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Step 5
&lt;/h1&gt;

&lt;p&gt;Now we are going to edit the &lt;strong&gt;package.json&lt;/strong&gt; file adding the following scripts:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"deploy": "npm run export &amp;amp;&amp;amp; node ./scripts/gh-pages.js"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And replace &lt;code&gt;export&lt;/code&gt; script with the following:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"export": "sapper export --basepath &amp;lt;your-app-name&amp;gt; --legacy"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzje5fjriw4bhw5k130vj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzje5fjriw4bhw5k130vj.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  The reason of everything:
&lt;/h3&gt;

&lt;p&gt;This will make when we run &lt;code&gt;npm run deploy&lt;/code&gt;, Sapper will run &lt;code&gt;npm run export&lt;/code&gt; to export our application under a folder with our app name, and then run the &lt;code&gt;gh-pages.js&lt;/code&gt; file that will deploy this folder in the &lt;code&gt;master&lt;/code&gt; branch of our GitHub Repo.&lt;/p&gt;
&lt;h1&gt;
  
  
  Step 6
&lt;/h1&gt;

&lt;p&gt;Create branch into your proyect with the command &lt;code&gt;git branch &amp;lt;your-branch-name&amp;gt;&lt;/code&gt;.&lt;br&gt;
And &lt;code&gt;git checkout &amp;lt;your-branch-name&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now you can commit and push your changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .
git commit -m "a commit message"
git push -u origin &amp;lt;your-branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you have a branch &lt;code&gt;&amp;lt;your-branch-name&amp;gt;&lt;/code&gt; with the Sapper proyect and the &lt;code&gt;master&lt;/code&gt; branch is for deploy the exported proyect and link with your GitHub Page (in the next step).&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 7
&lt;/h1&gt;

&lt;p&gt;Run the script &lt;code&gt;npm run deploy&lt;/code&gt; and wait to Sapper export your proyect.&lt;br&gt;
When everything is finished you will see the message configured in &lt;strong&gt;gh-pages.js&lt;/strong&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Deploy Complete!
&lt;/h5&gt;

&lt;h1&gt;
  
  
  Step 8
&lt;/h1&gt;

&lt;p&gt;Go to GitHub Repo, and click in Settings. Scroll to &lt;strong&gt;GitHub Pages&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;And select &lt;code&gt;master branch&lt;/code&gt;, the first option.&lt;/p&gt;

&lt;p&gt;After a few minutes, you can access to you PWA App in &lt;strong&gt;&lt;a href="https://your-username.github.io/your-app-name/" rel="noopener noreferrer"&gt;https://your-username.github.io/your-app-name/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can audit your page with LightHouse to check that everything is in order:&lt;/p&gt;

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

&lt;p&gt;Don't forget to have your &lt;code&gt;manifest.json&lt;/code&gt; file &lt;a href="https://web.dev/add-manifest/" rel="noopener noreferrer"&gt;updated&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;You can check &lt;a href="https://github.com/agustinl/la-cuenta" rel="noopener noreferrer"&gt;my app repository&lt;/a&gt; if it helps&lt;/p&gt;

&lt;p&gt;I hope everything is understood, if you can't comment below 😀&lt;/p&gt;

&lt;p&gt;Greetings!&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>svelte</category>
      <category>sapper</category>
      <category>github</category>
    </item>
    <item>
      <title>Creating a package for Svelte</title>
      <dc:creator>Agustín</dc:creator>
      <pubDate>Fri, 10 Jan 2020 20:07:29 +0000</pubDate>
      <link>https://forem.com/agustinl/creating-a-package-for-svelte-262n</link>
      <guid>https://forem.com/agustinl/creating-a-package-for-svelte-262n</guid>
      <description>&lt;h1&gt;
  
  
  Intro
&lt;/h1&gt;

&lt;p&gt;The idea of the following post is to make a quick, practical and simple version of how to create a package that can be downloaded via &lt;a href="https://www.npmjs.com/" rel="noopener noreferrer"&gt;npm&lt;/a&gt; in our project made with &lt;a href="https://svelte.dev/" rel="noopener noreferrer"&gt;Svelte&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I recently finished &lt;a href="https://www.npmjs.com/package/svelte-tags-input" rel="noopener noreferrer"&gt;my first package&lt;/a&gt; and the truth is that, although the information on the web is quite complete, the idea is to transmit my process in a short and simple way, and I didn't find too many posts explaining how to leave the package working for Svelte.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. 🛠️ Pre requisites
&lt;/h2&gt;

&lt;p&gt;First of all, the following is required:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Have an account on &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Account at &lt;a href="https://www.npmjs.com/" rel="noopener noreferrer"&gt;npm&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Have &lt;a href="https://nodejs.org/es/download/" rel="noopener noreferrer"&gt;Node&lt;/a&gt;, &lt;a href="https://www.npmjs.com/get-npm" rel="noopener noreferrer"&gt;npm&lt;/a&gt; and &lt;a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git" rel="noopener noreferrer"&gt;GIT&lt;/a&gt; installed on your computer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's it, we can go on.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. 💡 The idea
&lt;/h2&gt;

&lt;p&gt;Before you start anything, it's good to have an idea of what you want to do, so that you don't waste time and steps doing and undoing the package. No matter how basic it is, think of something that you can use first, both to use and to practice, and that you would like to upload.&lt;/p&gt;

&lt;p&gt;And don't think if it's already done or not, most things are probably already done, just look for the spin on it to have an added value for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. 🏁 Start the package
&lt;/h2&gt;

&lt;p&gt;You can now create a folder on your pc, with the name of the package (or the one you like), and open your preferred editor.&lt;/p&gt;

&lt;p&gt;In my case I used Visual Studio Code, which already has a built-in terminal, in case you use another one, you should open the Node console and go to the directory you just created.&lt;/p&gt;

&lt;p&gt;Now they must run &lt;code&gt;npm init -y&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;This will create a package.json file to place information about the package, such as &lt;strong&gt;name&lt;/strong&gt;, &lt;strong&gt;author&lt;/strong&gt;, &lt;strong&gt;description&lt;/strong&gt;, the &lt;strong&gt;dependencies&lt;/strong&gt; it uses, the &lt;strong&gt;version&lt;/strong&gt; etc.&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="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;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&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;"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;"1.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&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;"main"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"index.js"&lt;/span&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;"test"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"echo "&lt;/span&gt;&lt;span class="err"&gt;Error:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;no&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;test&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;specified&lt;/span&gt;&lt;span class="s2"&gt;" &amp;amp;&amp;amp; exit 1"&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;"keywords"&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;"author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&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;"license"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ISC"&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;You can fill in the fields like &lt;strong&gt;name&lt;/strong&gt;, &lt;strong&gt;description&lt;/strong&gt;, &lt;strong&gt;keywords&lt;/strong&gt;, &lt;strong&gt;author&lt;/strong&gt; and &lt;a href="https://help.github.com/en/enterprise/2.18/user/github/creating-cloning-and-archiving-repositories/licensing-a-repository" rel="noopener noreferrer"&gt;&lt;strong&gt;license&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we can install the dependencies that will use our package. Note that this is a basic code, this means that we will install basic dependencies.&lt;/p&gt;

&lt;p&gt;Execute in your terminal the following command&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install -D rollup rollup-plugin-node-resolve rollup-plugin-svelte svelte&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will install the basic dependencies like &lt;strong&gt;devDependencies&lt;/strong&gt; (&lt;em&gt;-D&lt;/em&gt;), so they will only be used for development.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;package.json&lt;/strong&gt; will add the following field:&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="w"&gt;    &lt;/span&gt;&lt;span class="nl"&gt;"devDependencies"&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;"rollup"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^1.28.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"rollup-plugin-node-resolve"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^5.2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"rollup-plugin-svelte"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^5.1.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"svelte"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^3.16.7"&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;
  
  
  4. 📦 The package
&lt;/h2&gt;

&lt;p&gt;Now we are going to create a folder &lt;strong&gt;src&lt;/strong&gt; in the root of the directory, and inside a file &lt;strong&gt;index.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inside this file we will put the following code:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Name&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./Name.svelte&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Where &lt;strong&gt;Name&lt;/strong&gt; should be the name you want to give the component.&lt;/p&gt;

&lt;p&gt;And then, we will also create inside the folder &lt;strong&gt;src&lt;/strong&gt;, a file &lt;strong&gt;Name.svelte&lt;/strong&gt; where &lt;strong&gt;Name&lt;/strong&gt; should be &lt;strong&gt;the same&lt;/strong&gt; that they put in the file &lt;strong&gt;index.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once inside the .svelte file, it's up to you to build the component of the idea you came up with, here it only acts as a normal .svelte page, with the style script blocks and the html.&lt;/p&gt;

&lt;p&gt;You can import elements of Svelte without problems.&lt;/p&gt;
&lt;h3&gt;
  
  
  package.json
&lt;/h3&gt;

&lt;p&gt;We're going to make some changes to this file, adding the following:&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="w"&gt;    &lt;/span&gt;&lt;span class="nl"&gt;"main"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dist/index.js"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"module"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dist/index.mjs"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"svelte"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"src/index.js"&lt;/span&gt;&lt;span class="err"&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;"build"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rollup -c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rollup -c -w"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;In &lt;strong&gt;main&lt;/strong&gt; we will set the output after running the &lt;strong&gt;build&lt;/strong&gt; script (no need to create the &lt;strong&gt;/dist&lt;/strong&gt; directory, it will be created automatically)&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;module&lt;/strong&gt; we are going to define the same thing but as output a &lt;strong&gt;.mjs,&lt;/strong&gt; file so that Node can distinguish between &lt;strong&gt;modules&lt;/strong&gt; created with CommonJS and ES6. &lt;a href="https://stackoverflow.com/questions/57492546/what-is-the-difference-between-js-and-mjs-files" rel="noopener noreferrer"&gt;More info here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;svelte&lt;/strong&gt;, we will define the path of our &lt;strong&gt;index.js&lt;/strong&gt; file created earlier.&lt;/li&gt;
&lt;li&gt;And then we'll define the scripts (if you're familiar with Svelte, you'll know them).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  rollup.config.js
&lt;/h3&gt;

&lt;p&gt;We're going to create another file, but this time at the root level (where the src folder is, and the package.json), and we're going to call it &lt;strong&gt;rollup.config.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you've used Svelte before, you already know this file.&lt;/p&gt;

&lt;p&gt;We're going to run this file when we run the &lt;strong&gt;build&lt;/strong&gt; script and pass it some directives on what to do:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;svelte&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rollup-plugin-svelte&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;resolve&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rollup-plugin-node-resolve&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pkg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./package.json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;src/Name.svelte&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;pkg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;format&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;en&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;pkg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;format&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;umd&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="nf"&gt;svelte&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
            &lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;In the first 2 lines, we exported 2 of the units that we installed before.&lt;/li&gt;
&lt;li&gt;Then in the constant &lt;strong&gt;pkg&lt;/strong&gt;, we bring the &lt;strong&gt;package.json&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;And then we tell him that the input he will enter is the .svelte file (again changing &lt;strong&gt;Name&lt;/strong&gt; by the name of his file), and that the output will be &lt;strong&gt;pkg.module&lt;/strong&gt;, that is the &lt;strong&gt;module&lt;/strong&gt; value we put before in the package.json &lt;code&gt;"module": "dist/index.mjs"&lt;/code&gt; and the &lt;strong&gt;main&lt;/strong&gt; &lt;code&gt;"main": "dist/index.js"&lt;/code&gt;, changing also the '&lt;strong&gt;Name&lt;/strong&gt;' value by that of his component.&lt;/li&gt;
&lt;li&gt;And then we execute the 2 plugins.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  5. 🧪 Test locally
&lt;/h2&gt;

&lt;p&gt;There is a way to test our package locally, before uploading it to npm.&lt;/p&gt;

&lt;p&gt;Create a new folder on your computer and &lt;a href="https://svelte.dev/" rel="noopener noreferrer"&gt;install Svelte&lt;/a&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;From the terminal, in your package's directory, run the command &lt;code&gt;npm link&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;From the newly created folder where we installed Svelte in step 1, open a new terminal located in that directory and run the command &lt;code&gt;npm link /path/of/your-package&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This will allow us to test the package locally, and also if we make any modifications to it, there is no need to update or install each time, it updates itself.&lt;/p&gt;
&lt;h2&gt;
  
  
  6. 🚀 Publish in npm
&lt;/h2&gt;

&lt;p&gt;After all this, we are ready to release the package and make it available for installation via npm.&lt;/p&gt;

&lt;p&gt;It is recommended to have created in the root directory a file &lt;strong&gt;README.md&lt;/strong&gt; with information about our package. How to install it, how to use it, configurations, etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.github.com/Villanuevand/6386899f70346d4580c723232524d35a" rel="noopener noreferrer"&gt;This&lt;/a&gt; is a good example for you to use.&lt;/p&gt;

&lt;p&gt;Remember that the &lt;strong&gt;README.md&lt;/strong&gt; will be the same for npm as for the GitHub repository.&lt;/p&gt;
&lt;h3&gt;
  
  
  Publish
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Execute in the terminal, in the directory of our package, the command &lt;code&gt;npm adduser&lt;/code&gt;, it will ask for the credentials of our account.&lt;/li&gt;
&lt;li&gt;Then run &lt;code&gt;npm publish&lt;/code&gt; and that's it!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt; Any changes we make to our package, before we can run &lt;code&gt;npm publish&lt;/code&gt; again, we must change the version in our &lt;strong&gt;package.json&lt;/strong&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="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;"1.0.0"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  7. 🚀 Posting on GitHub
&lt;/h2&gt;

&lt;p&gt;To get the package into our GitHub repository, let's do the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a &lt;strong&gt;.gitignore&lt;/strong&gt; file in the root directory of your package that includes the following:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        # Directories
        node_modules/
        dist/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This prevents the dist folder and the node_modules folder from being published.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In our GitHub account, we create a repository with the name of our package, and we put that &lt;strong&gt;DO NOT create a README.md file&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;We execute the following commands in our terminal:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;       git init
        git remote add origin https://github.com/tu-usuario/el-nombre-del-repositorio.git
        git add .
        git commit -m "First Commit"
        git push -u origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This will upload our files to the repository &lt;em&gt;(except the ones we put in the .gitignore file)&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  🧐 Recommendations
&lt;/h2&gt;

&lt;p&gt;It is quite useful, once our repository is created and our package is published, to add the following lines in our &lt;strong&gt;package.json&lt;/strong&gt; file:&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="w"&gt;        &lt;/span&gt;&lt;span class="nl"&gt;"repository"&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;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"git"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"url"&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://github.com/tu-usuario/el-nombre-del-repositorio"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"homepage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"bugs"&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;"url"&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://github.com/tu-usuario/el-nombre-del-repositorio/issues"&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;This will also add on the npm page of our package, the Homepage and Repository fields linking directly to our package site and the GitHub repository.&lt;/p&gt;
&lt;h2&gt;
  
  
  📕 Conclusion
&lt;/h2&gt;

&lt;p&gt;Is there much more that can be done before publishing the package? Yes, you can, like run tests, have a LICENSE file, add &lt;a href="https://docs.npmjs.com/misc/scripts" rel="noopener noreferrer"&gt;prebuild and pre-publish&lt;/a&gt; scripts in package.json, etc.&lt;/p&gt;

&lt;p&gt;Yes, you can, but the idea of the post is that at least they know how to start, then it's up to each one to add more things to the process.&lt;/p&gt;

&lt;p&gt;I hope everything is understood, if you can't comment below 😀&lt;/p&gt;

&lt;p&gt;Greetings!&lt;/p&gt;
&lt;h6&gt;
  
  
  Photo by Clark Tibbs on Unsplash
&lt;/h6&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/agustinl" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F167506%2Fd319e234-3e0c-47cf-931e-799575409087.jpg" alt="agustinl"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/agustinl/creando-un-paquete-para-svelte-20i7" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Creando un paquete para Svelte&lt;/h2&gt;
      &lt;h3&gt;Agustín ・ Jan 9 '20&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#svelte&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#npm&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#node&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



</description>
      <category>tutorial</category>
      <category>svelte</category>
      <category>javascript</category>
      <category>npm</category>
    </item>
    <item>
      <title>Creando un paquete para Svelte</title>
      <dc:creator>Agustín</dc:creator>
      <pubDate>Thu, 09 Jan 2020 23:48:35 +0000</pubDate>
      <link>https://forem.com/agustinl/creando-un-paquete-para-svelte-20i7</link>
      <guid>https://forem.com/agustinl/creando-un-paquete-para-svelte-20i7</guid>
      <description>&lt;h1&gt;
  
  
  Intro
&lt;/h1&gt;

&lt;p&gt;La idea del siguiente post es hacer una versión rápida, practica y sencilla de como crear un paquete (package) para podes descargar vía &lt;a href="https://www.npmjs.com/"&gt;npm&lt;/a&gt; en nuestro proyecto hecho con &lt;a href="https://svelte.dev/"&gt;Svelte&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hace poco finalice &lt;a href="https://www.npmjs.com/package/svelte-tags-input"&gt;mi primer package&lt;/a&gt; y la verdad, aunque la información en la web es bastante, y muy completa, la idea es transmitir mi proceso de forma corta y sencilla, además de que no encontré demasiados post explicando como dejar funcionando el paquete para Svelte.&lt;/p&gt;

&lt;p&gt;Recomiendo &lt;a href="https://sergiodxa.com/articles/crear-modulo-npm/"&gt;este post&lt;/a&gt; de &lt;a href="https://sergiodxa.com/"&gt;Sergio Xalambrí&lt;/a&gt;, que explica varios pasos mas, con muy buen nivel de detalle (que no es la idea de este post, por ahora).&lt;/p&gt;

&lt;h2&gt;
  
  
  1. 🛠️ Pre requisitos
&lt;/h2&gt;

&lt;p&gt;Antes que nada es requisito lo siguiente:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Tener cuenta en &lt;a href="https://github.com/"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Tener cuenta en &lt;a href="https://www.npmjs.com/"&gt;npm&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Tener &lt;a href="https://nodejs.org/es/download/"&gt;Node&lt;/a&gt;, &lt;a href="https://www.npmjs.com/get-npm"&gt;npm&lt;/a&gt; y &lt;a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git"&gt;GIT&lt;/a&gt; instalados en su pc.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Listo esto, podemos seguir.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. 💡 La idea
&lt;/h2&gt;

&lt;p&gt;Antes de empezar nada, es bueno tener una idea de que se quiere hacer, para no perder tiempo ni pasos haciendo y deshaciendo el paquete. No importa que sea algo básico, piensen en algo que les sirva a ustedes primero, tanto para usar como para practicar, y que les gustaría subir.&lt;/p&gt;

&lt;p&gt;Y no piensen si ya esta hecho o no, la mayoría de las cosas posiblemente estén hechas ya, solo búsquenle la vuelta para que tenga un valor agregado suyo.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. 🏁 Iniciar el paquete
&lt;/h2&gt;

&lt;p&gt;Ya pueden crear una carpeta en su pc, con el nombre del paquete (o el que les guste), y abrir su editor preferido.&lt;/p&gt;

&lt;p&gt;En mi caso use Visual Studio Code, que ya tiene una terminal integrada, en caso que utilicen otro, deberán abrir la consola de Node y situarse en el directorio que crearon recién.&lt;/p&gt;

&lt;p&gt;Ahora deben ejecutar &lt;code&gt;npm init -y&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;Esto va a crear un archivo package.json para colocar información sobre el paquete, como &lt;strong&gt;nombre&lt;/strong&gt;, &lt;strong&gt;autor&lt;/strong&gt;, &lt;strong&gt;descripción&lt;/strong&gt;, las &lt;strong&gt;dependencias&lt;/strong&gt; que utiliza, la &lt;strong&gt;versión&lt;/strong&gt; etc.&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="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;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&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;"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;"1.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&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;"main"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"index.js"&lt;/span&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;"test"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"echo "&lt;/span&gt;&lt;span class="err"&gt;Error:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;no&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;test&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;specified&lt;/span&gt;&lt;span class="s2"&gt;" &amp;amp;&amp;amp; exit 1"&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;"keywords"&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;"author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&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;"license"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ISC"&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;Pueden ir completando los campos como &lt;strong&gt;name&lt;/strong&gt;, &lt;strong&gt;description&lt;/strong&gt;, &lt;strong&gt;keywords&lt;/strong&gt;, &lt;strong&gt;author&lt;/strong&gt; y &lt;a href="https://help.github.com/en/enterprise/2.18/user/github/creating-cloning-and-archiving-repositories/licensing-a-repository"&gt;&lt;strong&gt;license&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ahora podemos instalar la dependencias que usara nuestro paquete. A tener en cuenta que es un código básico, esto quiere decir que instalaremos dependencias básicas.&lt;/p&gt;

&lt;p&gt;Ejecuten en su terminal el siguiente comando&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install -D rollup rollup-plugin-node-resolve rollup-plugin-svelte svelte&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Esto instalara las dependencias básicas como &lt;strong&gt;devDependencies&lt;/strong&gt; (&lt;em&gt;-D&lt;/em&gt;), ósea que solo se utilizaran para el desarrollo.&lt;/p&gt;

&lt;p&gt;El &lt;strong&gt;package.json&lt;/strong&gt; agregara el siguiente campo:&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="w"&gt;    &lt;/span&gt;&lt;span class="nl"&gt;"devDependencies"&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;"rollup"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^1.28.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"rollup-plugin-node-resolve"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^5.2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"rollup-plugin-svelte"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^5.1.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"svelte"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^3.16.7"&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;
  
  
  4. 📦 El paquete
&lt;/h2&gt;

&lt;p&gt;Ahora vamos a crear un carpeta &lt;strong&gt;src&lt;/strong&gt; en la raíz del directorio, y dentro un archivo &lt;strong&gt;index.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dentro de este archivo vamos a poner el siguiente código:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Name&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./Name.svelte&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Donde &lt;strong&gt;Name&lt;/strong&gt; deberá ser el nombre que quieran darle al componente.&lt;/p&gt;

&lt;p&gt;Y luego, crearemos también dentro de la carpeta &lt;strong&gt;src&lt;/strong&gt;, un archivo &lt;strong&gt;Name.svelte&lt;/strong&gt; donde &lt;strong&gt;Name&lt;/strong&gt; debera ser &lt;strong&gt;el mismo&lt;/strong&gt; que pusieron en el archivo &lt;strong&gt;index.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ya dentro del archivo .svelte, queda en ustedes construir el componente de la idea que se les ocurrió, acá solo actúa como una pagina .svelte normal, con los bloques script style y el html.&lt;/p&gt;

&lt;p&gt;Pueden importar elementos de Svelte sin problemas.&lt;/p&gt;
&lt;h3&gt;
  
  
  package.json
&lt;/h3&gt;

&lt;p&gt;Vamos a hacer unos cambios en este archivo, agregando lo siguiente:&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="w"&gt;    &lt;/span&gt;&lt;span class="nl"&gt;"main"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dist/index.js"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"module"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dist/index.mjs"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"svelte"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"src/index.js"&lt;/span&gt;&lt;span class="err"&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;"build"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rollup -c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rollup -c -w"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;En &lt;strong&gt;main&lt;/strong&gt; vamos a establecer el output después de correr el script &lt;strong&gt;build&lt;/strong&gt; (no hace falta crear el directorio &lt;strong&gt;/dist&lt;/strong&gt;, se creara automáticamente)&lt;/li&gt;
&lt;li&gt;En &lt;strong&gt;module&lt;/strong&gt; vamos a definir lo mismo pero como salida un archivo &lt;strong&gt;.mjs,&lt;/strong&gt; para que Node distinga entre &lt;strong&gt;módulos&lt;/strong&gt; creados con CommonJS y ES6. &lt;a href="https://stackoverflow.com/questions/57492546/what-is-the-difference-between-js-and-mjs-files"&gt;Más info aca (en Ingles)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;En &lt;strong&gt;svelte&lt;/strong&gt;, vamos a definir la ruta de nuestro archivo &lt;strong&gt;index.js&lt;/strong&gt; creado antes.&lt;/li&gt;
&lt;li&gt;Y después vamos a definir los scripts (si están familiarizados con Svelte, ya los conocerán).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  rollup.config.js
&lt;/h3&gt;

&lt;p&gt;Vamos a crear otro archivo, pero esta vez a nivel raíz (donde esta la carpeta src, y el package.json), y vamos a llamarlo &lt;strong&gt;rollup.config.js&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Si usaron Svelte antes, conocen ya este archivo.&lt;/p&gt;

&lt;p&gt;A este archivo vamos a ejecutarlo cuando corramos el script &lt;strong&gt;build&lt;/strong&gt; y vamos a pasarle algunas directivas de que hacer:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;svelte&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rollup-plugin-svelte&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;resolve&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rollup-plugin-node-resolve&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pkg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./package.json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;src/Name.svelte&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;pkg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;format&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;es&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;pkg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;format&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;umd&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="nx"&gt;svelte&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
            &lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;En las 2 primeras líneas, exportamos 2 de las dependencias que instalamos antes.&lt;/li&gt;
&lt;li&gt;Después en la constante &lt;strong&gt;pkg&lt;/strong&gt;, traemos el &lt;strong&gt;package.json&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Y después le decimos que el input que ingresara es el archivo .svelte (otra vez cambiando &lt;strong&gt;Name&lt;/strong&gt; por el nombre de su archivo), y que el output será &lt;strong&gt;pkg.module&lt;/strong&gt;, ósea el valor &lt;strong&gt;module&lt;/strong&gt; que pusimos antes en el package.json &lt;code&gt;"module": "dist/index.mjs"&lt;/code&gt; y el valor &lt;strong&gt;main&lt;/strong&gt; &lt;code&gt;"main": "dist/index.js"&lt;/code&gt;, cambiando también el valor '&lt;strong&gt;Name&lt;/strong&gt;' por el de su componente.&lt;/li&gt;
&lt;li&gt;Y luego ejecutamos los 2 plugin.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  5. 🧪 Testear localmente
&lt;/h2&gt;

&lt;p&gt;Hay una forma para poder testear nuestro paquete de manera local, antes de subirlo a npm.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creamos una carpeta nueva en nuestra pc e &lt;a href="https://svelte.dev/"&gt;instalamos Svelte&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Desde la terminal, en el directorio de tu paquete, ejecutamos el comando &lt;code&gt;npm link&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Desde la carpeta recién creada donde instalamos Svelte en el paso 1, abrimos una nueva terminal situada en ese directorio y ejecutamos el comando &lt;code&gt;npm link /la-ruta/de/tu-paquete&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Eso nos va a dejar testear localmente el paquete, y además si hacemos alguna modificación en el, no hace falta hacer un update o install cada vez, se actualiza solo.&lt;/p&gt;
&lt;h2&gt;
  
  
  6. 🚀 Publicar en npm
&lt;/h2&gt;

&lt;p&gt;Después de todo esto, ya estamos listos para publicar el paquete y dejarlo disponible para instalar vía npm.&lt;/p&gt;

&lt;p&gt;Es recomendable haber creado en el directorio raíz un archivo &lt;strong&gt;README.md&lt;/strong&gt; con información acerca de nuestro paquete. Como instalarlo, como utilizarlo, configuraciones, etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.github.com/Villanuevand/6386899f70346d4580c723232524d35a"&gt;Este&lt;/a&gt; es un buen ejemplo para que puedan usar.&lt;/p&gt;

&lt;p&gt;Recuerden que el &lt;strong&gt;README.md&lt;/strong&gt; será el mismo para npm que para el repositorio de GitHub.&lt;/p&gt;
&lt;h3&gt;
  
  
  Publicar
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Ejecutar en la terminal, en el directorio de nuestro paquete, el comando &lt;code&gt;npm adduser&lt;/code&gt;, nos va a pedir las credenciales de nuestra cuenta.&lt;/li&gt;
&lt;li&gt;Luego ejecutar &lt;code&gt;npm publish&lt;/code&gt; y listo!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;IMPORTANTE:&lt;/strong&gt; Cualquier cambio que hagamos en nuestro paquete, antes de poder ejecutar &lt;code&gt;npm publish&lt;/code&gt; de nuevo, debemos cambiar la versión en nuestro &lt;strong&gt;package.json&lt;/strong&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="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;"1.0.0"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  7. 🚀 Publicar en GitHub
&lt;/h2&gt;

&lt;p&gt;Para tener el paquete en nuestro repositorio de GitHub, vamos a hacer lo siguiente:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creamos un archivo &lt;strong&gt;.gitignore&lt;/strong&gt; en el directorio raíz de nuestro paquete que incluya lo siguiente:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        # Directories
        node_modules/
        dist/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Esto evita que se publique la carpeta dist y la carpeta node_modules.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;En nuestra cuenta de GitHub, creamos un repositorio con el nombre de nuestro paquete, y ponemos que &lt;strong&gt;NO cree un archivo README.md&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;Ejecutamos los siguientes comandos en nuestra terminal:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;       git init
        git remote add origin https://github.com/tu-usuario/el-nombre-del-repositorio.git
        git add .
        git commit -m "First Commit"
        git push -u origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Esto va a subir nuestros archivos al repositorio &lt;em&gt;(excepto los que pusimos en el archivo .gitignore)&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  🧐 Recomendaciones
&lt;/h2&gt;

&lt;p&gt;Es bastante útil, una vez creado nuestro repositorio y publicado nuestro paquete, agregar las siguientes líneas en nuestro archivo &lt;strong&gt;package.json&lt;/strong&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="w"&gt;        &lt;/span&gt;&lt;span class="nl"&gt;"repository"&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;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"git"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"url"&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://github.com/tu-usuario/el-nombre-del-repositorio"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"homepage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"bugs"&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;"url"&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://github.com/tu-usuario/el-nombre-del-repositorio/issues"&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;Esto además añadirá en la pagina npm de nuestro paquete, los campos Homepage y Repository linkeando directamente al sitio de nuestro paquete y al repositorio de GitHub.&lt;/p&gt;
&lt;h2&gt;
  
  
  📕 Conclución
&lt;/h2&gt;

&lt;p&gt;Se pueden hacer muchas mas cosas antes de publicar el paquete? Si, se pueden, como correr testeos, tener un archivo LICENSE, agregar scripts de &lt;a href="https://docs.npmjs.com/misc/scripts"&gt;prebuild y prepublish&lt;/a&gt; en el package.json, etc.&lt;/p&gt;

&lt;p&gt;Si, se puede, pero la idea del post es que al menos sepan como arrancar, después queda en cada uno agregarle mas cosas al proceso.&lt;/p&gt;

&lt;p&gt;Espero se haya entendido todo, si no pueden comentarlo abajo 😀&lt;/p&gt;

&lt;p&gt;Saludos!&lt;/p&gt;
&lt;h6&gt;
  
  
  Photo by Clark Tibbs on Unsplash
&lt;/h6&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/agustinl" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jbKyDI1A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--KxOy_ePz--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/167506/d319e234-3e0c-47cf-931e-799575409087.jpg" alt="agustinl"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/agustinl/creating-a-package-for-svelte-262n" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Creating a package for Svelte&lt;/h2&gt;
      &lt;h3&gt;Agustín ・ Jan 10 '20 ・ 6 min read&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#svelte&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#npm&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



</description>
      <category>svelte</category>
      <category>javascript</category>
      <category>npm</category>
      <category>node</category>
    </item>
    <item>
      <title>My side project in Svelte</title>
      <dc:creator>Agustín</dc:creator>
      <pubDate>Fri, 13 Dec 2019 22:59:56 +0000</pubDate>
      <link>https://forem.com/agustinl/my-side-project-in-svelte-2lfb</link>
      <guid>https://forem.com/agustinl/my-side-project-in-svelte-2lfb</guid>
      <description>&lt;h1&gt;
  
  
  A community list of personal sites for inspiration
&lt;/h1&gt;

&lt;p&gt;After some weeks I finished my side project.&lt;/p&gt;

&lt;p&gt;I was thinking in a new project to start, and get the opportunity of test svelte.&lt;br&gt;
Suddenly I thought about the idea of a &lt;em&gt;site where you could upload pages especially from designers, collaboratives, developers to show&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;On the site the pages sent do not pass through a filter, it is automatically uploaded. My idea was to do this and that those sites that were not in line with the page were reported for review.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DZFjA99F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/uf8q34lw8lg0iz8d27ma.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DZFjA99F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/uf8q34lw8lg0iz8d27ma.jpg" alt="sitesshowcase" width="880" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I used &lt;strong&gt;svelte&lt;/strong&gt; integrated with sapper, but I didn't give much use to the latter.&lt;br&gt;
The most important thing I have to say is that they &lt;strong&gt;use svelte&lt;/strong&gt;, it's really simple and with a lot of potential!&lt;/p&gt;
&lt;h2&gt;
  
  
  Are you a designer, developer, creative or a simple curious looking for inspiration?
&lt;/h2&gt;

&lt;p&gt;Take a look&lt;br&gt;
🌐 &lt;a href="//sitesshowcase.com/?ref=devto"&gt;sitesshowcase&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Github repo:
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/agustinl"&gt;
        agustinl
      &lt;/a&gt; / &lt;a href="https://github.com/agustinl/sitesshowcase"&gt;
        sitesshowcase
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A community list of personal sites for inspiration
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/a730f3b8f13d6cfdd91bc0c90051d68268ea56d268c09e4e5d01c9cc1054e0da/68747470733a2f2f7777772e736974657373686f77636173652e636f6d2f6f672d696d6167652e6a7067"&gt;&lt;img src="https://camo.githubusercontent.com/a730f3b8f13d6cfdd91bc0c90051d68268ea56d268c09e4e5d01c9cc1054e0da/68747470733a2f2f7777772e736974657373686f77636173652e636f6d2f6f672d696d6167652e6a7067"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;h6&gt;
A community list of personal sites for inspiration.&lt;/h6&gt;

&lt;p&gt;&lt;a href="http://sitesshowcase.com/" rel="nofollow"&gt;View site&lt;/a&gt;.&lt;/p&gt;

&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/agustinl/sitesshowcase"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;&lt;strong&gt;All suggestions, recommendations and criticisms will be well accepted&lt;/strong&gt; 🙌&lt;br&gt;
And this is my first post in dev.to too 🎉&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>showdev</category>
      <category>svelte</category>
    </item>
    <item>
      <title>RESTApi Host</title>
      <dc:creator>Agustín</dc:creator>
      <pubDate>Mon, 14 Oct 2019 22:17:35 +0000</pubDate>
      <link>https://forem.com/agustinl/restapi-host-2258</link>
      <guid>https://forem.com/agustinl/restapi-host-2258</guid>
      <description>&lt;p&gt;Hello community, I have a question here,&lt;/p&gt;

&lt;p&gt;I build a app with the MERN Stack, and I decided separate the front from the back.&lt;br&gt;
I thought of upload the static front in github pages, but, I dont know what is the best host to upload my backend.&lt;/p&gt;

&lt;p&gt;A host that allows you to store the files that are sent from my frontend and update the database (which I already have made in mlab).&lt;/p&gt;

&lt;p&gt;Any know a good solution for this?&lt;br&gt;
Now I tested my entire app in heroku, but the files I upload are removed 24 hours later.&lt;/p&gt;

&lt;p&gt;Thanks and nice week :)&lt;/p&gt;

</description>
      <category>help</category>
    </item>
  </channel>
</rss>
