Skip to content
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

Use bem-sdk in bemjson-to-bemdecl #266

Merged
merged 1 commit into from
Oct 1, 2017
Merged

Use bem-sdk in bemjson-to-bemdecl #266

merged 1 commit into from
Oct 1, 2017

Conversation

blond
Copy link
Member

@blond blond commented Oct 1, 2017

No description provided.

package.json Outdated
"@bem/sdk.deps": "0.1.0",
"@bem/sdk.naming.entity.stringify": "0.1.0",
"@bem/sdk.naming.presets": "0.1.0-alpha.21b40d0b",
"@bem/sdk.bemjson-to-decl": "^0.2.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ ?

* @param {Object} [options] Options.
* @param {String} [options.target='?.bemdecl.js'] Path to a built BEMDECL file.
* @param {String} [options.source='?.bemjson.js'] Path to a BEMJSON file.
* @param {String} [options.bemdeclFormat='bemdecl'] Format of result declaration (bemdecl or deps).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а зачем убрали пробелы?

return new BemCell({ entity: entity });
});

// bemdeclFormat: 'deps', 'bemdecl'
if (bemdeclFormat === 'deps') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess we should make this as a default.

if (bemdeclFormat === 'deps') {
decl = bemjsonDeps;
decl = bemDecl.format(cells, { format: 'enb' });
data = { deps: decl };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А разве у нас это не добавляется в формате?!

return new BemCell({ entity: entity });
});

// bemdeclFormat: 'deps', 'bemdecl'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do something like this:

({ bemdecl: 'v1', deps: 'enb' })[bemdeclFormat] || bemdeclFormat || 'enb'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And assert after this: Unsupported format ololo omg if there is nothing

}
const entities = bemjsonToDecl.convert(bemjson);
const cells = entities.map(entity => new BemCell({ entity }));
const bemdeclFormatName = convertBemdeclFormatName(bemdeclFormat);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нахрен тебе столько переменных, пятнашка

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ну либо называл бы уже format и дальше { format }

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нахрен тебе столько переменных

чтобы во время отладки смотреть промежуточный результат + переменные дают название промежуточному результату и становится понятно, что в нем

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну Вегед бы не одобрил)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а какие аргументы?

@blond blond merged commit b9012f0 into 3.x Oct 1, 2017
@blond blond deleted the bemjson-to-bemdecl branch October 1, 2017 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants