Skip to content

Meeco/js-sdk

Repository files navigation

Meeco TypeScript Tools

Main packages

CLI

JS SDK

File Storage SDK

Style Kit

Adding a Package to this Typescript Monorepo

In order to allow developers to import only the components they need we prefer to split up our libraries into multiple smaller ones. This is especially true when we are going to be adding a new (potentially large) dependency to a package.

For example, the large file handling library requires a dependency of Azure's storage package. If we were to add this to the main Meeco SDK might end up importing importing the storage package regardless of if they need to handle large files or not. Tree-shaking may help alleviate some of the issues but it does still mean that the dependency that gets pulled in is significantly bigger. It also means the SDK becomes a lot more complex and has a more polluted global scope.

Dependency Tree diagram

Where possible all packages/apps should be written in typescript.
If this is the case to get started with a new package.

  1. Create a directory in the packages directory.
  2. Copy the contents from the /examples/example-package directory into the newly created directory.
  3. Change the name of the package in the package.json, preferable to something starting with @meeco/ for most scenarios.
  4. Run npm install from the root of this project
  5. Run npm build from inside the directory of the new package to make sure it's all working.
  6. Add the name of the package along with the directory of the src to the root's tsconfig.json under "paths". e.g. "@meeco/example-package": ["packages/example-package/src"]

The above is just a basic guide to get started, feel free, if you're know what you're doing, to go off the rails a bit.

Updating a Package version of this Monorepo

To insure consistency we have to update a node_module version for all our packages. To make it easier there are several updating tools that does the job for you. It supports:

  1. @meeco/vault-api-sdk
  2. @meeco/identity-network-api-sdk
  3. @meeco/keystore-api-sdk
  4. @meeco/vc-api-sdk

To perform the update of a node_module you should just call:

npm update {node_module name from supports list}

Example:

npm update @meeco/vault-api-sdk