-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework walking logic to support pattern field #282
Comments
I correctly understand that this code describes such a file structure?
|
Almost. This:
You need: |
I probably brought a very abstract example for fs. From real world common.blocks/block/vanilla.js
// -> { entity : { block : 'block' }, tech : 'vanilla.js' }
common.blocks/block/__elem/browser.js
// -> { entity : { block : 'block' , elem : 'elem' }, tech : 'browser.js' }
common.blocks/block/__elem/_mod/bemtree.js
// -> { entity : { block : 'block' , elem : 'elem', mod : { name : 'mod', val : true }, tech : 'bemtree.js' }
common.blocks/block/__elem/_mod_val/bemhtml.js
// -> { entity : { block : 'block' , elem : 'elem', mod : { name : 'mod', val : 'val' }, tech : 'bemhtml.js' } |
Then your pattern is the correct one. ;-) But scheme should be corrected a little. Nested will match these files:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pattern
field in the main walk method (like file.parse should actually do it?)pattern
to find${entity}
inside itscheme
field (can beflat
andnested
for now)pattern
${entity}
part inpattern
onlypattern
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: bem-sdk-archive/bem-walk#77
More details on Russian: https://gist.github.com/zxqfox/02bacc8c5d44b425f819228cdf0756d3
Closes #282
The text was updated successfully, but these errors were encountered: