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

@nx-extensions/helm

v0.7.1

Published

First class support for Helm charts in Nx.

Downloads

5,352

Readme

@nx-extensions/helm

First class support for Helm charts in Nx.

The Nx Plugin for Helm provides a set of executors, generators, and utilities to help you manage Helm charts in your Nx workspace.

Features

  • [x] Generate Helm charts for your applications
  • [x] Add dependencies to your Helm charts
  • [ ] Lint Helm charts
  • [ ] Test Helm charts
  • [ ] Version Helm charts
  • [x] Package Helm charts
  • [x] Publish Helm charts

Getting Started

Prerequisites

Before you can use the Nx Plugin for Helm, you need to have Helm installed on your machine. You can install Helm by following the instructions here.

Install the Nx Plugin for Helm

To get started with the Nx Plugin for Helm, run the following command:

npm install --save-dev @nx-extensions/helm

Add a Helm chart to your project

To get started with the Nx Plugin for Helm, run the following command:

nx g @nx-extensions/helm:chart --name=my-chart --project=my-app

This will generate a new Helm chart for your project under {projectRoot}/chart directory and configure the helm target in your project project.json file.

{
  "name": "my-app",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "sourceRoot": "apps/my-app/src",
  "projectType": "application",
  "tags": [],
  "targets": {
    [...]
    "helm": {
      "executor": "@nx-extensions/helm:package",
      "outputs": ["{options.outputFolder}"],
      "options": {
        "chartFolder": "apps/test-project/chart",
        "outputFolder": "{workspaceRoot}/dist/charts/{projectRoot}",
        "push": false,
        "remote": "oci://localhost:5000/helm-charts",
        "dependencies": {
          "update": true,
          "build": true,
          "repositories": []
        }
      }
    }
  }
}

Add a Dependency to your Helm chart

You can also add a dependency to your Helm chart using the @nx-extensions/helm:dependency generator:

nx g @nx-extensions/helm:dependency --project=my-app --chartName=nginx --chartVersion=18.7.1 --repository=https://charts.bitnami.com/bitnami --repositoryName=bitnami

This will add the dependency to your Helm chart in the Chart.yaml file and add a entry to the repositories array in the project.json file.

Chart.yaml

[...]
dependencies:
  - name: nginx
    version: 18.1.7
    repository: 'https://charts.bitnami.com/bitnami'

project.json

{
  "name": "my-app",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "sourceRoot": "apps/my-app/src",
  "projectType": "application",
  "tags": [],
  "targets": {
    [...]
    "helm": {
      "executor": "@nx-extensions/helm:package",
      "outputs": ["{options.outputFolder}"],
      "options": {
        "chartFolder": "apps/test-project/chart",
        "outputFolder": "{workspaceRoot}/dist/charts/{projectRoot}",
        "push": false,
        "remote": "oci://localhost:5000/helm-charts",
        "dependencies": {
          "update": true,
          "build": true,
++        "repositories": [
++          {
++            "name": "bitnami",
++            "url": "https://charts.bitnami.com/bitnami"
++          }
++        ]
        }
      }
    }
  }
}

The package executor will automatically run helm repo add for each repository defined in the repositories array before packaging the chart.

Build and package your Helm chart

To build and package your Helm chart, you can use the nx run command to execute the helm target defined in your project:

nx run my-app:helm

This will build and package your Helm chart and output the packaged chart in the dist/charts/{projectRoot} directory under the workspace root.

Optionally, you can tell the executor to update and/or build the chart dependencies by setting the dependencies.update and dependencies.build option to true or false. This is going to tell the executor to respectively run helm dependency update and/or helm dependency build before packaging the chart.

Publish your Helm chart

By default the executor options will default to push: false and remote: oci://localhost:5000/helm-charts. To publish your Helm chart to a custom registry, update the project.json file with the desired remote and set push: true. The chart will be pushed automatically to the defined registry after it gets packaged.

{
  "name": "my-app",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "sourceRoot": "apps/my-app/src",
  "projectType": "application",
  "tags": [],
  "targets": {
    [...]
    "helm": {
      "executor": "@nx-extensions/helm:package",
      "outputs": ["{options.outputFolder}"],
      "options": {
        "chartFolder": "apps/test-project/chart",
        "outputFolder": "{workspaceRoot}/dist/charts/{projectRoot}",
--      "push": false,
++      "push": true,
--      "remote": "oci://localhost:5000/helm-charts"
++      "remote": "oci://localhost:5000/my-charts"
        "dependencies": {
          "update": true,
          "build": true
          "repositories": []
        }
      }
    }
  }
}