1.0.1 • Published 6 years ago
mpack v1.0.1
This is a tool to enable implementors to customise and package the settings to App Packs that can be deployed to an M4 database.
App Pack (or Data Pack)
To install, npm i -g mpack
Creating New Pack
Ensure git environment is setup as the mpack tool will automatically setup a new git repo.
- Create a new directory
- run
mpack newand answer the questions - Add your files, refer to best practices
- run
mpack uploadwhen you're done - Test the package in a M4 database
- When all working and final, run
mpack release
Update Existing Pack
- Make changes to the files or add new ones
- Review package.json for dependencies
- run
mpack uploadwhen you're done - Test the package in a M4 database
- When all working and final, run
mpack release
All Commands
Registry Commands
mpack loginmpack logoutmpack uploadmpack release
Once a pack is released, it cannot be undo.
Pack Commands
mpack newmpack configmpack depsmpack extractmpack make
Pack versioning
Minor and patch versions are auto updated.
Major versions usually indicates breaking-change which require manual updates.
Content of Packs
Pack files usually comes in a pair: pack@1.0.1.tgz and pack@1.0.1.patch.tgz (only applies to patch versions).
The versions here refer to semantic versioning (semver), which follow the same rules in NPM modules.
A Pack is a tar gzip file which contains the following minimum:
- package.json
- files
Structure of package.json
{
"name": "PackName",
"version": "1.0.0",
"description": '',
"deps": {
"pack": "version"
},
"path": "", // for pack development use, registry ignores this
"requires": {
"server": "version",
"web": "version"
},
"perms": [], // custom permissions for pack
"mpack": "mpack version"
}Notes
- Packs with minor and patch versions will be auto-updated
- Minor version bump do not have patch file, use minor to force full override (be careful)
- Packs with major version will need manual updates
- Major versions usually for major version of server
- Add / edit the dependencies
depsand requirementsrequiresto control the behavior of the packs
TODO
- upload single pack to server
- server to verify deps
- server to return latest versions of packs
- mpack to add / update deps in package.json