App center JS SDK
How to work with NPM in gar
Link
Concept
We provide our customers with two ways to use our SDK:
- downloading from a package manager (NPM, Yarn, etc.)
- downloading from static
So we have webpack configurations for each method.
Package manager
This configuration (webpack-config-npm.js) builds and puts files to ./dist/npm/
.
The final bundle contains:
index.js
— main js fileindex.d.ts
— typingsSM.d.ts
— typings
Static
This configuration (webpack-config-sdk.js) builds and puts files to ./dist/sdk/
The final bundle only has js file (sdk_<%SEMVER%>.js
).
NPM commands
Requires
node >= 18
Install dependencies
$ npm i
Linting
To lint *.ts files run script
$ npm run lint
also you can run this script with code fix
$ npm run lint:fix
Testing
To test code run script
$ npm run test
Build npm package
$ npm run build:npm
Build SDK for cdn
$ npm run build:sdk