{"version":"https://jsonfeed.org/version/1","title":"Aaron Gustafson: Content tagged open source","description":"The latest 20 posts and links tagged open source.","home_page_url":"https://www.aaron-gustafson.com","feed_url":"https://www.aaron-gustafson.com/feeds/open-source.json","author":{"name":"Aaron Gustafson","url":"https://www.aaron-gustafson.com"},"icon":"https://www.aaron-gustafson.com/i/og-logo.png","favicon":"https://www.aaron-gustafson.com/favicon.png","expired":false,"items":[{"id":"https://www.aaron-gustafson.com/notebook/a-web-component-starter-template/","title":"✍🏻 A Production-Ready Web Component Starter Template","summary":"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.","content_html":"<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>\n<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>\n<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>\n<p>The template provides everything you need to create a production-ready web component:</p>\n<ul>\n<li><strong>Interactive setup wizard</strong> that scaffolds everything for your component.</li>\n<li><strong>Multiple import patterns</strong> supporting both auto-define and manual registration.</li>\n<li><strong>Demo pages</strong> for development, documentation, and CDN examples.</li>\n<li><strong>Code quality tools</strong> including ESLint and Prettier with sensible defaults.</li>\n<li><strong>Modern testing setup</strong> with Vitest, Happy DOM, and coverage reporting.</li>\n<li><strong>CI/CD workflows</strong> for GitHub Actions with automated testing and npm publishing.</li>\n<li><strong>Publishing ready</strong> with proper npm package configuration and OIDC support.</li>\n</ul>\n<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>\n<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>\n<pre class=\"language-bash\" tabindex=\"0\"><code class=\"language-bash\"><span class=\"token function\">git</span> clone https://github.com/aarongustafson/web-component-starter.git my-component\n<span class=\"token builtin class-name\">cd</span> my-component\n<span class=\"token function\">npm</span> <span class=\"token function\">install</span>\n<span class=\"token function\">npm</span> run setup</code></pre>\n<p>The setup wizard asks for your component name and description, then automatically:</p>\n<ul>\n<li>Renames all files based on your component name,</li>\n<li>Updates all code and configuration templates with your details,</li>\n<li>Generates a proper README from the included template,</li>\n<li>Cleans up all template-specific files, and</li>\n<li>Initializes the git repository.</li>\n</ul>\n<p>You’re left with a fully scaffolded repository, ready for you to develop your component.</p>\n<h2 id=\"flexible-import-patterns\" tabindex=\"-1\"><a class=\"header-anchor\" href=\"#flexible-import-patterns\" aria-hidden=\"true\">#</a> Flexible import patterns</h2>\n<p>One of the key features is support for multiple registration patterns. Users of your component can choose what works best:</p>\n<p><strong>Manual registration for full control:</strong></p>\n<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>\n\ncustomElements<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>\n<p><strong>Auto-define for convenience:</strong></p>\n<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>\n<p><strong>Or call the helper directly:</strong></p>\n<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>\n\n<span class=\"token function\">defineComponentName</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre>\n<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>\n<h2 id=\"testing-made-easy\" tabindex=\"-1\"><a class=\"header-anchor\" href=\"#testing-made-easy\" aria-hidden=\"true\">#</a> Testing made easy</h2>\n<p>The template includes a comprehensive testing setup using Vitest:</p>\n<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>\n\n<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\">=></span> <span class=\"token punctuation\">{</span>\n  <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\">=></span> <span class=\"token punctuation\">{</span>\n    <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>\n    <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>\n  <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre>\n<p>Happy DOM provides a lightweight browser environment, and the included scripts support:</p>\n<ul>\n<li>Watch mode for development: <code>npm test</code></li>\n<li>Single run for CI: <code>npm run test:run</code></li>\n<li>Interactive UI: <code>npm run test:ui</code></li>\n<li>Coverage reports: <code>npm run test:coverage</code></li>\n</ul>\n<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>\n<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>\n<p>Manual publishing is still supported if you prefer that approach.</p>\n<h2 id=\"following-best-practices\" tabindex=\"-1\"><a class=\"header-anchor\" href=\"#following-best-practices\" aria-hidden=\"true\">#</a> Following best practices</h2>\n<p>The template bakes in best practices from the start:</p>\n<ul>\n<li>Shadow DOM with proper encapsulation</li>\n<li>Custom Elements v1 API</li>\n<li>Reflection of properties to attributes</li>\n<li>Lifecycle callbacks used appropriately</li>\n<li>Accessible patterns and ARIA support</li>\n<li>Progressive enhancement approach</li>\n</ul>\n<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>\n<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>\n<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>\n<p>If you build something with it, I’d love to hear about it!</p>\n","social_text":"Start building web components the right way with this production-ready template.","url":"https://www.aaron-gustafson.com/notebook/a-web-component-starter-template/","tags":["web components","JavaScript","open source","developer tools","best practices"],"date_published":"2026-01-02T00:06:37Z"},{"id":"https://www.aaron-gustafson.com/notebook/westhost-gets-rails/","title":"✍🏻 WestHost gets Rails","summary":"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…","content_html":"<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>\n","url":"https://www.aaron-gustafson.com/notebook/westhost-gets-rails/","tags":["web development","open source"],"date_published":"2006-04-14T14:50:29Z"},{"id":"https://www.aaron-gustafson.com/notebook/oracle-opens-up/","title":"✍🏻 Oracle opens up","summary":"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…","content_html":"<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>\n<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>\n<p>Here’s a breakdown of some of the features/limitations:</p>\n<ul>\n<li>available for Windows or Linux</li>\n<li>stores up to 4GB of data</li>\n<li>will only use one processor (crippled to keep their Enterprise clients no doubt)</li>\n<li>will only use up to 1GB of RAM (ditto)</li>\n<li>upgradeable to other Oracle Database 10g editions (of course)</li>\n</ul>\n<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>\n","url":"https://www.aaron-gustafson.com/notebook/oracle-opens-up/","tags":["open source","software development","business"],"date_published":"2005-11-03T15:25:17Z"}]}