Is there an existing feature request for this?
Command
No response
Description
Suppose melos.yaml to contain:
scripts:
foo:
run: echo foo
exec:
concurrency: 1
orderDependents: true
bar:
run: echo bar
exec:
concurrency: 1
orderDependents: true
baz:
run: echo baz
exec:
concurrency: 1
orderDependents: true
As you can see, the exec configuration is repeated over and over. YAML supports anchors and aliases, so we can instead write this:
x-exec: &execConfig
concurrency: 1
orderDependents: true
scripts:
foo:
run: echo foo
exec: *execConfig
bar:
run: echo bar
exec: *execConfig
baz:
run: echo baz
exec: *execConfig
This already works and nothing needs to be done, this YAML feature is supported by the Dart YAML parser.
The only 'issue' is that if the Melos plugin is installed, which turns on Melos YAML schema validiation (or without the plugin, validation can also be turned on) this causes an error:

The name x-exec is arbitrary and can be whatever, and it is not expected, hence the error, but this can be fixed. As an example, Docker Compose uses YAML as well for its config and it allows 'extension fields': https://docs.docker.com/compose/compose-file/compose-file-v3/#extension-fields (this is where the x- prefix comes from in my example). Here is how they do it: https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json (search for x-), here more about 'pattern properties': https://json-schema.org/understanding-json-schema/reference/object.html#pattern-properties
Would it be possible to make it work for Melos as well?
Reasoning
This would make the schema more flexible and ready for more advanced YAML features, which are already supported anyway.
Additional context and comments
No response
Is there an existing feature request for this?
Command
No response
Description
Suppose
melos.yamlto contain:As you can see, the
execconfiguration is repeated over and over. YAML supports anchors and aliases, so we can instead write this:This already works and nothing needs to be done, this YAML feature is supported by the Dart YAML parser.
The only 'issue' is that if the Melos plugin is installed, which turns on Melos YAML schema validiation (or without the plugin, validation can also be turned on) this causes an error:

The name
x-execis arbitrary and can be whatever, and it is not expected, hence the error, but this can be fixed. As an example, Docker Compose uses YAML as well for its config and it allows 'extension fields': https://docs.docker.com/compose/compose-file/compose-file-v3/#extension-fields (this is where thex-prefix comes from in my example). Here is how they do it: https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json (search for x-), here more about 'pattern properties': https://json-schema.org/understanding-json-schema/reference/object.html#pattern-propertiesWould it be possible to make it work for Melos as well?
Reasoning
This would make the schema more flexible and ready for more advanced YAML features, which are already supported anyway.
Additional context and comments
No response