Skip to content

Commit 617785e

Browse files
committed
Merge languages
1 parent c26bb8f commit 617785e

8 files changed

Lines changed: 1085 additions & 2389 deletions

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm
8585
- Response
8686
- [HTTP/2](https://en.wikipedia.org/wiki/HTTP/2)
8787
- Compression
88-
- Encryption
8988
- Minification
9089
- Server Push
9190
- WebSocket
@@ -218,7 +217,7 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm
218217
- [RequireJS](http://requirejs.org/) [[GitHub]](https://github.com/jrburke/requirejs/)
219218
- UMD
220219
- umd [[GitHub]](https://github.com/umdjs/umd/)
221-
- JavaScript framework
220+
- JavaScript Framework
222221
- [AngularJS](https://angularjs.org/) [[GitHub]](https://github.com/angular/angular.js/)
223222
- [Backbone](http://backbonejs.org/) [[GitHub]](https://github.com/jashkenas/backbone/)
224223
- [Knockout](http://knockoutjs.com/) [[GitHub]](https://github.com/SteveSanderson/knockout/)

README.zh-cn.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,10 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
9292
- 响应
9393
- [HTTP/2](https://en.wikipedia.org/wiki/HTTP/2)
9494
- 压缩
95-
- 加密
96-
- 缩小
95+
- 打包
9796
- 服务器端推送
9897
- WebSocket
99-
- 三大支柱
98+
- Web三剑客
10099
- HTML (HyperText Markup Language)
101100
- CSS (Cascading Style Sheets)
102101
- JavaScript
@@ -129,7 +128,7 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
129128
- [WebKit (Safari)](http://www.webkit.org/)
130129
- [Blink / prev. Presto (Opera)](http://www.chromium.org/blink)
131130
- [EdgeHTML (Edge)](https://en.wikipedia.org/wiki/EdgeHTML)
132-
- JavaScript引擎
131+
- 脚本引擎
133132
- [JScript (IE8- / ASP)](https://en.wikipedia.org/wiki/JScript)
134133
- [Chakra (IE9+ / Edge)](https://en.wikipedia.org/wiki/Chakra_(JScript_engine))
135134
- [V8 (Chrome / Opera / Nodejs / MongoDB)](https://developers.google.com/v8/?hl=zh-CN) [[GitHub]](https://github.com/v8/v8/)
@@ -140,10 +139,10 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
140139
- Local Cache
141140
- Session Storage
142141
- Local Storage
143-
- 组件
142+
- Components
144143
- Extensions
145144
- Plugins
146-
- 资源
145+
- Resources
147146
- Images
148147
- Icons
149148
- Fonts
@@ -162,9 +161,9 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
162161
- Dreamweaver ;-)
163162
- FrontPage ;-)
164163
- 编译任务
165-
- 缩小
164+
- 精简
166165
- 编译
167-
- 拼接
166+
- 合并
168167
- 混淆
169168
- 图像优化
170169
- 单元测试
@@ -175,7 +174,7 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
175174
- [Yeoman](http://yeoman.io/)
176175
- Broccoli [[GitHub]](https://github.com/broccolijs/broccoli/)
177176
- 调试
178-
- [开发者工具](https://developer.chrome.com/devtools)
177+
- [Developer Tools](https://developer.chrome.com/devtools)
179178
- [Firebug](http://getfirebug.com/) [[GitHub]](https://github.com/firebug/firebug/)
180179
- 基础工具
181180
- [Node.js](https://nodejs.org/) [[GitHub]](https://github.com/joyent/node/)
@@ -185,7 +184,7 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
185184
- [JSHint](http://jshint.com/) [[GitHub]](https://github.com/jshint/jshint/)
186185
- [jscs](http://jscs.info/) [[GitHub]](https://github.com/jscs-dev/node-jscs)
187186
- [Closure Linter](https://developers.google.com/closure/utilities/)
188-
- 打包
187+
- 包管理
189188
- [npm](https://www.npmjs.com/) [[GitHub]](https://github.com/npm/npm/)
190189
- [Bower](http://bower.io/) [[GitHub]](https://github.com/bower/bower/)
191190
- 测试
@@ -200,7 +199,7 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
200199
- [Sinon.JS](http://sinonjs.org/) [[GitHub]](https://github.com/cjohansen/Sinon.JS/)
201200
- [Karma](http://karma-runner.github.io/) [[GitHub]](https://github.com/karma-runner/karma/)
202201
- nodeunit [[GitHub]](https://github.com/caolan/nodeunit/)
203-
- 在线测试
202+
- 在线工具
204203
- [Sauce Labs](https://saucelabs.com/)
205204
- [Browser Stack](https://www.browserstack.com/)
206205
- [Browser Shots](http://browsershots.org/)
@@ -209,14 +208,14 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
209208
- [Cross Browser Testing](https://crossbrowsertesting.com/)
210209
- [Browsera](http://www.browsera.com/)
211210
- [SortSite](http://www.powermapper.com/products/sortsite/checks/browser-compatibility/)
212-
- 框架/类库
213-
- JavaScript基础类库
211+
- 库 / 框架
212+
- 基础库
214213
- [jQuery](https://jquery.com/) [[GitHub]](https://github.com/jquery/jquery/)
215214
- [Prototype](http://prototypejs.org/) [[GitHub]](https://github.com/sstephenson/prototype/)
216215
- [Zepto](http://zeptojs.com/) [[GitHub]](https://github.com/madrobby/zepto/)
217216
- [MooTool](http://mootools.net/) [[GitHub]](https://github.com/mootools/mootools-core/)
218217
- [Underscore](http://underscorejs.org/) [[GitHub]](https://github.com/jashkenas/underscore/)
219-
- Modular
218+
- 模块化
220219
- ES6 Module
221220
- CommonJS
222221
- [webpack](http://webpack.github.io/) [[GitHub]](https://github.com/webpack/webpack/)
@@ -225,7 +224,7 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
225224
- [RequireJS](http://requirejs.org/) [[GitHub]](https://github.com/jrburke/requirejs/)
226225
- UMD
227226
- umd [[GitHub]](https://github.com/umdjs/umd/)
228-
- JavaScript框架
227+
- 框架
229228
- [AngularJS](https://angularjs.org/) [[GitHub]](https://github.com/angular/angular.js/)
230229
- [Backbone](http://backbonejs.org/) [[GitHub]](https://github.com/jashkenas/backbone/)
231230
- [Knockout](http://knockoutjs.com/) [[GitHub]](https://github.com/SteveSanderson/knockout/)
@@ -234,7 +233,7 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
234233
- [polymer](https://www.polymer-project.org/) [[GitHub]](https://github.com/polymer/polymer/)
235234
- [Deft.js](http://deftjs.org/) [[GitHub]](https://github.com/deftjs/DeftJS/)
236235
- [Vue](http://vuejs.org/) [[GitHub]](https://github.com/yyx990803/vue/)
237-
- 界面框架
236+
- UI框架
238237
- [Bootstrap](http://getbootstrap.com/) [[GitHub]](https://github.com/twbs/bootstrap/)
239238
- [Semantic UI ](http://semantic-ui.com/) [[GitHub]](https://github.com/Semantic-Org/Semantic-UI/)
240239
- [Foundation](http://foundation.zurb.com/) [[GitHub]](https://github.com/zurb/foundation/)
@@ -243,7 +242,7 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
243242
- WebSocket
244243
- [Socket.io](http://socket.io/) [[GitHub]](https://github.com/Automattic/socket.io/)
245244
- web-socket-js [[GitHub]](https://github.com/gimite/web-socket-js/)
246-
- 数据呈现
245+
- 数据可视化
247246
- [D3](http://d3js.org/) [[GitHub]](https://github.com/mbostock/d3/wiki/Gallery/)
248247
- [Echarts](http://echarts.baidu.com) [[GitHub]](https://github.com/ecomfe/esl/)
249248
- [HighCharts](http://www.highcharts.com/) [[GitHub]](https://github.com/highslide-software/highcharts.com/)
@@ -253,12 +252,12 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
253252
- [Three.js](http://threejs.org/) [[GitHub]](https://github.com/mrdoob/three.js/)
254253
- [Babylon.js](http://www.babylonjs.com/) [[GitHub]](https://github.com/BabylonJS/Babylon.js/)
255254
- [Pixi.js](http://www.pixijs.com/) [[GitHub]](https://github.com/GoodBoyDigital/pixi.js/)
256-
- CSS3动画
255+
- CSS3 动画
257256
- [Animate.css](https://daneden.github.io/animate.css/) [[GitHub]](https://github.com/daneden/animate.css/)
258257
- [bounce.js](http://bouncejs.com/) [[GitHub]](https://github.com/tictail/bounce.js/)
259258
- [Effeckt.css](https://h5bp.github.io/Effeckt.css/) [[GitHub]](https://github.com/h5bp/Effeckt.css/)
260259
- [move.js](https://visionmedia.github.io/move.js/) [[GitHub]](https://github.com/visionmedia/move.js/)
261-
- Flow Controller
260+
- 流程控制
262261
- ES6
263262
- Promise
264263
- Generator
@@ -271,15 +270,15 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
271270
- Bluebird [[GitHub]](https://github.com/petkaantonov/bluebird/)
272271
- q [[GitHub]](https://github.com/kriskowal/q/)
273272
- when.js [[GitHub]](https://github.com/cujojs/when/)
274-
- Functional
273+
- 函数式编程
275274
- backon.js [[GitHub]](https://github.com/baconjs/bacon.js/)
276275
- [immutable.js](https://facebook.github.io/immutable-js/) [[GitHub]](https://github.com/facebook/immutable-js/)
277-
- 移动界面
276+
- 手机 UI 框架
278277
- [jQuery Mobile](https://jquerymobile.com/) [[GitHub]](https://github.com/jquery/jquery-mobile/)
279278
- [Jo](http://joapp.com/) [[GitHub]](https://github.com/davebalmer/jo/)
280279
- [Dojo Mobile](https://dojotoolkit.org/reference-guide/1.10/dojox/mobile.html)
281280
- [Lungo](http://lungo.tapquo.com/) [[GitHub]](https://github.com/tapquo/Lungo.js/)
282-
- CSS预处理
281+
- CSS 预处理器
283282
- LESS
284283
- [LESS](http://lesscss.org/) [[GitHub]](https://github.com/less/less.js/)
285284
- [Hat](http://lesshat.madebysource.com/) [[GitHub]](https://github.com/csshat/lesshat/)
@@ -289,15 +288,15 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
289288
- [Gumby](http://www.gumbyframework.com/) [[GitHub]](https://github.com/GumbyFramework/Gumby/)
290289
- Stylus
291290
- nib [[GitHub]](https://github.com/tj/nib/)
292-
- 模板
291+
- 模板引擎
293292
- [Handlebars](http://handlebarsjs.com/) [[GitHub]](https://github.com/wycats/handlebars.js/)
294293
- [Haml](http://haml.info/) [[GitHub]](https://github.com/haml/haml/)
295294
- [Slim](http://slim-lang.com/) [[GitHub]](https://github.com/slim-template/slim/)
296295
- [Jade](http://jade-lang.com/) [[GitHub]](https://github.com/jadejs/jade/)
297296
- [Ejs](http://www.embeddedjs.com/)
298297
- [Spacebars](http://meteorcapture.com/spacebars/)
299298
- mustache [[GitHub]](https://github.com/janl/mustache.js/)
300-
- 现代化
299+
- 统一化
301300
- Normalize
302301
- Reset
303302
- 最佳实践
@@ -314,7 +313,7 @@ https://rawgit.com/unruledboy/WebFrontEndStack/master/ux/WebFrontEndStack.htm?lo
314313
- [Dart](https://www.dartlang.org/) [[GitHub]](https://github.com/dart-lang/sdk/)
315314
- [LiveScript](http://livescript.net/) [[GitHub]](https://github.com/gkz/LiveScript/)
316315
- ClojureScript [[GitHub]](https://github.com/clojure/clojurescript/)
317-
- 移动应用
316+
- 移动应用开发
318317
- [PhoneGap / Cordova](https://cordova.apache.org/) [[GitHub]](https://github.com/apache/cordova-android/)
319318
- [MUI](http://dev.dcloud.net.cn/mui/) [[GitHub]](https://github.com/dcloudio/mui/)
320319
- [React Native](https://facebook.github.io/react-native/) [[GitHub]](https://github.com/facebook/react-native/)

Web Front End Stack.png

277 KB
Loading

Web Front End Stack.zh-cn.png

256 KB
Loading

index.js

Lines changed: 72 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,25 @@ var promisify = function promisify(object) {
5757
/**
5858
* Recursion to generate readme
5959
* @param object object
60+
* @param string language
6061
* @param int deep
6162
* @return string
6263
*/
63-
var buildReadme = function buildReadme(object, deep) {
64+
var buildReadme = function buildReadme(object, language, deep) {
6465
var deeper = deep + 1;
6566
var deepString = "\t".repeat(deep) + "- ";
6667
var ret = [];
68+
var lang = typeof object.languages == "undefined" ? object.name : object.languages[language];
69+
lang = lang || object.name;
70+
6771
ret.push((function(deepString, name, url, github) {
6872
var haveUrl = !!url;
6973
var haveGitHub = !!github;
70-
return deepString + (haveUrl ? "[" : "") + object.name + (haveUrl ? "](" + url + ")" : "") + (haveGitHub ? " [\[GitHub\]](" + github + ")" : "");
71-
})(deepString, object.name, object.url, object.github));
74+
return deepString + (haveUrl ? "[" : "") + name + (haveUrl ? "](" + url + ")" : "") + (haveGitHub ? " [\[GitHub\]](" + github + ")" : "");
75+
})(deepString, lang, object.url, object.github));
7276
if (object.children) {
7377
object.children.map(function(value, index) {
74-
ret.push(buildReadme(value, deeper));
78+
ret.push(buildReadme(value, language, deeper));
7579
});
7680
}
7781
return ret.join("\n");
@@ -86,7 +90,7 @@ var actions = {
8690
*/
8791
updatestargazers: function updatestargazers() {
8892
return new Promise(function(resolve, reject) {
89-
var originalData = JSON.parse(fs.readFileSync('./ux/WebFrontEndStack' + config.locale + '.json', "utf-8")); // Require will lock the file.
93+
var originalData = JSON.parse(fs.readFileSync('./ux/WebFrontEndStack.json', "utf-8")); // Require will lock the file.
9094
var getGitHubApi = function(github) {
9195
var githubArray = github.split("/");
9296
// I want a sprintf T_T
@@ -139,7 +143,7 @@ var actions = {
139143
q.push({ // For some reason, the ``drain`` will not be called.
140144
noRequest: true
141145
}, function() {
142-
fs.writeFileAsync('./ux/WebFrontEndStack' + config.locale + '.json', JSON.stringify(originalData), "utf-8").then(function() {
146+
fs.writeFileAsync('./ux/WebFrontEndStack.json', JSON.stringify(originalData), "utf-8").then(function() {
143147
resolve();
144148
});
145149
});
@@ -151,57 +155,76 @@ var actions = {
151155
* @return Promise<any>
152156
*/
153157
phantomjs: function phantomjs() {
158+
var json = require('./ux/WebFrontEndStack.json');
154159
var phantom = require('phantom');
155-
var ph;
156-
var page;
157160
promisify(phantom);
158161
// What the fucking API
159-
return phantom.createAsync().then(function(phantom) {
160-
ph = phantom;
161-
promisify(ph);
162-
console.log("Created Phantomjs");
163-
return ph.createPageAsync();
164-
}).then(function(pg) {
165-
page = pg;
166-
promisify(pg);
167-
return page.setAsync('viewportSize', {
168-
width: pageWidth,
169-
height: pageHeight
162+
var resolver = Promise.defer();
163+
var buildByLanguage = function(language) {
164+
var displayLanguage = language == "" ? "en" : language;
165+
var ph;
166+
var page;
167+
return phantom.createAsync().then(function(phantom) {
168+
ph = phantom;
169+
promisify(ph);
170+
console.log("Created Phantomjs for " + displayLanguage);
171+
return ph.createPageAsync();
172+
}).then(function(pg) {
173+
page = pg;
174+
promisify(pg);
175+
return page.setAsync('viewportSize', {
176+
width: pageWidth,
177+
height: pageHeight
178+
});
179+
}).then(function() {
180+
console.log("Set viewportSize");
181+
console.log("Opening " + httpServer + "?locale=" + language + " for " + displayLanguage);
182+
return page.openAsync(httpServer + "?locale=" + language);
183+
}).then(function(status) {
184+
console.log("Rendered HTML, the image will be saved after 2 seconds.");
185+
if (status == "success") {
186+
return Promise.delay(2000);
187+
} else {
188+
throw status;
189+
}
190+
}).then(function() {
191+
return page.renderAsync(path.join(__dirname, 'Web Front End Stack' + (language == "" ? "" : ".") + language + '.png'));
192+
}).then(function() {
193+
console.log("The image(" + displayLanguage + ") saved successfully!");
194+
page.close();
195+
ph.exit();
170196
});
171-
}).then(function() {
172-
console.log("Set viewportSize");
173-
return page.openAsync(httpServer);
174-
}).then(function(status) {
175-
console.log("Rendered HTML, the image will be saved after 2 seconds.");
176-
if (status == "success") {
177-
return Promise.delay(2000);
178-
} else {
179-
return reject(status);
180-
}
181-
}).then(function() {
182-
return page.renderAsync(path.join(__dirname, 'Web Front End Stack' + config.locale + '.png'));
183-
}).then(function() {
184-
console.log("The image saved successfully!");
185-
page.close();
186-
ph.exit();
187-
});
197+
};
198+
resolver.promise.then(buildByLanguage(""));
199+
for (var item in json.languages) {
200+
resolver.promise.then(buildByLanguage(item));
201+
}
202+
return resolver.promise;
188203
},
189204

190205
/**
191206
* To rebuild the README.md
192207
* @return Promise<any>
193208
*/
194209
readme: function readme() {
195-
var json = require('./ux/WebFrontEndStack' + config.locale + '.json');
196-
return Promise.resolve().then(function() {
197-
return fs.readFileAsync('./README' + config.locale + '.md', "utf-8");
198-
}).then(function(fileContent) {
199-
var ret = buildReadme(json, 0);
200-
fileContent = fileContent.replace(/<\!--BUILD_START-->[\d\D]+?<\!--BUILD_END-->/, "{%BuildStart%}")
201-
return fs.writeFileAsync('./README' + config.locale + '.md', fileContent.replace("{%BuildStart%}", "<!--BUILD_START-->\n\n" + ret + "\n\n<!--BUILD_END-->", "utf-8"));
202-
}).then(function() {
203-
console.log('Readme built successfully!');
204-
})
210+
var json = require('./ux/WebFrontEndStack.json');
211+
var resolver = Promise.defer();
212+
var buildByLanguage = function(language) {
213+
return Promise.resolve().then(function() {
214+
return fs.readFileAsync('./README' + (language == "" ? "" : ".") + language + '.md', "utf-8");
215+
}).then(function(fileContent) {
216+
var ret = buildReadme(json, language, 0);
217+
fileContent = fileContent.replace(/<\!--BUILD_START-->[\d\D]+?<\!--BUILD_END-->/, "{%BuildStart%}")
218+
return fs.writeFileAsync('./README' + (language == "" ? "" : ".") + language + '.md', fileContent.replace("{%BuildStart%}", "<!--BUILD_START-->\n\n" + ret + "\n\n<!--BUILD_END-->", "utf-8"));
219+
}).then(function() {
220+
console.log('Readme' + (language == "" ? "" : ":") + language + ' built successfully!');
221+
})
222+
};
223+
resolver.promise.then(buildByLanguage(""));
224+
for (var item in json.languages) {
225+
resolver.promise.then(buildByLanguage(item));
226+
}
227+
return resolver.promise;
205228
},
206229
/**
207230
* To start an express server
@@ -214,10 +237,10 @@ var actions = {
214237
.set('view engine', 'html')
215238
.use(express.static(path.join(__dirname, '/ux')))
216239
.use('/', function(req, res) {
217-
res.redirect('/WebFrontEndStack.htm?locale=' + config.rawLocale);
240+
res.redirect('/WebFrontEndStack.htm?locale=' + req.query.locale);
218241
})
219242
.listen(config.port, function() {
220-
console.info('Express started on: http://127.0.0.1:' + config.port + '?locale=' + config.rawLocale);
243+
console.info('Express started on: http://127.0.0.1:' + config.port);
221244
resolver(app);
222245
});
223246
});
@@ -239,6 +262,7 @@ process.argv.forEach(function(val) {
239262

240263
var promise = Promise.all(queue);
241264
if (queue.length > 1) { // for somebody who only want to start the server.
265+
console.log("You can press Ctrl+C to exit if tasks finished.")
242266
promise.then(function() {
243267
console.log("OK!");
244268
process.exit(0);

0 commit comments

Comments
 (0)