
Scripts for umm modules.
{
"scripts": {
"umm:init": "./node_modules/.bin/umm-init",
"umm:install": "./node_modules/.bin/umm-install",
"umm:uninstall": "./node_modules/.bin/umm-uninstall",
"postinstall": "npm run --silent umm:install",
"postuninstall": "npm run --silent umm:uninstall"
},
}
- Automatic deployment by
umm:install.
- Copy assets to
Assets/Modules/<scope>@<module>/ from Assets/ in modules excepts listed in .npmignore.
{
"scripts": {
"umm:init": "./node_modules/.bin/umm-init",
"umm:install": "./node_modules/.bin/umm-install",
"umm:uninstall": "./node_modules/.bin/umm-uninstall",
"postinstall": "npm run --silent umm:install && node ./scripts/postinstall.js",
"postuninstall": "npm run --silent umm:uninstall"
},
}
- Append calling script into
postinstall section if you need to customized deploy.
const umm = require('@umm/scripts');
umm.libraries.synchronize("path/to/source", "path/to/destination");
- Synchronize assets flexiblly.
| Argument |
Type |
Description |
| source_path |
{String} |
Copy source path |
| destination_path |
{String} |
Copy destination path |
| patterns |
`{Array<String |
Object>}` |
| overwrite_options |
{Object} |
Overwrite default options |
| callback |
{Function} |
Callback function |
| Key |
Type |
Description |
Default |
| pattern |
{String} |
Designation patterns as glob. |
- |
| overwrite |
{Boolean} |
Overwrite files if already exists. |
true |
| remove_source |
{Boolean} |
Remove source files when finish copy. |
false |
| remove_empty_source_directory |
{Boolean} |
Remove empty directory in source path after finish processing remove_source. |
false |
| remove_deleted_files |
{Boolean} |
Remove files that do not exist on the source path. |
false |
- Parameters are ignored if specified by patterns.
| Key |
Type |
Description |
Default |
| overwrite |
{Boolean} |
Overwrite files if already exists. |
true |
| remove_source |
{Boolean} |
Remove source files when finish copy. |
false |
| remove_empty_source_directory |
{Boolean} |
Remove empty directory in source path after finish processing remove_source. |
false |
| remove_deleted_files |
{Boolean} |
Remove files that do not exist on the source path. |
false |
- Information of module as JavaScript
Object.
| Key |
Type |
Description |
| npm_package_name |
{String} |
Name of npm package. |
| has_scope |
{Boolean} |
Package name has scope? (Package name has @ character if scoped.) |
| development_install |
{Boolean} |
Set true if installation process is development. |
| module_name |
{String} |
Module name. |
| scope |
{String} |
Scope of module. |
| name |
{String} |
Name of module. |
| package_path |
{String} |
Path to package install. |
| base_path |
{String} |
Path of project. |
{
npm_package_name: "@umm/sample_module",
has_scope: true,
development_install: false,
module_name: "umm@sample_module",
scope: "umm",
name: "sample_module",
package_path: "/Users/monry/Development/git/monry/some_project/node_modules/@umm/sample_module",
base_path: "/Users/monry/Development/git/monry/some_project",
}
Copyright (c) 2018 Tetsuya Mori
Released under the MIT license, see LICENSE.txt