1.0.0 • Published 3 years ago

assetfoundry-dataviz v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
3 years ago

AssetFoundry Dataviz lib

The main goal

JS datavisualization library for Angular made for the Asset Foundry project

Dependencies

this relies on 3 libs (+Angular)

  • ngx-charts
  • D3.js
  • agGrid

The process

Angular lib creation

For Angular, pre-existing commands helps a lot

ng new assetfoundry-dataviz --create-application=false

cd assetfoundry-dataviz
ng generate library dataviz

Generates a load of essential files.

You should not combine it with a npm init or a git init, those files will be created. As we are publishing on a special registry, the package.json (at the root) must be modified

{
  "name": "@ifs-alpha/assetfoundry-dataviz",
  "version": "1.0.2",
  "repository": {
    "type": "git",
    "url": "git://github.com/ifs-alpha/assetFoundry-dataviz.git"
  },
  "author": "ifs-quimerchewen",
  "publishConfig": {
    "registry": "https://npm.pkg.github.com"
  }
}
  • author: must belong to the Github org (beware not to be connected with your personal Github account)
  • name: begin with a @ and contain no capital letter. It should pass the regular expression "@([a-z]|-|[0-9])+\/([a-z]|-|[0-9])+" (see this quick online demo), merely a lowered version of the github repo name. It won't work well otherwise. There is no issue if the repo name have a different casing, as Github manages it correctly (try typing a repo name with random case, it will redirect to the good repo).
  • publishConfig: very important : otherwise, it will be published in public on npm

Login to Github Packages

You must be logged to the correct registry before publishing.

npm login
npm whoami --registry https://npm.pkg.github.com/

Update package

Change the version in package.json (respect these "semver" conventions)

Building & publishing

ng build --prod # Don't forget the flag !
git tag vX.Y.Z # good practice, use semver here too
npm publish --registry https://npm.pkg.github.com/ # beware not to publish to npm !

Using the package

Create a .npmrc file at the root of the app. Add the following line: registry=https://npm.pkg.github.com/

Then run

npm install @ifs-alpha/assetfoundry-dataviz

and import components in your Angular module