Skip to content

Commit

Permalink
docs: add resource page (#364)
Browse files Browse the repository at this point in the history
Closes #287
  • Loading branch information
popomore authored and fengmk2 committed Feb 13, 2017
1 parent c52cbbf commit 0bbfa7b
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 17 deletions.
1 change: 1 addition & 0 deletions docs/source/_data/guide_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ Advanced:
View Plugin: /advanced/view-plugin.html
Community:
Contributing: /contributing.html
Resource: /resource.html
# Member Guide: /member_guide.html
# FAQ: /faq.html
13 changes: 13 additions & 0 deletions docs/source/zh-cn/resource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
title: 资源
---

## 框架列表

- [aliyun-egg](https://github.com/eggjs/aliyun-egg)

## 社区文章

- [如何评价阿里开源的企业级 Node.js 框架 egg?](https://www.zhihu.com/question/50526101/answer/144952130)
[天猪](https://github.com/atian25)

- 你也可以到[知乎专栏](https://zhuanlan.zhihu.com/eggjs)看我们的文章
1 change: 0 additions & 1 deletion docs/source/zh-cn/tutorials/async-function.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

title: 使用 async function 开发应用
---

Expand Down
1 change: 1 addition & 0 deletions docs/themes/egg/languages/zh-cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ guide_toc:
Contributing: 如何贡献
Member Guide: 成员指南
FAQ: 常见问题
Resource: 资源
11 changes: 6 additions & 5 deletions scripts/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ co(function* () {
}

console.log('Copying CONTRIBUTING.md');
yield copyFile('CONTRIBUTING.md', 'docs/source/contributing.md');
yield copyFile('CONTRIBUTING.zh-CN.md', 'docs/source/zh-cn/contributing.md');
yield copyContributing('CONTRIBUTING.md', 'docs/source/en/contributing.md');
yield copyContributing('CONTRIBUTING.zh-CN.md', 'docs/source/zh-cn/contributing.md');

yield rm('docs/public');
yield runscript('npminstall', { cwd: 'docs' });
Expand Down Expand Up @@ -65,9 +65,10 @@ function* deploy() {
});
}

function* copyFile(src, dist) {
const buf = yield fs.readFile(src);
yield fs.writeFile(dist, buf);
function* copyContributing(src, target) {
let content = yield fs.readFile(src, 'utf8');
content = content.replace(/^#\s*(.*?)\n/, 'title: $1\n---\n');
yield fs.writeFile(target, content);
}

function rm(dir) {
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/apps/logger-level-debug/app/router.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
'use strict';

const sleep = require('ko-sleep');


module.exports = app => {
app.get('/', function*() {
this.logger.debug('hi %s %s', this.method, this.url);
// wait for writing to file
yield sleep(1000);
this.body = 'ok';
});
};
24 changes: 13 additions & 11 deletions test/lib/core/messenger.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,19 @@ describe('test/lib/core/messenger.test.js', () => {
});
after(() => app.close());

it('app should accept agent message', done => {
setTimeout(() => {
const m = app.stdout.match(/\d+=\d+/g);
const map = new Map();
for (const item of m) {
const a = item.split('=');
map.set(a[0], a[1]);
}
map.size.should.equal(4);
done();
}, 8000);
it('app should accept agent message', function* () {
yield sleep(10000);

const m = app.stdout.match(/\d+=\d+/g);
const map = new Map();
for (const item of m) {
const a = item.split('=');
map.set(a[0], a[1]);
}
for (const [ pid, count ] of map) {
console.log('pid: %s, %s', pid, count);
}
map.size.should.equal(4);
});
});

Expand Down

0 comments on commit 0bbfa7b

Please sign in to comment.