Tonto
Tools

Tonto Package Manager

Use TPM to install and manage Git-based Tonto project dependencies.

TPM is the Tonto Package Manager. The current npm package and command are both named tpm.

npm install -g tpm
tpm help

TPM lets a Tonto project reuse other Tonto projects as dependencies.

Manifest dependencies

TPM reads the dependencies object in tonto.json:

{
  "projectName": "Aguiar2019ooco",
  "displayName": "Aguiar 2019 Object Oriented Example",
  "publisher": "Aguiar",
  "version": "1.0.0",
  "license": "MIT",
  "dependencies": {
    "SWO": {
      "url": "https://github.com/matheuslenke/tonto-example-models.git",
      "directory": "SWO",
      "branch": "feature/test-tonto-reference"
    },
    "SPO": {
      "url": "https://github.com/matheuslenke/tonto-example-models.git",
      "directory": "SPO",
      "version": "1.0.0"
    }
  },
  "outFolder": "outDirectory"
}

Dependency fields:

FieldRequiredPurpose
urlYesGit repository URL.
directoryNoSubdirectory inside the repository containing the Tonto project.
versionNoGit tag to install.
branchNoGit branch to install.

If neither version nor branch is provided, TPM clones the repository default branch.

Install dependencies

Run from the project root:

tpm install

or:

tpm i

Install a different project directory:

tpm install --dir path/to/project

TPM clones dependencies into a temporary folder, resolves nested dependencies recursively, then copies the selected projects into tonto_dependencies.

Add a dependency

Use the current add command:

tpm add . -n CoreTypes -u https://github.com/example/tonto-core-types.git -v 1.0.0

Include a subdirectory:

tpm add . -n CoreTypes -u https://github.com/example/tonto-libraries.git -v 1.0.0 -d core-types

Dependency folder

Installed dependencies are placed under:

tonto_dependencies/

Do not commit this folder. It should be restored with tpm install.

TPM install

TPM install from the VS Code extension