fbx-sdk
v0.7.1
Published
FancyBox SDK
Readme
Description
FancyBox SDK written in TypeScript.
Table of Contents
Getting started
Step 1: Set up the Development Environment
You need to set up your development environment before you can do anything.
Install Node.js and NPM (install the latest 16.x LTS version)
- on OSX use homebrew
brew install node - on Windows use chocolatey
choco install nodejs - with nvm
nvm install v16
Install yarn globally
npm install -g yarnIf you work with a mac, we recommend to use homebrew and nvm for the installation.
Husky commands
Git hooks are handled by husky and are installed by the prepare
script when you run yarn install.
If you use nvm, create a ~/.huskyrc file with the following content, so the hooks can find your
node installation:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"Step 2: Set up the project
Clone this repository, install the dependencies and create your local configuration files starting from the provided examples:
yarn install
cp .nvmrc.example .nvmrc
cp .env.example .env
cp .npmrc.example .npmrc.nvmrc— node version used by nvm..env— environment variables (npm credentials, broker credentials, Moleculer discovery options)..npmrc— npm auth token, needed only to publish the package.
The runtime configuration file
config/configs.<platform>-<arch>.jsonis created automatically by the SDK on the first run, copying the matching.examplefile when one is available.
Step 3: Start your App in development
Go to the project dir and start your app with this yarn script.
yarn start:devThis starts a local server using
nodemon, which will watch for any file changes and will restart the server according to these changes.
Build
Go to the project dir and build your app with this yarn script.
yarn buildThe bundle is generated in the ./lib folder. To build for the linux/arm target use yarn build:arm.
Static analysis is run with:
yarn lint
yarn typecheckTest
yarn test # all the test suites
yarn test:unit
yarn test:integration
yarn test:e2e
yarn test:coverageThe
pre-pushgit hook runs the whole test suite before pushing.
Run test script
NODE_ENV=development node -r ts-node/register ./scripts/test_script.tsPublish on NPM (2FA required)
Add your npm token in the .npmrc file and then run the following script, which builds the library
and publishes it. You will be asked for the 2FA code.
./publish.sh