0.1.2 • Published 5 years ago

lyra-workflow v0.1.2

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
5 years ago

ts-workflow

Overview

This repo contains a TypeScript Lyra SDK allowing you to build Lyra workflows in TypeScript. For more information see https://github.com/lyraproj/lyra

Some sample TypeScript workflows can be found in the examples folder, and more in the lyra repo.

Many of these workflows rely on types and state handlers (contained in "typesets") implemented in other languages and made available in typescript (and javascript) via the "lyra generate" CLI command (lyra generate typescript)

We will soon create an example state handler in TypeScript.

Contents

lib/examples - example workflows in typescript, used here for testing only. See the test folder for usage. The lib/examples/vpc_with_subnet.ts is an example workflow which uses the lib/examples/Aws.ts typeset which was, as mentioned above, generated by lyra generate typescript

lib/datapb - this is the TypeScript implementation of the data-protobuf data format, allowing transport of generic, deeply-nested data structures.

lib/pcore - this is the TypeScript implementation of the pcore Puppet Type System. This facilitates language-agnostic interoperability with an entirely native experience, in this case for TypeScript.

lib/servicesdk - this is the only library that workflow writers need to interface with. For example:

import {resource, serveWorkflow} from 'lyra-workflow';

// Import types used in workflow here, i.e. something similar to:
// import * as Aws from './types/Aws';

serveWorkflow({
  source: __filename,
  // define workflow here, see examples for how to do this
});

Testing

To test changes, run:

npm test

Or

./node_modules/pre-commit/hook

This also runs gts check. To fix any linting errors automatically, you can run

npm run fix

Deploying

The package is published here https://www.npmjs.com/package/lyra-workflow and requires an npmjs login and access to be granted by the project team.