Universal Package Tool
UPT is a crossplatform ( thanks to nodejs ) and general purpose package manager that
aims to be an universal installer for each kind of software.
Since actually i'm the only tester of this project, please be careful with your sensible data.
UPT is derived from Bower project , inheriting all commands and
keeping the compatibility with bower.json/component.json file ( for now )
we are also on npm https://www.npmjs.org/package/upt
npm install upt
Would you try upt now? just run this command:
upt install hw2-core/js-kernel
the installation of packages that use forward slashes in names. So you can use:
upt install vendor/lib/mylib" -> this package will be installed in same path specified by the name
you can keep .git folder when not in --production mode. This allow you to work with your repository.
moreover, the default enabled flag --direct-update allows to update packages directly using repositories commands, speeding up the whole updating process.
NOTE: you MUST know that after an install --force , or an update using flag --no-direct-update the .git folder will be replaced with new one from the repository. If you want avoid it atm, you need to add ".git" or ".git/config" entry in "keep" upt.json array ( read below )
NOTE2: if you're keeping the .git folder, upt will compare the current commit hash during updates ( without --force ) So if the commit hash of new version from repository source is equal to current hash of local git repository, the update will be skipped.
you can use the special character "%" as prefix of dependency name to use original package name as directory instead of specifying it. However the dependency name must be defined and be unique for json consistency. Ex:
if you want that dependencies are installed in their original path, but at the same moment you need a "link" inside your package folder, you can use the special character ":" as prefix of your dependency name. This name will be used as the path to create a symbolic link to original dependecy folder.
in this case the package "js-kernel" will be installed in its original path, but will be also linked in "/my/custom/path".
you can preserve folders and files after "update" command using the keyword "keep" in your upt.json file it is particularly useful when you've sensible data such as uploads , configurations etc. that updating process should not destroy. You can use the same syntax of "ignore" key. Ex:
If you change one of this keep value in future , remember to use a postinstall script to rename the old directory otherwise it will be definitively removed.
you can create an hook script ( a node module ) for all dependencies/installed package , that will be execute at each installer event without the need of a .uptrc hook scrips . however uptrc will continue to execute its hooks but they cannot be determined by dependencies of course You have to create a folder called **_upt** inside your project where you need to have an **installer_hook.js** script that must have this structure:
// action: the step reached by the process// name: package resolved name ( it's the name of the final directory too)// config: configurations that contains the current working directory where you're running the process, and other .uptrc / default specifications// pkgPath: absolute path where the package is installed ( postinstall / preuninstall ) or temp directory ( preinstall / postresolved )// newMeta: meta descriptions of new installed package in json format// oldMeta: if we're updating version, it's the old meta description in json format of previous package version.// callback: you MUST call this function when your instructions end for an ordered execution of hook scriptsswitchactioncase "postresolved":// YOUR CODE HEREbreak;case "preinstall":// YOUR CODE HEREbreak;case "postinstall":// YOUR CODE HEREbreak;case "preuninstall":// YOUR CODE HEREbreak;//[...]callback;return 0;;
You can use upt.custom.json file to add your custom specifications to dependencies. For example you're using a dependency that install different folders/files that you don't need? just create your upt.custom.json in directory of dependency with the ignore entries. Example:
upt.custom.json will replace keys that you define
if dependency is not installed yet, you need to create an empty folder where the dep. will be installed with upt.custom.json
each time you change something in upt.custom.json , you need to clean the cache with upt cache clean command and then reinstall/update the dependency with --force flag ( we can avoid it in future )
Via the 'version' command now you are able to recursively change the version to all packages installed and/or commit/push repository changes.
Use case: You have a project with many personal libraries subdivided in multiple repositories and you've changed a library function that which involves all other repositories?
upt version --push --recursive -m "updated code to fit new foo library changes"
Actually i'm hearing for testers and developers. Contact me if you're interested