1.2.4 • Published 3 years ago

super-yaml v1.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

super-yaml

Version Downloads/week codecov License semantic-release oclif

Intro

super-yaml is a tool that helps you write enhanced yaml's and compile them to regular yaml .yml files.

Quick demo: https://doriaviram.github.io/super-yaml/

Features

Common types

In

_types:
  MyCoolType:
    properties:
      englishName: <% Var(name) %> # Expect name parameter
      geoData:
        city: Jerusalem # Const
        country: <% Var(country,Israel) %> # Parameter with default value
      hebrewName: <% Var(name) %> # Reuse same parameter

CoolExample1<MyCoolType>:
  name: SuperYaml
CoolExample2<MyCoolType>:
  name: Syml
  country: Tel-Aviv # Is it a country ?

Out

CoolExample1:
  englishName: SuperYaml
  geoData:
    city: Jerusalem
    country: Israel
  hebrewName: SuperYaml
CoolExample2:
  englishName: Syml
  geoData:
    city: Jerusalem
    country: Tel-Aviv
  hebrewName: Syml

DRY - Imports

In

shared.syml

_types:
  MyCoolType:
    properties:
      englishName: <% Var(name) %> # Expect name parameter
      geoData:
        city: Jerusalem # Const
        country: <% Var(country,Israel) %> # Parameter with default value
      hebrewName: <% Var($.name) %> # Reuse same parameter

config.syml

_import:
  - ./shared.syml

CoolExample1<MyCoolType>:
  name: SuperYaml
CoolExample2<MyCoolType>:
  name: Syml
  country: Tel-Aviv # Is it a country ?

Out

CoolExample1:
  englishName: SuperYaml
  geoData:
    city: Jerusalem
    country: Israel
  hebrewName: SuperYaml
CoolExample2:
  englishName: Syml
  geoData:
    city: Jerusalem
    country: Tel-Aviv
  hebrewName: Syml

String templates

In

_types:
  MyCoolType:
    properties:
      englishName: Mr. <% Var(name) %>
      welcomeMessage: Mr. <% Var(name) %><% Var(name) %>, Hello
CoolExample1<MyCoolType>:
  name: SuperYaml

Out

CoolExample1:
  englishName: Mr. SuperYaml
  welcomeMessage: Mr. SuperYaml, Hello

Config

All options, which are set Available in global config? from ToastOptions are supported. Below are extra configurable options:

NameTypeDefaultDescription
typeKeyPrefixstring<Set the prefix for type declaration Example1<MyCoolType>
typeKeySuffixstring>Set the suffix for type declaration Example1<MyCoolType>
typeVariablePrefixstring$.Set the prefix for variable $.myParam

Requirements

nodejs >= 12

Usage

$ npm install -g super-yaml
$ super-yaml COMMAND
running command...
$ super-yaml (-v|--version|version)
super-yaml/1.2.4 linux-x64 node-v14.18.1
$ super-yaml --help [COMMAND]
USAGE
  $ super-yaml COMMAND
...

Commands

super-yaml compile

Compile syml to simple yml

USAGE
  $ super-yaml compile

OPTIONS
  -s, --source=source                      (required)
  -t, --target=target                      (required)
  --typeKeyPrefix=typeKeyPrefix
  --typeKeySuffix=typeKeySuffix
  --typeVariablePrefix=typeVariablePrefix
  --typeVariableSuffix=typeVariableSuffix

EXAMPLES
  $ super-yaml compile -s config.syml -t config.yml
  $ super-yaml compile --source config.syml --target config.yml

See code: src/commands/compile.ts

super-yaml help [COMMAND]

display help for super-yaml

USAGE
  $ super-yaml help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

1.2.4

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.1.3

3 years ago

1.2.1

3 years ago

1.1.2

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago