umm is an abbreviation Unity Module Manager, a management system for assets of Unity.
We call various assets aggregation as modules
, and manage thier dependencies using yarn which is an upward compatible tool of npm which is a package management system in Node.js.
Will explain the environment construction method to use umm.
Will explain how to retrieve some modules in a Unity project already module managed by umm
.
- Run
yarn install
command in the root directory of the Unity project for which you want to retrieve the modules. - Modules are deploying under the
Assets/Modules/
of the Unity project automatically.
Will exprain how to add a module into a Unity project.
- Run
yarn install
command in the root directory of the Unity project for which you want to add the module. - Module is deploying under the
Assets/Modules/
of the Unity project, also create of update the files which namedpackage.json
andyarn.lock
.- I strongly recommend to version control each manifest files which manage information of modules.
Module name specification method differs according to module publication destination.
yarn add @$SCOPE/$MODULE
yarn add github:$ORGANIZATION/$REPOSITORY
yarn add $TAR_BALL_URL
yarn add file:$PATH_TO_MODULE
Specify the version to be installed according to SemVer's rules
Please check the document of npm to specify the range of versions.
You can specify a range of versions for a git repository like GitHub if you use yarn.
yarn add "umm/cafu_core#^1.0.0"
^^^^^^
To create umm modules needs configuration file names .umm-config.json
.
Replace placeholders in template when initialize module accoring to this file.
Write the configuration like below and put to your home directory.
{
"scopes": {
"@monry": {
"repository": {
"type": "<REPOSITORY_TYPE>",
"host": "<REPOSITORY_HOST>",
"group": "<REPOSITORY_GROUP>",
"user": "<REPOSITORY_USER>"
},
"author": {
"name": "<AUTHOR_NAME>",
"email": "<AUTHOR_EMAIL>",
"url": "<AUTHOR_HOMEPAGE>"
},
"license": "<DEFAULT_LICENSE>"
}
}
}
Means of parameters are defined below table.
Parameter | Example | Description |
---|---|---|
REPOSITORY_TYPE | git |
Specify type of repository. Currently supported only git 😓 |
REPOSITORY_HOST | github.com |
Specify hostname of repository. |
REPOSITORY_GROUP | monry |
Specify name of user or organization of repository. |
REPOSITORY_USER | git |
Specify ssh username of repository. |
AUTHOR_NAME | monry |
Specify name of author. |
AUTHOR_EMAIL | monry@example.com |
Specify email of author. |
AUTHOR_HOMEPAGE | https://github.com/monry |
Specify homepage of author. |
DEFAULT_LICENSE | MIT |
Specify default license. |
- Executing the following command creates a template for the module.
- Thanks @mattak !!
bash <(curl -L https://gist.githubusercontent.com/mattak/f95a8f4c8750ee61aea79ec09d87f659/raw/cb49f66f5a7747fa700b2e8fb57f386969e64b49/umm-create.sh)
- You can develop the module like normally Unity project.
- Of cource, you can use other umm modules.
- Publish the module into some repository like GitHub.
- But, you must deploy into private repository if your module includes paid assets or private codes.
- You can contribute as contributer of umm if you want, so you can publish module in umm organizations.
- I don't recommend to publish to npmjs.org with use
npm publish
command, because assets is not codes of Node.js.
The module can publishes into any destination which supported by npm, such as GitHub, BitBucket and local storage.
Versioning according to SemVer's rules.
If you publish a module to GitHub, you can think of it as a module version by setting the tag of SemVer notation as git tag
.
By using the npm version
command, you can changes version of package.json
and run git tag
command at the same time.