Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl committed Feb 16, 2016
0 parents commit be9cfcc
Show file tree
Hide file tree
Showing 13 changed files with 273 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
@@ -0,0 +1,6 @@
; Unix-style newlines
[*]
end_of_line = LF
indent_style = tab
trim_trailing_whitespace = false
insert_final_newline = true
31 changes: 31 additions & 0 deletions .gitignore
@@ -0,0 +1,31 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules

# Users Environment Variables
.lock-wscript

docs/
dist/
50 changes: 50 additions & 0 deletions .jshintrc
@@ -0,0 +1,50 @@
{
"globals": {
"steal": true,
"can": true,
"Zepto": true,
"QUnit": true,
"System": true,
"SimpleDOM": true,
"test": true,
"asyncTest": true,
"expect": true,
"module": true,
"ok": true,
"equal": true,
"notEqual": true,
"deepEqual": true,
"notDeepEqual": true,
"strictEqual": true,
"notStrictEqual": true,
"raises": true,
"start": true,
"stop": true,
"global": true
},
"curly": true,
"eqeqeq": true,
"freeze": true,
"indent": 2,
"latedef": true,
"noarg": true,
"undef": true,
"unused": true,
"trailing": true,
"maxdepth": 4,
"boss" : true,
"eqnull": true,
"evil": true,
"loopfunc": true,
"smarttabs": true,
"maxerr" : 200,
"jquery": true,
"dojo": true,
"mootools": true,
"yui": true,
"browser": true,
"phantom": true,
"rhino": true,
"node": true,
"esnext": true
}
1 change: 1 addition & 0 deletions .npmignore
@@ -0,0 +1 @@
!dist/
5 changes: 5 additions & 0 deletions .travis.yml
@@ -0,0 +1,5 @@
language: node_js
node_js: node
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
18 changes: 18 additions & 0 deletions build.js
@@ -0,0 +1,18 @@
var stealTools = require("steal-tools");

stealTools.export({
system: {
config: __dirname + "/package.json!npm"
},
outputs: {
"+cjs": {},
"+amd": {},
"+global-js": {}
}
}).catch(function(e){

setTimeout(function(){
throw e;
},1);

});
14 changes: 14 additions & 0 deletions documentjs.json
@@ -0,0 +1,14 @@
{
"sites": {
"docs": {
"dest": "docs",
"parent": "donejs-number-input",
"pageConfig": {
"page": "docs"
},
"glob": {
"pattern": "src/**/*.{js,md}"
}
}
}
}
54 changes: 54 additions & 0 deletions package.json
@@ -0,0 +1,54 @@
{
"name": "donejs-number-input",
"version": "0.0.0",
"description": "A number input field for DoneJS using Bootstrap",
"homepage": "http://donejs.com",
"author": {
"name": "Bitovi",
"email": "contact@bitovi.com",
"url": "http://bitovi.com"
},
"scripts": {
"preversion": "npm test && npm run build",
"version": "git commit -am \"Update dist for release\" && git checkout -b release && git add -f dist/",
"postversion": "git push --tags && git checkout master && git branch -D release && git push",
"testee": "testee src/test/test.html --browsers firefox",
"test": "npm run jshint && npm run testee",
"jshint": "jshint src/. --config",
"release:patch": "npm version patch && npm publish",
"release:minor": "npm version minor && npm publish",
"release:major": "npm version major && npm publish",
"build": "node build.js",
"document": "documentjs"
},
"main": "src/donejs-number-input",
"files": [
"src"
],
"keywords": [
"canjs",
"donejs"
],
"system": {
"directories": {
"lib": "src"
},
"npmIgnore": [
"documentjs",
"testee"
],
"npmAlgorithm": "flat"
},
"dependencies": {
"can": "^2.3.0",
"jquery": "2.1.4"
},
"devDependencies": {
"documentjs": "^0.4.1",
"jshint": "^2.9.1",
"steal": "^0.14.0-pre.8",
"steal-qunit": "^0.1.1",
"steal-tools": "^0.14.0-pre.1",
"testee": "^0.2.4"
}
}
74 changes: 74 additions & 0 deletions readme.md
@@ -0,0 +1,74 @@
# donejs-number-input

[![Build Status](https://travis-ci.org/donejs/donejs-number-input.png?branch=master)](https://travis-ci.org/donejs/donejs-number-input)

A number input field for DoneJS using Bootstrap

## Usage

### ES6 use

With StealJS, you can import this module directly in a template that is autorendered:

```js
import plugin from 'donejs-number-input';
```

### CommonJS use

Use `require` to load `donejs-number-input` and everything else
needed to create a template that uses `donejs-number-input`:

```js
var plugin = require("donejs-number-input");
```

## AMD use

Configure the `can` and `jquery` paths and the `donejs-number-input` package:

```html
<script src="require.js"></script>
<script>
require.config({
paths: {
"jquery": "node_modules/jquery/dist/jquery",
"can": "node_modules/canjs/dist/amd/can"
},
packages: [{
name: 'donejs-number-input',
location: 'node_modules/donejs-number-input/dist/amd',
main: 'lib/donejs-number-input'
}]
});
require(["main-amd"], function(){});
</script>
```

### Standalone use

Load the `global` version of the plugin:

```html
<script src='./node_modules/donejs-number-input/dist/global/donejs-number-input.js'></script>
```

## Contributing

### Making a Build

To make a build of the distributables into `dist/` in the cloned repository run

```
npm install
node build
```

### Running the tests

Tests can run in the browser by opening a webserver and visiting the `test.html` page.
Automated tests that run the tests from the command line in Firefox can be run with

```
npm test
```
3 changes: 3 additions & 0 deletions src/donejs-number-input.js
@@ -0,0 +1,3 @@
export default function() {
return `This is the donejs-number-input plugin`;
}
5 changes: 5 additions & 0 deletions src/donejs-number-input.md
@@ -0,0 +1,5 @@
@page donejs-number-input

# donejs-number-input

A number input field for DoneJS using Bootstrap
3 changes: 3 additions & 0 deletions src/test/test.html
@@ -0,0 +1,3 @@
<title>donejs-number-input</title>
<script src="../../node_modules/steal/steal.js" main="donejs-number-input/test/"></script>
<div id="qunit-fixture"></div>
9 changes: 9 additions & 0 deletions src/test/test.js
@@ -0,0 +1,9 @@
import QUnit from 'steal-qunit';
import plugin from '../donejs-number-input';

QUnit.module('donejs-number-input');

QUnit.test('Initialized the plugin', function(){
QUnit.equal(typeof plugin, 'function');
QUnit.equal(plugin(), 'This is the donejs-number-input plugin');
});

0 comments on commit be9cfcc

Please sign in to comment.