-
Notifications
You must be signed in to change notification settings - Fork 2
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
Windows compatible #2
Open
pahaz
wants to merge
4
commits into
bevis-ui:master
Choose a base branch
from
pahaz:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,36 @@ | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
|
||
module.exports = function (config) { | ||
config.setLanguages(['ru', 'en']); | ||
|
||
config.nodes('build/*'); | ||
config.setLanguages(['ru']); | ||
|
||
config.nodeMask(/^build\/.*$/, function (nodeConfig) { | ||
nodeConfig.addTechs([ | ||
[require('enb/techs/file-provider'), {target: '?.bemdecl.js'}], | ||
[require('enb/techs/levels'), {levels: getLevels()}], | ||
require('enb-modules/techs/deps-with-modules'), | ||
require('enb/techs/files'), | ||
require('enb-stylus/techs/css-stylus-with-autoprefixer'), | ||
[require('enb/techs/browser-js'), {target: '?.pre.js'}], | ||
require('enb-bt/techs/bt-server'), | ||
[require('enb-bt/techs/bt-client-module'), {target: '?.client.bt.js'}], | ||
[require('enb/techs/pub-js-i18n') , { | ||
target: '?.pre.{lang}.js', | ||
jsTarget: '?.pre.js', | ||
bemhtmlTarget: '?.client.bt.js', | ||
lang: '{lang}' | ||
}], | ||
[require('enb-modules/techs/prepend-modules'), {source : '?.pre.{lang}.js', target: '?.{lang}.js'}], | ||
[require('enb/techs/i18n-merge-keysets'), {lang: 'all'}], | ||
[require('enb/techs/i18n-merge-keysets'), {lang: '{lang}'}], | ||
[require('./techs/i18n-lang-js'), {lang: 'all' }], | ||
[require('./techs/i18n-lang-js'), {lang: '{lang}'}], | ||
[require('./techs/page')] | ||
]); | ||
nodeConfig.addTargets(['_?.{lang}.js', '_?.css']); | ||
config.includeConfig('enb-bevis-helper'); | ||
|
||
nodeConfig.mode('development', function(nodeConfig) { | ||
nodeConfig.addTechs([ | ||
[require('enb/techs/file-copy'), {sourceTarget: '?.{lang}.js', destTarget: '_?.{lang}.js'}], | ||
[require('enb/techs/file-copy'), {sourceTarget: '?.css', destTarget: '_?.css'}] | ||
]); | ||
}); | ||
nodeConfig.mode('production', function(nodeConfig) { | ||
nodeConfig.addTechs([ | ||
[require('enb/techs/borschik'), {sourceTarget: '?.{lang}.js', destTarget: '_?.{lang}.js'}], | ||
[require('enb/techs/borschik'), {sourceTarget: '?.css', destTarget: '_?.css', freeze: 'yes'}] | ||
]); | ||
}); | ||
}); | ||
var bevisHelper = config.module('enb-bevis-helper') | ||
.browserSupport([ | ||
'IE >= 9', | ||
'Safari >= 5', | ||
'Chrome >= 33', | ||
'Opera >= 12.16', | ||
'Firefox >= 28' | ||
]) | ||
.useAutopolyfiller(); | ||
|
||
config.node('test', function (nodeConfig) { | ||
nodeConfig.addTechs([ | ||
[require('enb/techs/files')], | ||
[require('enb/techs/levels'), {levels: getLevels()}], | ||
[require('enb/techs/bemdecl-test'), {target: 'test.bemdecl.js'}], | ||
[require('enb/techs/js-test'), {fileMask: getTestFileMask()}], | ||
require('enb-modules/techs/deps-with-modules'), | ||
[require('enb/techs/i18n-merge-keysets'), {lang: 'all'}], | ||
[require('enb/techs/i18n-merge-keysets'), {lang: 'ru'}], | ||
[require('./techs/i18n-lang-js'), {lang: 'all' }], | ||
[require('./techs/i18n-lang-js'), {lang: 'ru'}], | ||
[require('enb/techs/js'), {target: '?.source.js'}], | ||
[require('enb-bt/techs/bt-client-module'), {target: '?.bt.client.js'}], | ||
[require('enb/techs/pub-js-i18n'), { | ||
target: '?.pre.js', | ||
jsTarget: '?.source.js', | ||
bemhtmlTarget: '?.bt.client.js', | ||
lang: 'ru' | ||
}], | ||
[require('enb-modules/techs/prepend-modules'), {source: '?.pre.js', target: '?.js'}], | ||
[require('enb/techs/file-provider'), {target: 'test.html'}], | ||
[require('enb/techs/file-provider'), {target: 'mocha.js'}], | ||
[require('enb/techs/file-provider'), {target: 'mocha.css'}], | ||
[require('enb/techs/file-provider'), {target: 'chai.js'}], | ||
[require('enb/techs/file-provider'), {target: 'sinon.js'}] | ||
]); | ||
fs.readdirSync('pages').forEach(function(pageName) { | ||
var nodeName = pageName.replace(/(.*?)\-page/, path.join('build', '$1')); | ||
|
||
nodeConfig.addTargets([ | ||
'?.js', | ||
'?.test.js' | ||
]); | ||
}); | ||
config.node(nodeName, function (nodeConfig) { | ||
|
||
function getLevels() { | ||
return [ | ||
'core', | ||
'blocks', | ||
'pages' | ||
].map(config.resolvePath.bind(config)); | ||
} | ||
bevisHelper | ||
.sourceDeps(pageName) | ||
.forServerPage() | ||
.configureNode(nodeConfig); | ||
|
||
nodeConfig.addTech(require('./techs/page')); | ||
nodeConfig.addTarget('?.page.js'); | ||
}); | ||
|
||
}); | ||
|
||
function getTestFileMask() { | ||
var tests = process.env.TEST_CASES; | ||
if (tests) { | ||
var filesForMask = tests.split(' ') | ||
.map(function (test) { | ||
return test | ||
.replace(/\//g, '\\/') | ||
.replace(/\./g, '\\.') + | ||
'$'; | ||
}) | ||
.join('|'); | ||
var fileMask = new RegExp(filesForMask); | ||
} | ||
return fileMask || /^((?!vendors).)*$/; | ||
} | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
.layout { | ||
&__aside { | ||
position: absolute; | ||
left: 0px; | ||
top: 0px; | ||
} | ||
|
||
&__content { | ||
margin-left: 300px; | ||
} | ||
.layout__aside { | ||
position: absolute; | ||
left: 0px; | ||
top: 0px; | ||
} | ||
|
||
.layout__content { | ||
margin-left: 300px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you speak russian?
Почему вы хотите писать именно так? Нам нравится использовать возможности Stylus.
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.
Yes.
К сожалению, я не нашел списка используемых в ваших проектах соглашений и рекомендаций.
Для начинающих разработчиков явный синтаксис будет более понятен. (+ https://github.com/bevis-ui/bevis-stub/blob/master/blocks/layout/layout.styl#L1-L9 использует подобный синтаксис)
Я посчитал, что project-stub имеет больший приоритет в данном случае.
Должен быть какой-то канонический пример или список рекомендаций (в данном случае я использовал project-stub).
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.
Согласен с вами. Я сам виноват, что ввожу в заблуждение разношёрстным кодом :)