-
Notifications
You must be signed in to change notification settings - Fork 23
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
Conversation
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
?
techs/bemjson-to-bemdecl.js
Outdated
* @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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а зачем убрали пробелы?
techs/bemjson-to-bemdecl.js
Outdated
return new BemCell({ entity: entity }); | ||
}); | ||
|
||
// bemdeclFormat: 'deps', 'bemdecl' | ||
if (bemdeclFormat === 'deps') { |
There was a problem hiding this comment.
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.
techs/bemjson-to-bemdecl.js
Outdated
if (bemdeclFormat === 'deps') { | ||
decl = bemjsonDeps; | ||
decl = bemDecl.format(cells, { format: 'enb' }); | ||
data = { deps: decl }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А разве у нас это не добавляется в формате?!
techs/bemjson-to-bemdecl.js
Outdated
return new BemCell({ entity: entity }); | ||
}); | ||
|
||
// bemdeclFormat: 'deps', 'bemdecl' |
There was a problem hiding this comment.
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'
There was a problem hiding this comment.
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
3f0878d
to
8c07a74
Compare
} | ||
const entities = bemjsonToDecl.convert(bemjson); | ||
const cells = entities.map(entity => new BemCell({ entity })); | ||
const bemdeclFormatName = convertBemdeclFormatName(bemdeclFormat); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нахрен тебе столько переменных, пятнашка
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну либо называл бы уже format
и дальше { format }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нахрен тебе столько переменных
чтобы во время отладки смотреть промежуточный результат + переменные дают название промежуточному результату и становится понятно, что в нем
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ну Вегед бы не одобрил)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а какие аргументы?
8c07a74
to
7e12c98
Compare
No description provided.