bem / bem-sdk

BEM SDK packages
https://en.bem.info/toolbox/sdk/
88 stars 25 forks source link

What about cli version? #117

Closed a-x- closed 7 years ago

a-x- commented 8 years ago

my quick dirty reference implementation: https://github.com/a-x-/bem-naming-cli/blob/master/bem-naming

blond commented 8 years ago

Hi!

I think than with cli we want get info about files. For example, you can use bem-find.

Can you tell me what's the point of this?

Maybe we need to make another plugin for bem-tools?

a-x- commented 8 years ago

Hi, @blond! i want get struclural parts of bem names and check them, not to find files.

bem-naming bem_dfsf isBlockMod        # (stdout: "True")
bem-naming bem__fdsfs_dfsf isBlockMod # (stdout: "\n")
bem-naming bem__fdsfs_dfsf isElemMod  # True
bem-naming foo__bar_baz block         # foo
bem-naming foo__bar_baz elem          # bar
blond commented 8 years ago

I still don't understand why.

@a-x- explain where it is to be used? In other tools or for users to to test bem-naming?

But if do, then I would prefer this CLI:

Usage
  $ bem-entity-part <command> <bem-entity-part>

Commands
  type   Returns type of BEM entity part
  block  Returns block name of BEM entity part
  elem   Returns elem name of BEM entity part
  mod    Returns mod of BEM entity part

Options
  --naming  Include a rainbow

Examples
  $ bem-entity-part type button_disabled
  blockMod

  $ bem-entity-part block button__text
  button

  $ bem-entity-part block button--checked --naming=two-dashes
  blockMod

Now we think about move part API from bem-naming to bem-entity package. In bem-naming must remain parse and stringify methods.

@a-x- your example more suited to bem-entity-part.

a-x- commented 8 years ago

sometimes i need to write bash one-liners working with bem world quickly.

bem-entity-part

It's cool and acceptable for me. But name bem-entity-part is not clear as i see. bem-naming cli api would be more comprehensible for me.

a-x- commented 8 years ago

add reference to bem-entity-part cli on bem-naming readme please, as far as it'll be ready

Yeti-or commented 8 years ago

I think that tenorok is more suitable name On Mon 16 May 2016 at 21:55 Александр invntrm@ notifications@github.com wrote:

add reference to bem-entity-part cli on bem-naming readme please, as far as it'll be ready

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/bem-sdk/bem-naming/issues/117#issuecomment-219513243

blond commented 8 years ago

@a-x- thanks for the explanation )

add reference to bem-entity-part cli on bem-naming readme please, as far as it'll be ready

sure

blond commented 8 years ago

Still bothers me that bem-sdk packages will have cli dependencies.

We can create bem-entity-part-cli package or create bem-tools-entity-part plugin, which will be provided entity-part command.

$ bem entity-part type button_disabled
blond commented 7 years ago

I published @bem/entity-name v1.0.0.

@a-x- You can use it to create bem-tools-entity-name plugin.