Skip to content

Commit 0ffde0f

Browse files
committed
Update
1 parent 26e37a9 commit 0ffde0f

13 files changed

+213
-221
lines changed

.enb/make.js

+17-16
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ var techs = {
77
borschik: require('enb-borschik/techs/borschik'),
88

99
// css
10-
cssStylus: require('enb-stylus/techs/stylus'),
10+
stylus: require('enb-stylus/techs/stylus'),
1111

1212
// js
13-
browserJs: require('enb-diverse-js/techs/browser-js'),
14-
prependYm: require('enb-modules/techs/prepend-modules'),
13+
browserJs: require('enb-js/techs/browser-js'),
1514

1615
// bemtree
1716
bemtree: require('enb-bemxjst/techs/bemtree'),
1817

1918
// bemhtml
20-
bemhtml: require('enb-bemxjst/techs/bemhtml')
19+
bemhtml: require('enb-bemxjst/techs/bemhtml'),
20+
bemtreeToHtml: require('./techs/bemtree-to-html')
2121
},
2222
enbBemTechs = require('enb-bem-techs'),
2323
levels = [
@@ -43,20 +43,22 @@ module.exports = function(config) {
4343
[enbBemTechs.files],
4444

4545
// css
46-
[techs.cssStylus, {
46+
[techs.stylus, {
4747
target: '?.css',
48+
sourcemap: !isProd,
4849
autoprefixer: {
4950
browsers: ['ie >= 10', 'last 2 versions', 'opera 12.1', '> 2%']
5051
}
5152
}],
5253

5354
// bemtree
54-
[techs.bemtree, { devMode: process.env.BEMTREE_ENV === 'development' }],
55+
[techs.bemtree, { sourceSuffixes: ['bemtree', 'bemtree.js'] }],
5556

5657
// bemhtml
57-
[techs.bemhtml, { devMode: process.env.BEMHTML_ENV === 'development' }],
58+
[techs.bemhtml, { sourceSuffixes: ['bemhtml', 'bemhtml.js'] }],
5859

59-
[require('./techs/bemtree-to-html')],
60+
// html
61+
[techs.bemtreeToHtml],
6062

6163
// client bemhtml
6264
[enbBemTechs.depsByTechToBemdecl, {
@@ -76,22 +78,21 @@ module.exports = function(config) {
7678
[techs.bemhtml, {
7779
target: '?.browser.bemhtml.js',
7880
filesTarget: '?.bemhtml.files',
79-
devMode: process.env.BEMHTML_ENV === 'development'
81+
sourceSuffixes: ['bemhtml', 'bemhtml.js']
8082
}],
8183

8284
// js
83-
[techs.browserJs],
85+
[techs.browserJs, { includeYM: true }],
8486
[techs.fileMerge, {
85-
target: '?.pre.js',
86-
sources: ['?.browser.bemhtml.js', '?.browser.js']
87+
target: '?.js',
88+
sources: ['?.browser.js', '?.browser.bemhtml.js']
8789
}],
88-
[techs.prependYm, { source: '?.pre.js' }],
8990

9091
// borschik
91-
[techs.borschik, { sourceTarget: '?.js', destTarget: '?.min.js', freeze: true, minify: isProd }],
92-
[techs.borschik, { sourceTarget: '?.css', destTarget: '?.min.css', tech: 'cleancss', freeze: true, minify: isProd }]
92+
[techs.borschik, { source: '?.js', target: '?.min.js', minify: isProd }],
93+
[techs.borschik, { source: '?.css', target: '?.min.css', tech: 'cleancss', minify: isProd }]
9394
]);
9495

95-
nodeConfig.addTargets(['?.bemtree.js', '?.html', '?.min.css', '?.min.js']);
96+
nodeConfig.addTargets(['?.html', '?.min.css', '?.min.js']);
9697
});
9798
};

.enb/techs/bemtree-to-html.js

+6-14
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,20 @@
1616
* nodeConfig.addTech(require('enb/techs/html-from-bemjson'));
1717
* ```
1818
*/
19-
var vow = require('vow'),
20-
vfs = require('enb/lib/fs/async-fs'),
21-
asyncRequire = require('enb/lib/fs/async-require'),
22-
dropRequireCache = require('enb/lib/fs/drop-require-cache');
19+
var dropRequireCache = require('enb/lib/fs/drop-require-cache');
2320

2421
module.exports = require('enb/lib/build-flow').create()
2522
.name('html-from-bemtree')
2623
.target('destTarget', '?.html')
2724
.useSourceFilename('bemtreeTarget', '?.bemtree.js')
2825
.useSourceFilename('bemhtmlTarget', '?.bemhtml.js')
2926
.builder(function(bemtreeFilename, bemhtmlFilename) {
27+
dropRequireCache(require, bemtreeFilename);
3028
dropRequireCache(require, bemhtmlFilename);
3129

32-
return vow.all([
33-
asyncRequire(bemtreeFilename),
34-
asyncRequire(bemhtmlFilename)
35-
])
36-
.spread(function(bemtree, bemhtml) {
37-
return bemtree.BEMTREE.apply({ block: 'root' })
38-
.then(function(bemjson) {
39-
return bemhtml.BEMHTML.apply(bemjson);
40-
});
41-
});
30+
var BEMTREE = require(bemtreeFilename).BEMTREE,
31+
BEMHTML = require(bemhtmlFilename).BEMHTML;
32+
33+
return BEMHTML.apply(BEMTREE.apply({ block: 'root' }));
4234
})
4335
.createTech();

.travis.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: node_js
22
node_js:
3-
- "0.11"
4-
- "0.10"
3+
- "0.12"
54

65
script:
7-
- "node_modules/.bin/bem make"
6+
- "npm run make"

README.md

-90
Original file line numberDiff line numberDiff line change
@@ -1,91 +1 @@
11
# Stub to start a new [BEM](https://bem.info) project
2-
3-
Project-stub is a template project repository used for BEM projects creation. It contains the minimal configuration files and folders you will need for quick start from scratch.
4-
5-
There are two main BEM libraries are linked here by default:
6-
7-
* [bem-core](https://github.com/bem/bem-core)
8-
* [bem-components](https://github.com/bem/bem-components)
9-
10-
Just try and taste BEM!
11-
12-
## Installation requirements
13-
14-
- [Node.js](http://nodejs.org) is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications.
15-
16-
## Installation
17-
18-
So, how easy is it to get started with BEM? *Super easy*.
19-
20-
It's as easy as...
21-
22-
git clone https://github.com/bem/project-stub.git -b bem-core my-bem-project
23-
cd my-bem-project
24-
npm install
25-
26-
## Usage
27-
28-
Now you can run any bem-tools commands from a `./node_modules/bem/bin/bem` directory.
29-
To be able to run bem-tools commands without typing a full path to an executable file (node_modules/bem/bin/bem), use bem-cli npm package:
30-
31-
`npm install -g bem-cli` or use an alternative method `export PATH=./node_modules/.bin:$PATH`
32-
33-
**Start the server:**
34-
35-
```bash
36-
bem server # bem server -p 8080 -v info|silly|debug|verbose|warn|error
37-
```
38-
39-
> **hint:** execute the above commands in your terminal
40-
41-
Now that `bem server ` is running, check it out:
42-
43-
navigate to: http://localhost:8080/desktop.bundles/index/index.html
44-
45-
Stopping the server is also easy, pressing `Ctrl` + `C` while the terminal is your active window will stop the server.
46-
47-
**Add block:**
48-
49-
bem create -l desktop.blocks -b newBlock
50-
51-
**Add page:**
52-
53-
bem create -l desktop.bundles -b page
54-
55-
> **hint:** you can add aliases for super easy use
56-
57-
<pre><code class="lasso">echo "alias 'bemblock'='bem create -l desktop.blocks -b'" >> ~/.bashrc
58-
echo "alias 'bempage'='bem create -l desktop.bundles -b'" >> ~/.bashrc
59-
</code></pre>
60-
61-
## Generator of BEM projects for Yeoman
62-
63-
This generator provides you the ability to get the base of BEM project in few minutes by answering the simple questions.
64-
- [generator-bem-stub](https://en.bem.info/tools/bem/bem-stub/)
65-
66-
## Docs
67-
68-
- [Full stack quick start](https://en.bem.info/articles/start-with-project-stub/)
69-
- [Tutorial for BEMJSON template-engine](https://en.bem.info/technology/bemjson/current/bemjson/)
70-
- [Tutorial on BEMHTML](https://en.bem.info/libs/bem-core/2.0.0/bemhtml/reference/)
71-
- [Tutorial on i-bem.js](https://en.bem.info/tutorials/bem-js-tutorial/)
72-
- [JavaScript for BEM: main terms](https://en.bem.info/articles/bem-js-main-terms/)
73-
- [Commands bem-tools](https://en.bem.info/tools/bem/bem-tools/commands/)
74-
75-
## Project-stub based projects
76-
77-
- [Creating BEM application on Leaflet and 2GIS API](https://en.bem.info/tutorials/firm-card-story/)
78-
- [Creating a menu of geo objects collections with Yandex.Maps API and BEM](https://en.bem.info/tutorials/yamapsbem/)
79-
- [SSSR (Social Services Search Robot)](https://github.com/bem/sssr) — study app with BEM full-stack
80-
81-
## Useful tools
82-
83-
- [bem-cli](https://en.bem.info/blog/bem-cli/) — run bem-tools locally
84-
- [borschik](https://en.bem.info/tools/optimizers/borschik/) — borschik is a simple but powerful builder for text-based file formats
85-
86-
## Videos
87-
- [BEM for JavaScript Talk on Camp JS](https://en.bem.info/talks/campjs-melbourne-2014/)
88-
89-
## Working under Windows environment
90-
91-
- [bemup-workshop-vagrant](https://github.com/dab/bemup-workshop-vagrant/blob/master/README.ru.md) — Provisions a clean VirtualBox Ubuntu server instance with all needed Node.js development tools

0 commit comments

Comments
 (0)