Rework walking logic to support pattern field
- Dominant language
- JavaScript
- Stars
- 89
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
- Support `pattern` field in the main walk method (like file.parse should actually do it?)
- Parse `pattern` to find `${entity}` inside it
- Choose Walker according to passed `scheme` field (can be `flat` and `nested` for now)
- Read basic directory to generate some context
- Read the rest with chosen Walker
- Filter anything unneeded from walker with `pattern`
- Send to stream (as it was done before)
- Walkers should care about `${entity}` part in `pattern` only
- Tech should not be parsed in walkers now, move it
- Walkers should receive basic depth/scope and path to go deeper (resolves https://github.com/bem-sdk-archive/bem-walk/issues/14, https://github.com/bem-sdk-archive/bem-walk/issues/37)
- Empty `pattern` means `${layer}/${entity}.${tech}`
Feels like it's all the things we should do for `pattern` support. Not a huge deal for real.
More ideas on Russian: https://github.com/bem-sdk-archive/bem-walk/issues/77
More details on Russian: https://gist.github.com/zxqfox/02bacc8c5d44b425f819228cdf0756d3
Closes #282
Contributor guide
Assessment
This issue has not been assessed yet.