← All reportsPublic report

chalarangelo/30-seconds-of-code

Coding articles to level up your development skills

129k stars JavaScript View on GitHubprofiled 11d ago
Try GitZoid
9PRs this week
2Contributors
528Deps scanned
4Issues found
01 · Repo overview

How 30-seconds-of-code is put together

This repository is the source for the 30 seconds of code website, a statically generated content site built with Astro (v6) on Node.js (>=22.14.0). Markdown snippets under content/snippets plus YAML metadata (collections, languages, grammars, ranking engine, hub, redirects) are processed by a custom 'prepare' build step (bin/prepare) that generates JSON query data into .content/, a client-side search index (public/search-data.json), sitemap, RSS feed, redirects, and optimized cover images. The site follows an MVC-like internal structure: core model/recordSet/serializer abstractions, domain models (Snippet, Collection, Language), presenters, and serializers, all orchestrated by lib modules feeding Astro pages. There is no server-side application runtime or database; deployment is static hosting on Netlify.

Languages

JavaScriptSassMarkdownYAMLTypeScript

Frameworks

AstroVitestESLintPrettierShikiPrism.jsunified/remark/rehype

Infrastructure

Netlify (static hosting per README)Node.js >=22.14.0 runtime.nvmrcpublic/_headers (Netlify-style headers)

Major components

Content preparation pipeline (bin/prepare + src/lib/loader.js, src/lib/preparedQueries.js)

Builds .content/content.json and per-page JSON queries from markdown snippets and YAML metadata before Astro builds.

Core ORM-like layer (src/core/model.js, recordSet.js, serializer.js)

Provides generic model, scoped record-set querying, and serialization primitives reused by domain models.

Domain models (src/models/snippet.js, collection.js, language.js, collectionSnippet.js, contentModel.js)

Model Snippet, Collection, Language, and CollectionSnippet entities with scopes such as 'published', 'listed', 'byId'.

Search subsystem (src/lib/searchIndex.js, src/lib/search/documentIndex.js)

Builds an inverted-index/n-gram search index over published snippets and collections and writes it to public/search-data.json.

Presenters & serializers (src/presenters/*, src/serializers/*)

Transform models into view data: breadcrumbs, covers, recommendations, sublinks, previews, and page contexts.

Site generation outputs (src/lib/sitemap.js, feed.js, redirects.js, timestampDump.js)

Generate public/sitemap.xml, public/feed.xml, public/_redirects, and a build timestamp module.

Content configuration (content/*.yaml, src/config/settings.js, src/astro/settings.js)

Declarative site settings, languages, grammars, ranking engine weights, hub layout, collections, and redirect rules.

Tests & tooling (spec/**, eslint.config.js, .prettierrc, bin/console)

Vitest unit tests with factories for models/presenters/serializers, plus lint/format configuration and a REPL console.

The past few weeks were almost entirely housekeeping, with the team updating the project's underlying software building blocks (called dependencies) to newer, safer versions. One update to an image-processing tool was rolled back after being applied, suggesting it caused a problem. No new features or user-facing changes shipped during this stretch.

Week by week

2026-08-03A quiet week with a single routine security-style update to a configuration-file library.latest1 change

Chore

Updated js-yaml library

The js-yaml tool, which reads configuration files, was upgraded from version 4.3.0 to 4.3.1 for a small maintenance fix.

2026-07-27Several dependency updates went in, but one image-tool upgrade was undone after causing trouble.3 changes

Chore

Updated postcss styling tool

The postcss tool used for processing website styles was bumped from 8.5.15 to 8.5.24.

Fix

Reverted sharp and astro upgrade

An earlier upgrade to the sharp image processor and astro site builder was rolled back, likely because it broke something.

Chore

Updated esbuild and vite build tools

Two tools that compile and bundle the project's code, esbuild and vite, were refreshed to newer versions.

2026-07-20A busy maintenance week with five dependency upgrades across the project's toolkit.5 changes

Chore

Updated js-yaml library

The js-yaml configuration reader was upgraded from 4.2.0 to 4.3.0.

Chore

Updated brace-expansion package

A small helper library called brace-expansion was bumped from 1.1.11 to 1.1.16, likely for a security fix.

Chore

Updated immutable library

The immutable data-structure library was upgraded from 5.1.1 to 5.1.9.

Chore

Updated svgo graphics optimizer

The svgo tool that shrinks SVG image files received a minor patch from 4.0.1 to 4.0.2.

Chore

Upgraded sharp and astro

The sharp image processor and astro site builder were both moved to newer versions (later reverted the following week).

03 · Security check

Dependencies and code review

528 dependencies scanned

Dependency advisories

Security Watch

4 vulnerable packages (6 advisories) across 528 scanned dependencies.

warninghigh · npmfixed in 5.0.8

brace-expansion 1.1.16

2 advisories. Fixed in 5.0.8.

How it can be abusedAn attacker who can get a crafted filename or pattern into the repo, for example through a pull request adding snippet files, could make the build expand it into enormous amounts of data and crash the process with out-of-memory errors. Only the site's own developers and CI builds are affected during the prepare/build step, since there is no running server using this code.

  • highGHSA-mh99-v99m-4gvgbrace-expansion: DoS via unbounded expansion length causing an out-of-memory process crash
  • highGHSA-rgw5-rvv9-x895brace-expansion: DoS via unbounded intermediate arrays, bypassing the CVE-2026-14257 mitigation
warninghigh · npmfixed in 3.15.0

js-yaml 3.14.1

2 advisories. Fixed in 3.15.0.

How it can be abusedThis library parses YAML during the build step, and specially crafted YAML files with merge keys or omap tags can make parsing extremely slow, stalling the build. An attacker would need to get a malicious YAML file into the repository (for example via an accepted pull request), so only site maintainers running builds are exposed, not website visitors.

  • highGHSA-52cp-r559-cp3mjs-yaml: YAML merge-key chains can force quadratic CPU consumption
  • highGHSA-5p4m-2wfm-xmqjJS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026-59870 fix not backported
warninghigh · npmfixed in 3.3.18

nanoid 3.3.16

1 advisory. Fixed in 3.3.18.

How it can be abusedThis flaw only matters if code calls nanoid's custom generator with a zero length, which makes it spin forever and hang the process. In this site nanoid is only a build-time helper for making short ids during the prepare step, so an attacker has no way to trigger it; at worst a developer could freeze their own build.

warninghigh · npmfixed in 0.35.0

sharp 0.34.2

1 advisory. Fixed in 0.35.0.

How it can be abusedSharp uses a native image library that can be crashed or made to run malicious code by a crafted image file during processing. Here it only optimizes cover images from your own repository during the build step, so an attack would require someone to sneak a malicious image into the content, affecting whoever runs the build rather than site visitors.

  • highGHSA-f88m-g3jw-g9cjsharp inherited vulnerabilities in libvips: CVE-2026-33327, CVE-2026-33328, CVE-2026-35590, CVE-2026-35591

Code review

No concrete code-level issues confirmed.

Get this report every week for your repos.

GitZoid learns each repo, reports what changed, and flags what needs attention. One flat price for the whole team.

$19 a month, flat · First 10 outputs free · No card required