<?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: Isac Petinate</title>
    <description>The latest articles on DEV Community by Isac Petinate (@ipetinate).</description>
    <link>https://dev.to/ipetinate</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%2F326070%2F6eb8bdd5-75b1-47f7-92fe-2db658925968.jpeg</url>
      <title>DEV Community: Isac Petinate</title>
      <link>https://dev.to/ipetinate</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ipetinate"/>
    <language>en</language>
    <item>
      <title>Clingon: A Ferramenta CLI para Geração de Recursos</title>
      <dc:creator>Isac Petinate</dc:creator>
      <pubDate>Mon, 29 Apr 2024 11:56:47 +0000</pubDate>
      <link>https://dev.to/ipetinate/clingon-a-ferramenta-cli-para-geracao-de-recursos-bgi</link>
      <guid>https://dev.to/ipetinate/clingon-a-ferramenta-cli-para-geracao-de-recursos-bgi</guid>
      <description>&lt;p&gt;&lt;a href="https://dev.to/ipetinate/clingon-the-cli-tool-for-resource-generation-1gfi"&gt;Version for native English speakers&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://clingon.dev"&gt;Site oficial: clingon.dev&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nós, desenvolvedores, sempre buscamos simplificar as coisas e evitar ao máximo o trabalho chato e repetitivo. Fazemos isso em nossos projetos usando recursos globais, criando bibliotecas internas e externas, ferramentas, e qualquer coisa necessária para tornar nossas vidas mais fáceis.&lt;/p&gt;

&lt;p&gt;Hoje, quero falar um pouco sobre esse assunto e como esse espírito me levou a criar uma ferramenta para nos ajudar no dia a dia.&lt;/p&gt;

&lt;h2&gt;
  
  
  Breve História
&lt;/h2&gt;

&lt;p&gt;Quando comecei a trabalhar com Frontend, tive contato com alguns frameworks. No Vue, achei incrível a CLI para criar projetos, que oferecia muitos recursos prontos. Era só gerar o projeto e começar a codificar. Na CLI do Angular, você podia criar serviços, componentes, pipes, módulos e muito mais com poucos comandos. Eles já vinham com testes, arquivos de estilo, imports nos módulos, etc.&lt;/p&gt;

&lt;p&gt;Quando comecei a trabalhar com React alguns anos depois, senti falta de uma ferramenta que facilitasse essas tarefas, especialmente quando temos muitos arquivos para um único componente.&lt;/p&gt;

&lt;p&gt;Na época, até procurei algumas ferramentas, mas eram poucas e a experiência de uso não era boa. Acabei não usando-as no meu dia a dia. &lt;br&gt;
Em conversas com amigos, por volta de 2020 ou 2021, discutimos a ideia de criar algo assim, cheguei a começar a criar algumas coisas, mas o projeto não avançou.&lt;/p&gt;

&lt;h2&gt;
  
  
  O Começo de Tudo
&lt;/h2&gt;

&lt;p&gt;Inspirado por simplificar tarefas do dia a dia, em um projeto no trabalho que iniciamos no ano passado, criei alguns snippets para o VS Code. Foi um começo, mas ainda era necessário criar muitos arquivos manualmente.&lt;/p&gt;

&lt;p&gt;Então tive a ideia de criar um shell script que simplificasse a criação de recursos no projeto. Ele gerava os arquivos necessários, já com o código básico pronto para começar a programar. O projeto usava Next.js, e o script permitia criar páginas dentro da estrutura do Next, componentes com seus testes, stories e arquivo index. Também era possível criar hooks com a estrutura adequada.&lt;/p&gt;

&lt;p&gt;Depois disso, um colega de trabalho me perguntou: por que não criar algo em JavaScript que fosse extensível e pudesse ser usado em outros projetos sem muito esforço?&lt;/p&gt;

&lt;p&gt;Essa era uma vontade que eu tinha há anos. A partir daí, comecei a projetar uma ferramenta nova para alcançar esse objetivo.&lt;/p&gt;

&lt;p&gt;Assim nasceu o Clingon.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mas O Que é o Clingon?
&lt;/h2&gt;

&lt;p&gt;O Clingon é uma biblioteca CLI (Command Line Interface) que auxilia na criação de recursos em um projeto. Ao invocar a ferramenta, você tem a opção de criar vários elementos (inicialmente limitado a Funções, Componentes e Páginas, mas será expandido ao longo do tempo), tudo pronto para começar a desenvolver, economizando tempo e evitando ter que copiar conteúdo de outros arquivos ou usar snippets de terceiros (caso você não tenha os seus próprios), e mesmo que tenha seus próprios, não precisa se preocupar com os arquivos.&lt;/p&gt;

&lt;h2&gt;
  
  
  Como Usar
&lt;/h2&gt;

&lt;p&gt;Você pode executar a biblioteca usando o NPX do Node.js e invocar o comando gen da seguinte forma: npx clingon@latest gen. Ou você pode instalá-la globalmente via npm: npm i -g clingon.&lt;/p&gt;

&lt;p&gt;Por enquanto, apenas o comando gen está disponível. Futuramente, mais opções serão adicionadas.&lt;/p&gt;

&lt;p&gt;Nota: Ao instalar globalmente, certifique-se de que seu sistema operacional permite a execução de scripts npm com privilégios. Caso contrário, poderá ocorrer um erro. Se isso acontecer, use o NPX, que funcionará.&lt;/p&gt;

&lt;h2&gt;
  
  
  Observações
&lt;/h2&gt;

&lt;p&gt;Devemos nos atentar ao fato de que a ferramenta ainda está em estado beta, em desenvolvimento, portanto, podem surgir bugs, falta de funcionalidades ou comportamentos inesperados. Se você identificar algum desses problemas, por favor, abra uma issue e me ajude a corrigir. Contribuições são bem-vindas (seguindo as diretrizes de contribuição; caso contrário, os Pull Requests não serão aprovados).&lt;/p&gt;

&lt;p&gt;Os recursos disponíveis no momento incluem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Criação de componentes e páginas para Vue e React&lt;/li&gt;
&lt;li&gt;Criação de funções com JavaScript ou TypeScript&lt;/li&gt;
&lt;li&gt;Escolha da abordagem de CSS

&lt;ul&gt;
&lt;li&gt;SCSS&lt;/li&gt;
&lt;li&gt;Tailwind com &lt;a class="mentioned-user" href="https://dev.to/apply"&gt;@apply&lt;/a&gt; ou direto nas classes&lt;/li&gt;
&lt;li&gt;CSS Modules&lt;/li&gt;
&lt;li&gt;CSS padrão&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Geração de arquivos de teste:

&lt;ul&gt;
&lt;li&gt;Escolha do sufixo .spec ou .test&lt;/li&gt;
&lt;li&gt;Adição da Testing Library nos testes (para componentes ou páginas)&lt;/li&gt;
&lt;li&gt;Escolha do framework de teste: Jest ou Vitest&lt;/li&gt;
&lt;/ul&gt;


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

&lt;h2&gt;
  
  
  Considerações Finais
&lt;/h2&gt;

&lt;p&gt;Espero que o Clingon seja útil no seu dia a dia e que simplifique seu fluxo de trabalho e sua experiência de desenvolvimento. Peço que, se possível, publiquem issues com bugs encontrados, sugestões de melhorias ou contribuições para a ferramenta.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preview
&lt;/h2&gt;

&lt;p&gt;Exemplo do fluxo de criação de um componente Vue com tailwind e testes&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qwuobyqm296ee96afp2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qwuobyqm296ee96afp2.png" alt="Perguntas do Clingon CLI no terminal Warp" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cli</category>
      <category>generator</category>
      <category>vue</category>
      <category>react</category>
    </item>
    <item>
      <title>Clingon: The CLI Tool for Resource Generation</title>
      <dc:creator>Isac Petinate</dc:creator>
      <pubDate>Mon, 29 Apr 2024 11:54:48 +0000</pubDate>
      <link>https://dev.to/ipetinate/clingon-the-cli-tool-for-resource-generation-1gfi</link>
      <guid>https://dev.to/ipetinate/clingon-the-cli-tool-for-resource-generation-1gfi</guid>
      <description>&lt;p&gt;&lt;a href="https://dev.to/ipetinate/clingon-a-ferramenta-cli-para-geracao-de-recursos-bgi"&gt;Versão em Português do Brasil&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://clingon.dev"&gt;Official website: clingon.dev&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We, developers, always strive to simplify things and avoid as much tedious and repetitive work as possible. We do this in our projects by using global resources, creating internal and external libraries, tools, and anything necessary to make our lives easier.&lt;/p&gt;

&lt;p&gt;Today, I want to talk a bit about this topic and how this spirit led me to create a tool to help us in our day-to-day work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Brief History
&lt;/h2&gt;

&lt;p&gt;When I started working with Frontend, I had contact with some frameworks. With Vue, I found the CLI for creating projects amazing, offering many ready-made resources. It was just a matter of generating the project and starting to code. In Angular's CLI, you could create services, components, pipes, modules, and much more with a few commands. They already came with tests, style files, module imports, etc.&lt;/p&gt;

&lt;p&gt;When I started working with React a few years later, I felt the lack of a tool that made these tasks easier, especially when we have many files for a single component.&lt;/p&gt;

&lt;p&gt;At the time, I even looked for some tools, but there were few and the user experience wasn't great. I ended up not using them in my day-to-day work.&lt;br&gt;
In conversations with friends, around 2020 or 2021, we discussed the idea of creating something like this, and I even started to create a few things, but the project didn't progress.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Beginning of It All
&lt;/h2&gt;

&lt;p&gt;Inspired by simplifying day-to-day tasks, in a work project that we started last year, I created some snippets for VS Code. It was a start, but it still required manually creating many files.&lt;/p&gt;

&lt;p&gt;Then I had the idea of creating a shell script that would simplify the creation of resources in the project. It generated the necessary files, already with basic code ready to start programming. The project used Next.js, and the script allowed creating pages within the Next structure, components with their tests, stories, and index file. It was also possible to create hooks with the proper structure.&lt;/p&gt;

&lt;p&gt;After that, a colleague at work asked me: why not create something in JavaScript that would be extensible and could be used in other projects without much effort?&lt;/p&gt;

&lt;p&gt;This was something I had wanted to do for years. From there, I started designing a new tool to achieve this goal.&lt;/p&gt;

&lt;p&gt;Thus was born Clingon.&lt;/p&gt;

&lt;h2&gt;
  
  
  But What is Clingon?
&lt;/h2&gt;

&lt;p&gt;Clingon is a CLI (Command Line Interface) library that helps create resources in a project. When invoking the tool, you have the option to create various elements (initially limited to Functions, Components, and Pages, but it will be expanded over time), all ready to start developing, saving time and avoiding having to copy content from other files or use third-party snippets (in case you don't have your own), and even if you have your own, you don't need to worry about the files.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Use
&lt;/h2&gt;

&lt;p&gt;You can run the library using Node.js's NPX and invoke the &lt;code&gt;gen&lt;/code&gt; command as follows: &lt;code&gt;npx clingon@latest gen&lt;/code&gt;. Or you can install it globally via npm: &lt;code&gt;npm i -g clingon&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For now, only the &lt;code&gt;gen&lt;/code&gt; command is available. In the future, more options will be added.&lt;/p&gt;

&lt;p&gt;Note: When installing globally, make sure your operating system allows npm scripts to run with privileges. Otherwise, an error may occur. If this happens, use NPX, which will work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Observations
&lt;/h2&gt;

&lt;p&gt;We should be aware that the tool is still in beta, in development, so bugs, missing functionalities, or unexpected behavior may occur. If you identify any of these problems, please open an issue and help me fix it. Contributions are welcome (following the contribution guidelines; otherwise, Pull Requests will not be approved).&lt;/p&gt;

&lt;p&gt;The available resources at the moment include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creation of components and pages for Vue and React&lt;/li&gt;
&lt;li&gt;Creation of functions with JavaScript or TypeScript&lt;/li&gt;
&lt;li&gt;Choice of CSS approach

&lt;ul&gt;
&lt;li&gt;SCSS&lt;/li&gt;
&lt;li&gt;Tailwind with &lt;a class="mentioned-user" href="https://dev.to/apply"&gt;@apply&lt;/a&gt; or directly in classes&lt;/li&gt;
&lt;li&gt;CSS Modules&lt;/li&gt;
&lt;li&gt;Standard CSS&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Generation of test files:

&lt;ul&gt;
&lt;li&gt;Choice of suffix .spec or .test&lt;/li&gt;
&lt;li&gt;Addition of the Testing Library in tests (for components or pages)&lt;/li&gt;
&lt;li&gt;Choice of testing framework: Jest or Vitest&lt;/li&gt;
&lt;/ul&gt;


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

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;I hope Clingon is useful in your day-to-day work and that it simplifies your workflow and development experience. I ask that, if possible, you publish issues with found bugs, suggestions for improvements, or contributions to the tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preview
&lt;/h2&gt;

&lt;p&gt;Example of creating a Vue component with Tailwind and tests&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6k3eu0gcr7cxid5laexv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6k3eu0gcr7cxid5laexv.png" alt="Clingon prompts on Warp Terminal screenshoot" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cli</category>
      <category>generator</category>
      <category>vue</category>
      <category>react</category>
    </item>
  </channel>
</rss>
