Socket
Book a DemoInstallSign in
Socket

@matrix42/cli

Package Overview
Dependencies
Maintainers
3
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@matrix42/cli

Matrix42 TypeScript Development Kit CLI

Source
npmnpm
Version
0.7.2
Version published
Weekly downloads
43
30.3%
Maintainers
3
Weekly downloads
 
Created
Source

@matrix42/cli

Matrix42 AG TypeScript Development Kit CLI (MTDK)

The official Matrix42 CLI (MTDK) is the Command Line for developing, building, packaging and publishing your Matrix42 DWP Extensions. (https://extensions.matrix42.com)

At the moment the MTDK can only be used for Scripted Activities. Other Features are planned for the future!

Installation

You can use npm to install the MTDK as quick and easy as possible:

$ npm i -g @matrix42/cli

TODO Or you can use our Matrix42 CLI Installer for Windows only.

Usage

You can use the help [command] command to get an overview of all or one specific CLI command:

$ Outputs an overview of all available commands
$ mtdk help
$
$ Outputs the help documentation for a specific command (e.g. create-project)
$ mtdk help create-project

Why is the Matrix42 CLI using old Command Packages?

The Matrix42 CLI caches its command packages for 24 hours or you can add the force-command-registry-update option to any command:

$ mtdk -fcru
$
$ mtdk --force-command-registry-update

Another problem could be that you did not update the latestStable field of your command in the Matrix42 CLI Command Registry: How to update Matrix42 CLI Command Registry

Contributing

The Matrix42 CLI is written with extensibility in mind. That's why we want to inspire you to create new CLI Commands or extend existing ones!

Adding New Commands

Before creating your first Matrix42 CLI Command you will need to setup a few things.

  • Clone the Matrix42 CLI repository (https://github.com/Matrix42AG/m42-typescript-development-kit)
  • Execute the following commands in the root of the repository:
    $ Install all dependencies
    $ npm i
    $
    $ Setup the project structure for developing
    $ npx lerna bootstrap
    
  • Create your first Matrix42 CLI Command using the Matrix42 CLI:
    $ Install the Matrix42 CLI globally
    $ npm i -g @matrix42/cli
    $
    $ Create a new project
    $ mtdk create-project my-first-project
    $ ...
    $
    $ Navigate to your freshly created project
    $ cd packages/my-first-project
    $
    $ Add your first Matrix42 CLI Command
    $ mtdk add-command my-first-command
    $ ...
    

Now you can edit the lib/index.ts to your desires until you are ready to test your command:

$ Navigate to the Matrix42 CLI
$ cd ../cli
$
$ Build the Matrix42 CLI
$ npm run rebuild
$
$ Execute your command
$ node ./dist/index.js my-first-command ...

As soon as you are satisfied with your new command you can publish it:

$ Navigate to your project
$ cd ../my-first-project
$
$ Publish your project to npmjs.org
$ npm publish --access=public
$ ...

Now you will need to request an update on the official Matrix42 CLI Command Registry so your command can be used in production:

Updating Existing Commands

If you want to update one of the official Matrix42 CLI Commands you can start with their corresponding package:

If you want to update any command which is not official you will have to contact the owner of the corresponding repository.

Contributing to the CLI itself

Please contact David Vollmers if you plan to contribute to the Matrix42 CLI itself.

FAQs

Package last updated on 12 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts