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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bertelli.luca/helm-schema

v1.3.0

Published

[JSON Schema](https://json-schema.org) generator for your [HELM charts](https://helm.sh).

Downloads

2

Readme

@bertelli.luca/helm-schema npm (scoped) Publish demo Tests n publish

JSON Schema generator for your HELM charts.

Project forked from: https://github.com/SocialGouv/helm-schema

Demo: https://banshee86vr.github.io/helm-schema

Usage

Example values.yaml, following JSDoc standards

# @param {object} smtp Your SMTP setup
smtp:
  # @param {string} host SMTP hostname
  host:
  # @param {number} [port] SMTP port
  port: 587

# @param {enum{IfNotPresent,Always,Never}} pullPolicy Specifies whether a container image should be created
pullPolicy: IfNotPresent
# @param {pattern{^.*$}} name Application name validated by a pattern
name: JSONSchemaGenerator
# @param {integer{min=0,max=5}} replicaCount Number of possible replica with a fixed range
replicaCount: 3
# @param {string{minLength=10,maxLength=15}} username Username with limited length range
username: banshee86vr
# @param {string[CreateNamespace=true,Prune=false,SkipDryRunOnMissingResource=true]} syncOptions Options allow you to specify whole app sync-options
syncOptions: []

# Setup your securityContext to reduce security risks, see https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
# @param {https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.24.0/_definitions.json#/definitions/io.k8s.api.core.v1.PodSecurityContext} [securityContext]
securityContext:

To generate a JSON schema from your values.yaml :

npx @bertelli.luca/helm-schema -f values.yaml

Or via TS :

import { toJsonSchema } from "@bertelli.luca/helm-schema";

import yaml from "./values.yaml";

const schema = toJsonSchema(yaml);

You get such JSON schema in result :

{
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema",
  "required": ["pullPolicy", "name", "replicaCount", "username"],
  "properties": {
    "pullPolicy": {
      "type": ["string", "boolean", "number", "object", "array"],
      "enum": ["IfNotPresent", "Always", "Never"],
      "title": "Specifies whether a container image should be created",
      "default": "IfNotPresent"
    },
    "name": {
      "type": "string",
      "pattern": "^.*$",
      "title": "Application name validated by a pattern",
      "default": "JSONSchemaGenerator"
    },
    "replicaCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 5,
      "title": "Number of possible replica with a fixed range",
      "default": "3"
    },
    "username": {
      "type": "string",
      "minLength": 10,
      "maxLength": 15,
      "title": "Username with limited length range",
      "default": "banshee86vr"
    },
    "syncOptions": {
      "type": "array",
      "default": [
        "CreateNamespace=true",
        "Prune=false",
        "SkipDryRunOnMissingResource=true"
      ],
      "title": "Options allow you to specify whole app sync-options",
      "items": {
        "type": ["string"]
      }
    }
  }
}

This schema can then be used with your favorite editor for HELM values validation.

⚠️ Be sure to add an $id to the schema if its meant to be referenced from other schemas

Dev

update snapshots : yarn snapshots