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.
Where possible all packages/apps should be written in typescript.
If this is the case to get started with a new package.
- Create a directory in the packages directory.
- Copy the contents from the
/examples/example-package
directory into the newly created directory. - Change the name of the package in the
package.json
, preferable to something starting with@meeco/
for most scenarios. - Run
npm install
from the root of this project - Run
npm build
from inside the directory of the new package to make sure it's all working. - 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.
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:
@meeco/vault-api-sdk
@meeco/identity-network-api-sdk
@meeco/keystore-api-sdk
@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