Open BennyAlex opened 4 years ago
Hi,
That's a good one. And also doesn't seem very difficult to implement. The most important part deciding a notation for variables in json files. I'll think about it. Any other suggestions and even PRs are very welcome.
json needs for all keys/values strings, so maybe __id__
without quotes is enough
you are already introduced a wildcard notation with double underscore, so you probably fine using it again
I'm not sure about "not using" quotes because in that case json files will be invalid and it can disturb people on editors or some linters. Maybe
{
"id": "__id__"
}
will be also good and safe enough.
yeah you are right. Another cool thing would be usage of simple expressions
{ 'doubleID': 'mockExpresion(__uuid__ * 2)' }
where 'mockExpresion' indicates the value is an expression
But {"id": "__id__"}
would be already nice and I think its okay to turn it on by default, but maybe the user can disable it with an option passed to the mock config
Hello,
it would be cool if the wildcard is passed into the json files to, so
{ id: __project_uuid__ }
will return the current uuid.Maybe the wildcard needs some type of escaping, eg:
$__project_uuid__$
This would reduce the usage of more complicated js files.