yandex-domain-configs
Tool for generating static domain configs.
Benefits
- Simple config inheritance.
- Simple domain config inheritance.
- Config validation against JSON-schema.
- 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
:
foo: 0
bar:
baz: 1
$domains:
yandex.ru
foo: 2
yandex.com
$extends: yandex.ru
bar:
baz: 3
config.production.yaml
:
$extends: config.base.yaml
bar:
baz: 5
$domainList:
- yandex.ru
- yandex.com
$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
}
}