Setting Up Your Machine
Any IDE can be used for working with HubX although though generally most are VS Code.
Aside from an IDE the key areas to ensure are setup are the following:
Cova (Retail Innovation Labs) GitHub.
Access can be requested via Retail Innovation Labs GitHub can be requested by emailing webdev@covasoft.net
Azure DevOps
Developers can request access to Azure DevOps via ITSupport@iqmetrix.com. Once you have access, a request can be made to the Web Team to ensure you are set up as a Contributor on the Cova Web Team Project.
Installing Node.js
Node.js is required to build the HubX web projects. It is currently recommended to use Node 18.x. If you need to switch versions of Node.js, for example to work on Hub v1 applications, it is recommended to install NVM for Mac/Linux and NVM Windows for Windows 10 machines.
Setting up access to the Cova Web NPM Repository
In order to retrieve the NPM artifacts from the cova web npm registry, an .npmrc (Mac/Linux) or npmrc (Windows) file needs to be created in the users home directory contain the access token to allow access to the repository. If you already have a Personal Access Token generated for the IQMetrix NPM Registry, this can be used for the covaweb feed too.
For Mac/Linux, this file should be located in the following location: ~/.npmrc, for Windows it should be located at: C:\Users\%username%\AppData\Roaming\npm\etc\npmrc
Step 1
Copy the code below to your user .npmrc.
; begin auth token
//pkgs.dev.azure.com/iqmetrix/_packaging/covaweb/npm/registry/:username=iqmetrix
//pkgs.dev.azure.com/iqmetrix/_packaging/covaweb/npm/registry/:_password=[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]
//pkgs.dev.azure.com/iqmetrix/_packaging/covaweb/npm/registry/:email=npm requires email to be set but doesn't use the value
//pkgs.dev.azure.com/iqmetrix/_packaging/covaweb/npm/:username=iqmetrix
//pkgs.dev.azure.com/iqmetrix/_packaging/covaweb/npm/:_password=[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]
//pkgs.dev.azure.com/iqmetrix/_packaging/covaweb/npm/:email=npm requires email to be set but doesn't use the value
; end auth token
Step 2
Generate a Personal Access Token with Packaging read & write scopes.
Step 3
Base64 encode the personal access token from Step 2.
One safe and secure method of Base64 encoding a string is to:
- From a command/shell prompt run:
node -e "require('readline') .createInterface({input:process.stdin,output:process.stdout,historySize:0}) .question('PAT> ',p => { b64=Buffer.from(p.trim()).toString('base64');console.log(b64);process.exit(); })"
- Paste your personal access token value and press Enter/Return
- Copy the Base64 encoded value
Step 4
Replace both [BASE64_ENCODED_PERSONAL_ACCESS_TOKEN] values in your user .npmrc file with your personal access token from Step 3.