Next | Previous

Package layout

This document describes the technical details of a Nyssa package.

Layout

The default layout for Nyssa package when generated by nyssa init is as follows:

  • .blade: The default Blade pacakges directory which contains installed packages and will only be available when at least one or more package is installed.
  • app: The directory contains the main application/package code.
  • index.b: The default Blade package index file.
  • README.md: The README.md file should contain the main introduction to or documentation for your package.

    NOTE: If your packages adheres to Blade standard multiline comment documentation format as shown in the Blade standard library documentation, your package documentation may be expanded to include such documentations.

  • nyssa.json: The Nyssa package configuration script.
  • tests: This directory contains unit, integration and all types of tests for your package.

!Important

You can create a Nyssa package without having to run nyssa init. Essentially, the only files required are the index.b and the nyssa.json files and they can be manually created without losing Nyssa's ability to install, uninstall and configure packages.

nyssa.json

The nyssa.json file is pretty intuitive and is very similar to NodeJS NPM package.json files. A typical sample of a complete nyssa.json file looks like this:

{
  "name": "sample", 
  "version": "0.1.0", 
  "description": "An example package", 
  "homepage": "", 
  "tags": [
    "tag1",
    "tag2",
    "tag3"
  ], 
  "author": "Package Author ", 
  "license": "MIT", 
  "sources": [
    "nyssa.bladelang.org"
  ],
  "deps": {
    "dependecny1": "1.0.0",
    "dependecny2": "1.0.0",
    "dependecny3": "1.0.0"
  },
  "post_install": "post-install-script.b",
  "pre_uninstall": "pre-uninstall-script.b",
  "cli": "cli-entry-script.b"
}