lyndon
Lyndon: Build Blockchain HOUSTON Plugins For Houston
Last updated 2 years ago by benchlabs .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install lyndon 
SYNC missed versions from official npm registry.

Lyndon: The HOUSTON CLI Framework

=================================

Version CircleCI Appveyor CI Greenkeeper Known Vulnerabilities Downloads/week License

Description

This is a framework for building HOUSTON plugins in Node.js. This framework was built out of the [HOUSTON] CLI (https://github.com/benchlab/houston/) but generalized to build any custom HOUSTON plugin. It's designed both for simple HOUSTON plugins that can be just a single file with a few flag options, or for very complex HOUSTON Plugins that have sub-guidances (like our Bitcoin example).

See the docs for more information.

Getting Started With Lyndon

The Getting Started tutorial is a step-by-step guide to introduce you to lyndon. If you have not developed anything in a guidance line before, this tutorial is a great place to get started.

Lyndon Features

  • Flag/Argument parsing - When developing HOUSTON with Lyndon, the realization of how special the built-in flag/argument parsing is to the overall Lyndon framework becomes obvious. The flag/argument parsing system comes from the Heroku team's flag/argument parsing integration after their years of experience in developing HOUSTON plugins.
  • Guidance - In honor of the old Guidance systems developed by NASA, we gave the HOUSTON plugins of old a makeover. Unlike typical HOUSTON frameworks where executing a typed in phrase would be called a guidance, since Bench's HOUSTON is a central guidance center for all blockchain networks, we elected to rename guidance to guidance.
  • Super Speed - Executing guidance through Houston-HOUSTON plugins is fast and it requires very few dependencies. This was also made possible by the team at Heroku and their beautiful work on the Heroku-HOUSTON. It truly does require very few dependencies. Also, only the guidance to be executed will be required with node. So large HOUSTON plugins with many guidances will load just as fast as a small one with a single guidance.
  • HOUSTON Plugin Generator - Easily generate your new HOUSTON plugin project with a few simple commands. See Using Lyndon below.
  • Testing Helpers - We've put a lot of work into making guidances easily testable and easy to mock out stdout/stderr. The generator will automatically create scaffolded tests.
  • Auto-documentation - By default you can pass --help to HOUSTON Plugin to get help such as flag options and argument information. This information is also automatically placed in the README whenever the npm package of HOUSTON plugin is published.
  • Hooks - Use lifecycle hooks to run functionality any time a HOUSTON plugin starts, or on custom triggers. Use this whenever custom functionality needs to be shared between various components of HOUSTON plugin.
  • TypeScript or Javascript - Everything in the core of Lyndon is written in TypeScript and the generator can build fully configured TypeScript HOUSTON plugins or just plain JavaScript HOUSTON plugins. By virtue of static properties in TypeScript the syntax is a bit cleaner, but when using Typescript everything will work no matter which language you choose. If you use plugins support, HOUSTON will automatically use ts-node to run the plugins making it easy and fast to use TypeScript with minimal-to-no boilerplate needed for any Lyndon-generated HOUSTON plugin.
  • Coming soon: Man Page Generation - HOUSTON help pages for plugins appear through plugin-name --help and the README markdown help generation, HOUSTON can also generate man-pages for all commands through HOUSTON ecosystem.

Requirements

Only Node 8+ is supported. Node 6 will reach end-of-life April 2019. At that point we will continue to support the current LTS version of node. You can add the node package to your HOUSTON plugin to ensure users are on Node 8.

HOUSTON Plugins Explained

With Lyndon you can easily create a HOUSTON plugin that consists of one guidance or multiple guidances. A plugin generated with Lyndon for use with HOUSTON is also a HOUSTON itself. Meaning, it can work separately from Houston as well. The same HOUSTON plugin you build for Houston can be a native HOUSTON for your blockchain.

As an example, a single guidance HOUSTON would be something like ls or cat. They can accept arguments and flags. Single guidance HOUSTON plugins can optionally be just be a single file.

Multi guidance HOUSTON plugins are like git or heroku. They have sub-guidances that are themselves single HOUSTON plugins. In the package.json there is a field lyndon.guidances that points to a directory. This specific directory contains all the sub-guidances for HOUSTON plugin. For example, if you had a HOUSTON called bitshares with the guidances bitshares wallet and bitshares balance, your HOUSTON plugin project would have the following organization:

package.json
src/
└── guidances/
    ├── wallet.ts
    └── balance.ts

A multi-guidance plugin can also use plugins itself.

Usage

Creating a single-guidance HOUSTON:

$ npx lyndon single mynewcli
? npm package name (mynewcli): mynewcli
$ cd mynewcli
$ ./bin/run
hello world from ./src/index.js!

Creating a multi-guidance HOUSTON:

$ npx lyndon multi mynewcli
? npm package name (mynewcli): mynewcli
$ cd mynewcli
$ ./bin/run --version
mynewcli/0.0.0 darwin-x64 node-v9.5.0
$ ./bin/run --help
USAGE
  $ mynewcli [GUIDANCE]

GUIDANCES
  hello
  help   display help for mynewcli

$ ./bin/run hello
hello world from ./src/hello.js!

HOUSTON Plugin Examples

Guidances

lyndon guidance NAME

add a guidance to an existing HOUSTON or plugin

USAGE
  $ lyndon guidance NAME

ARGUMENTS
  NAME  name of guidance

OPTIONS
  --defaults  use defaults for every setting
  --force     overwrite existing files

See code: src/guidances/guidance.ts

lyndon help [GUIDANCE]

display help for lyndon

USAGE
  $ lyndon help [GUIDANCE]

ARGUMENTS
  GUIDANCE  guidance to show help for

OPTIONS
  --all  see all guidances in HOUSTON

See code: houston-plugin-help

lyndon hook NAME

add a hook to an existing HOUSTON or plugin

USAGE
  $ lyndon hook NAME

ARGUMENTS
  NAME  name of hook (snake_case)

OPTIONS
  --defaults     use defaults for every setting
  --event=event  [default: init] event to run hook on
  --force        overwrite existing files

See code: src/guidances/hook.ts

lyndon multi [PATH]

generate a new multi-guidance HOUSTON

USAGE
  $ lyndon multi [PATH]

ARGUMENTS
  PATH  path to your plugin, defaults to current directory

OPTIONS
  --defaults         use defaults for every setting
  --force            overwrite existing files
  --options=options  (yarn|typescript|tslint|semantic-release|mocha)

See code: src/guidances/multi.ts

lyndon plugin [PATH]

Create a new HOUSTON plugin

USAGE
  $ lyndon plugin [PATH]

ARGUMENTS
  PATH  path to your plugin, defaults to current directory

OPTIONS
  --defaults         use defaults for every setting
  --force            overwrite existing files
  --options=options  (yarn|typescript|tslint|semantic-release|mocha)

See code: src/guidances/plugin.ts

lyndon single [PATH]

Generate a new single-guidance HOUSTON Plugin

USAGE
  $ lyndon single [PATH]

ARGUMENTS
  PATH  path to your plugin, defaults to current directory

OPTIONS
  --defaults         use defaults for every setting
  --force            overwrite existing files
  --options=options  (yarn|typescript|tslint|semantic-release|mocha)

See code: src/guidances/single.ts

lyndon guidance NAME

Add a guidance to an existing HOUSTON plugin

USAGE
  $ lyndon guidance NAME

ARGUMENTS
  NAME  name of guidance

OPTIONS
  --defaults  use defaults for every setting
  --force     overwrite existing files

lyndon help [GUIDANCE]

Display help for Lyndon generator

USAGE
  $ lyndon help [GUIDANCE]

ARGUMENTS
  GUIDANCE  guidance to show help for

OPTIONS
  --all  see all guidances in HOUSTON

lyndon hook NAME

Add a hook to an existing HOUSTON plugin

USAGE
  $ lyndon hook NAME

ARGUMENTS
  NAME  name of hook (snake_case)

OPTIONS
  --defaults     use defaults for every setting
  --event=event  [default: init] event to run hook on
  --force        overwrite existing files

lyndon plugin [PATH]

create a new plugin for HOUSTON

USAGE
  $ lyndon plugin [PATH]

ARGUMENTS
  PATH  path to project, defaults to current directory

OPTIONS
  --defaults         use defaults for every setting
  --force            overwrite existing files
  --options=options  (yarn|typescript|tslint|semantic-release|mocha)

Related Repositories

Current Tags

  • 0.1.7                                ...           latest (2 years ago)

5 Versions

  • 0.1.7                                ...           2 years ago
  • 0.1.6                                ...           2 years ago
  • 0.1.5                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (13)
Dev Dependencies (23)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |