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

generator-stackstate-lab

v0.1.3

Published

Yeoman generator for StackState extension and customisation projects.

Downloads

8

Readme

Yo Code - StackState Project Generator

We have written a Yeoman generator to help get you started with StackState extension and customization.

Install the Generator

Install Yeoman and the StackState generator:

npm install -g yo generator-stackstate-lab

Install pre-requisites for generated projects

Install PDM:

Linux

curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 -

macOS

brew install pdm

Run Yo Code

The Yeoman generator will walk you through the steps required to create your project prompting for the required information.

To launch the generator simply type:

yo stackstate-lab

StackState Agent Check Project Type

The StackState-Lab Generator can scaffold a new StackState Agent Check project using a basic check structure or a more complex structure that uses the StackState ETL Framework.

The generated project uses PDM for Python package and dependency management which supports the latest PEP standards. Especially PEP 582 support, no virtualenv involved at all. PDM Scripts drive the development life-cycle of the project.

| Command | Description | |----------------|----------------------------------------------------------------------------------------------------------------------------| | pdm install | Installs package and setups up PEP 582 environment | | pdm test | Runs unit tests | | pdm format | Code styling and linting performed by Black, FlakeHell and MyPy | | pdm build | Will transpile the custom agent check to Python 2.7 and create install zip | | pdm cleanAgent | Remove the custom StackState Agent Docker image used during development | | pdm buildAgent | Build a custom StackState Agent Docker to use during development | | pdm check | Dry-run custom agent check inside the StackState Agent container | | pdm serve | Starts the StackState Agent in the foreground using the configuration src/data/conf.d/ directory |

Command line

Usage:
  yo stackstate-lab:app [<destination>] [options]

Generates StackState extension and customization projects ready for development.

Options:
  -h,     --help                # Print the generator's options and usage
          --skip-cache          # Do not remember prompt answers                                                             Default: false
          --skip-install        # Do not automatically install dependencies                                                  Default: false
          --force-install       # Fail on install dependencies error                                                         Default: false
          --ask-answered        # Show prompts for already configured options                                                Default: false
  -t,     --projectType         # agent-check...
  -q,     --quick               # Quick mode, skip all optional prompts and use defaults
  -n,     --projectName         # Display name of the project
          --projectDescription  # Description of the project
          --url                 # StackState receiver api url. Example 'https://stackstate.mycompany.com/receiver/stsAgent'
          --apiKey              # StackState Api Key
  -acn,   --agentCheckName      # Name of the agent check
          --gitInit             # Initialize a git repo
          --useEtlFramework     # Use StackState ETL Agent Framework

Arguments:
  destination  # 
    The folder to create the project in, absolute or relative to the current working directory.
    Use '.' for the current folder. If not provided, defaults to a folder with the extension display name.
    Type: String  Required: false

Example usages:
  yo stackstate-lab                               # Create project in a folder with the project's name as prompted in the generator.
  yo stackstate-lab .                             # Create project in current folder
  yo stackstate-lab -acn=Hello -t=agent-check -q  # Create an Agent check project, skip prompts, use defaults.
  yo stackstate-lab -acn=Hello -t=agent-check --useEtlFramework -q  # Create an ETL Agent check project, skip prompts, use defaults.

Run Generator using Docker

If you don't want to install nodejs or any node packages, use this method to containerize the generator.

Go into your project directory.

cd <project directory>

Build the docker image from the docker file.

docker build -t stackstate-lab-generator .

Create a docker container with volumes.

docker run -v $(pwd):/usr/src/app stackstate-lab-generator

Local development

After making necessary changes, run npm link before running yo code to test the local version.

You can learn more about Yeoman generator development on its documentation website.

License

MIT