Use Monite SDK to embed invoicing and payables powered by Monite into your products. The SDK provides React UI components for displaying and managing data served via the Monite API, as well as a standalone JavaScript API client for those whose prefer to build a UI from scratch.
This repository is a monorepo that contains several npm packages. The packages can be installed individually, so you can use only what you need. For the usage examples, see the READMEs of the individual packages (linked below):
-
@monite/sdk-react - A library of ready-to-use React UI components connected to the Monite API. Can be used to display and manage data served by the API.
-
@monite/sdk-api - A JavaScript library for making requests to the Monite API.
Before using any of these packages, you need to register a partner account with Monite, get API credentials, and generate an access token. For details, see Get started with Monite API.
This repository is a monorepo managed with Turborepo. It contains several npm packages.
yarn
# Build all packages
yarn build
# Run all dev servers for all packages
yarn dev
# Run storybook for UI React Widgets
# and all related packages in real-time
yarn storybook
We use Changesets to manage versioning and changelog entries in our mono-repository.
Run the yarn changeset add
command in your terminal.
This will prompt you with a series of questions about:
- Which packages π¦ you wish to release
- What type of semver bump (major, minor, patch) for each package
- A summary of the changeset
At the final step, it will show the changeset it will generate and confirm that you want to add it.
π‘ Pro Tip: Run command below as soon as you can formulate your changes as a sentence for the Changesets.
yarn changeset add
A changeset that major bumps @monite/sdk-api
would look like this:
---
"@monite/sdk-api": major
---
Add API URL as required parameter to SDK constructor
The changeset *.md
file with the content will be created in the .changeset
folder. If you wish to modify this file after it's generated, that's totally fine. Alternatively, if you prefer to write changeset files yourself, that's also acceptable.
π Note: Your Merge Request (MR) can contain several changeset files. All described changes will be added to the
CHANGELOG.md
of the changed packages.
Run the following command in your terminal.
yarn changeset add --empty
The --empty
flag allows you to create an empty changeset if no packages are being bumped. This is typically only required if you have CI that blocks merges without a changeset. A changeset created with the empty
flag would look like this:
---
---
By default, Changesets will commit the changeset files once you run the yarn changeset add
command. Don't forget to commit your changeset files as part of your pull request.
- Search on GitLab for the MR with the name Version Packages and associated with the
changeset-release/master
branch. - Review the MR and merge it.
- Profit! π
We could publish packages with the following options:
latest
- stable versionbeta
- for beta testers. This version is available for the public
To switch between release modes, you could use the following commands:
latest
- our default, but if we're inbeta
mode, you could switch tostable
by running:yarn changeset pre exit
- For the
beta
releases run:yarn changeset pre enter beta
Ensure you have a NPM account and this account is added to the @monite
organization.
- Login to NPM:
yarn npm login --scope monite
- Create new branch
packages-version-update(-<version>)
from themaster
branch. - Run
yarn install --immutable
- Run
yarn build
to validate that packages are building correctly. - Run Changesets versioning:
.changeset/version.sh
- Push your
packages-version-update(-<version>)
branch that were created on step 2 to theorigin
, and create a new Merge Request intomaster
. Review it and merge. - Checkout
master
branch - Run
yarn build
to rebuild packages with the updated versions. - Run command below and answer Y:
.changeset/publish.sh --create-git-tags
- Push Git tags to the
origin
:git push --follow-tags
- Profit! π
π« We don't use
changeset publish
. Instead, we utilize Yarn for publishing. This allows us to replace theworkspace:~
with a standard version syntax in our dependencies.
Add NPM Auth Token into ~/.yarnrc.yml
:
yarn config set 'npmScopes["monite"]' --home \
--json '{"npmAuthToken":"npm_YOUR_TOKEN", "npmAlwaysAuth":true}'
π Place
.yarnrc.yml
file in the directory above the application directory or in the user's $HOME directory. In this case,npmScopes
will be inherited by the Yarn.
Please read the documentation carefully before using pre-releases: π Changesets pre-releases
Manually publishing pre-releases is done in the same way as for regular releases. π
The only difference is that you will need to manually commit the pre.json
file (created on yarn changeset pre enter <tag>
).
β οΈ Warning! Pre-releases are very complicated! Using them requires a thorough understanding of all parts of npm publishes. Mistakes can lead to repository and publish states that are very difficult to fix.
Werf is an Open Source CLI tool that helps developers build and deploy applications using Docker or Kubernetes. It simplifies the process of creating Docker images and deploying them to Kubernetes clusters.
Sure, here is the updated section:
Before you can use Werf, you need to install it on your local machine. Follow these steps:
For macOS/Linux, you can use the following command:
curl -sSL https://werf.io/install.sh | bash -s -- --version 1.2 --channel stable
This command downloads and installs the stable version 1.2 of Werf.
To build all images defined in your werf.yaml
file, use the following command:
werf build --platform=linux/amd64 --dev
If you want to build a specific image, you can specify the image name. For example, to build
the sdk-demo-with-nextjs-and-clerk-auth
image, use:
werf build sdk-demo-with-nextjs-and-clerk-auth --platform=linux/amd64 --dev
MIT