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

@kumori/kumori-module-generator

v1.0.7

Published

## Build Component Module

Downloads

465

Readme

Kumori Module Generator

Build Component Module

const component: ComponentSpec = {
  type: "component",
  tenantId: "",
  accountId: "",
  environmentId: "",
  deploymentId: "",
  moduleDomain: "kumori.systems",
  moduleId: "http-echo",
  moduleVersion: [0, 0, 1],
  labels: {},
  bundleTargetDir: "",
  bundleTargetKind: "",
  channels: {
    client: ["client_channel1", "client_channel2", "client_channel3"],
    server: [
      { name: "server_channel1", port: 1234 },
      { name: "server_channel2", port: 4321 },
      { name: "server_channel3", port: 5432 },
    ]
  },
  cpuRequirements: 1234,
  memoryRequirements: 4321,
  registryUrl: "docker.io",
  imageTag: "mendhak/http-https-echo:31",
  registrySecret: "",
  defaultExecutable: {
    cmd: "test test1 test2 test3",
    entrypoint: "test test1 test2 test3"
  },
  config: {
    parameters: [
      { name: "EXAMPLE_ENV_VAR_1", defaultValue: "value1", type: "string" },
      {
        name: "my_file_content", defaultValue: `My value for the file 2. \\Testing \\text \\scape
My value for the file 2. \\Testing \\text \\scape
My value for the file 2. \\Testing \\text \\scape
My value for the file 2. \\Testing \\text \\scape
My value for the file 2. \\Testing \\text \\scape
My value for the file 2. \\Testing \\text \\scape
My value for the file 2. \\Testing \\text \\scape`, type: "string"
      },
      { name: "param3", defaultValue: "3", type: "number" },
      { name: "param4", defaultValue: "true", type: "bool" },
    ],
    resources: [
      { secret: { name: "my_secret1" } },
      { secret: { name: "my_secret2" } },
      { secret: { name: "my_secret3" } },
      { ca: { name: "my_ca" } },
      { volume: { name: "my_volume" } },
      { domain: { name: "my_domain" } },
      { port: { name: "my_port" } },
      { certificate: { name: "my_certificate" } },
    ]
  },
  environment: [
    { varName: "EXAMPLE_ENV_VAR_1", param: "EXAMPLE_ENV_VAR_1" },
    { varName: "EXAMPLE_ENV_VAR_2", param: "param2" },
    { varName: "EXAMPLE_ENV_VAR_3", param: "param3" },
    { varName: "EXAMPLE_ENV_VAR_4", param: "param4" },
    { varName: "SUPERSECRET", secret: "my_secret1" },
  ],
  filesystem: [
    { path: "/test/mount/volume", resourceVolume: "my_volume" },
    { path: "/test/mount/file", param: "my_file_content" }
  ]
}

await buildComponentModule(component)

Build Service Module

const service: ServiceSpec = {
  type: "service",
  tenantId: "",
  accountId: "",
  environmentId: "",
  deploymentId: "",
  moduleDomain: "kumori.systems",
  moduleId: "codeserver-service",
  moduleVersion: [0, 0, 1],
  labels: {},
  bundleTargetDir: "",
  bundleTargetKind: "",
  channels: {
    client: ["client_channel1"],
    server: [
      { name: "server_channel1" },
    ]
  },
  config: {
    parameters: [
      { name: "vscode_size", defaultValue: "5", type: "number" },
      { name: "vscode_data", defaultValue: "XYZ", type: "string" },
      { name: "vscode_userid", defaultValue: "ZYX", type: "string" },
    ],
    resources: [
      { certificate: { name: "main_inbound_servercert" } },
      { domain: { name: "main_inbound_serverdomain" } },
      { ca: { name: "main_inbound_clientcertca" } },
    ],
  },
  roles: [
    {
      name: "vscode",
      artifact: {
        artifactKind: "component",
        moduleDomain: "kumori.systems",
        moduleName: "porting/codeserver",
        moduleVersion: [1, 0, 4],
        artifactName: "./base",
        config: {
          parameters: [
            { name: "size", configParam: "vscode_size", type: "number" },
            { name: "protect", value: "false", type: "bool" },
            { name: "data", configParam: "vscode_data", type: "string" },
            { name: "userid", configParam: "vscode_userid", type: "string", },
          ],
          resources: [],
        }
      }
    },
    {
      name: "inbound",
      artifact: {
        artifactKind: "service",
        moduleDomain: "kumori.systems",
        moduleName: "builtins/inbound",
        moduleVersion: [1, 3, 0],
        artifactName: "./",
        config: {
          parameters: [
            { name: "type", value: "https", type: "string" },
            { name: "websocket", value: "true", type: "bool" },
            { name: "clientcert", value: "true", type: "bool" },
            { name: "certrequired", value: "false", type: "bool" },
          ],
          resources: [
            { certificate: { name: "servercert", configResource: "main_inbound_servercert" } },
            { domain: { name: "serverdomain", configResource: "main_inbound_serverdomain" } },
            { ca: { name: "clientcertca", configResource: "main_inbound_clientcertca" } },
          ],
        }
      }
    }
  ],
  topology: [
    {
      clientRole: "self",
      clientChannel: "server_channel1",
      serverRole: "vscode",
      serverChannel: "main",
    },
    {
      clientRole: "vscode",
      clientChannel: "psql",
      serverRole: "self",
      serverChannel: "client_channel1",
    },
    {
      clientRole: "inbound",
      clientChannel: "inbound",
      serverRole: "vscode",
      serverChannel: "main",
    }
  ],
}

await buildServiceModule(service)

Build Component Deployment Module

await buildComponentDeploymentModule({
  ...component,
  deploymentConfig: {
    parameters: [
      { name: "param1", value: "value1", type: "string" },
      { name: "param2", value: "value2", type: "string" },
      { name: "param3", value: "3", type: "number" },
      { name: "param4", value: "true", type: "bool" },
    ],
    resources: [
      { secret: { name: "my_secret1", resource: "real_secret1" } },
      { secret: { name: "my_secret2", resource: "real_secret2" } },
      { secret: { name: "my_secret3", resource: "real_secret3" } },
      { ca: { name: "my_ca", resource: "real_ca" } },
      { volume: { name: "my_volume", resource: "real_volume" } },
      { volume: { name: "my_volume2", volume: { size: 5, unit: "M" } } },
      { domain: { name: "my_domain", resource: "real_domain" } },
      { port: { name: "my_port", resource: "real_port" } },
      { certificate: { name: "my_certificate", resource: "real_certificate" } },
    ],
    scale: 3
  },
})

Build Service Deployment Module

await buildServiceDeploymentModule({
  ...service,
  deploymentConfig: {
    parameters: [
      { name: "vscode_size", value: "1", type: "number" },
      { name: "vscode_data", value: "Test_generator", type: "string" },
      { name: "vscode_userid", value: "Generator_test", type: "string" },
    ],
    resources: [
      { certificate: { name: "main_inbound_servercert", resource: "cluster.core/wildcard-vera-kumori-cloud" } },
      { domain: { name: "main_inbound_serverdomain", resource: "test_serverdomain" } },
      { ca: { name: "main_inbound_clientcertca", resource: "cluster.core/rootca" } },
    ],
    scale: {
      detail: {
        "vscode": 1
      }
    }
  },
})