An open API service indexing awesome lists of open source software.

https://github.com/cssmagic/sample

File templates for front-end projects.
https://github.com/cssmagic/sample

doc open-source project-template scaffolding

Last synced: 9 months ago
JSON representation

File templates for front-end projects.

Awesome Lists containing this project

README

          

# Sample

> File templates for front-end projects.

## 简介

每次在 GitHub 新建一个前端小项目,都要做一遍繁琐的、重复的 “文案工作”?那不如把常用文件汇总为一个项目模板吧,以后新建项目时直接复制出来填填改改就可以了。

现在可用以下源码文件模板:

* `README.md` (稍复杂的项目可以选用 `README.full.md`)
* `.gitignore`
* `package.json`
* `bower.json`
* `.editorconfig`
* `src/*.*`
* `test/*.*`
* `gulpfile.js`
* `redir.html` (适用于 GitHub Pages 的重定向页面)

以及文档模板:

* `doc/*.md`
* `wiki/*.md`
* `releases/*.md`

## 兼容性

#### 浏览器支持

* 支持以下移动平台的主流浏览器:
* iOS 5+
* Android 2.3+

* 同样支持以下桌面浏览器:
* Firefox (edge)
* Chrome (edge)
* Safari (edge)

#### 外部依赖

* Underscore 1.6+
* Zepto 1.1+

## 安装

0. 通过 Bower 安装:

```sh
$ bower install {sample}
```

0. 在页面中加载 {Sample} 的样式文件、脚本文件及必要的依赖:

```html



...



...






```

## API 文档

* {Sample} 提供了简洁易用的 API,[详见此文档](https://github.com/cssmagic/sample/issues/1)。
* 此外,建议阅读 [Wiki](https://github.com/cssmagic/sample/wiki) 来获取更多信息。

## 谁在用?

以下开源项目采用 {Sample} 作为基础组件:

* [CMUI](https://github.com/CMUI/CMUI)

因此,本项目运行在以下网站:

* [某某网站](https://github.com/cssmagic/sample)

***

## 参与开发

#### 构建

0. 把本项目的代码 fork 并 clone 到本地。
0. 在项目根目录执行 `npm install`,安装必要的依赖。
0. 在项目根目录执行 `npm run dist`,运行构建脚本。
0. 构建生成的发布文件将保存到 `/dist` 目录下。

#### 单元测试

0. 把本项目的代码 fork 并 clone 到本地。
0. 在项目根目录执行 `bower install`,安装必要的依赖。
0. 在浏览器中打开以下文件即可运行单元测试:
* `test/test-dev.html` - 测试源码
* `test/test-dist.html` - 测试发布文件

如果想在移动设备上运行单元测试,可尝试以下任一方法:

* 在本地建立 Web 服务,以便移动设备通过局域网访问上述单元测试页面。
* 把本项目的所有文件(及必要的依赖)发布至公网,以便移动设备访问上述单元测试页面。

***

## License

[MIT License](http://www.opensource.org/licenses/mit-license.php)