<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: カワリミ人形</title>
    <description>The latest articles on DEV Community by カワリミ人形 (@kawarimidoll).</description>
    <link>https://dev.to/kawarimidoll</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%2F693623%2Fc1c5e2c2-9aa2-49bd-800c-d4b2ad33ddaa.png</url>
      <title>DEV Community: カワリミ人形</title>
      <link>https://dev.to/kawarimidoll</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kawarimidoll"/>
    <language>en</language>
    <item>
      <title>Made a service for Deno Deploy to create a self-introduction page</title>
      <dc:creator>カワリミ人形</dc:creator>
      <pubDate>Wed, 01 Sep 2021 06:06:11 +0000</pubDate>
      <link>https://dev.to/kawarimidoll/made-a-service-for-deno-deploy-to-create-a-self-introduction-page-1g9l</link>
      <guid>https://dev.to/kawarimidoll/made-a-service-for-deno-deploy-to-create-a-self-introduction-page-1g9l</guid>
      <description>&lt;p&gt;As the number of pages you have accounts for increases, such as DEV, Twitter, GitHub, etc., it becomes difficult to display links to other services on each service.&lt;br&gt;
In such a case, it is easier to manage if you create a "link list" profile page somewhere and post links to it.&lt;/p&gt;

&lt;p&gt;There is an existing service, Linktree.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://linktr.ee/"&gt;https://linktr.ee/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, I personally don't want to manage only links.&lt;br&gt;
I thought it would be nice to be able to display profile items as bullet points as well.&lt;/p&gt;

&lt;p&gt;This is why I made it myself, while also learning Deno Deploy.&lt;br&gt;
I've made it available as a service for others to use, so I'll introduce it here.&lt;/p&gt;
&lt;h2&gt;
  
  
  Denote
&lt;/h2&gt;

&lt;p&gt;The name is &lt;strong&gt;Denote.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is demo: &lt;a href="https://denote.deno.dev/denote"&gt;https://denote.deno.dev/denote&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The page is like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NrKDhDTp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/2f59628847d4d9881ab0417b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NrKDhDTp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/2f59628847d4d9881ab0417b.png" alt="denote"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The overall balance of the page (the list of items below the icons) is based on Linktree, but the separation of items within the page and the rain are original.&lt;br&gt;
After all, Deno is all about rain at night!&lt;/p&gt;

&lt;p&gt;The profile page of kawarimidoll is here: &lt;a href="https://denote.deno.dev/kawarimidoll"&gt;https://denote.deno.dev/kawarimidoll&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  API
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Registration &amp;amp; Update
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;POST https://denote.deno.dev/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Instead of separating &lt;code&gt;POST&lt;/code&gt; and &lt;code&gt;PUT&lt;/code&gt; for registration and update, I decided to use the same one.&lt;br&gt;
This is because I thought it would be more convenient to automate the process with GitHub Actions, etc. (as described later).&lt;/p&gt;
&lt;h4&gt;
  
  
  Parameters
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;name&lt;/code&gt; Page name&lt;br&gt;
&lt;code&gt;token&lt;/code&gt; Token (to be referenced when updating or deleting the page, cannot be changed)&lt;br&gt;
&lt;code&gt;config&lt;/code&gt; JSON of settings for list items, main image, etc.&lt;/p&gt;

&lt;p&gt;Any token can be used when registering a new page, but when updating, an error will occur if the name and token do not match.&lt;/p&gt;
&lt;h3&gt;
  
  
  Delete
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;DELETE https://denote.deno.dev/&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Parameters
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;name&lt;/code&gt; Page name&lt;br&gt;
&lt;code&gt;token&lt;/code&gt; Token (set when registering)&lt;/p&gt;
&lt;h3&gt;
  
  
  Display
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;GET https://denote.deno.dev/[name]&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  CLI
&lt;/h2&gt;

&lt;p&gt;You can register, update and delete by throwing a request to the above API using &lt;code&gt;curl&lt;/code&gt;, etc. However, as the number of configuration items increases, a long JSON file will be placed in the config, making it difficult to operate.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X POST -d '{"name":"my-name","token":"my-token","config":{"list":{"id-1":{"icon":"fontawesome/font-awesome","items":[{"icon":"jam/info","text":"this is a text with an icon"},{"text":"this is a just text"},{"icon":"octicons/octoface","text":"this is a link to GitHub","link":"https://github.com"},{"text":"this is a link to Twitter","link":"https://twitter.com"},{"link":"https://gitlab.com"}]},"id-2":{"icon":"feather/anchor","items":[{"icon":"clarity/block","text":"this is the second block"},{"icon":"simple/deno"}]}}}}' https://denote.deno.dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So I created a script that parses a local JSON/YAML file and makes a request to the endpoint.&lt;br&gt;
It can be installed as a CLI tool by &lt;code&gt;deno install&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://deno.land/x/denote"&gt;https://deno.land/x/denote&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Install
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ deno install --allow-read --allow-write --allow-net --no-check --force https://deno.land/x/denote/cli/denote.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  Registration and update
&lt;/h4&gt;

&lt;p&gt;Use &lt;code&gt;denote register&lt;/code&gt; to reflect the configuration file to Denote.&lt;br&gt;
The &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;token&lt;/code&gt; options are required.&lt;br&gt;
It is possible to specify a file not only your local, but also published on the web due to Deno specifications.&lt;br&gt;
In other words, you can put the configuration in Gist and run &lt;code&gt;denote register&lt;/code&gt; locally to publish it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ denote register ./config.yml --name my-name --token my-token
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Delete
&lt;/h4&gt;

&lt;p&gt;Deletes the page published by denote unregister.&lt;br&gt;
The &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;token&lt;/code&gt; options are required.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ denote unregister --name my-name --token my-token
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Checking on a local server
&lt;/h4&gt;

&lt;p&gt;You can set up a local server with &lt;code&gt;denote serve&lt;/code&gt;, in case you want to check the display before publishing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ denote serve ./config.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Auto run
&lt;/h4&gt;

&lt;p&gt;We can run it without installation by hitting the public URL directly with &lt;code&gt;deno run&lt;/code&gt;.&lt;br&gt;
So if you run &lt;code&gt;denote register&lt;/code&gt; in GitHub Actions, you can update Denote automatically.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# .github/workflows/denote_profile.yml&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Denote profile&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;master&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;timeout-minutes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;denoland/setup-deno@v1&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="s"&gt;deno run --allow-read --allow-net --no-check&lt;/span&gt;
          &lt;span class="s"&gt;https://deno.land/x/denote/cli/denote.ts register ./denote.yml&lt;/span&gt;
          &lt;span class="s"&gt;--name kawarimidoll --token '${{ secrets.DENOTE_TOKEN }}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When doing this, it was difficult to split between new registration and renewal, so I combined Denote's registration and renewal APIs together.&lt;/p&gt;

&lt;p&gt;It's running in the kawarimidoll profile repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kawarimidoll/kawarimidoll/blob/master/.github/workflows/denote_profile.yml"&gt;https://github.com/kawarimidoll/kawarimidoll/blob/master/.github/workflows/denote_profile.yml&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuration file
&lt;/h2&gt;

&lt;p&gt;The configuration file can be written in JSON or YAML.&lt;/p&gt;

&lt;p&gt;There is &lt;code&gt;example.yml&lt;/code&gt; in the repository (actually, &lt;code&gt;denote init&lt;/code&gt; just downloads this).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kawarimidoll/denote/blob/main/example.yml"&gt;https://github.com/kawarimidoll/denote/blob/main/example.yml&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Required keys
&lt;/h3&gt;

&lt;p&gt;The key "list" is required at the top level.&lt;br&gt;
It is a bit complicated under that, so I will explain it in &lt;code&gt;example.yml&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# example.yml&lt;/span&gt;
&lt;span class="na"&gt;list&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;id-1&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;icon&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;fontawesome/font-awesome&lt;/span&gt;
    &lt;span class="na"&gt;items&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;icon&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;jam/info&lt;/span&gt;
        &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;this is a text with an icon&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;this is a just text&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;icon&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;octicons/octoface&lt;/span&gt;
        &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;this is a link to GitHub&lt;/span&gt;
        &lt;span class="na"&gt;link&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;this is a link to Twitter&lt;/span&gt;
        &lt;span class="na"&gt;link&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://twitter.com&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;link&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://gitlab.com&lt;/span&gt;
  &lt;span class="na"&gt;id-2&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;icon&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;feather/anchor&lt;/span&gt;
    &lt;span class="na"&gt;items&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;icon&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;clarity/block&lt;/span&gt;
        &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;this is the second block&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;icon&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;simple/deno&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;A list has a key of any name under it.

&lt;ul&gt;
&lt;li&gt;The children of this &lt;code&gt;list&lt;/code&gt; (&lt;code&gt;id-1&lt;/code&gt; and &lt;code&gt;id-2&lt;/code&gt; above) are treated as a group.&lt;/li&gt;
&lt;li&gt;This key will be treated as the ID of the link in the page.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;The group has keys named &lt;code&gt;icon&lt;/code&gt; and &lt;code&gt;items&lt;/code&gt;.

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;icon&lt;/code&gt; is a string with the name &lt;code&gt;[iconset-name]/[icon-name]&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Only icons listed in the &lt;a href="https://icongr.am"&gt;icongram&lt;/a&gt; can be used.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;items&lt;/code&gt; is an array of list items.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;A list item can have the keys &lt;code&gt;icon&lt;/code&gt;, &lt;code&gt;text&lt;/code&gt;, and &lt;code&gt;link&lt;/code&gt;.

&lt;ul&gt;
&lt;li&gt;All three of these are optional.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;icon&lt;/code&gt; is an icon that can be displayed in icongram as well as in the group.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;text&lt;/code&gt; is the text to be displayed in the list.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;link&lt;/code&gt; is the URL of the link destination. If &lt;code&gt;text&lt;/code&gt; is present, it will be displayed, otherwise the &lt;code&gt;link&lt;/code&gt; string will be displayed.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Optional keys
&lt;/h3&gt;

&lt;p&gt;The following keys are optional.&lt;/p&gt;

&lt;h4&gt;
  
  
  name
&lt;/h4&gt;

&lt;p&gt;The name to be displayed at the top of the page.&lt;br&gt;
If omitted, the &lt;code&gt;name&lt;/code&gt; option set at the time of registration (i.e., the one that goes into &lt;code&gt;https://denote.deno.dev[name]&lt;/code&gt; when displayed) will be used.&lt;br&gt;
It will also be used as the page name in the HTML file in the form &lt;code&gt;name | Denote&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  image
&lt;/h4&gt;

&lt;p&gt;The URL of the main image.&lt;br&gt;
If omitted, no image is used.&lt;br&gt;
This is also reflected in the OGP setting &lt;code&gt;og:image&lt;/code&gt;, so it will be displayed in an embedded link.&lt;/p&gt;

&lt;h4&gt;
  
  
  favicon
&lt;/h4&gt;

&lt;p&gt;The URL of the favicon image.&lt;br&gt;
If omitted, the Denote logo will be used.&lt;/p&gt;

&lt;h4&gt;
  
  
  description
&lt;/h4&gt;

&lt;p&gt;The description or comment to be displayed below the name above.&lt;br&gt;
If omitted, no comment will be used.&lt;br&gt;
This is also reflected in the OGP setting &lt;code&gt;og:description&lt;/code&gt;, so it will be displayed in an embedded link.&lt;/p&gt;

&lt;h4&gt;
  
  
  twitter
&lt;/h4&gt;

&lt;p&gt;This is the twitter user name used in the OGP setting &lt;code&gt;twitter:site&lt;/code&gt;.&lt;br&gt;
If omitted, it will simply be skipped.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closure
&lt;/h2&gt;

&lt;p&gt;At first it was just a simple white background.&lt;br&gt;
I wanted to make it rain at night since it was a deno, so I did some research and made some adjustments.&lt;br&gt;
I'm happy with the result, because I think I was able to give it a nice look.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/KawarimiDoll/status/1422858096234274816"&gt;https://twitter.com/KawarimiDoll/status/1422858096234274816&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a translation of the following article.&lt;br&gt;
Please leave comments if there are any mistakes in the translation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://zenn.dev/kawarimidoll/articles/e00d79b97042ee"&gt;https://zenn.dev/kawarimidoll/articles/e00d79b97042ee&lt;/a&gt;&lt;/p&gt;

</description>
      <category>deno</category>
      <category>denodeploy</category>
    </item>
    <item>
      <title>Made an API to get GitHub contributions in Deno (for Terminal/JSON/SVG)</title>
      <dc:creator>カワリミ人形</dc:creator>
      <pubDate>Tue, 31 Aug 2021 05:33:33 +0000</pubDate>
      <link>https://dev.to/kawarimidoll/made-an-api-to-get-github-contributions-in-deno-for-terminal-json-svg-4ien</link>
      <guid>https://dev.to/kawarimidoll/made-an-api-to-get-github-contributions-in-deno-for-terminal-json-svg-4ien</guid>
      <description>&lt;p&gt;I created this project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kawarimidoll/deno-github-contributions-api"&gt;https://github.com/kawarimidoll/deno-github-contributions-api&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is demo:&lt;br&gt;
&lt;a href="https://twitter.com/KawarimiDoll/status/1411657903614742532"&gt;https://twitter.com/KawarimiDoll/status/1411657903614742532&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ayx75pEz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://github.com/kawarimidoll/deno-github-contributions-api/raw/main/t-rec.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ayx75pEz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://github.com/kawarimidoll/deno-github-contributions-api/raw/main/t-rec.gif" alt="demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please access the following URL from your browser or request it using &lt;code&gt;curl&lt;/code&gt;, and follow the instructions displayed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github-contributions-api.deno.dev/"&gt;https://github-contributions-api.deno.dev/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since I wanted the engineers to have fun, didn't dare to create a rich UI, but rather provide explanations through text responses.&lt;br&gt;
In this article, each API is explained briefly. Please try to access and play with them by yourself.&lt;/p&gt;
&lt;h2&gt;
  
  
  API
&lt;/h2&gt;

&lt;p&gt;When you access &lt;code&gt;https://github-contributions-api.deno.dev/[username]&lt;/code&gt;, you will see the number of annual contributions for that user and some descriptions of the API.&lt;br&gt;
Each API can be accessed by adding an extension to the end of the URL, such as &lt;code&gt;/[username].text&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  .text
&lt;/h3&gt;

&lt;p&gt;This is the simplest and most uninteresting type. It outputs a comma-separated list of contribution graphs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ curl https://github-contributions-api.deno.dev/kawarimidoll.text
2387 contributions in the last year
13, 5, 2, 4, 5, 9, 1, 2, 3, 3, 3, 8, 3,10, 1, 4, 1, 1, 6, 2, 4, 2,10,10,10, 9, 8, 6,13, 4, 7, 7, 6, 6, 3, 1,11, 1, 5, 2, 6, 6, 6,21,11,17,13,16, 2, 7, 6,10,12
 4, 0, 1, 5, 7, 1, 1, 3, 9, 1, 5, 8, 3, 1, 4, 5, 3, 1, 1, 1, 1, 6, 7,12, 5, 7, 5, 5,19, 2,20,11, 8,10,32, 4, 6, 2, 5, 4, 3, 3, 7,20, 5,17, 6, 5,13,14,22, 6,12
 0, 5, 0, 7, 8, 3, 3, 3, 2, 2, 5, 1, 1, 4, 1, 3, 1, 1, 2, 1, 1, 7, 5, 9, 4,10, 2,14,12,18,11,22, 6, 7, 7,14, 1, 3, 2, 5, 1,18, 5,20, 7, 4, 6, 5,16,14, 4,17, 2
 8, 5, 1, 4, 2, 5, 2, 4, 1, 5, 2, 3, 1, 4, 1, 1, 1, 1, 1, 2, 2, 4, 7, 5, 6, 4, 2, 6,18,16, 6, 6, 2, 2, 7, 9, 1, 4, 1, 4, 4, 9, 4,11, 5,20, 6,14, 7,16,15, 9,
 6, 1, 0, 0, 5, 1, 4, 3, 1, 6, 3, 2, 1, 1, 2,10, 1, 1, 1, 2, 2,11, 3,18, 4,15, 4,12,24, 4,23,15, 4,17, 8, 5, 4, 2, 2,14, 2,12, 6, 9, 1, 9, 4, 2,11,17,14, 7,
 2, 3, 3, 2, 3, 1, 3, 1, 9, 5, 6, 1, 1, 1, 3, 1, 1, 1, 1, 2, 1, 9, 7,23, 6,13, 6, 1,14, 6, 3,12, 3, 4, 6, 2, 1, 2, 6,14, 6,12, 6,15, 2,10, 4,18, 7,20, 5,11,
 7, 3, 3,10, 4, 5, 4, 3, 2, 4, 1, 6, 4, 1, 4, 2, 2, 3, 1, 2, 1,10, 7,28, 6,12, 8,17, 7, 6, 4,14,13, 3, 5,15, 2, 5, 4,11, 6,15,24,20, 8,19, 9, 9,23, 4,12,18,
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The display of the total number of contributions can be removed with the &lt;code&gt;no-total&lt;/code&gt; parameter.&lt;br&gt;
Since it is comma-separated, saving it to a CSV file may be an interesting use.&lt;/p&gt;
&lt;h3&gt;
  
  
  .term
&lt;/h3&gt;

&lt;p&gt;This is the most characteristic type. This is the one that is shown in the demo at the beginning of this article, and is the one that I'm promoting.&lt;br&gt;
It is intended to be used with &lt;code&gt;curl&lt;/code&gt;, etc in the terminal.&lt;/p&gt;

&lt;p&gt;The display of the total number of contributions can be removed with the &lt;code&gt;no-total&lt;/code&gt; parameter and the legend (&lt;code&gt;Less...More&lt;/code&gt;) can be removed with the &lt;code&gt;no-legend&lt;/code&gt; parameter.&lt;br&gt;
In addition, there is a &lt;code&gt;scheme&lt;/code&gt; parameter to set the color scheme, a &lt;code&gt;pixel&lt;/code&gt; parameter to change the text used for the pixels, and an &lt;code&gt;invert&lt;/code&gt; parameter to change the background color instead of the text.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;pixel&lt;/code&gt; parameter allows non-ascii characters if encoded properly.&lt;/p&gt;

&lt;p&gt;Make sure that your device supports True Color to this works well.&lt;/p&gt;
&lt;h3&gt;
  
  
  .json
&lt;/h3&gt;

&lt;p&gt;This is the most "API-like" type. It returns a JSON containing a string with the total number of contributions and an array of contribution data for each week.&lt;br&gt;
I can say it's a wrapper for GraphQL API of GitHub.&lt;/p&gt;

&lt;p&gt;The contribution data is a two-dimensional array of 7 days x 53 weeks, but it can be received as a one-dimensional array using the &lt;code&gt;flat&lt;/code&gt; option.&lt;/p&gt;

&lt;p&gt;I think this type can be utilized as a source when you want to use the contributions for some purpose.&lt;/p&gt;
&lt;h3&gt;
  
  
  .svg
&lt;/h3&gt;

&lt;p&gt;This is the most intuitive type. It returns the contribution graph as an SVG image.&lt;br&gt;
It's almost the same as the one on the GitHub user page, but the official one has some quirks in specifying coordinates, so I refactored it a bit.&lt;/p&gt;

&lt;p&gt;Since it is an image, &lt;strong&gt;it can be pasted on DEV.&lt;/strong&gt; Now you can show off your development activities on your articles!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zgBdklsL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github-contributions-api.deno.dev/kawarimidoll.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zgBdklsL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github-contributions-api.deno.dev/kawarimidoll.svg" alt="svg"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;![svg](https://github-contributions-api.deno.dev/kawarimidoll.svg)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are some options, &lt;code&gt;no-total&lt;/code&gt;, &lt;code&gt;no-legend&lt;/code&gt;, &lt;code&gt;scheme&lt;/code&gt;, &lt;code&gt;font-color&lt;/code&gt;, &lt;code&gt;frame&lt;/code&gt; and &lt;code&gt;bg&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ElJB8i86--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github-contributions-api.deno.dev/kawarimidoll.svg%3Fno-total%3Dtrue%26no-legend%3Dtrue%26bg%3D184038%26font-color%3Dd7f07b%26frame%3Df03153%26scheme%3Damber" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ElJB8i86--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github-contributions-api.deno.dev/kawarimidoll.svg%3Fno-total%3Dtrue%26no-legend%3Dtrue%26bg%3D184038%26font-color%3Dd7f07b%26frame%3Df03153%26scheme%3Damber" alt="svg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think it can be used anywhere you can attach an image with a URL.&lt;br&gt;
Please use it conveniently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closure
&lt;/h2&gt;

&lt;p&gt;I'm satisfied with the result, because it's fun to make, and the finished product is visually interesting, and I can see my achievements.&lt;/p&gt;

&lt;p&gt;If you like it, please have a look at the repository page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kawarimidoll/deno-github-contributions-api"&gt;https://github.com/kawarimidoll/deno-github-contributions-api&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Deno has a really good development experience.&lt;br&gt;
I'd like to continue playing with Deno and Deno Deploy.&lt;/p&gt;

&lt;p&gt;This is a translation of the following article.&lt;br&gt;
Please leave comments if there are any mistakes in the translation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://zenn.dev/kawarimidoll/articles/b573f617a51c0b"&gt;https://zenn.dev/kawarimidoll/articles/b573f617a51c0b&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Extra
&lt;/h2&gt;

&lt;p&gt;The tiger🐯 has given it a Star🌟! Overwhelming thanks...!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/KawarimiDoll/status/1411871548449853443"&gt;https://twitter.com/KawarimiDoll/status/1411871548449853443&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This have also been picked up by Deno official Twitter! Overwhelmingly impressed...!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/deno_land/status/1420387162206478340"&gt;https://twitter.com/deno_land/status/1420387162206478340&lt;/a&gt;&lt;/p&gt;

</description>
      <category>deno</category>
      <category>github</category>
      <category>api</category>
      <category>cli</category>
    </item>
    <item>
      <title>Introduction to the use and configuration of deno-udd, a module version control tool for Deno</title>
      <dc:creator>カワリミ人形</dc:creator>
      <pubDate>Sun, 29 Aug 2021 01:37:56 +0000</pubDate>
      <link>https://dev.to/kawarimidoll/introduction-to-the-use-and-configuration-of-deno-udd-a-module-version-control-tool-for-deno-1d11</link>
      <guid>https://dev.to/kawarimidoll/introduction-to-the-use-and-configuration-of-deno-udd-a-module-version-control-tool-for-deno-1d11</guid>
      <description>&lt;p&gt;Deno does away with the &lt;code&gt;package.json&lt;/code&gt; of the Node.js era, and introduces version control by putting the version number directly into the URL.&lt;br&gt;
According to the style guide, it is recommended to load modules into a file called &lt;code&gt;deps.ts&lt;/code&gt; and import them indirectly from there in the project.&lt;/p&gt;

&lt;p&gt;Here is a tool, UDD, to help you manage the module version.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/hayd/deno-udd"&gt;https://github.com/hayd/deno-udd&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It seems that UDD stands for &lt;strong&gt;Update Deno Dependencies&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;By the way, why does the Sauropod of the main image (↓) have a cow-like atmosphere?&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rMxuF_uM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/b2c520fa78188ba3ce9a6229.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rMxuF_uM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/b2c520fa78188ba3ce9a6229.png" alt="logo"&gt;&lt;/a&gt;&lt;br&gt;
Raising and lowering its long neck to eat grass that grows directly on the ground is obviously useless, so I think the survival of the species is in jeopardy...&lt;/p&gt;
&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;It is available at &lt;code&gt;deno.land/x&lt;/code&gt;. Let's install it with &lt;a href="https://deno.land/manual/tools/script_installer"&gt;&lt;code&gt;deno install&lt;/code&gt;&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ deno install -A -f -n udd https://deno.land/x/udd@0.5.0/main.ts
(logs...)
✅ Successfully installed udd
/Users/kawarimidoll/.deno/bin/udd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The default installation directory is &lt;code&gt;~/.deno/bin&lt;/code&gt;. Make sure that your &lt;code&gt;PATH&lt;/code&gt; includes this directory.&lt;/p&gt;

&lt;p&gt;If you run it with no arguments, you can see help.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ udd
usage: udd [-h] [--dry-run] [--test TEST] file [file ...]

udd: Update Deno Dependencies

Positional arguments:
  file          files to update dependencies

Optional arguments:
 -h, --help     show this help text
 --dry-run      test what dependencies can be updated
 --test TEST    command to run after each dependency update e.g. "deno test"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;udd&lt;/code&gt; checks the version of the modules in the file, and updates them all at once.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ # basic
❯ udd deps.ts
❯ # just check
❯ udd deps.ts --dry-run
❯ # multiple files
❯ udd main.ts util.ts
❯ # bulk
❯ udd *.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Modules that do not contain a version number in the &lt;code&gt;import&lt;/code&gt; URL will be skipped.&lt;/p&gt;

&lt;p&gt;If you add the &lt;code&gt;--test&lt;/code&gt; option, it will update the file after making sure that the test passes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ udd deps.ts --test="deno test"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Basically, you can run it without any configuration, so you can try it right away.&lt;br&gt;
Another advantage is that if you no longer use this tool, there is no debt associated with it.&lt;/p&gt;
&lt;h3&gt;
  
  
  Where to get support
&lt;/h3&gt;

&lt;p&gt;At the time of writing, the following registries have been updated.&lt;br&gt;
Most of the commonly used ones in Deno are supported.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://deno.land/std"&gt;https://deno.land/std&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://deno.land/x"&gt;https://deno.land/x&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://denopkg.com"&gt;https://denopkg.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.jspm.io"&gt;https://dev.jspm.io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cdn.pika.dev"&gt;https://cdn.pika.dev&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cdn.skypack.dev"&gt;https://cdn.skypack.dev&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://unpkg.com"&gt;https://unpkg.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://raw.githubusercontent.com"&gt;https://raw.githubusercontent.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitlab.com/:user/:repo/-/raw"&gt;https://gitlab.com/:user/:repo/-/raw&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cdn.jsdelivr.net"&gt;https://cdn.jsdelivr.net&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://x.nest.land"&gt;https://x.nest.land&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;p&gt;As mentioned above, no configuration is required for the basic operation, but there are a few useful settings that can be found here.&lt;/p&gt;
&lt;h3&gt;
  
  
  Respecting Semver
&lt;/h3&gt;

&lt;p&gt;Just like &lt;code&gt;package.json&lt;/code&gt; in Node.js, you can fix the major version by adding a token.&lt;br&gt;
This is specified in the hash of the module URL. This is a very interesting idea.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;^&lt;/code&gt; Fix the major version

&lt;ul&gt;
&lt;li&gt;If the major version is 0, fix the minor version.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;~&lt;/code&gt; Fix major and minor versions

&lt;ul&gt;
&lt;li&gt;If the major version is 0, the minor version will be updated.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;[version]&lt;/code&gt; Fix to a lower version (in semver) than the specified version.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;=&lt;/code&gt; Do not update.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;&lt;/code&gt; requires you to specify the upper version limit, others refer to the version specification contained in the URL.&lt;/p&gt;
&lt;h3&gt;
  
  
  Use it with Velociraptor
&lt;/h3&gt;

&lt;p&gt;This is a personal preference, but I like to use Velociraptor for all the commands used in the Deno project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://velociraptor.run"&gt;https://velociraptor.run&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add a configuration like this to &lt;code&gt;velociraptor.yml&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;scripts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;deps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;desc&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Update dependencies with ensuring pass tests&lt;/span&gt;
    &lt;span class="na"&gt;cmd&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;udd deps.ts --test="deno test -Ar"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can use &lt;code&gt;vr deps&lt;/code&gt; to update the module while checking that the test passes.&lt;/p&gt;

&lt;p&gt;This configuration is included in my template.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kawarimidoll/deno-dev-template"&gt;https://github.com/kawarimidoll/deno-dev-template&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Closure
&lt;/h2&gt;

&lt;p&gt;This will allow us to "test and update" and reduce the psychological and work load of updating modules.&lt;br&gt;
As a result, the life of the project will be extended.&lt;/p&gt;

&lt;p&gt;This is a translation of the following article.&lt;br&gt;
Please leave comments if there are any mistakes in the translation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://zenn.dev/kawarimidoll/articles/d4e5ac8770e024"&gt;https://zenn.dev/kawarimidoll/articles/d4e5ac8770e024&lt;/a&gt;&lt;/p&gt;

</description>
      <category>deno</category>
      <category>dependencies</category>
    </item>
    <item>
      <title>How to fix [deno-ts 2339] in the code for Deno Deploy</title>
      <dc:creator>カワリミ人形</dc:creator>
      <pubDate>Sat, 28 Aug 2021 00:38:56 +0000</pubDate>
      <link>https://dev.to/kawarimidoll/how-to-fix-deno-ts-2339-in-the-code-for-deno-deploy-5b47</link>
      <guid>https://dev.to/kawarimidoll/how-to-fix-deno-ts-2339-in-the-code-for-deno-deploy-5b47</guid>
      <description>&lt;p&gt;I am studying Deno Deploy.&lt;/p&gt;

&lt;p&gt;This article summarizes how to deal with the [deno-ts 2339] error I encountered while writing code for Deno Deploy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Errors that occur
&lt;/h2&gt;

&lt;p&gt;The error is the one displayed in the editor, &lt;code&gt;[deno-ts 2339] [E] Property 'respondWith' does not exist on type 'Event'&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;As an example, we will use the code from the Hello World page of &lt;a href="https://deno.com/deploy/docs/hello-world"&gt;the official documentation&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// server.ts&lt;/span&gt;
&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fetch&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;event&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello World!&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;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;content-type&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="s2"&gt;text/plain&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;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;respondWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&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;Even with all this code, the error occurs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--F7DeUBON--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/b33bb76f2d4fa6d6a78dca1e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F7DeUBON--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/b33bb76f2d4fa6d6a78dca1e.png" alt="err"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is a warning that "&lt;code&gt;respondWith&lt;/code&gt; is not defined in &lt;code&gt;Event&lt;/code&gt;".&lt;/p&gt;

&lt;p&gt;It can be ignored by the Deno Deploy environment and &lt;code&gt;deployctl&lt;/code&gt;, and &lt;code&gt;deno lint&lt;/code&gt; does not get particularly angry.&lt;br&gt;
In other words, LSP is just giving you a warning, and you don't need to worry about it.&lt;br&gt;
However, it is not very pleasant to keep getting errors during development. To be honest, it bothers me.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to deal with it
&lt;/h2&gt;

&lt;p&gt;An issue about it was raised in the deploy_feedback repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/denoland/deploy_feedback/issues/13"&gt;https://github.com/denoland/deploy_feedback/issues/13&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this issue was mentioned. We can use this method.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/denoland/deployctl/issues/24#issuecomment-819272065"&gt;https://github.com/denoland/deployctl/issues/24#issuecomment-819272065&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, generate a type definition file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ deployctl types &amp;gt; deploy.d.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, add Triple-Slash Directives on the first part in &lt;code&gt;server.ts&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html"&gt;https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;/// &amp;lt;reference path="./deploy.d.ts" /&amp;gt;&lt;/span&gt;

&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fetch&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;event&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello Deno Deploy!&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;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;content-type&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="s2"&gt;text/plain&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;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;respondWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&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 will remove the error.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EgO6gMG1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/2618cee57666ff2c04134e29.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EgO6gMG1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://storage.googleapis.com/zenn-user-upload/2618cee57666ff2c04134e29.png" alt="clean"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But now &lt;code&gt;deployctl run . /server.ts&lt;/code&gt; fails.&lt;/p&gt;

&lt;p&gt;To make it work correctly, you need to add the libs option at runtime.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ deployctl run --libs="" ./server.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This completes the error handling and adjusting the command for execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use task runner
&lt;/h2&gt;

&lt;p&gt;It is tedious to type the options every time.&lt;br&gt;
You can use Velociraptor, a task runner for Deno, to register the commands to be entered each time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://velociraptor.run/"&gt;https://velociraptor.run/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add the following description to velociraptor.yml.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;scripts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;dev&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;desc&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Starts local server&lt;/span&gt;
    &lt;span class="na"&gt;cmd&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;deployctl run --libs="" --watch ./server.ts&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can now start a local server with &lt;code&gt;vr dev&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ vr dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Closure
&lt;/h2&gt;

&lt;p&gt;Personally, I think that more and more Deno development will be written with the assumption that it will run on Deno Deploy.&lt;br&gt;
That's why I included it in my template repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kawarimidoll/deno-dev-template"&gt;https://github.com/kawarimidoll/deno-dev-template&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a translation of the following article.&lt;br&gt;
Please leave comments if there are any mistakes in the translation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://zenn.dev/kawarimidoll/articles/efed8ada433f24"&gt;https://zenn.dev/kawarimidoll/articles/efed8ada433f24&lt;/a&gt;&lt;/p&gt;

</description>
      <category>deno</category>
      <category>denodeploy</category>
      <category>typescript</category>
      <category>lsp</category>
    </item>
  </channel>
</rss>
