Setting Up the Investec Online Plugins on Your Machine
Follow these instructions to set up the Investec Online Plugins on your local machine:
1. Clone the Repository
Clone the repo from the following link: https://dev.azure.com/investec/client-channel-tech/_git/cxt-channel-investec-plugins
2. Install Dependencies
Next, run the following command in your terminal:
npm installYou are now ready to start working with the Investec Online Plugins!
3. Optional: Add your own plugin
Command to create a new plugin
nx g lib my-pluginfor all the questions asked, make sure you select the options that include vite.
Configure the package.json file
In the package.json file, change the package name to the following naming standard
{
"name": "@investec/plugins-my-plugin"
}and remove the private: true flag.
Configure the plugin pipeline
In the root of your plugin folder , add a new .azure-pipelines.yml file. Now copy the following code snippet into the file and replace all instances of my-plugin with your plugin name.
trigger:
branches:
include:
- main
paths:
include:
- feature-library/*
pool:
vmImage: 'ubuntu-latest'
variables:
- group: cxt-channel-investec-online-apps-cf-config
steps:
- task: NodeTool@0
inputs:
versionSpec: '18.x'
displayName: 'install node.js 18.x'
- task: npmAuthenticate@0
inputs:
workingFile: '.npmrc'
displayName: 'npm authenticate'
- script: |
echo "npm install.."
npm install
echo "Build package"
npx nx build my-plugin
displayName: 'Build @investec/plugins-my-plugin'
- task: Npm@1
displayName: Publish Package
inputs:
command: 'publish'
workingDir: './dist/my-plugin'
publishRegistry: 'useFeed'
publishFeed: 'af1d0aa9-75bb-4ec8-8c52-a8e3bedde160'Configure the azure pipelines
Create a PR for your new plugin and once approved you need to configure the pipeline in the azure devops portal.
- Go to the Azure DevOps portal
- Click on the
New Pipelinebutton - Select the
Azure Repos Gitoption - Select the
cxt-channel-investec-pluginsrepo - Select the
Existing Azure Pipelines YAML fileoption - Select the
mainbranch - Select the
feature-library/my-plugin/.azure-pipelines.ymlfile - Click on the
Runbutton