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

bvapigee

v0.0.1

Published

Apigee CLI

Downloads

14

Readme

apigee-cli

CLI tool desinged to aid the CI/CD process of Apigee artifacts, even across different Apigee instances.

Installation

npm install -g git+ssh://[email protected]:bazaarvoice/apigee-cli.git

Usage

Terminology

  • export: download artifact from the specified Apigee source instance
  • include: using the previously exported artifacts, add the respective files into your Apigee configuration source
  • package: using the previously included sources, package them so that they can be imported into an Apigee instance
  • import: create/update artifact in the specified Apigee destination instance

config.json

Create config.json from config.json.example

  • credentials: default credentials to be used for source and destination configurations
  • source: defines Apigee instance which will be queried
    • can specify own credentials configuration
  • destination: defines Apigee instance which will receive updates
    • can specify own credentials configuration
  • directory: specifies the directories which will be used for the various artifact related processes
  • plugins: specify the globally installed plugins to load

Methodology

This tool does not perscribe much about how CI/CD must be done. It's only requirements are that you specify known locations of where artifacts will be exported, included, and packaged. Given those facts, any number of custom CI/CD processes can be implemented.

Proxy Cloning

Apigee Edge UI does allow for multiple developers to edit Apigee artifacts in a maintanable manner. Developers can inadvertantently make conflicting changes to artifacts. For this reason the concept of proxy cloning has been added to this tool. Given a proxy name and a label, a unique identifier, a clone of the proxy can be created alongside all of its dependencies (sharedflows, kvms, etc). All of the dependencies will also adorn the specified label.

A developer can now make and test changes in an isolated way via the Apigee Edge UI without having to worry if another developer is also making changes.

Basic Proxy Cloning Workflow
  1. Clone desired proxy
apigee proxy clone create myproxy mylabel
  1. Deploy desired proxy
apigee proxy clone deploy myproxy mylabel
  1. Make changes to proxy clone in Apigee Edge UI
  2. Export changes made to proxy clone
apigee proxy clone export myproxy mylabel
  1. Apply the changes to source
apigee proxy include --name myproxy
  1. Commit changes to source control
  2. Package and deploy updated proxy
apigee proxy package --name myproxy
apigee proxy import --name myproxy

Commands

Every command has a help subcommand, use it to get details about the command:

apigee help

Any value defined in the config.json can be overriden via CLI arguments:

apigee kvm list --source.organization <org> --source.environment <env>

Plugins

Plugins are yargs commands exported from an npm package.

A plugin package needs to export a yargs CommandModule object which apigee-cli will load and expose the underlying commands.

  1. Export a yargs CommandModule from plugin package
import yargs from 'yargs';

const Command: yargs.CommandModule = {
    command: 'bv <command>',
    describe: 'bazaarvoice commands',
    builder: (yargs: yargs.Argv) => {
        return yargs
            .commandDir("cmds");
    },
    handler(/*args: any*/) { }
};

export = Command;
  1. Install plugin globally for apigee-cli to be able to load
npm install -g your-plugin
  1. Add the plugin package to config.json
"plugins": ["your-plugin"]
  1. Your plugins commands are now available via apigee-cli:
apigee help

Development

  1. Fork the repo
  2. Clone your fork

Requirements

  • nvm for Node version management
    • brew install nvm
    • run nvm install and nvm use commands inside the project directory
      • the .nvmrc will be used to determine which node version to install and use
  • Visiual Studio Code for editing and debugging
    • brew cask install visual-studio-code