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

@azbake/ingredient-acs

v0.0.6

Published

Ingredient for managing Azure Communications Service

Downloads

157

Readme

Follow these basic steps to setup a new ingredient project:

  1. Copy the ingredient-template folder into a new location

    a. If creating an HCHB offical ingredient, that should be copied into the ingredient root folder, and renamed approriately.

  2. Modify the package.json file and fill out at least the name, which should be a unique npm package.

    a. If an offical HCHB ingredient, should be under the @azbake/ moniker

  3. Run npm install in the new ingredient folder.

  4. Modify src/index.ts and set the NS properties for the types you are developing.

    a. Functions should set a functiosNS property to the namespace you want to use, as well as set functions to your functions objet.

    b. A Plugin should set pluginNS to your unique plugin namespace, along with the plugin object.

    c. You can define one, or both.

  5. Define either your plugin or function code and then run npm run compile, to make sure everything compiles.

  6. When you are ready to publish to an NPM repository, you can run npm run upload. This will compile, package, version, and publish. You must be logged into the npm repo before executing this for the publish to work.

    a. If developing for our mono-repo offical ingredients. You can not self publish. Instead submit a Pull Request with just your ingredient changes. If accepted it will get auto versioned and published.

Understanding BakeVariables

Bake.yaml recipe files support a concept of expressions. These are specially formatted string values which describe sandboxed javascript to execute and resolve a value. BakeVariables are used for all variable, and parameter based fields in the recipe; as well as other properties when noted.

Within a plugin, or a function object, you must resolve a property directly if it's a BakeVariable, otherwise you will not access the correct value. Resolving a BakeVariable requires the current deployment execution context so that the right resolution can happen:

//ingredient property source is a BakeVairbale. We call BakeVariable.value(ctx) to return
//the correct resolved value so we can use it.
let source: string = this._ingredient.properties.source.value(this._ctx)

Developing a plugin ingredient

A plugin ingredient must extend BaseIngredient from "@azbake/core". It must also implement:

public async Execute(): Promise<void>{}

Within your execute method you have access to the current deployment context, which implements DeploymentContext from "@azbake/core"

this._ctx

This will give you access to things like the logger (which is context aware of current region/ingredient/etc.), the bake package config, environment variables (minus login credentials), The current region for the execution (if needed around primary/secondary ingredient logic), The current azure AuthToken that can be passed to Azure APIs, as well as the current Ingredient object which contains the parameters:

this._ingredient.properties.parameters
this._ingredient.properties.source

note: source and parameter values are BakeVariables and must be resolved with the current context

Your plugin will execute with an isolated context for each region that should be deployed ast the environment level, and once for every entry in the bake.yaml file for the recipe.

You can also access function objects of any referenced ingredients from the recipe. CoreUtils is always avalible to a recipe, even if not directly included.

let util = IngredientManager.getIngredientFunction("coreutils", this._ctx)