As a package manager, one of the core responsibilities of nyssa is to help you manage dependencies for your application. In Blade, there are three (3) scopes of libraries that exist.
$BLADE_INSTALL_DIR/vendor) and are available to all applications in Blade and can be imported in the same way as the core libraries, but not part of the core packages.
$APPLICATION_DIR/.blade/libs) and are available to all modules in your application and can be imported in the same way as the core libraries.
Nyssa lets you install both global and local libraries for your application. The default behavior is to install a package locally.
To install a package locally into your application, open a terminal at the root of your application and run
nyssa install <package_name>
This will create the path
.blade/libs in your current directory if it doesn't exist already and download the package into that directory. This will also update the
nyssa.json file with the installed dependency uder the
NOTE: nyssa does not install a local package outside of a nyssa project.
If you want to install a specific version of a package, you have you specify the version in the install command using the
@ separator like below.
nyssa install <package_name>@<package_version>
nyssa install firstname.lastname@example.org
To install a package globally and make it available to all applications, you need to add the
--global flag (or
-g for short) to the command. For example:
nyssa install --global <package_name>
NOTE: You can install a package globally from any directory on your device. A
nyssa.jsonfile will only be updated if it is ran inside a nyssa project.
You can also choose to install a package from another repository other than nyssa.bladelang.com by specifying the
--repo flag (or
-r for short) like below.
nyssa install --repo <repo_url> <package_name>
The new repo will be added as a source into the
nyssa.json script. This allows nyssa to easily restore the dependency later on.
When installing packages, by default nyssa does not use the cache. You can instruct nyssa to check if a version of the package and version has been previously downloaded and use that download copy again by specifying the
-cfor short). This helps avoid unnecessary bandwidth costs.
To uninstall or remove a dependency from a project, you need to run the
nyssa uninstall command like
nyssa uninstall <package_name>
To uninstall a package that was installed globally, you need to specify the
nyssa uninstall --global <package_name>
To upgrade Nyssa packages whether globally installed or locally installed, you only need to reinstall it. Nyssa will install the latest version of that package and replace the current one with it.
When nyssa creates a project, it includes a
.gitignore file that tells it to ignore the
.blade directory. This keeps source control light and easy to manage. To restore back all your packages when you move or copy your code across locations or devices, you can run the command
This is also useful if you ever mistakenly delete the
.blade directory or compress the project with archivers that ignore hidden file on Unix machines or somehow end up with a corrupted library. You can also use restore to reinstall all packages.
Unlike package installation, restore uses a cache by default. Sometimes, this isn't exactly what you want. You can ask nyssa to not use any cached version by specifying the