Skip to content

Commit eeba27b

Browse files
committed
[T] refactor
1 parent c76e934 commit eeba27b

23 files changed

+2265
-1855
lines changed
File renamed without changes.

chapters/01-start-project.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
创建开源项目
2+
---
3+
4+
5+
取一个好的名字
6+
---
7+
8+
9+
挑选好 LICENSE
10+
---
11+
12+
13+
官方主页
14+
---
15+
16+
GitHub Pages
17+

chapters/04-create-project-documents.md renamed to chapters/03-create-project-documents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#创建项目文档
1+
# 创建项目文档
22

33
我们需要为我们的项目创建一个文档,通常我们可以将核心代码以外的东西都称为文档:
44

chapters/03-build-github-project.md renamed to chapters/04-build-github-project.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#构建GitHub项目
1+
# 构建GitHub项目
22

3-
##如何用好GitHub
3+
## 如何用好GitHub
44

55
如何用好GitHub,并实践一些敏捷软件开发是一个很有意思的事情.我们可以在上面做很多事情,从测试到CI,再到自动部署.
66

chapters/05-tdd-with-autotest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#测试
1+
# 改善 GitHub 项目代码质量:测试
22

33
##TDD
44

chapters/06-refactor-project.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#重构
1+
# 改善 GitHub 项目代码质量:重构
22

33
或许你应该知道了,重构是怎样的,你也知道重构能带来什么。在我刚开始学重构和设计模式的时候,我需要去找一些好的示例,以便于我更好的学习。有时候不得不创造一些更好的场景,来实现这些功能。
44

@@ -8,7 +8,7 @@
88

99
艺,需要有创造性的方法。
1010

11-
##为什么重构?
11+
## 为什么重构?
1212

1313
> 为了更好的代码。
1414
@@ -24,7 +24,7 @@
2424

2525
让我们来看看我们的第一个训练,相当有挑战性。
2626

27-
##重构uMarkdown
27+
## 重构uMarkdown
2828

2929
代码及setup请见github: [js-refactor](https://github.com/artisanstack/js-refactor)
3030

chapters/07-github-marketing.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
除了擅长编写 md 电子书来攒 star,我还写了一系列的开源软件,也掌握了一些项目运营的技巧。
2+
3+
**开源并不是你把软件、README 写好就行了,还有详细的文档、示例程序等等**
4+
5+
**开源也不是你的项目好了,就会有一堆人参与进来**
6+
7+
**开源还要你帮助别人解决 Bug,……**
8+
9+
**人们做事都是有原因的**,即动机。再举例一下,如果你的项目不够火,别人都没听过,那么**写到简历上可能没啥用**
10+
11+
Marketing First
12+
---
13+
14+
开源需要一些营销的技巧,这些技巧可以帮你吸引关注。举个简单的例子,司徒正美的 [avalon](https://github.com/RubyLouvre/avalon) 框架出身得很早,也 MV* 方面也做得很不错,但是在 marketing 上就……。以至于国内的很多前端,都不了解这个框架,要不今天在国内可能就是 AVRR 四大框架了。
15+
16+
Vue 不是因为好用,而一下子火了。这一点我印象特别深,当时在 GitHub Trending 上看到了这个项目,发现它还不能很好地 work。
17+
18+
而如文章 《[FIRST WEEK OF LAUNCHING VUE.JS](http://blog.evanyou.me/2014/02/11/first-week-of-launching-an-oss-project/)》所说,项目刚开始的时候作者做了一系列的营销计划:
19+
20+
- HackerNews
21+
- Reddit /r/javascript
22+
- EchoJS
23+
- The DailyJS blog
24+
- JavaScript Weekly
25+
- Maintain a project Twitter account(维护项目的 Vue 账户)
26+
27+
除此,文中还提到了一篇文章《[How to Spread The Word About Your Code](https://hacks.mozilla.org/2013/05/how-to-spread-the-word-about-your-code/?utm_source=statuscode&utm_medium=email)》 。
28+
29+
这一点相当的有意思,如果你的想法好的话,那么大家都会肯定,点下链接,为你来个 star。那么,你就获得更好的动力去做这件事。项目也在开头的时候,获得了相当多的关注。而如果大家觉得你的项目没有新意的话,那么你懂的~
30+
31+
除此,还有一种可能是,你的 ID 不够 fancy,即你在社区的影响上比较少。此时,就需要**一点点慢慢积累人气**了。当你积累了一些人气,你就能和松本行弘一样,在创建 mRuby 的时候就有 1000+ 的 star。并且,在社区上还有一些相关的文章介绍,各个头条也由他的粉丝发了上去。如,一年多以前,我创建了 [mole](https://github.com/phodal/mole) 项目。
32+
33+
![Mole](mole.png)
34+
35+
当时,是为了给自己做一个基于 GitHub 云笔记的工具,在完成度到一定程度的时候。我在我的微信公从号上发了相关的介绍,第二天就有 100+ 的 star 了,还接收至最一些鼓舞的话语。对应于国内则有:
36+
37+
- 极客头条
38+
- 掘金
39+
- 开发者头条
40+
- v2ex
41+
- 知乎
42+
- 不成器的微博
43+
44+
所以,你觉得呢?
45+
46+
编写 README
47+
---
48+
49+
在一个开源项目里,README 是最重要的内容。它快速地介绍了这个项目,并决定了它能不能吸引用户:
50+
51+
- **这个项目做什么?**
52+
- **它解决了什么问题**
53+
- **它有什么特性**
54+
**hello, world 示例**
55+
56+
### 这个项目做什么——一句话文案
57+
58+
GitHub 的 Description 是我们在 Hacking News、GitHub Trneding 等等,第一时间看到的介绍。也是我们能快速介绍给别人的东西,如下图所示:
59+
60+
![GitHub Trending](./img/github-trending-example.png)
61+
62+
这一句话,必须简单明了也介绍,它是干什么的。
63+
64+
如 Angular 的一句话方案是:One framework. Mobile & desktop.
65+
66+
而 React 是:A declarative, efficient, and flexible JavaScript library for building user interfaces.
67+
68+
Vue 则是:A progressive, incrementally-adoptable JavaScript framework for building UI on the web.
69+
70+
### 它解决了什么问题
71+
72+
上面的一句话描述,它不能很好地说明,它能解决什么问题。
73+
74+
如下是今天在 GitHub Trending 上榜的 RPC 项目的简介:
75+
76+
> Most machines on internet communicate with each other via TCP/IP. However TCP/IP only guarantees reliable data transmissions, we need to abstract more to build services:
77+
78+
![RPC 开源项目](./img/rpc-example.png)
79+
80+
以上便是这个项目能解决的问题,不过这个项目能解决的问题倒是比较长,哈哈哈。
81+
82+
### 它有什么特性
83+
84+
当我们有 A、B、C 几个不同的框架的时候,作为一个开发人员,就需要对比他们的特性,。如下是 Go 语言实现的 MQTT 示例:
85+
86+
![GO MQTT 示例](./img/go-mqtt.png)
87+
88+
这个项目只支持的 Qos 级别为 0。如果我们需要的级别是 1,那么就不能用这个项目了。
89+
90+
又比如 lodash 项目:
91+
92+
> Lodash makes JavaScript easier by taking the hassle out of working with arrays,
93+
numbers, objects, strings, etc. Lodash’s modular methods are great for:
94+
95+
- Iterating arrays, objects, & strings
96+
- Manipulating & testing values
97+
- Creating composite functions
98+
99+
你会怎么写?
100+
101+
### hello, world 示例
102+
103+
在我们看完了上面的介绍之后,紧接着就是一个 hello, world 的示例。如 React 的示例:
104+
105+
```
106+
class HelloMessage extends React.Component {
107+
render() {
108+
return <div>Hello {this.props.name}</div>;
109+
}
110+
}
111+
112+
ReactDOM.render(
113+
<HelloMessage name="John" />,
114+
document.getElementById('container')
115+
);
116+
```
117+
118+
这个
119+
120+
技术文档——手把手教会别人
121+
---
122+
123+
124+
示例程序
125+
---
126+
127+
128+
129+
吸引贡献者
130+
---
131+
132+

chapters/08-maintain-project.md

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)