Skip to content

Commit

Permalink
add module template
Browse files Browse the repository at this point in the history
  • Loading branch information
Fishrock123 committed Aug 15, 2014
1 parent e8216df commit 17c699e
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ This is a guideline to how new repos and commits should be styled

The guides are intended to be as simple and concise as possible.

__[Javascript Guide](javascript.md)__
### [Javascript Guide](javascript.md)

__[Documentation Guide](documentation.md)__
### [Module Template](template)

## Contributing

Expand Down
17 changes: 17 additions & 0 deletions template/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# OS generated files
#####
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db

This comment has been minimized.

Copy link
@Fishrock123

Fishrock123 Aug 24, 2014

Author Member

Yeah, people won't. I don't want to deal with people not doing this. Especially people like me who don't even know you can.

This comment has been minimized.

Copy link
@dougwilson

dougwilson Aug 24, 2014

Remove all these os-specific ignores, please. People need to configure their local git ignores for their own OS. Otherwise, add the rest of the Windows and Mac OS X temp files as well as whatever other OS temp files there are.

This comment has been minimized.

Copy link
@Fishrock123

Fishrock123 Aug 24, 2014

Author Member

Let me know what they are, and I'll add them.

Afaik, the thumbs was the main windows thing.

This comment has been minimized.

Copy link
@dougwilson

dougwilson Aug 24, 2014

lol. just remove them.

This comment has been minimized.

Copy link
@Fishrock123

Fishrock123 Aug 24, 2014

Author Member

No, these are useful to avoid extraneous junk because people don't know you can config this stuff and I don't want to have to tell them.

Again, I had no idea you could globally gitignore, even if it was obvious.

This comment has been minimized.

Copy link
@dougwilson

dougwilson Aug 24, 2014

No, these are useful to avoid extraneous junk because people don't know you can config this stuff and I don't want to have to tell them.

if you're going to include everything, then you can find the full list here: https://github.com/github/gitignore/tree/master/Global

Again, I had no idea you could globally gitignore, even if it was obvious.

https://help.github.com/articles/ignoring-files#create-a-global-gitignore

This comment has been minimized.

Copy link
@Fishrock123

Fishrock123 Aug 24, 2014

Author Member

Ok but I don't think we need to add most of these, just things that will be generated via normal use such as thumbs, ds_store, maybe directories and ~, etc?

This comment has been minimized.

Copy link
@dougwilson

dougwilson Aug 24, 2014

Desktop.ini for Windows. they always end up in my dirs, but i have a global ignore set.



# npm
#####
node_modules
*.log

This comment has been minimized.

Copy link
@Fishrock123

Fishrock123 Aug 24, 2014

Author Member

@dougwilson should I add coveralls here?

This comment has been minimized.

Copy link
@dougwilson

dougwilson Aug 24, 2014

yea, add coverage folder since the coveralls badge is in the template


# Editors
#####
*.sublime*

This comment has been minimized.

Copy link
@dougwilson

dougwilson Aug 24, 2014

Remove all editor-specifc ignores, please. People need to configure their local git ignores for their own editors. Otherwise you need to add WebStorm, vi, nano, etc. temporary files to this section.

This comment has been minimized.

Copy link
@Fishrock123

Fishrock123 Aug 24, 2014

Author Member

Is it that big of a deal? I guess I can remove the editors one, I don't use them anymore anyways.

Also, I would have, but idk what those files are.

This comment has been minimized.

Copy link
@dougwilson

dougwilson Aug 24, 2014

Just don't add them. It's the best solution.

This comment has been minimized.

Copy link
@dougwilson

dougwilson Aug 24, 2014

Also, I would have, but idk what those files are.

list is here: https://github.com/github/gitignore/tree/master/Global

This comment has been minimized.

Copy link
@dougwilson

dougwilson Aug 24, 2014

if you keep the editors section, at least add what i use: vim and nodepad++ :)

This comment has been minimized.

Copy link
@dougwilson

dougwilson Aug 24, 2014

and add webstorm (it's the one with .idea--the jetbrains one; it seems to be extremely popular)

This comment has been minimized.

Copy link
@Fishrock123

Fishrock123 Aug 24, 2014

Author Member

I'll think about it, but OS files are far more important.

Most of the time I just drag folders onto my editors, does that create files in those editors?
It only makes sublime files if you register a project, which I no longer do.

This comment has been minimized.

Copy link
@dougwilson

dougwilson Aug 24, 2014

just having a file open in vim with a change will create the vim stuff.

This comment has been minimized.

Copy link
@dougwilson

dougwilson Aug 24, 2014

and opening in webstorm it'll create .idea right away

This comment has been minimized.

Copy link
@Fishrock123

Fishrock123 Aug 24, 2014

Author Member

-_-

I currently have this:

# OS X
.DS_Store*
Icon?
._*

# Windows
Thumbs.db
ehthumbs.db
Desktop.ini

# Linux
.directory
*~


# npm
node_modules
*.log


# Coveralls
coverage

This comment has been minimized.

Copy link
@dougwilson

dougwilson Aug 24, 2014

seems fine to me.

22 changes: 22 additions & 0 deletions template/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(The MIT License)

Copyright (c) 2014 Your Name with optional email

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18 changes: 11 additions & 7 deletions documentation.md → template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
[![Build Status](http://img.shields.io/travis/expressjs/style-guide.svg?style=flat)](https://travis-ci.org/expressjs/style-guide)
[![Coverage Status](https://img.shields.io/coveralls/expressjs/style-guide.svg?style=flat)](https://coveralls.io/r/expressjs/style-guide)


> #### You can directly copy this folder to create a new module!
> NOTE: The "files" in package.json is a whitelist you may have to add to.

This document provides a general guideline for creating a README in an [expressjs](https://github.com/expressjs) repository.

When writing content for a README, keep these two guidelines in mind:
Expand All @@ -29,18 +35,14 @@ $ npm install <npm-name>
## API

```js
var express = require('express')
var module = require('npm-name')

var app = express()
app.use(module())
var module = require('npm-name')
```

### module(options)

#### Options

- `option1` - asdf. (default `true`)
- `option1` - asdf. (default: `true`)
- `option2` - cats.
- `option10` - always 42.
- `option9000` - epic.
Expand Down Expand Up @@ -76,6 +78,8 @@ existing_object.object.property // => example value from description

## Example(s)

Full examples go here.
```js
// Full examples go here.
```

### [MIT Licensed](LICENSE)
17 changes: 17 additions & 0 deletions template/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*!
* npm-name
* Copyright (c) 2014 Your Name
* MIT Licensed
*/

/**
* Module dependencies.
*/

var module = require('module')

/**
* Expose `Thingy`.
*/

module.exports = Thingy
24 changes: 24 additions & 0 deletions template/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "npm-name",
"description": "describe this module",
"version": "0.0.0",
"author": "author name <email> (optional website)",
"license": "MIT",
"repository": "github_username/repo",
"dependencies": {
},
"devDependencies": {
},
"engines": {
"node": ">= 0.8.0"
},
"files": [
"LICENSE"
"index.js"
],
"scripts": {
"test": "mocha --reporter spec --bail --check-leaks --require should test/",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks --require should test/",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks --require should test/"
}
}

0 comments on commit 17c699e

Please sign in to comment.