web-data-manager v0.1.183
Web Data Manager
This library was formerly known as JSAF (aka JS App SDK).
Install
Recommend using Node version 12.4.1 but will work from version 10.
npm install
Building
npm run build
Compiles files web-data-manager.js
and web-data-manager.js.map
output to dist
.
Test
npm run test
Test files are tests/*.spec.ts
Setting Up Artifactory for dependencies
To allow your machine to authenticate, first make sure you have access to Switch's Artifactory instance, then generate the config with the following command with your own Artifactory login credentials:
curl -u <username>:<password> -s -XGET "https://af.switchmedia.asia/api/npm/auth" > .npmrc
You'll get back a few lines of configuration to add to the project's
.npmrc
which will look something like this:
_auth="ZmhhbmxleTpBUEFTak14UkNLMXRjRXV4U2JLMUNjNHRNRUs="
always-auth=true
email=some.dude@switch.tv
You should also add the following lines:
loglevel = "http"
registry=https://af.switchmedia.asia/api/npm/npm-repo
Dev Process and Build Automation
The practice for this repo is similar to our other repos in that it follows gitflow. The following things will then happen when a commit or merge is made in the Stash repo:
- When any commit pushed a build is triggered but just the linting and test tasks are executed.
- When a feature or defect branch is merged to develop a build is triggered with the linting, test and build tasks. When a branch is merged to master then the build is triggered, an artifact is packaged up then a deployment job is then triggered to push the artifact to Artifactory.
Interim Publishing Process
The publishing process was broken on Bamboo in the migration from Stash to GitLab. The eventual solution is to complete the migration and setup builds/publishing on GitLab but there is ongoing work there and some restructuring of projects will occur so in the meantime the publishing process is manual. The steps are as follows:
- Ensure the feature branches targeted for the build are merged to
develop
. - Increment the version on package.json and
run npm i
and push it todevelop
. - On GitLab to merge
develop
tomaster
. - Locally checkout
master
and sync with remote. - Run
npm build
to create the local/dist
folder (important). - Run
npm publish
to push to Artifactory (will need thevpn.switch.tv
VPN and.npmrc
in place to allow access for publishing)