Skip to content

Latest commit

 

History

History
79 lines (46 loc) · 1.73 KB

DEVREADME.md

File metadata and controls

79 lines (46 loc) · 1.73 KB

Dev setup

Pre-Reqs

  1. Have the axway and axway central cli already installed
npm install -g axway
axway pm install @axway/axway-central-cli 
  1. Link your new/current extension to the central CLI
axway central config set extensions.<extension name> <path to the directory of your extension>

Adding/Removing config options

  1. Under src/commands/config/set.ts add/remove any config options you want.

  2. Under types.ts add/remove the corresponding config options to the ConfigKeys object. The formatting really seems to matter here.

Example: adding 'mySetting'

// set.ts
--my-setting [value]": "my setting"

// types.ts
MY_SETTING = "mySetting"

Modifying the Generate method

Under src/commands/resources/generate.ts is where you add/shoehorn the generate logic. We currently have this flow.

  1. Get/validate the config

  2. Fetch the apis from service

  3. Create the files

Debugging

There are several ways you can debug a new/current extension. Several extensions come with a launch file you can use to debug in vscode. Alternatively, you can use the below method:

  1. Add your breakpoints with 'debugger' statements

  2. Modify the axway cli

// get path to cli
which axway

// add debug setting to node
vim <path to cli>
#!/usr/bin/env node --inspect-brk
  1. Open this uri in chrome

chrome://inspect

  1. click 'Open dedicated DevTools for Node'

  2. Run the CLI command you're debugging

axway central azure-extension config list

Example commands

  1. Azure list config axway central azure-extension config list

  2. Azure set tenantid axway central azure-extension config set --tenant-id=<tenant>

  3. Azure generate resources axway central azure-extension resources generate