├── src
├── sample.styl
├── _wrapper
│ ├── css.styl
│ ├── umd-no-deps.ejs
│ └── umd.ejs
└── sample.js
├── releases
├── 0.1.0.md
└── 0.1.1.md
├── .npmignore
├── wiki
└── home.md
├── .npmrc
├── .gitignore
├── .editorconfig
├── redir.html
├── test
├── test.js
└── test.html
├── doc
└── api.zh.md
├── bower.json
├── package.json
├── LICENSE.txt
├── gulpfile.js
├── README.md
└── README.full.md
/src/sample.styl:
--------------------------------------------------------------------------------
1 | sample()
2 | color red
3 |
--------------------------------------------------------------------------------
/src/_wrapper/css.styl:
--------------------------------------------------------------------------------
1 | @import '../sample.styl'
2 |
3 | .sample
4 | sample()
5 |
--------------------------------------------------------------------------------
/releases/0.1.0.md:
--------------------------------------------------------------------------------
1 | ---
2 | tag: 0.1.0
3 | title: 0.1.0
4 | ---
5 |
6 | * First public release.
7 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | *
2 |
3 | !package.json
4 | !README.md
5 | !src/*.js
6 | !src/*.styl
7 | !dist/*.js
8 | !dist/*.css
9 |
--------------------------------------------------------------------------------
/wiki/home.md:
--------------------------------------------------------------------------------
1 | * [API Documentation](https://github.com/cssmagic/sample/issues/1) (Zh)
2 | * JavaScript API
3 | * `sample.sample1()`
4 | * `sample.sample2()`
5 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
2 | phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/
3 | electron_mirror=https://npm.taobao.org/mirrors/electron/
4 |
5 | ;registry=https://registry.npm.taobao.org
6 |
7 | package-lock=false
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | Thumbs.db
2 | ehthumbs.db
3 | [Dd]esktop.ini
4 | $RECYCLE.BIN/
5 | .DS_Store
6 | .klive
7 | .dropbox.cache
8 |
9 | *.tmp
10 | *.bak
11 | *.swp
12 | *.lnk
13 |
14 | .svn
15 | .idea
16 |
17 | node_modules/
18 | bower_components/
19 | npm-debug.log
20 |
21 | *.zip
22 | *.gz
23 |
24 | *.sh
25 | *.bat
26 |
27 | # Sample ignores this dir, but your project may need to include this.
28 | dist/
29 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # This file is for unifying the coding style for different editors and IDEs
2 | # editorconfig.org
3 |
4 | root = true
5 |
6 | [*]
7 | charset = utf-8
8 | indent_style = tab
9 | end_of_line = lf
10 | insert_final_newline = true
11 | trim_trailing_whitespace = true
12 |
13 | [{package,bower}.json]
14 | indent_style = space
15 | indent_size = 2
16 |
17 | [*.{html}]
18 | quote_type = double
19 |
20 | [*.md]
21 | # use `
` to insert a line break explicitly.
22 | ; trim_trailing_whitespace = false
23 |
--------------------------------------------------------------------------------
/redir.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Redirecting...
19 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/_wrapper/umd-no-deps.ejs: -------------------------------------------------------------------------------- 1 | !function (root, factory) { 2 | if (typeof define === 'function' && define.amd) { 3 | // AMD 4 | define([], factory) 5 | } else if (typeof exports === 'object') { 6 | // CommonJS 7 | module.exports = factory() 8 | } else { 9 | // Browser globals 10 | root.{sample} = factory() 11 | } 12 | }(this, function () { 13 | 14 | //////////////////// START: source code //////////////////// 15 | <%= contents %> 16 | //////////////////// END: source code //////////////////// 17 | 18 | return {sample} 19 | }) 20 | -------------------------------------------------------------------------------- /src/_wrapper/umd.ejs: -------------------------------------------------------------------------------- 1 | !function (root, factory) { 2 | if (typeof define === 'function' && define.amd) { 3 | // AMD 4 | define(['jquery', 'underscore'], factory) 5 | } else if (typeof exports === 'object') { 6 | // CommonJS 7 | module.exports = factory(require('jquery'), require('underscore')) 8 | } else { 9 | // Browser globals 10 | root.{sample} = factory(root.jQuery || root.Zepto || root.$, root._) 11 | } 12 | }(this, function ($, _) { 13 | 14 | //////////////////// START: source code //////////////////// 15 | <%= contents %> 16 | //////////////////// END: source code //////////////////// 17 | 18 | return {sample} 19 | }) 20 | -------------------------------------------------------------------------------- /src/sample.js: -------------------------------------------------------------------------------- 1 | /** 2 | * {Sample} - {Description of Sample}. 3 | * Released under the MIT license. 4 | * https://github.com/cssmagic/sample 5 | */ 6 | var sample = function (window) { 7 | 'use strict' 8 | 9 | // util 10 | function _util() { 11 | //... 12 | } 13 | 14 | // fn 15 | function sample1() { 16 | //... 17 | } 18 | function sample2() { 19 | //... 20 | } 21 | 22 | // api 23 | var exports = {} 24 | exports.sample1 = sample1 25 | exports.sample2 = sample2 26 | 27 | /** DEBUG_INFO_START **/ 28 | // only for unit test 29 | exports.__util = _util 30 | /** DEBUG_INFO_END **/ 31 | 32 | return exports 33 | 34 | }(window) 35 | -------------------------------------------------------------------------------- /releases/0.1.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | tag: 0.1.1 3 | title: 0.1.1 4 | --- 5 | 6 | * [Changed] Update some API. (#??) 7 | * [New] Add some feature. (#??) 8 | * [New] Add dist file in UMD format. (#??) 9 | * [New] Now available on npm. 10 | * [Fixed] Fix some issue. (#??) 11 | * [Improved] Improve some feature. (#??) 12 | * [Improved] Upgrade `{sub-sample}` module to [v?.?.?](https://github.com/cssmagic/sample/releases/tag/0.1.0). 13 | 14 | *** 15 | 16 | > Action names in Angular-style commit message: 17 | > 18 | > * feat (feature) 19 | > * fix (bug fix) 20 | > * docs (documentation) 21 | > * style (formatting, missing semi colons, …) 22 | > * refactor 23 | > * test (when adding missing tests) 24 | > * chore (maintain) 25 | -------------------------------------------------------------------------------- /test/test.js: -------------------------------------------------------------------------------- 1 | void function () { 2 | 'use strict' 3 | 4 | // check env 5 | if (typeof window === 'undefined') { 6 | console.error('[Sample] Open test.html in browsers to run tests!') 7 | return 8 | } 9 | 10 | describe('Util', function () { 11 | describe('sample.__util()', function () { 12 | it('does basic functionality', function () { 13 | expect(true).to.be.true 14 | }) 15 | }) 16 | }) 17 | 18 | describe('APIs', function () { 19 | describe('sample.sample1()', function () { 20 | it('does basic functionality', function () { 21 | expect(true).to.be.true 22 | }) 23 | }) 24 | describe('sample.sample2()', function () { 25 | it('does basic functionality', function () { 26 | expect(true).to.be.true 27 | }) 28 | }) 29 | }) 30 | 31 | }() 32 | -------------------------------------------------------------------------------- /doc/api.zh.md: -------------------------------------------------------------------------------- 1 | # API 文档 2 | 3 | ## 导言 4 | 5 | 一段介绍文字。 6 | 7 | ## JavaScript 变量 8 | 9 | ### `sample.var1` 10 | 11 | 类型。接口用途。 12 | 13 | 14 | ## JavaScript 接口 15 | 16 | ### `sample.sample1()` 17 | 18 | 接口用途。 19 | 20 | #### 参数 21 | 22 | (无) 23 | 24 | #### 返回值 25 | 26 | (无) 27 | 28 | #### 示例 29 | 30 | ```js 31 | sample.sample1() 32 | ``` 33 | 34 | #### 注意事项 35 | 36 | * 此接口的注意事项。 37 | * 此接口的注意事项。 38 | * 此接口的注意事项。 39 | 40 | *** 41 | 42 | ### `sample.sample2(arg)` 43 | 44 | 接口用途。 45 | 46 | #### 参数 47 | 48 | * `arg` -- 类型。参数含义。 49 | 50 | #### 返回值 51 | 52 | 类型。返回值含义。 53 | 54 | #### 示例 55 | 56 | ```js 57 | sample.sample2(1) // => true 58 | ``` 59 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{sample}", 3 | "homepage": "https://github.com/cssmagic/{sample}", 4 | "authors": [ 5 | "cssmagic