A monorepo for the AppFit Javascript SDKs.
Included packages:
- Browser - NPM-hosted library for use with web apps
- CDN - a cdn-hosted bundle of the SDK. It wraps the browser library.
- Server - a server-based version of the SDK
- Shared - NPM-hosted library shared by other packages
- Install NVM and run
nvm use
to switch to the proper Node version - Install dependencies:
NOTE: This is a mono repo (it uses workspaces), so there is only one
npm i
node_modules
for all projects.
This monorepo uses NPM's workspaces functionality (see documentation).
You may reference an individual workspace with npm
by appending the option -w [workspace name]
to a command,
where [workspace name]
is the name
property in the workspace's package.json
file.
For example, to install a package (e.g. luxon
) to the server workspace, use:
npm i luxon -w @uptechworks/appfit-server-sdk
- Build all the packages:
npm run build
- Version & tag the packages (this will push the tags!):
Use the prompts to bump each package. It will ask for every package where it detects a change.
npm run deploy:version
- Push to
prod
branch to publish to NPM and update the CDN. - Update snippet in docs, if it was changed. (See section below)
- Test the packages:
npm run test
In the documentation, we give users a <script>
tag to insert in a webpage. This code loads AppFit from a CDN.
This tag is generated by the build and just needs to be pasted into the documentation.
- Run the build
- In the
cdn/dist/snippet
folder, is asnippet.html
- Copy the code into the documentation. It's probably good to add some newlines to make it clearer where to paste the API key.