Skip to content
This repository has been archived by the owner on Feb 6, 2018. It is now read-only.

To have a way to read single (or several) blocks files #37

Open
qfox opened this issue Jan 28, 2016 · 2 comments
Open

To have a way to read single (or several) blocks files #37

qfox opened this issue Jan 28, 2016 · 2 comments

Comments

@qfox
Copy link
Contributor

qfox commented Jan 28, 2016

Probably the scheme like nested but just for one block.

https://nda.ya.ru/3RHPRF

@blond blond mentioned this issue May 9, 2016
@blond
Copy link
Member

blond commented May 10, 2016

I think we can get declaration instead of path parameter.

blocks/
  button/
    button.css
    button.js
const config = require('bem-config')();
const walk = require('bem-walk');

walk({ block: 'button' }, { levels: config.levelMapSync() });
// is equal
walk(['blocks/button/'], { levels: config.levelMapSync() });

Each item of declaration can be transform to some paths with bem-fs-scheme.path().

const path = require('path');
const nestedScheme = require('bem-fs-scheme')('nested');

const dirname = nestedScheme.path({ block: 'button' }) // button/

levels.map(level => path.join(level, dirname)); // ['blocks/button/']

@qfox
Copy link
Contributor Author

qfox commented Apr 20, 2017

Can we try to make it? We really need it for watch or partial scan and there are no other options to do it ;-(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants