npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@r8s/flux-controller

v0.1.0

Published

FluxCD source controller for r8s TSX manifests

Readme

r8s FluxCD Controller

A FluxCD source controller that renders r8s TSX manifests directly to YAML.

How It Works

Git Repository (.tsx files)
    ↓
Flux GitRepository (clones to /data)
    ↓
r8s-controller (renders TSX → YAML)
    ↓
Flux Kustomization (applies rendered YAML)
    ↓
Kubernetes

Installation

1. Install the controller as a Flux Kustomization

# flux-system/r8s-controller.yaml
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
  name: r8s-manifests
  namespace: flux-system
spec:
  interval: 1m
  url: https://github.com/your-org/your-repo
  ref:
    branch: main
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: r8s-rendered
  namespace: flux-system
spec:
  interval: 10m
  path: ./rendered
  prune: true
  sourceRef:
    kind: GitRepository
    name: r8s-manifests
  postBuild:
    substituteFrom:
      - kind: ConfigMap
        name: cluster-vars

2. Add the r8s-controller as an init container

# patch the source-controller deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: source-controller
  namespace: flux-system
spec:
  template:
    spec:
      initContainers:
        - name: r8s-render
          image: ghcr.io/r8s-io/flux-controller:latest
          command:
            - r8s-controller
            - --source=/data
            - --output=/data/rendered
            - --verbose
          volumeMounts:
            - name: data
              mountPath: /data
      containers:
        - name: manager
          volumeMounts:
            - name: data
              mountPath: /data

Repository Structure

Your Git repository should look like this:

.
├── apps/
│   ├── web/
│   │   └── r8s.tsx          # Entry file
│   └── api/
│       └── r8s.tsx          # Entry file
├── infrastructure/
│   ├── databases/
│   │   └── r8s.tsx
│   └── ingress/
│       └── r8s.tsx
└── package.json             # With @r8s/* dependencies

Example r8s.tsx

import { Database } from '@r8s/recipes';
import { Ingress } from '@r8s/recipes';
import { WebService } from '@r8s/recipes';

export default function WebApp() {
  return (
    <>
      <Database name="web-db" storage="10Gi" />
      <WebService name="web" image="myapp/web:v1" port={3000} />
      <Ingress
        name="web"
        host="app.example.com"
        serviceName="web"
        tls={{ secretName: "web-tls", clusterIssuer: "letsencrypt" }}
      />
    </>
  );
}

Local Development

# Render locally
npx r8s-controller --source=./k8s --output=./rendered --verbose

# The rendered YAML will be in ./rendered/
ls rendered/
# apps/web/r8s.yaml
# apps/api/r8s.yaml

How It Works with Flux

  1. GitRepository clones your repo to /data
  2. Init container runs before the source-controller starts
  3. r8s-controller finds all r8s.tsx files and renders them
  4. Rendered YAML is written to /data/rendered/
  5. Kustomization reads from ./rendered/ path
  6. Kubernetes resources are applied

Benefits

  • No build step in CI — rendering happens in-cluster
  • Git is still source of truth — your .tsx files are versioned
  • Automatic updates — Flux watches git and re-renders on changes
  • Type safety — catch errors at build time, not deploy time
  • DRY — reuse components across environments

Alternative: Pre-render in CI

If you prefer, you can render in CI and commit the YAML:

# .github/workflows/render.yml
name: Render r8s manifests
on:
  push:
    paths:
      - '**.tsx'
jobs:
  render:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
      - run: npm ci
      - run: npx r8s-controller --source=./k8s --output=./rendered
      - run: |
          git config user.name "github-actions"
          git config user.email "[email protected]"
          git add rendered/
          git diff --quiet && git diff --staged --quiet || git commit -m "chore: render r8s manifests"
          git push