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

Support short-naming #81

Open
belozer opened this issue Aug 15, 2016 · 6 comments
Open

Support short-naming #81

belozer opened this issue Aug 15, 2016 · 6 comments

Comments

@belozer
Copy link

belozer commented Aug 15, 2016

Now:

block-super-long/block-super-long.css
block-super-long/block-super-long.deps.js
block-super-long/block-super-long.bemtree.js
block-super-long/block-super-long.bemhtml.js
block-super-long/__elem/block-super-long__elem.css
block-super-long/__elem/_modifier/block-super-long__elem_modifier_value.css

Short:

block-super-long/style.css
block-super-long/deps.js
block-super-long/bemtree.js
block-super-long/bemhtml.js
block-super-long/__elem/style.css
block-super-long/__elem/_modifier_value/style.css

2016-08-15 23-42-02
2016-08-15 23-42-55

@blond
Copy link
Member

blond commented Aug 16, 2016

I think we can add nested-lite scheme that will support only short-naming.

@qfox
Copy link
Contributor

qfox commented Aug 16, 2016

This looks strange.

block-super-long/bemtree.js
block-super-long/bemhtml.js

If tech is 'bemtree.js' then name is empty?

How it should works?

@Guria
Copy link

Guria commented Aug 16, 2016

@zxqfox name is folder name

@belozer
Copy link
Author

belozer commented Aug 16, 2016

A block is a set of techs and resources.

block -> folder on filesystem

techs and resources located in the block and belong to him

@qfox
Copy link
Contributor

qfox commented Aug 17, 2016

@zxqfox name is folder name

Nope, it can't be by default.

Check it:

const path = require('path');
[
  path.parse('blockname/bemhtml.js'),
  path.parse('blockname/style.css'),
  path.parse('blockname/deps.js')
];
// →
[ { root: '', dir: 'blockname', base: 'bemhtml.js', ext: '.js',  name: 'bemhtml' },
  { root: '', dir: 'blockname', base: 'style.css',  ext: '.css', name: 'style' },
  { root: '', dir: 'blockname', base: 'deps.js',    ext: '.js',  name: 'deps' } ]

P.s. Of course we can always pass a couple of params to customize this logic inside scheme. But is the game worth the candle?

@belozer
Copy link
Author

belozer commented Aug 19, 2016

@zxqfox yes.

BEM already very long in HTML.. But for HTML created XJST.
Next step: for FS we can create nested-lite

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

4 participants