yandex-domain-configs

Yandex Domain Configs

Package is deprecated
Last updated 2 years ago by razetdinov .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install yandex-domain-configs 
SYNC missed versions from official npm registry.

yandex-domain-configs

Tool for generating static domain configs.

Benefits

  1. Simple config inheritance.
  2. Simple domain config inheritance.
  3. Config validation against JSON-schema.
  4. Customizing domain list for different environments.

Installation

npm:

npm install --save-dev yandex-domain-configs

yarn:

yarn add -D yandex-domain-configs

Usage

npm:

node_modules/.bin/yandex-domain-configs [options]

yarn:

yarn yandex-domain-configs -- [options]

Options

    -i, --input <filename>      Input file
    -o, --output-dir <dirname>  Output directory
    -s, --schema <filename>     JSON Schema
    -h, --help                  output usage information

Example

config.base.yaml:

# default settings
foo: 0
# objects are merged recursively when overriden
bar:
  baz: 1
# domain settings override the default ones
$domains:
  yandex.ru
    foo: 2
  yandex.com
    # yandex.com will inherit settings from yandex.ru
    $extends: yandex.ru
    bar:
      baz: 3

config.production.yaml:

$extends: config.base.yaml
# these settings override the default ones in the base config
bar:
  baz: 5
# domains not listed here will be ignored
$domainList:
  - yandex.ru
  - yandex.com
# these settings override domain settings in the base config
$domains:
  yandex.ru
    foo: 6

config.schema.yaml:

title: Project configuration
type: object
required:
  - foo
  - bar
properties:
  foo:
    title: Foo description
    type: integer
  bar:
    title: Bar description
    type: object
    required:
      - baz
    properties:
      baz:
        title: Baz description
        type: integer

Command

yarn yandex-domain-configs -- -i config.production.xml -o production -s config.schema.yaml

Result

production/yandex.ru.json:

{
    "foo": 6,
    "bar": {
        "baz": 5
    }
}

production/yandex.com.json:

{
    "foo": 6,
    "bar": {
        "baz": 3
    }
}

Current Tags

  • 0.0.4                                ...           latest (2 years ago)

4 Versions

  • 0.0.4 [deprecated]           ...           2 years ago
  • 0.0.3 [deprecated]           ...           2 years ago
  • 0.0.2 [deprecated]           ...           2 years ago
  • 0.0.1 [deprecated]           ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 0
Last Month 6
Dependencies (15)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |