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

@aserto/console-type-definitions

v0.8.90

Published

Automated generation of Aserto console-type-definitions.

Downloads

58

Readme

console-type-definitions

Automated generation of Aserto console-type-definitions.

Consuming the definitions

These definitions can be consumed by yarn from npm registry or directly from git using the following reference:

"devDependencies": {
    "@aserto/console-type-definitions": "^0.8.83",

Replace 0.8.83 with the version you would like to use.

Generation Process

Environment Variables

Generation is driven by generate.sh. To work with the latest specs available in aserto-dev/openapi-grpc, invoke generate.sh --fetch-specs with the following environment variables set:

  • USERNAME: GitHub username to use when authenticating with the GitHub REST API. Typically this is the value of <vault>/kv/github/USERNAME.
  • READ_WRITE_TOKEN: GitHub token enabling at minimum READ access to the GitHub REST API for the aserto-dev/grpc-openapi repo. Typically this is the value of <vault>/kv/github/READ_WRITE_TOKEN.
  • COMMIT_HASH: the aserto-dev/grpc-openapi commit for which to generate type definitions. This value is stored in downloaded/commit_hash.sh to enable build reproducability. That file is re-generated each time this repo's workflow is invoked by the GitHub Workflow Dispatch API.

generate.sh

When invoked with the --fetch-specs flag, generate.sh uses the Environment Variables to download the appropriate openapi.json files into the downloaded/specs directory. It then runs typescript-openapi to generate the type definitions. If no flag is provided, then it will run typescript-openapi with any existing openapi.json files in downloaded/specs.

Local Dev Experience

To run the script locally, set the USERNAME and READ_WRITE_TOKEN as described above and run ./generate.sh from the workspace root directory. Because the commit_hash is checked in, the build will be identical to how it occured in the GitHub Workflow to generate this commit. To debug an older build, simply check out that commit and follow these same steps.

GitHub Workflow

The GitHub Workflow is triggered as a workflow_dispatch. It expects to be provided with two required parameters:

  • grpc_openapi_commit_hash: The aserto-dev/grpc-openapi commit hash for which type definitions should be created. This value is used to download the appropriate version of the openapi.json files from that repo.
  • proto_version: The version tag of aserto-dev/proto that is represented by the grpc_openapi_commit_hash. This is used to tag the console-type-definitions commit with the same proto version.

Using these variables the GitHub Workflow runs the same ./generate.sh script, commits, and tags its results for downstream consumption. Run results are deterministic as explicit commit hash and version numbers are taken as explicit input parameters.