<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/css" href="https://www.aaron-gustafson.com/c/feed.min.css" ?><feed xmlns="http://www.w3.org/2005/Atom"
      xmlns:amg="https://www.aaron-gustafson.com.com/amg-dtd/"><title>Aaron Gustafson: Content tagged open source</title><subtitle>The latest 20 posts and links tagged open source.</subtitle><id>https://www.aaron-gustafson.com</id><link href="https://www.aaron-gustafson.com/feeds/open-source.xml" rel="self"/><link href="https://www.aaron-gustafson.com"/><author><name>Aaron Gustafson</name><uri>https://www.aaron-gustafson.com</uri></author><updated>2026-01-02T00:06:37Z</updated><entry><id>https://www.aaron-gustafson.com/notebook/a-web-component-starter-template/</id><title type="html"><![CDATA[✍🏻 A Production-Ready Web Component Starter Template]]></title><link href="https://www.aaron-gustafson.com/notebook/a-web-component-starter-template/" rel="alternate" type="text/html" /><published>2026-01-02T00:06:37Z</published><content type="html" xml:base="https://www.aaron-gustafson.com"><![CDATA[<p>Creating a new web component from scratch involves a lot of boilerplate—testing setup, build configuration, linting, CI/CD, documentation structure, and more. After building — and refining/rebuilding — numerous web components, I’ve distilled all that work into a starter template that lets you focus on your component’s functionality rather than project setup.</p><p>The <a href="https://github.com/aarongustafson/web-component-starter">Web Component Starter Template</a> is based on the architecture and patterns I’ve refined across my web component work, incorporating <a href="https://web.dev/articles/custom-elements-best-practices">Google’s Custom Element Best Practices</a> and advice from other web components practitioners including the always-brilliant <a href="https://daverupert.com/">Dave Rupert</a>.</p><h2 id="what%E2%80%99s-included" tabindex="-1"><a class="header-anchor" href="#what%E2%80%99s-included" aria-hidden="true">#</a> What’s included</h2><p>The template provides everything you need to create a production-ready web component:</p><ul><li><strong>Interactive setup wizard</strong> that scaffolds everything for your component.</li><li><strong>Multiple import patterns</strong> supporting both auto-define and manual registration.</li><li><strong>Demo pages</strong> for development, documentation, and CDN examples.</li><li><strong>Code quality tools</strong> including ESLint and Prettier with sensible defaults.</li><li><strong>Modern testing setup</strong> with Vitest, Happy DOM, and coverage reporting.</li><li><strong>CI/CD workflows</strong> for GitHub Actions with automated testing and npm publishing.</li><li><strong>Publishing ready</strong> with proper npm package configuration and OIDC support.</li></ul><h2 id="quick-start-with-interactive-setup" tabindex="-1"><a class="header-anchor" href="#quick-start-with-interactive-setup" aria-hidden="true">#</a> Quick start with interactive setup</h2><p>Getting started is straightforward. If you’re a GitHub user, you can create a new repository directly from the template. Alternatively, clone it locally:</p><pre class="language-bash" tabindex="0"><code class="language-bash"><span class="token function">git</span> clone <a href="https://github.com/aarongustafson/web-component-starter.git">https://github.com/aarongustafson/web-component-starter.git</a> my-component<span class="token builtin class-name">cd</span> my-component<span class="token function">npm</span><span class="token function">install</span><span class="token function">npm</span> run setup</code></pre><p>The setup wizard asks for your component name and description, then automatically:</p><ul><li>Renames all files based on your component name,</li><li>Updates all code and configuration templates with your details,</li><li>Generates a proper README from the included template,</li><li>Cleans up all template-specific files, and</li><li>Initializes the git repository.</li></ul><p>You’re left with a fully scaffolded repository, ready for you to develop your component.</p><h2 id="flexible-import-patterns" tabindex="-1"><a class="header-anchor" href="#flexible-import-patterns" aria-hidden="true">#</a> Flexible import patterns</h2><p>One of the key features is support for multiple registration patterns. Users of your component can choose what works best:</p><p><strong>Manual registration for full control:</strong></p><pre class="language-javascript" tabindex="0"><code class="language-javascript"><span class="token keyword">import</span><span class="token punctuation">{</span> ComponentNameElement <span class="token punctuation">}</span><span class="token keyword">from</span><span class="token string">‘@yourscope/component-name’</span><span class="token punctuation">;</span>customElements<span class="token punctuation">.</span><span class="token function">define</span><span class="token punctuation">(</span><span class="token string">‘my-custom-name’</span><span class="token punctuation">,</span> ComponentNameElement<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre><p><strong>Auto-define for convenience:</strong></p><pre class="language-javascript" tabindex="0"><code class="language-javascript"><span class="token keyword">import</span><span class="token string">‘@yourscope/component-name/define.js’</span><span class="token punctuation">;</span></code></pre><p><strong>Or call the helper directly:</strong></p><pre class="language-javascript" tabindex="0"><code class="language-javascript"><span class="token keyword">import</span><span class="token punctuation">{</span> defineComponentName <span class="token punctuation">}</span><span class="token keyword">from</span><span class="token string">‘@yourscope/component-name/define.js’</span><span class="token punctuation">;</span><span class="token function">defineComponentName</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre><p>The auto-define approach includes guards to ensure it only runs in browser environments and checks if <code>customElements</code> is available, making it safe for server-side rendered (SSR) scenarios.</p><h2 id="testing-made-easy" tabindex="-1"><a class="header-anchor" href="#testing-made-easy" aria-hidden="true">#</a> Testing made easy</h2><p>The template includes a comprehensive testing setup using Vitest:</p><pre class="language-javascript" tabindex="0"><code class="language-javascript"><span class="token keyword">import</span><span class="token punctuation">{</span> describe<span class="token punctuation">,</span> it<span class="token punctuation">,</span> expect <span class="token punctuation">}</span><span class="token keyword">from</span><span class="token string">‘vitest’</span><span class="token punctuation">;</span><span class="token function">describe</span><span class="token punctuation">(</span><span class="token string">‘MyComponent’</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">=&gt;</span><span class="token punctuation">{</span><span class="token function">it</span><span class="token punctuation">(</span><span class="token string">‘should render’</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">=&gt;</span><span class="token punctuation">{</span><span class="token keyword">const</span> el <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">createElement</span><span class="token punctuation">(</span><span class="token string">‘my-component’</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token function">expect</span><span class="token punctuation">(</span>el<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">toBeInstanceOf</span><span class="token punctuation">(</span>HTMLElement<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre><p>Happy DOM provides a lightweight browser environment, and the included scripts support:</p><ul><li>Watch mode for development: <code>npm test</code></li><li>Single run for CI: <code>npm run test:run</code></li><li>Interactive UI: <code>npm run test:ui</code></li><li>Coverage reports: <code>npm run test:coverage</code></li></ul><h2 id="automated-publishing-with-oidc" tabindex="-1"><a class="header-anchor" href="#automated-publishing-with-oidc" aria-hidden="true">#</a> Automated publishing with OIDC</h2><p>The template is configured for secure automated publishing to npm using OpenID Connect (OIDC), which is more secure than long-lived tokens. After you manually publish the first version and configure OIDC on npm, create a GitHub release and the workflow handles publishing automatically.</p><p>Manual publishing is still supported if you prefer that approach.</p><h2 id="following-best-practices" tabindex="-1"><a class="header-anchor" href="#following-best-practices" aria-hidden="true">#</a> Following best practices</h2><p>The template bakes in best practices from the start:</p><ul><li>Shadow DOM with proper encapsulation</li><li>Custom Elements v1 API</li><li>Reflection of properties to attributes</li><li>Lifecycle callbacks used appropriately</li><li>Accessible patterns and ARIA support</li><li>Progressive enhancement approach</li></ul><p>The included <a href="https://github.com/aarongustafson/web-component-starter/blob/main/WEB-COMPONENTS-BEST-PRACTICES.md"><code>WEB-COMPONENTS-BEST-PRACTICES.md</code> document</a> explains the reasoning behind each pattern, making it a learning resource as well as a starter template.</p><h2 id="why-i-built-this" tabindex="-1"><a class="header-anchor" href="#why-i-built-this" aria-hidden="true">#</a> Why I built this</h2><p>After creating components like <a href="https://github.com/aarongustafson/form-obfuscator">form-obfuscator</a>, <a href="https://github.com/aarongustafson/tabbed-interface">tabbed-interface</a>, and several others, I found myself copying and adapting the same project structure each time. This template captures those patterns so I — and now you — can start building components faster.</p><p>If you build something with it, I’d love to hear about it!</p>]]></content><amg:twitter><![CDATA[Start building web components the right way with this production-ready template.]]></amg:twitter><amg:summary><![CDATA[I created a comprehensive starter template for creating production-ready web components with modern tooling, testing, and CI/CD—following Google’s Custom Element Best Practices.]]></amg:summary><summary type="html"><![CDATA[<p>I created a comprehensive starter template for creating production-ready web components with modern tooling, testing, and CI/CD—following Google’s Custom Element Best Practices.</p>]]></summary><category term="web components" /><category term="JavaScript" /><category term="open source" /><category term="developer tools" /><category term="best practices" /></entry><entry><id>https://www.aaron-gustafson.com/notebook/westhost-gets-rails/</id><title type="html"><![CDATA[✍🏻 WestHost gets Rails]]></title><link href="https://www.aaron-gustafson.com/notebook/westhost-gets-rails/" rel="alternate" type="text/html" /><published>2006-04-14T14:50:29Z</published><content type="html" xml:base="https://www.aaron-gustafson.com"><![CDATA[<p>I received an email announcement yesterday that <a href="http://www.westhost.com/">WestHost</a> (my host of choice) is going to be offering <a href="http://www.rubyonrails.org">Ruby on Rails</a> for install through its Site Manager. I guess it means that, sometime this month, <a href="http://www.easy-designs.net/articles/WesthostOnRails/">my tutorial on the subject</a> will no longer needed. Still, I’m glad it will be a bit easier to set up Rails on WestHost now.</p>]]></content><amg:summary><![CDATA[I received an email announcement yesterday that WestHost (my host of choice) is going to be offering Ruby on Rails for install through its Site Manager. I guess it means that, sometime this month, my tutorial on the subject will no…]]></amg:summary><summary type="html"><![CDATA[<p>I received an email announcement yesterday that WestHost (my host of choice) is going to be offering Ruby on Rails for install through its Site Manager. I guess it means that, sometime this month, my tutorial on the subject will no…</p>]]></summary><category term="web development" /><category term="open source" /></entry><entry><id>https://www.aaron-gustafson.com/notebook/oracle-opens-up/</id><title type="html"><![CDATA[✍🏻 Oracle opens up]]></title><link href="https://www.aaron-gustafson.com/notebook/oracle-opens-up/" rel="alternate" type="text/html" /><published>2005-11-03T15:25:17Z</published><content type="html" xml:base="https://www.aaron-gustafson.com"><![CDATA[<p>In hopes of stemming the massive explosion of open source database use, Oracle is preparing an “express” version of it’s Oracle Database 10g line: <a href="http://www.oracle.com/technology/products/database/xe/index.html">Oracle Database XE</a>. Like many things on the web right now, it’s currently in beta, with a full release planned for late this year.</p><p>Courting the open source set is an interesting move for Oracle. <a href="http://www.php.net">PHP</a> developers are the obvious target right now, but I wouldn’t be surprised to see some of the focus shifted to <a href="http://www.rubyonrails.org">Rails</a> developers in the near future.</p><p>Here’s a breakdown of some of the features/limitations:</p><ul><li>available for Windows or Linux</li><li>stores up to 4GB of data</li><li>will only use one processor (crippled to keep their Enterprise clients no doubt)</li><li>will only use up to 1GB of RAM (ditto)</li><li>upgradeable to other Oracle Database 10g editions (of course)</li></ul><p>I haven’t downloaded it to play yet, but there seems to be some fairly detailed instructions on both install and integration on the PHP end.</p>]]></content><amg:summary><![CDATA[In hopes of stemming the massive explosion of open source database use, Oracle is preparing an “express” version of it’s Oracle Database 10g line: Oracle Database XE . Like many things on the web right now, it’s currently in beta, with…]]></amg:summary><summary type="html"><![CDATA[<p>In hopes of stemming the massive explosion of open source database use, Oracle is preparing an “express” version of it’s Oracle Database 10g line: Oracle Database XE . Like many things on the web right now, it’s currently in beta, with…</p>]]></summary><category term="open source" /><category term="software development" /><category term="business" /></entry></feed>