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 new
and answer the questions - Add your files, refer to best practices
- run
mpack upload
when 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 upload
when you're done - Test the package in a M4 database
- When all working and final, run
mpack release
All Commands
Registry Commands
mpack login
mpack logout
mpack upload
mpack release
Once a pack is released, it cannot be undo.
Pack Commands
mpack new
mpack config
mpack deps
mpack extract
mpack 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:
Structure of package.json
{
"name": "PackName",
"version": "1.0.0",
"description": '',
"deps": {
"pack": "version"
},
"path": "",
"requires": {
"server": "version",
"web": "version"
},
"perms": [],
"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
deps
and requirements requires
to 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