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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@neutronappsio/cirrus

v1.1.0

Published

Terraform form generator to bridge the gap between user requests and IaC!

Readme

🧩 Cirrus JSON Schema Documentation for Dynamic Form Configuration

This schema format defines a way to dynamically describe form fields, validations, conditions, and nested list structures. It's designed for form-driven workflows for configuring infrastructure-as-code, specifically using Terraform.


📋 Schema Structure Overview

Each schema is an array of field definitions. Each field object describes:

  • Field type and UI metadata
  • Validation rules
  • Conditional logic
  • Default values
  • Nested list inputs

🔑 Common Field Properties

| Property | Type | Required | Description | | ------------- | ---------- | -------- | --------------------------------------------------------------------------------------------------------------------- | | id | string | ✅ | Unique identifier used for data access and conditional logic. | | type | string | ✅ | One of: text, option, multi, list. | | label | string | ✅ | Label shown to the user. | | description | string | ✅ | Helper text shown in the UI. | | default | any | ❌ | Default value (varies by type). | | validation | string[] | ❌ | Validation rules. See Laravel Validation Docs. | | condition | string | ❌ | Conditional visibility expression using JEXL. | | inCode | boolean | ❌ | If false, excludes field from generated code. Default is true. |


🧱 Field Types

🔤 text

Simple string input.

{
  "id": "akv_name",
  "type": "text",
  "label": "Name",
  "description": "The name of your Azure Key Vault",
  "default": "akv",
  "validation": ["required", "max:5"]
}

🎛️ option

Single-choice dropdown.

{
  "id": "akv_location",
  "type": "option",
  "label": "Location",
  "description": "Where to deploy",
  "options": [
    { "label": "East US", "value": "EastUS" },
    { "label": "West US", "value": "WestUS" }
  ],
  "default": { "label": "East US", "value": "EastUS" },
  "validation": ["required", "in:EastUS,WestUS"]
}

multi

Multi-select using checkboxes or tags.

{
  "id": "akv_zones",
  "type": "multi",
  "label": "Zones",
  "description": "Availability zones",
  "options": [
    { "label": "One", "value": 1 },
    { "label": "Two", "value": 2 },
    { "label": "Three", "value": 3 },
    { "label": "Four", "value": 4 }
  ],
  "default": [1, 2],
  "validation": ["required", "array", "list", "min:1", "max:3", "distinct"]
}

📄 list

A repeatable array of field groups (e.g., multiple storage accounts).

{
  "id": "sa_list",
  "type": "list",
  "label": "Storage Accounts",
  "description": "Configure multiple storage accounts",
  "fields": [
    {
      "id": "sa_location",
      "type": "option",
      "label": "Location",
      "description": "Deployment region",
      "options": [
        { "label": "East US", "value": "EastUS" },
        { "label": "West US", "value": "WestUS" }
      ],
      "default": { "label": "East US", "value": "EastUS" },
      "validation": ["required", "in:EastUS,WestUS"]
    },
    {
      "id": "sa_nickname",
      "type": "text",
      "label": "Nickname",
      "description": "Name to reference this account",
      "default": "acct",
      "validation": ["required", "max:5", "distinct"],
      "condition": "list.sa_location == 'WestUS' && includes(list.sa_zones, 1)"
    },
    {
      "id": "sa_zones",
      "type": "multi",
      "label": "Zones",
      "description": "Availability zones for this account",
      "options": [
        { "label": "One", "value": 1 },
        { "label": "Two", "value": 2 },
        { "label": "Three", "value": 3 },
        { "label": "Four", "value": 4 }
      ],
      "default": [1, 2],
      "validation": ["required", "array", "list", "min:1", "max:3", "distinct"]
    }
  ],
  "default": [
    {
      "sa_location": "WestUS",
      "sa_nickname": "stor",
      "sa_zones": [1]
    },
    {
      "sa_location": "EastUS",
      "sa_nickname": "hello",
      "sa_zones": [1]
    }
  ],
  "validation": ["required", "array", "min:2", "max:5"]
}

✅ Validation Rules

Validation rules follow the Laravel validation syntax.

Common examples:

| Rule | Description | | ---------- | ----------------------------------- | | required | Field must have a value | | max:N | Maximum length (text) or array size | | min:N | Minimum length (text) or array size | | distinct | Values must be unique | | array | Must be an array | | list | Required for multi/list types | | in:A,B,C | Must match one of the listed values |


⚙️ Conditional Logic

The condition field uses JEXL expressions to control dynamic visibility.

Syntax Examples

  • Show if "Three" is selected in zones:

    includes(form.akv_zones, 3)
  • Inside a list, show field only when location is WestUS and zone 1 is selected:

    list.sa_location == 'WestUS' && includes(list.sa_zones, 1)

Context

| Scope | Prefix | | ----------- | ------- | | Root-level | form. | | Inside list | list. |


🔧 inCode Flag

If present and set to false, the field is excluded from generated outputs like Terraform or ARM templates.

"inCode": false

Useful for UI-only helper fields or configuration metadata.


🧰 Example Summary

Root-Level Example (AKV)

{
  "id": "akv_name",
  "type": "text",
  "label": "Name",
  "description": "Key Vault name",
  "default": "akv",
  "validation": ["required", "max:5"],
  "condition": "includes(form.akv_zones, 3)"
}

Nested List Example (SA)

{
  "id": "sa_list",
  "type": "list",
  "fields": [
    {
      "id": "sa_location",
      "type": "option",
      ...
    },
    {
      "id": "sa_nickname",
      "type": "text",
      "condition": "list.sa_location == 'WestUS' && includes(list.sa_zones, 1)"
    },
    {
      "id": "sa_zones",
      "type": "multi",
      ...
    }
  ]
}